Commit 19bb52a8 by Julien Jorry

Fix error date cotisation + remove bouton switch user + fix page list

parent be1ee842
...@@ -15,9 +15,11 @@ use Sonata\AdminBundle\Show\ShowMapper; ...@@ -15,9 +15,11 @@ use Sonata\AdminBundle\Show\ShowMapper;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\Extension\Core\Type\DateType; use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\MoneyType; use Symfony\Component\Form\Extension\Core\Type\MoneyType;
use Symfony\Component\Intl\DateFormatter\IntlDateFormatter;
use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Security;
/** /**
...@@ -96,17 +98,19 @@ class CotisationAdmin extends AbstractAdmin ...@@ -96,17 +98,19 @@ class CotisationAdmin extends AbstractAdmin
} }
$formMapper->end() $formMapper->end()
->with('Date', ['class' => 'col-md-4']) ->with('Date', ['class' => 'col-md-4'])
->add('cotisationInfos.debut', DateType::class, array( ->add('cotisationInfos.debut', DateTimeType::class, array(
'label' => 'Date de début', 'label' => 'Date de début',
'widget' => 'single_text', 'widget' => 'single_text',
'html5' => false, // 'html5' => false,
'attr' => ['class' => 'js-datepicker'], 'date_format' => IntlDateFormatter::SHORT,
// 'attr' => ['class' => 'js-datepicker'],
)) ))
->add('cotisationInfos.fin', DateType::class, array( ->add('cotisationInfos.fin', DateTimeType::class, array(
'label' => 'Date de fin', 'label' => 'Date de fin',
'widget' => 'single_text', 'widget' => 'single_text',
'html5' => false, // 'html5' => false,
'attr' => ['class' => 'js-datepicker'], 'date_format' => IntlDateFormatter::SHORT,
// 'attr' => ['class' => 'js-datepicker'],
)) ))
->end() ->end()
; ;
......
...@@ -297,6 +297,6 @@ abstract class Flux ...@@ -297,6 +297,6 @@ abstract class Flux
if (empty($this->getDestinataire()) || empty($this->getExpediteur()) || empty($this->getMontant())) { if (empty($this->getDestinataire()) || empty($this->getExpediteur()) || empty($this->getMontant())) {
return "[FLUX] Visualisation impossible ! Destinataire / Expéditeur et/ou montant manquant(s) !"; return "[FLUX] Visualisation impossible ! Destinataire / Expéditeur et/ou montant manquant(s) !";
} }
return $this->getCreatedAt()->format('d/m/Y H:i').' | '.ucwords($this->getParenttype()).' : '.$this->getDestinataire().' => '.$this->getExpediteur().' ; '.$this->getMontant().'€'; return ($this->getCreatedAt()?$this->getCreatedAt()->format('d/m/Y H:i').' | ':'').ucwords($this->getParenttype()).' : '.$this->getDestinataire().' => '.$this->getExpediteur().' ; '.$this->getMontant().'€';
} }
} }
{# UNIQUEMENT POUR LES TESTS #} {# UNIQUEMENT POUR LES TESTS #}
{% if app.environment == 'dev' and is_granted('ROLE_USER') %} {#% if app.environment == 'dev' and is_granted('ROLE_USER') %}
{% set routeName = routeName|default('index')%} {% set routeName = routeName|default('index')%}
{% if is_granted('ROLE_PREVIOUS_ADMIN') %} {% if is_granted('ROLE_PREVIOUS_ADMIN') %}
<div class='w-100 text-center mb-2'> <div class='w-100 text-center mb-2'>
...@@ -24,18 +24,6 @@ ...@@ -24,18 +24,6 @@
<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_gestiongroupe'> <a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_gestiongroupe'>
{{ 'GESTION GROUPE'|trans }} {{ 'GESTION GROUPE'|trans }}
</a> </a>
{# <span class="dropdown">
<a href="#" class='btn btn-xs m-1 btn-primary dropdown-toggle' id="dropdownMenuButton" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
{{ 'GESTION GROUPE'|trans }}
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
{% for groupe in getAllGroupes() %}
{% for user in groupe.gestionnaires %}
<a class="dropdown-item" href="{{path(routeName, [], true)}}?_switch_user='{{user.username}}">{{groupe}} ({{user}})</a>
{% endfor %}
{% endfor %}
</div>
</span> #}
<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_contact'> <a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_contact'>
{{ 'CONTACT'|trans }} {{ 'CONTACT'|trans }}
</a> </a>
...@@ -50,7 +38,7 @@ ...@@ -50,7 +38,7 @@
</a> </a>
</div> </div>
{% endif %} {% endif %}
{% endif %} {% endif %#}
{# ACTIONS PRINCIPALES POUR CHAQUE UTILISATEUR CONNECTE #} {# ACTIONS PRINCIPALES POUR CHAQUE UTILISATEUR CONNECTE #}
<div id="accordion"> <div id="accordion">
......
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