Commit cc5d55de by Julien Jorry

Admin presta and adherent export : add admin rights to users

parent 789714b4
...@@ -55,7 +55,7 @@ class AdherentAdmin extends AbstractAdmin ...@@ -55,7 +55,7 @@ class AdherentAdmin extends AbstractAdmin
// reverse order (default = 'ASC') // reverse order (default = 'ASC')
'_sort_order' => 'DESC', '_sort_order' => 'DESC',
// name of the ordered field (default = the model's id field, if any) // name of the ordered field (default = the model's id field, if any)
'_sort_by' => 'updatedAt', '_sort_by' => 'createdAt',
// '_page' => 1, // '_page' => 1,
// '_per_page' => 32 // '_per_page' => 32
]; ];
......
...@@ -670,7 +670,9 @@ class Prestataire extends AccountableObject implements AccountableInterface ...@@ -670,7 +670,9 @@ class Prestataire extends AccountableObject implements AccountableInterface
public function getUsersString() public function getUsersString()
{ {
return join(' - ', array_map(function ($user) { 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())); }, $this->users->getValues()));
} }
......
...@@ -70,6 +70,25 @@ class CustomDoctrineORMQuerySourceIterator extends AbstractPropertySourceIterato ...@@ -70,6 +70,25 @@ class CustomDoctrineORMQuerySourceIterator extends AbstractPropertySourceIterato
$data['Cotisation à jour'] = $cotisEnd == false ? '' : ($cotisEnd->format('d/m/Y')); $data['Cotisation à jour'] = $cotisEnd == false ? '' : ($cotisEnd->format('d/m/Y'));
$firstCotis = $this->cotisationUtils->getFirstCotisationForAdherent($adherent); $firstCotis = $this->cotisationUtils->getFirstCotisationForAdherent($adherent);
$data['Première Cotisation'] = $firstCotis == false ? '' : ($firstCotis->format('d/m/Y')); $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(); $this->query->getEntityManager()->clear();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment