Commit a8a904e4 by Julien Jorry

ADMIN export : Add simple email into prestataire and solidoume export

parent a7127e65
......@@ -802,7 +802,6 @@ class PrestataireAdmin extends AbstractAdmin
$em->flush();
}
/* @TODO : définir champ à exporter */
public function getExportFields()
{
return [
......@@ -812,6 +811,7 @@ class PrestataireAdmin extends AbstractAdmin
'Groupe local' => 'groupe.name',
'Rubriques' => 'rubriquesString',
'Gestionnaires' => 'usersString',
'Gestionnaires emails' => 'gestionnairesEmailsString',
'Tags' => 'etatsString',
'Crée le' => 'createdAt',
'Mise à jour le' => 'updatedAt',
......
......@@ -226,6 +226,23 @@ class SolidoumeAdmin extends AbstractAdmin
return $actions;
}
public function getExportFields()
{
return [
'Id' => 'id',
'Adhérent' => 'adherent.fullname',
'Adhérent email' => 'adherent.email',
'Date de prélèvement' => 'paiementDate',
'Montant' => 'amount',
'Activé ?' => 'enabled',
'Récurrent ?' => 'isRecurrent',
'Don ?' => 'isDonation',
'Crée le' => 'createdAt',
'Mise à jour le' => 'updatedAt',
'Commentaires' => 'comments',
];
}
/**
* {@inheritdoc}
*/
......
......@@ -198,6 +198,14 @@ class Adherent extends AccountableObject implements AccountableInterface
return 'Adhérent xxx';
}
public function getEmail(): ?string
{
if (!empty($this->getUser())) {
return $this->getUser()->getEmail();
}
return '';
}
public function getFullname(): string
{
$return = '';
......
......@@ -705,6 +705,13 @@ class Prestataire extends AccountableObject implements AccountableInterface
return $return;
}, $this->users->getValues()));
}
public function getGestionnairesEmailsString()
{
return join(' - ', array_map(function ($user) {
return $user->getEmail();
}, $this->users->getValues()));
}
public function getCaissiersString()
......
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