Commit 0be89805 by Damien Moulard

Merge branch '7279-affiche-username-mail-dans-tous-les-exports' into 'develop'

show email instead of username

See merge request !120
parents 4b21ca29 da6880a9
...@@ -184,8 +184,10 @@ class DonAdmin extends AbstractAdmin ...@@ -184,8 +184,10 @@ class DonAdmin extends AbstractAdmin
public function getExportFields() public function getExportFields()
{ {
$ssaFriendlyTypeNames = $this->getConfigurationPool()->getContainer()->getParameter('tav_env')
&& $this->getConfigurationPool()->getContainer()->getParameter('ssa_friendly_flux_type_names');
return [ return [
'Id' => 'expediteur', 'Id' => $ssaFriendlyTypeNames ? 'expediteur.email' : 'expediteur',
'Groupe' => 'expediteur.groupe.name', 'Groupe' => 'expediteur.groupe.name',
'Type' => 'type', 'Type' => 'type',
'Montant' => 'montant', 'Montant' => 'montant',
......
...@@ -64,6 +64,7 @@ class FluxAdmin extends AbstractAdmin ...@@ -64,6 +64,7 @@ class FluxAdmin extends AbstractAdmin
$collection->clearExcept(['list', 'export']); $collection->clearExcept(['list', 'export']);
} }
//Where is this method used ?
protected function configureExportFields(): array protected function configureExportFields(): array
{ {
$ssaFriendlyTypeNames = $this->getConfigurationPool()->getContainer()->getParameter('tav_env') $ssaFriendlyTypeNames = $this->getConfigurationPool()->getContainer()->getParameter('tav_env')
...@@ -104,7 +105,7 @@ class FluxAdmin extends AbstractAdmin ...@@ -104,7 +105,7 @@ class FluxAdmin extends AbstractAdmin
->add('montant', 'decimal', ['label' => 'Montant', 'attributes' => ['fraction_digits' => 2]]) ->add('montant', 'decimal', ['label' => 'Montant', 'attributes' => ['fraction_digits' => 2]])
->add('expediteur', null, ['label' => 'Expediteur']) ->add('expediteur', null, ['label' => 'Expediteur'])
->add('destinataire', null, ['label' => 'Destinataire']) ->add('destinataire', null, ['label' => 'Destinataire'])
->add('operateur', null, ['label' => 'Operateur']) ->add($ssaFriendlyTypeNames ? 'operateur.email' : 'operateur', null, ['label' => 'Operateur'])
->addIdentifier('reference', null, ['label' => 'Reference']) ->addIdentifier('reference', null, ['label' => 'Reference'])
// @TODO : ajouter le verify uniquement si l'on souhaite (param url)=> sinon c'est beaucoup trop long... // @TODO : ajouter le verify uniquement si l'on souhaite (param url)=> sinon c'est beaucoup trop long...
// ->addIdentifier('verify', null, array('label' => 'Vérifié')) // ->addIdentifier('verify', null, array('label' => 'Vérifié'))
...@@ -245,7 +246,7 @@ class FluxAdmin extends AbstractAdmin ...@@ -245,7 +246,7 @@ class FluxAdmin extends AbstractAdmin
'Montant' => 'montant', 'Montant' => 'montant',
'Expediteur' => 'expediteur', 'Expediteur' => 'expediteur',
'Destinataire' => 'destinataire', 'Destinataire' => 'destinataire',
'Operateur' => 'operateur', 'Operateur' => $ssaFriendlyTypeNames ? 'operateur.email' : 'operateur',
'Moyen' => 'moyen', 'Moyen' => 'moyen',
'Reference' => 'reference', 'Reference' => 'reference',
]; ];
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div> <div>
{% if object is instanceof("App\\Entity\\DonAdherent") or (object is instanceof("App\\Entity\\Don") and object.type == 'don_adherent' ) %} {% if object is instanceof("App\\Entity\\DonAdherent") or (object is instanceof("App\\Entity\\Don") and object.type == 'don_adherent' ) %}
<a class="sonata-link-identifier" href="{{ path('adherent_edit', {'id': object.expediteur.id}) }}"> <a class="sonata-link-identifier" href="{{ path('adherent_edit', {'id': object.expediteur.id}) }}">
{{ 'Adhérent'|trans }} : {{ object.expediteur.name }} {{ 'Adhérent'|trans }} : {% if tav_env and ssa_friendly_flux_type_names %}{{ object.expediteur.email }}{% else %}{{ object.expediteur.name }}{% endif %}
</a> </a>
{% elseif object is instanceof("App\\Entity\\DonPrestataire") or (object is instanceof("App\\Entity\\Don") and object.type == 'don_prestataire' ) %} {% elseif object is instanceof("App\\Entity\\DonPrestataire") or (object is instanceof("App\\Entity\\Don") and object.type == 'don_prestataire' ) %}
<a class="sonata-link-identifier" href="{{ path('prestataire_edit', {'id': object.expediteur.id}) }}"> <a class="sonata-link-identifier" href="{{ path('prestataire_edit', {'id': object.expediteur.id}) }}">
......
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