Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos-tav
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
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
agplv3
kohinos-tav
Commits
cc5d55de
Commit
cc5d55de
authored
Jan 18, 2022
by
Julien Jorry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Admin presta and adherent export : add admin rights to users
parent
789714b4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
AdherentAdmin.php
src/Admin/AdherentAdmin.php
+1
-1
Prestataire.php
src/Entity/Prestataire.php
+3
-1
CustomDoctrineORMQuerySourceIterator.php
src/Exporter/CustomDoctrineORMQuerySourceIterator.php
+19
-0
No files found.
src/Admin/AdherentAdmin.php
View file @
cc5d55de
...
...
@@ -55,7 +55,7 @@ class AdherentAdmin extends AbstractAdmin
// reverse order (default = 'ASC')
'_sort_order'
=>
'DESC'
,
// name of the ordered field (default = the model's id field, if any)
'_sort_by'
=>
'
upd
atedAt'
,
'_sort_by'
=>
'
cre
atedAt'
,
// '_page' => 1,
// '_per_page' => 32
];
...
...
src/Entity/Prestataire.php
View file @
cc5d55de
...
...
@@ -670,7 +670,9 @@ class Prestataire extends AccountableObject implements AccountableInterface
public
function
getUsersString
()
{
return
join
(
' - '
,
array_map
(
function
(
$user
)
{
return
$user
->
getName
()
.
(
$user
->
getEmail
()
==
$user
->
getName
()
?
''
:
(
':'
.
$user
->
getEmail
()));
$return
=
$user
->
getName
()
.
(
$user
->
getEmail
()
==
$user
->
getName
()
?
''
:
(
':'
.
$user
->
getEmail
()));
$return
.=
'['
.
implode
(
', '
,
$user
->
getPossiblegroups
()
->
toArray
())
.
']'
;
return
$return
;
},
$this
->
users
->
getValues
()));
}
...
...
src/Exporter/CustomDoctrineORMQuerySourceIterator.php
View file @
cc5d55de
...
...
@@ -70,6 +70,25 @@ class CustomDoctrineORMQuerySourceIterator extends AbstractPropertySourceIterato
$data
[
'Cotisation à jour'
]
=
$cotisEnd
==
false
?
''
:
(
$cotisEnd
->
format
(
'd/m/Y'
));
$firstCotis
=
$this
->
cotisationUtils
->
getFirstCotisationForAdherent
(
$adherent
);
$data
[
'Première Cotisation'
]
=
$firstCotis
==
false
?
''
:
(
$firstCotis
->
format
(
'd/m/Y'
));
$adminRoles
=
''
;
if
(
!
empty
(
$adherent
->
getUser
()))
{
foreach
(
$adherent
->
getUser
()
->
getPossiblegroups
()
as
$group
)
{
if
(
!
empty
(
$adminRoles
))
{
$adminRoles
.=
', '
;
}
$adminRoles
.=
$group
->
getName
();
if
(
$group
->
getName
()
==
'Comptoir'
)
{
$adminRoles
.=
'('
.
implode
(
','
,
$adherent
->
getUser
()
->
getComptoirsgeres
()
->
toArray
())
.
')'
;
}
else
if
(
$group
->
getName
()
==
'Prestataire'
)
{
$adminRoles
.=
'('
.
implode
(
','
,
$adherent
->
getUser
()
->
getPrestataires
()
->
toArray
())
.
')'
;
}
else
if
(
$group
->
getName
()
==
'Caissier'
)
{
$adminRoles
.=
'('
.
implode
(
','
,
$adherent
->
getUser
()
->
getCaissiers
()
->
toArray
())
.
')'
;
}
else
if
(
$group
->
getName
()
==
'Gestionnaire de Groupe'
||
$group
->
getName
()
==
'Contact'
)
{
$adminRoles
.=
'('
.
implode
(
','
,
$adherent
->
getUser
()
->
getGroupesgeres
()
->
toArray
())
.
')'
;
}
}
}
$data
[
"Droits d'administration"
]
=
$adminRoles
;
}
$this
->
query
->
getEntityManager
()
->
clear
();
...
...
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