Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-mlc
kohinos
Commits
be1ee842
Commit
be1ee842
authored
Mar 22, 2019
by
Julien Jorry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BO : add page(s) admin + fix role admin for super admin
parent
37824fac
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
37 deletions
+40
-37
services.yaml
config/services.yaml
+2
-2
AdherentAdmin.php
src/Admin/AdherentAdmin.php
+0
-1
GroupAdmin.php
src/Application/Sonata/UserBundle/Admin/GroupAdmin.php
+3
-1
UserAdmin.php
src/Application/Sonata/UserBundle/Admin/UserAdmin.php
+34
-32
Flux.php
src/Entity/Flux.php
+1
-1
No files found.
config/services.yaml
View file @
be1ee842
...
...
@@ -355,8 +355,8 @@ services:
tags
:
-
name
:
sonata.admin
manager_type
:
orm
group
:
"
Pages
"
label
:
"
Pages
"
group
:
"
Import
"
label
:
"
Import
"
show_mosaic_button
:
false
public
:
true
...
...
src/Admin/AdherentAdmin.php
View file @
be1ee842
...
...
@@ -12,7 +12,6 @@ use App\Enum\MoyenEnum;
use
FOS\UserBundle\Event\FilterUserResponseEvent
;
use
FOS\UserBundle\FOSUserEvents
;
use
Knp\Menu\ItemInterface
as
MenuItemInterface
;
use
Knp\Menu\ItemInterface
;
use
Sonata\AdminBundle\Admin\AbstractAdmin
;
use
Sonata\AdminBundle\Admin\AdminInterface
;
use
Sonata\AdminBundle\Datagrid\DatagridMapper
;
...
...
src/Application/Sonata/UserBundle/Admin/GroupAdmin.php
View file @
be1ee842
...
...
@@ -21,7 +21,9 @@ class GroupAdmin extends BaseGroupAdmin
protected
function
configureRoutes
(
RouteCollection
$collection
)
{
$subject
=
$this
->
getSubject
();
$collection
->
clearExcept
(
'list'
);
if
(
$subject
!=
null
&&
!
(
$subject
->
isGranted
(
'ROLE_SUPER_ADMIN'
)
||
$subject
->
isGranted
(
'ROLE_ADMIN_SIEGE'
)))
{
$collection
->
clearExcept
(
'list'
);
}
}
public
function
getBatchActions
()
...
...
src/Application/Sonata/UserBundle/Admin/UserAdmin.php
View file @
be1ee842
...
...
@@ -213,39 +213,41 @@ class UserAdmin extends BaseUserAdmin
if
(
$subject
->
isGranted
(
'ROLE_COMPTOIR'
)
&&
!
empty
(
$subject
->
getComptoirsgere
()))
{
$hideOrShowComptoir
=
[];
}
$formMapper
->
with
(
'Groups'
)
->
add
(
'groups'
,
ModelType
::
class
,
[
'required'
=>
false
,
'expanded'
=>
true
,
'multiple'
=>
true
,
])
->
add
(
'groupesgere'
,
null
,
[
'required'
=>
false
,
'label'
=>
'Groupe local géré (obligatoire)'
,
'attr'
=>
$hideOrShowGroupe
,
'label_attr'
=>
$hideOrShowGroupe
,
])
->
add
(
'comptoirsgere'
,
null
,
[
'required'
=>
false
,
'label'
=>
'Comptoir géré (obligatoire)'
,
'attr'
=>
$hideOrShowComptoir
,
'label_attr'
=>
$hideOrShowComptoir
,
])
->
end
();
$formMapper
->
end
();
$formMapper
->
with
(
'Groups'
)
->
add
(
'groups'
,
ModelType
::
class
,
[
'required'
=>
false
,
'expanded'
=>
true
,
'multiple'
=>
true
,
])
->
add
(
'groupesgere'
,
null
,
[
'required'
=>
false
,
'label'
=>
'Groupe local géré (obligatoire)'
,
'attr'
=>
$hideOrShowGroupe
,
'label_attr'
=>
$hideOrShowGroupe
,
])
->
add
(
'comptoirsgere'
,
null
,
[
'required'
=>
false
,
'label'
=>
'Comptoir géré (obligatoire)'
,
'attr'
=>
$hideOrShowComptoir
,
'label_attr'
=>
$hideOrShowComptoir
,
])
->
end
()
->
with
(
'Roles'
)
->
add
(
'realRoles'
,
SecurityRolesType
::
class
,
[
'label'
=>
'form.label_roles'
,
'expanded'
=>
true
,
'multiple'
=>
true
,
'required'
=>
false
,
])
->
end
()
->
end
()
;
}
// ->with('Roles')
// ->add('realRoles', SecurityRolesType::class, [
// 'label' => 'form.label_roles',
// 'expanded' => true,
// 'multiple' => true,
// 'required' => false,
// ])
// ->end()
// ->with('Keys')
// ->add('token', null, ['required' => false])
// ->add('twoStepVerificationCode', null, ['required' => false])
// ->end()
// ->with('Keys')
// ->add('token', null, ['required' => false])
// ->add('twoStepVerificationCode', null, ['required' => false])
// ->end()
}
public
function
getBatchActions
()
...
...
src/Entity/Flux.php
View file @
be1ee842
...
...
@@ -267,7 +267,7 @@ abstract class Flux
$em
=
$event
->
getEntityManager
();
$flux
->
getExpediteur
()
->
setCompte
(
$compteExp
);
$em
->
persist
(
$flux
->
getExpediteur
());
if
(
$
this
->
getParenttype
()
!=
'vente'
)
{
if
(
$
flux
->
getParenttype
()
!=
'vente'
)
{
$compteDest
=
$flux
->
getDestinataire
()
->
getCompte
()
+
$flux
->
getMontant
();
$flux
->
getDestinataire
()
->
setCompte
(
$compteDest
);
$em
->
persist
(
$flux
->
getDestinataire
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment