Commit d3417d3c by Damien Moulard

Merge branch 'develop'

parents 0ece0ca1 33462cd4
......@@ -784,6 +784,11 @@ App\Entity\GlobalParameter:
description: "Paiement par chèque : Ordre à mettre sur ceux-ci"
value: ''
mandatory: 1
gp30:
name: "CONTACT_FORM_PHONE_NUMBER"
description: "Numéro de téléphone à afficher dans le formulaire de contact si défini"
value: ''
mandatory: 1
App\Entity\Siege:
......
......@@ -784,6 +784,11 @@ App\Entity\GlobalParameter:
description: "Paiement par chèque : Ordre à mettre sur ceux-ci"
value: ''
mandatory: 1
gp30:
name: "CONTACT_FORM_PHONE_NUMBER"
description: "Numéro de téléphone à afficher dans le formulaire de contact si défini"
value: ''
mandatory: 1
App\Entity\Siege:
......
......@@ -191,7 +191,7 @@ class AdherentAdmin extends AbstractAdmin
->add('profilDeCotisation', ChoiceType::class, [
'required' => true,
'label' => 'Choix du profil de cotisation :',
'choices' => $this->getConfigurationPool()->getContainer()->get('doctrine')->getRepository(ProfilDeCotisation::class)->findAll(),
'choices' => $this->getConfigurationPool()->getContainer()->get('doctrine')->getRepository(ProfilDeCotisation::class)->findBy([], ['montant' => 'ASC']),
'empty_data' => null,
'placeholder' => 'Choisir un profil',
'choice_label' => function ($choice, $key, $value) {
......@@ -585,10 +585,11 @@ class AdherentAdmin extends AbstractAdmin
}
}
$em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager();
$cotisationUtils = $this->getConfigurationPool()->getContainer()->get('app.utils.cotisations');
$container = $this->getConfigurationPool()->getContainer();
$em = $container->get('doctrine')->getManager();
$cotisationUtils = $container->get('app.utils.cotisations');
$iterator = new CustomDoctrineORMQuerySourceIterator($cotisationUtils, $em, $query, $fields);
$iterator = new CustomDoctrineORMQuerySourceIterator($cotisationUtils, $em, $container, $query, $fields);
$iterator->setDateTimeFormat('d/m/Y H:i:s'); //change this to suit your needs
return $iterator;
......
......@@ -875,10 +875,11 @@ class PrestataireAdmin extends AbstractAdmin
}
}
$em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager();
$cotisationUtils = $this->getConfigurationPool()->getContainer()->get('app.utils.cotisations');
$container = $this->getConfigurationPool()->getContainer();
$em = $container->get('doctrine')->getManager();
$cotisationUtils = $container->get('app.utils.cotisations');
$iterator = new CustomDoctrineORMQuerySourceIterator($cotisationUtils, $em, $query, $fields);
$iterator = new CustomDoctrineORMQuerySourceIterator($cotisationUtils, $em, $container, $query, $fields);
$iterator->setDateTimeFormat('d/m/Y H:i:s'); //change this to suit your needs
return $iterator;
......
......@@ -50,6 +50,7 @@ class GlobalParameter
const HELLOASSO_URL_EMLC_PRESTATAIRE = 'HELLOASSO_URL_EMLC_PRESTATAIRE';
const HELLOASSO_URL_COTISATION_ADHERENT = 'HELLOASSO_URL_COTISATION_ADHERENT';
const HELLOASSO_URL_COTISATION_PRESTATAIRE = 'HELLOASSO_URL_COTISATION_PRESTATAIRE';
const CONTACT_FORM_PHONE_NUMBER = 'CONTACT_FORM_PHONE_NUMBER';
/**
* @var \Ramsey\Uuid\UuidInterface
......
......@@ -15,11 +15,14 @@ namespace App\Exporter;
use App\Entity\Adherent;
use App\Entity\Prestataire;
use App\Entity\Flux;
use App\Entity\GlobalParameter;
use App\Utils\CotisationUtils;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Query;
use Sonata\Exporter\Source\AbstractPropertySourceIterator;
use Sonata\Exporter\Source\SourceIteratorInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* @final since sonata-project/exporter 2.4.
......@@ -32,14 +35,22 @@ class CustomDoctrineORMQuerySourceIterator extends AbstractPropertySourceIterato
protected $query;
protected $em;
protected $cotisationUtils;
protected $container;
/**
* @param array<string> $fields Fields to export
*/
public function __construct(CotisationUtils $cotisationUtils, EntityManagerInterface $em, Query $query, array $fields, string $dateTimeFormat = 'r')
{
public function __construct(
CotisationUtils $cotisationUtils,
EntityManagerInterface $em,
ContainerInterface $container,
Query $query,
array $fields,
string $dateTimeFormat = 'r'
) {
$this->em = $em;
$this->cotisationUtils = $cotisationUtils;
$this->container = $container;
$this->query = clone $query;
$this->query->setParameters($query->getParameters());
foreach ($query->getHints() as $name => $value) {
......@@ -74,12 +85,37 @@ class CustomDoctrineORMQuerySourceIterator extends AbstractPropertySourceIterato
} elseif (!empty($data['Id']) && !empty($data['Email'])) {
//adherent
$adherent = $this->em->getRepository(Adherent::class)->findOneById($data['Id']);
$cotisEnd = $this->cotisationUtils->isCotisationValidForAdherent($adherent);
$cotisEnd = is_string($cotisEnd) ? new \DateTime( $cotisEnd ) : $cotisEnd;
$data['Cotisation à jour'] = false == $cotisEnd ? '' : ($cotisEnd->format('d/m/Y'));
$firstCotis = $this->cotisationUtils->getFirstCotisationForAdherent($adherent);
$firstCotis = is_string($firstCotis) ? new \DateTime( $firstCotis ) : $firstCotis;
$data['Première Cotisation'] = false == $firstCotis ? '' : ($firstCotis->format('d/m/Y'));
if ($this->container->getParameter('tav_env')) {
// Last TAV cotisation
$cotisations = $this->em->getRepository(Flux::class)->getLastTavCotisation($adherent);
if (count($cotisations) > 0) {
$cotisDate = date("d/m/Y H:i:s", strtotime($cotisations[0]["created_at"]));
$data['Dernière Cotisation'] = $cotisDate;
} else {
$data['Dernière Cotisation'] = "Aucune";
}
// Current emlc balance
$balance = $adherent->getEmlcAccount()->getBalance();
$mlc = $this->em->getRepository(GlobalParameter::class)->val(GlobalParameter::MLC_SYMBOL);
$data['Solde'] = $balance . " " . $mlc;
// Profil de cotisation
$cotisationProfile = $adherent->getProfilDeCotisation();
if (!is_null($cotisationProfile) ) {
$data['Profil de cotisation'] = $cotisationProfile;
} else {
$data['Profil de cotisation'] = "Aucun profil assigné";
}
} else {
$cotisEnd = $this->cotisationUtils->isCotisationValidForAdherent($adherent);
$cotisEnd = is_string($cotisEnd) ? new \DateTime( $cotisEnd ) : $cotisEnd;
$data['Cotisation à jour'] = false == $cotisEnd ? '' : ($cotisEnd->format('d/m/Y'));
$firstCotis = $this->cotisationUtils->getFirstCotisationForAdherent($adherent);
$firstCotis = is_string($firstCotis) ? new \DateTime( $firstCotis ) : $firstCotis;
$data['Première Cotisation'] = false == $firstCotis ? '' : ($firstCotis->format('d/m/Y'));
}
$adminRoles = '';
if (!empty($adherent->getUser())) {
foreach ($adherent->getUser()->getPossiblegroups() as $group) {
......
......@@ -324,6 +324,13 @@ class GlobalConfigurationFormType extends AbstractType
// 'label_attr' => ['class' => 'checkbox-inline'], ],
'help' => 'Si cette option est à "true", les prestataires pourront ajouter un don lors de leur acaht d\'e-mlc.',
])
->add('contactformphonenumber', GlobalParameterType::class, [
'label' => 'Numéro de téléphone à afficher dans le formulaire de contact si défini',
'_description' => 'Numéro de téléphone à afficher dans le formulaire de contact si défini',
'name_param' => GlobalParameter::CONTACT_FORM_PHONE_NUMBER,
'required' => false,
'_placeholder' => '',
])
;
}
......
......@@ -67,7 +67,11 @@
{# Affichage de la carte des prestataires pour les adhérents #}
{% if KOH_USE_WORDPRESS is defined and KOH_USE_WORDPRESS == 'false' and ((app.user and is_granted('ROLE_ADHERENT')) or not app.user) %}
<div class='d-none d-md-block'>
{% include '@kohinos/presta/block/carte.html.twig' with {'title': 'Situer les Prestataires'|trans}%}
{% if tav_env == 1 %}
{% include '@kohinos/presta/block/carte.html.twig' with {'title': 'Situer les points de vente'|trans}%}
{% else %}
{% include '@kohinos/presta/block/carte.html.twig' with {'title': 'Situer les Prestataires'|trans}%}
{% endif %}
</div>
{% endif %}
{% if app.user and is_granted('ROLE_ADMIN') %}
......
......@@ -33,6 +33,13 @@
{% import _self as self %}
{% for menuItem in items %}
{% set url = menuItem.url %}
<a href="{{ url }}" class="dropdown-item {% if currentPath == url %}current{% endif %}" {% if menuItem.target %} target="_blank"{% endif %}>{{ menuItem.name }}</a>
{% if tav_env == 1 and menuItem.name == "Carte des prestataires" %}
{% set name = "Carte des points de vente" %}
{% elseif tav_env == 1 and menuItem.name == "Liste des prestataires" %}
{% set name = "Liste des points de vente" %}
{% else %}
{% set name = menuItem.name %}
{% endif %}
<a href="{{ url }}" class="dropdown-item {% if currentPath == url %}current{% endif %}" {% if menuItem.target %} target="_blank"{% endif %}>{{ name }}</a>
{% endfor %}
{% endmacro %}
\ No newline at end of file
......@@ -40,6 +40,9 @@
{{ form_row(form.captcha) }}
{{ form_row(form.save) }}
{{form_end(form)}}
{% if KOH_CONTACT_FORM_PHONE_NUMBER|default('') != '' %}
<p style="margin-top: 30px;">Vous pouvez aussi nous contacter au {{KOH_CONTACT_FORM_PHONE_NUMBER}}</p>
{% endif %}
</div>
</div>
</div>
......
......@@ -2,9 +2,14 @@
{% block content %}
<div class='container prestalist mt-2'>
{% include '@kohinos/block/breadcrumb.html.twig' with {'label' : 'Carte des prestataires'} %}
{% if tav_env == 1 %}
{% set name = "Carte des points de vente" %}
{% else %}
{% set name = "Carte des prestataires" %}
{% endif %}
{% include '@kohinos/block/breadcrumb.html.twig' with {'label' : name} %}
<div class='card'>
<div class="card-header"><h3>{{ 'Carte des prestataires :'|trans }}</h3></div>
<div class="card-header"><h3>{{ name|trans }}</h3></div>
<div class="card-body">
<div class="card-text">
{% include '@kohinos/presta/block/carte.html.twig' with {style:"height: 400px;"} %}
......
......@@ -2,7 +2,17 @@
{% block content %}
<div class='container prestalist mt-2'>
{% include '@kohinos/block/breadcrumb.html.twig' with {'label' : type, 'label2': 'Prestataires', 'url2': path('liste_prestataire', {'order': 'groupelocal'}) } %}
{% if type == 'Prestataires' and tav_env == 1 %}
{% set label = 'Points de vente' %}
{% else %}
{% set label = type %}
{% endif %}
{% if tav_env == 1 %}
{% set label2 = 'Points de vente' %}
{% else %}
{% set label2 = 'Prestataires' %}
{% endif %}
{% include '@kohinos/block/breadcrumb.html.twig' with {'label' : label, 'label2': label2, 'url2': path('liste_prestataire', {'order': 'groupelocal'}) } %}
{% if type == 'Prestataires' %}
<div class="d-flex justify-content-center">
<div class="btn-group text-center mb-2" role="group" aria-label="Basic example">
......
......@@ -2,7 +2,12 @@
{% block content %}
<div class='container prestalist mt-2'>
{% include '@kohinos/block/breadcrumb.html.twig' with {'label' : type} %}
{% if type == 'Prestataires' and tav_env == 1 %}
{% set label = 'Points de vente' %}
{% else %}
{% set label = type %}
{% endif %}
{% include '@kohinos/block/breadcrumb.html.twig' with {'label' : label} %}
<div class="d-flex justify-content-center">
<div class="btn-group text-center mb-2" role="group" aria-label="Basic example">
<a href='{{ path('liste_prestataire', {'order': 'raison'}) }}' type="button" class="btn btn-secondary">Par nom</a>
......
......@@ -24,7 +24,11 @@
{% endif %}
<div class="card-text mx-auto text-center mt-2">
<h5 class='btn btn-secondary'><a href="#" class="card-text mt-3" style='cursor:pointer;' data-toggle="collapse" data-target="#collapsepresta{{rubrique.id}}" aria-expanded="false" aria-controls="collapsepresta{{rubrique.id}}">
{{ 'Voir le(s)'|trans }} {{rubrique.prestataires|length}} {{'prestataire(s)'|trans}}
{% if tav_env == 1 %}
{{ 'Voir le(s)'|trans }} {{rubrique.prestataires|length}} {{'point(s) de vente'|trans}}
{% else %}
{{ 'Voir le(s)'|trans }} {{rubrique.prestataires|length}} {{'prestataire(s)'|trans}}
{% endif %}
</a></h5>
</div>
<ul class="list-group list-group-flush collapse mx-2 my-2" id="collapsepresta{{rubrique.id}}">
......
......@@ -10,7 +10,11 @@
</h1>
<div class="my-3 p-3 bg-white rounded box-shadow">
<p>{{rubrique.content|raw}}</p>
<h3>{{ 'Prestataires'|trans }} : </h3>
{% if tav_env == 1 %}
<h3>{{ 'Points de vente'|trans }} : </h3>
{% else %}
<h3>{{ 'Prestataires'|trans }} : </h3>
{% endif %}
{% for presta in prestataires %}
<div class='my-2'>
{% include '@kohinos/presta/onepresta.html.twig' with { 'withrubrique': false} %}
......
......@@ -31,7 +31,7 @@
</trans-unit>
<trans-unit id="dLzMRPR" resname="Invalid CSRF token.">
<source>Invalid CSRF token.</source>
<target>Jeton CSRF invalide.</target>
<target>Jeton CSRF invalide. Pas de panique, il suffit de vous reconnecter.</target>
</trans-unit>
<trans-unit id="PhhlLem" resname="No authentication provider found to support the authentication token.">
<source>No authentication provider found to support the authentication token.</source>
......
......@@ -4,7 +4,7 @@
'Invalid credentials.': 'Identifiants invalides.'
'Cookie has already been used by someone else.': 'Le cookie a déjà été utilisé par quelqu''un d''autre.'
'Not privileged to request the resource.': 'Privilèges insuffisants pour accéder à la ressource.'
'Invalid CSRF token.': 'Jeton CSRF invalide.'
'Invalid CSRF token.': 'Jeton CSRF invalide. Pas de panique, il suffit de vous reconnecter.'
'No authentication provider found to support the authentication token.': 'Aucun fournisseur d''authentification n''a été trouvé pour supporter le jeton d''authentification.'
'No session available, it either timed out or cookies are not enabled.': 'Aucune session disponible, celle-ci a expiré ou les cookies ne sont pas activés.'
'No token could be found.': 'Aucun jeton n''a pu être trouvé.'
......
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