diff --git a/app/config/config.yml b/app/config/config.yml index 3935ccc36..89c49c210 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -128,6 +128,9 @@ parameters: forum_inscriptions: nom: 'Inscriptions' niveau: 'ROLE_FORUM' + url: '/admin/event/inscription' + extra_routes: + - admin_event_inscription_list forum_pending_bankwires: nom: 'Virements en attente' niveau: 'ROLE_ADMIN' diff --git a/app/config/routing/admin_event.yml b/app/config/routing/admin_event.yml index 86e76fa97..318828920 100644 --- a/app/config/routing/admin_event.yml +++ b/app/config/routing/admin_event.yml @@ -105,3 +105,7 @@ admin_event_restore: admin_event_votes: path: /votes defaults: {_controller: AppBundle\Controller\Admin\Event\VotesListeAction} + +admin_event_inscription_list: + path: /inscription + defaults: { _controller: AppBundle\Controller\Admin\Event\Inscription\ListAction} diff --git a/db/seeds/Inscriptions.php b/db/seeds/Inscriptions.php index d2854a82d..0dec09904 100644 --- a/db/seeds/Inscriptions.php +++ b/db/seeds/Inscriptions.php @@ -11,6 +11,7 @@ public function run(): void // Inscriptions $data = [ [ + 'date' => time(), 'reference' => 'REF-TEST-001', 'type_inscription' => AFUP_FORUM_2_JOURNEES, 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][AFUP_FORUM_2_JOURNEES], @@ -26,6 +27,7 @@ public function run(): void 'etat' => AFUP_FORUM_ETAT_REGLE, ], [ + 'date' => time(), 'reference' => 'REF-TEST-002', 'type_inscription' => AFUP_FORUM_2_JOURNEES, 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][AFUP_FORUM_2_JOURNEES], @@ -41,6 +43,7 @@ public function run(): void 'etat' => AFUP_FORUM_ETAT_REGLE, ], [ + 'date' => time(), 'reference' => 'REF-TEST-003', 'type_inscription' => AFUP_FORUM_2_JOURNEES, 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][AFUP_FORUM_2_JOURNEES], diff --git a/htdocs/pages/administration/forum_inscriptions.php b/htdocs/pages/administration/forum_inscriptions.php index aace5dbf6..b4de9b65a 100644 --- a/htdocs/pages/administration/forum_inscriptions.php +++ b/htdocs/pages/administration/forum_inscriptions.php @@ -23,7 +23,7 @@ checkForumRedirection(); -$action = verifierAction(['lister', 'ajouter', 'modifier', 'supprimer','envoyer_convocation']); +$action = verifierAction(['ajouter', 'modifier', 'supprimer','envoyer_convocation']); $tris_valides = ['i.date', 'i.nom', 'f.societe', 'i.etat']; $sens_valides = [ 'desc','asc' ]; $smarty->assign('action', $action); @@ -72,68 +72,14 @@ function updateGlobalsForTarif( $forum_inscriptions = new Inscriptions($bdd); $forum_facturation = new Facturation($bdd); -if ($action == 'lister') { - $list_champs = 'i.id, i.date, i.nom, i.prenom, i.email, f.societe, i.etat, i.coupon, i.type_inscription, f.type_reglement, i.presence_day1, i.presence_day2'; - $list_ordre = 'date desc'; - $list_sens = 'desc'; - $list_associatif = false; - $list_filtre = false; - - if (isset($_GET['tri']) && in_array($_GET['tri'], $tris_valides) - && isset($_GET['sens']) && in_array($_GET['sens'], $sens_valides)) { - $list_ordre = $_GET['tri'] . ' ' . $_GET['sens']; - } - if (isset($_GET['filtre'])) { - $list_filtre = $_GET['filtre']; - } - - chargerForumId(); - - if (!isset($_GET['id_forum']) || intval($_GET['id_forum']) == 0) { - $_GET['id_forum'] = $forum->obtenirDernier(); - } - $forumData = $forum->obtenir($_GET['id_forum']); - $smarty->assign('id_forum', $_GET['id_forum']); - $memberTickets = []; - - $retour = updateGlobalsForTarif($eventRepository, $ticketEventTypeRepository, $ticketTypeAvailability, $_GET['id_forum'], $memberTickets); - $restantes = $retour['restantes']; - - $smarty->assign('forum_tarifs_members', $memberTickets); - $smarty->assign('forum_tarifs_lib',$AFUP_Tarifs_Forum_Lib); - $smarty->assign('forum_tarifs_restantes', $restantes); - $smarty->assign('forum_tarifs',$AFUP_Tarifs_Forum); - $stats = $eventStatsRepository->getStats((int) $_GET['id_forum']); - $smarty->assign('statistiques', [ - 'premier_jour' => [ - 'inscrits' => $stats->firstDay->registered, - 'confirmes' => $stats->firstDay->confirmed, - 'en_attente_de_reglement' => $stats->firstDay->pending, - ], - 'second_jour' => [ - 'inscrits' => $stats->secondDay->registered, - 'confirmes' => $stats->secondDay->confirmed, - 'en_attente_de_reglement' => $stats->secondDay->pending, - ], - 'types_inscriptions' => [ - 'confirmes' => $stats->ticketType->confirmed, - 'inscrits' => $stats->ticketType->registered, - 'payants' => $stats->ticketType->paying, - ], - ]); - - $smarty->assign('forums', $forum->obtenirListActive()); - $smarty->assign('inscriptions', $forum_inscriptions->obtenirListe($_GET['id_forum'], $list_champs, $list_ordre, $list_associatif, $list_filtre)); - $smarty->assign('finForum', (new \DateTime($forumData['date_fin']))->format('U')); - $smarty->assign('now', (new \DateTime())->format('U')); -} elseif ($action == 'supprimer') { +if ($action == 'supprimer') { /** @var Invoice|null $invoice */ $invoice = $invoiceRepository->getByReference($_GET['id']); if ($forum_inscriptions->supprimerInscription($_GET['id']) && (null === $invoice || $invoiceService->deleteInvoice($invoice))) { Logs::log('Suppression de l\'inscription ' . $_GET['id']); - afficherMessage('L\'inscription a été supprimée', 'index.php?page=forum_inscriptions&action=lister'); + afficherMessage('L\'inscription a été supprimée', '/admin/event/inscription'); } else { - afficherMessage('Une erreur est survenue lors de la suppression de l\'inscription', 'index.php?page=forum_inscriptions&action=lister', true); + afficherMessage('Une erreur est survenue lors de la suppression de l\'inscription', '/admin/event/inscription', true); } } else { $pays = new Pays($bdd); @@ -156,7 +102,7 @@ function updateGlobalsForTarif( } else { $champs = $forum_inscriptions->obtenir($_GET['id']); if ($champs == false) { - afficherMessage('L\'inscription n\'existe plus', 'index.php?page=forum_inscriptions&action=lister'); + afficherMessage('L\'inscription n\'existe plus', '/admin/event/inscription'); exit(0); } $champs2 = $forum_facturation->obtenir($champs['reference']); @@ -409,7 +355,7 @@ function updateGlobalsForTarif( } else { Logs::log('Modification de l\'inscription de ' . $formulaire->exportValue('prenom') . ' ' . $formulaire->exportValue('nom') . ' (' . $_GET['id'] . ')'); } - afficherMessage('L\'inscription a été ' . (($action == 'ajouter') ? 'ajoutée' : 'modifiée'), 'index.php?page=forum_inscriptions&action=lister&id_forum=' . $valeurs['id_forum']); + afficherMessage('L\'inscription a été ' . (($action == 'ajouter') ? 'ajoutée' : 'modifiée'), '/admin/event/inscription?id=' . $valeurs['id_forum']); } else { $smarty->assign('erreur', 'Une erreur est survenue lors de ' . (($action == 'ajouter') ? "l'ajout" : 'la modification') . ' de l\'inscription'); } diff --git a/htdocs/templates/administration/forum_inscriptions.html b/htdocs/templates/administration/forum_inscriptions.html index 748b90607..c234baa47 100644 --- a/htdocs/templates/administration/forum_inscriptions.html +++ b/htdocs/templates/administration/forum_inscriptions.html @@ -1,279 +1,6 @@ -{if $action == 'lister'} - -

Inscriptions

- -
-
- -
-
-
- - -
-
-
-
-
- - - -
- - - - - - - - - - - - - - {foreach from=$forum_tarifs item=forum_tarif key=forum_tarif_key} - {assign var=inscrits value=$statistiques.types_inscriptions.inscrits[$forum_tarif_key]|default:0} - {assign var=confirmes value=$statistiques.types_inscriptions.confirmes[$forum_tarif_key]|default:0} - {assign var=payants value=$statistiques.types_inscriptions.payants[$forum_tarif_key]|default:0} - {assign var=montant value=$statistiques.types_inscriptions.payants[$forum_tarif_key]|default:0*$forum_tarif} - {assign var=inscrits_total value=$inscrits_total+$inscrits} - {assign var=confirmes_total value=$confirmes_total+$confirmes} - {assign var=payants_total value=$payants_total+$payants} - {assign var=montant_total value=$montant_total+$montant} - {if $inscrits !== 0} - - - - - - - - - - - {/if} - - {/foreach} - - - - - - - - - - - - - -
TypeTarifNb inscritsNb ConfirmeNb payantsMontantPlaces restantes
- {$forum_tarifs_lib[$forum_tarif_key]} - {$forum_tarif} €{$inscrits}{$confirmes}{$payants} {$montant} {$forum_tarifs_restantes[$forum_tarif_key]|default:''}
{$inscrits_total}{$confirmes_total}{$payants_total}{$montant_total}
- - - - - - - - - - - - - - - - - - - - - - - - -
InscritsConfirmésEn attente de règlement
Jour 1{$statistiques.premier_jour.inscrits}{$statistiques.premier_jour.confirmes}{if $statistiques.premier_jour.en_attente_de_reglement == ''}0{else}{$statistiques.premier_jour.en_attente_de_reglement}{/if}
Jour 2{$statistiques.second_jour.inscrits}{$statistiques.second_jour.confirmes}{if $statistiques.second_jour.en_attente_de_reglement == ''}0{else}{$statistiques.second_jour.en_attente_de_reglement}{/if}
-
- -
-
- {assign var=tri value=$smarty.get.tri|default:''} - {assign var=sens value=$smarty.get.sens|default:''} - {assign var=filtre value=$smarty.get.filtre|default:''|stripslashes} - - - - - -
-
-
- - -
-
- -
-
-
-
- - {if $inscriptions} - - - - - - - - - - - - - - - {foreach from=$inscriptions item=inscription} - - - - - - - - {if $inscription.type_inscription|in_array:$forum_tarifs_members} - {if $inscription.lastsubscription == null} - - {elseif $inscription.lastsubscription < $now} - - {elseif $inscription.lastsubscription < $finForum} - - {else} - - {/if} - {else} - - {/if} - - - {/foreach} - -
DateNom PrénomSociété (facturation)TypeEtatRèg.Statut cotisation 
{$inscription.date|date_format:"%d/%m/%Y %H:%M:%S"} - {$inscription.prenom} {$inscription.nom} - - - - - {$inscription.societe} - {if $inscription.societe} - - - - {/if} - {$forum_tarifs_lib[$inscription.type_inscription]} - {if $inscription.etat == 0} - Créé - {elseif $inscription.etat == 1} - Annulé - {elseif $inscription.etat == 2} - Erreur - {elseif $inscription.etat == 3} - Refusé - {elseif $inscription.etat == 4} - Reglé - {elseif $inscription.etat == 5} - Invité - {elseif $inscription.etat == 6} - Attente règlement - {elseif $inscription.etat == 7} - Facturé - {/if} - {if $inscription.type_reglement == 0}CB{elseif $inscription.type_reglement == 1}CHQ{elseif $inscription.type_reglement == 2}VIR{/if} - - Non trouvée - - - - A expiré le {$inscription.lastsubscription|date_format:'%d/%m/%Y'} - - - URL Paiement - - - - Expire le {$inscription.lastsubscription|date_format:'%d/%m/%Y'} - - - URL Paiement - - - OK - - n/a - - - - - - - - -
- {else} -
-
- - Aucune inscription -
-
- {/if} -
+{if $action == 'ajouter'} +

Ajouter une inscription pour le {$forum_name}

{else} - {if $action == 'ajouter'} -

Ajouter une inscription pour le {$forum_name}

- {else} -

Modifier une inscription pour le {$forum_name}

- {/if} - {include file="formulaire.html"} +

Modifier une inscription pour le {$forum_name}

{/if} +{include file="formulaire.html"} diff --git a/sources/AppBundle/Controller/Admin/Event/Inscription/ListAction.php b/sources/AppBundle/Controller/Admin/Event/Inscription/ListAction.php new file mode 100644 index 000000000..271c3e5f9 --- /dev/null +++ b/sources/AppBundle/Controller/Admin/Event/Inscription/ListAction.php @@ -0,0 +1,70 @@ +query->get('id'); + $direction = $request->query->get('direction'); + $sort = $request->query->get('sort'); + $filter = $request->query->get('filter'); + + $event = $eventActionHelper->getEventById($id); + + $stats = $eventStatsRepository->getStats($event->getId()); + + return $this->render('event/inscription/list.html.twig', [ + 'filter' => $filter, + 'direction' => $direction, + 'sort' => $sort, + 'now' => new DateTime(), + 'inscriptions' => $ticketRepository->getTicketsForList($event, $filter, $sort, $direction), + 'statistiques' => [ + 'premier_jour' => [ + 'inscrits' => $stats->firstDay->registered, + 'confirmes' => $stats->firstDay->confirmed, + 'en_attente_de_reglement' => $stats->firstDay->pending, + ], + 'second_jour' => [ + 'inscrits' => $stats->secondDay->registered, + 'confirmes' => $stats->secondDay->confirmed, + 'en_attente_de_reglement' => $stats->secondDay->pending, + ], + 'types_inscriptions' => [ + 'confirmes' => $stats->ticketType->confirmed, + 'inscrits' => $stats->ticketType->registered, + 'payants' => $stats->ticketType->paying, + ], + ], + 'ticketTypesDetailsCollection' => $ticketTypeDetailsCollectionFactory->create($event), + 'event' => $event, + 'event_select_form' => $eventSelectFactory->create($event, $request)->createView(), + ]); + } +} diff --git a/sources/AppBundle/Controller/Admin/Event/ListAction.php b/sources/AppBundle/Controller/Admin/Event/ListAction.php index 722e53f2d..f5ee7536c 100644 --- a/sources/AppBundle/Controller/Admin/Event/ListAction.php +++ b/sources/AppBundle/Controller/Admin/Event/ListAction.php @@ -14,14 +14,6 @@ public function __construct(private readonly EventRepository $eventRepository) { public function __invoke(): Response { - //TODO : à supprimer quand les actions via le formulaire auront été migée - if (isset($_SESSION['flash']['message'])) { - $this->addFlash('notice', $_SESSION['flash']['message']); - } - if (isset($_SESSION['flash']['erreur'])) { - $this->addFlash('error', $_SESSION['flash']['erreur']); - } - unset($_SESSION['flash']); $list = $this->eventRepository->getList(); return $this->render('admin/event/list.html.twig', [ 'events' => $list, diff --git a/sources/AppBundle/Controller/Admin/HomeAction.php b/sources/AppBundle/Controller/Admin/HomeAction.php index a55206344..0853cb6c8 100644 --- a/sources/AppBundle/Controller/Admin/HomeAction.php +++ b/sources/AppBundle/Controller/Admin/HomeAction.php @@ -51,7 +51,7 @@ public function __invoke(): Response } $info['statistics']['montant total'] = number_format($montantTotal, 0, ',', "\u{a0}") . "\u{a0}€"; - $info['url'] = '/pages/administration/index.php?page=forum_inscriptions&id_forum=' . $event->getId(); + $info['url'] = '/admin/event/inscription?id=' . $event->getId(); $cards[] = $info; } diff --git a/sources/AppBundle/Controller/LegacyController.php b/sources/AppBundle/Controller/LegacyController.php index 69a5b5d08..4e73c4837 100644 --- a/sources/AppBundle/Controller/LegacyController.php +++ b/sources/AppBundle/Controller/LegacyController.php @@ -76,14 +76,6 @@ public function backOffice() // Initialisation de AFUP_Log Logs::initialiser($bdd, $droits->obtenirIdentifiant()); require_once __DIR__ . '/../../../htdocs/pages/administration/' . $_GET['page'] . '.php'; - // On gère des infos popups - if (isset($_SESSION['flash']['message'])) { - $this->addFlash('notice', $_SESSION['flash']['message']); - } - if (isset($_SESSION['flash']['erreur'])) { - $this->addFlash('error', $_SESSION['flash']['erreur']); - } - unset($_SESSION['flash']); // Récupération du contenu de la page généré par smarty $content = $smarty->fetch($_GET['page'] . '.html'); diff --git a/sources/AppBundle/Event/Model/HydratorArrayCallable.php b/sources/AppBundle/Event/Model/HydratorArrayCallable.php new file mode 100644 index 000000000..4df253d11 --- /dev/null +++ b/sources/AppBundle/Event/Model/HydratorArrayCallable.php @@ -0,0 +1,23 @@ + $data) { + ($this->getIteratorClosure)($key, $data); + + yield $key => $data; + } + } +} diff --git a/sources/AppBundle/Event/Model/Repository/TicketRepository.php b/sources/AppBundle/Event/Model/Repository/TicketRepository.php index db70f0b25..afc9bf500 100644 --- a/sources/AppBundle/Event/Model/Repository/TicketRepository.php +++ b/sources/AppBundle/Event/Model/Repository/TicketRepository.php @@ -5,9 +5,11 @@ namespace AppBundle\Event\Model\Repository; use AppBundle\Event\Model\Event; +use AppBundle\Event\Model\HydratorArrayCallable; use AppBundle\Event\Model\Invoice; use AppBundle\Event\Model\Ticket; use AppBundle\Event\Model\TicketType; +use AppBundle\Ting\DateTimeWithTimeZoneSerializer; use CCMBenchmark\Ting\Driver\Mysqli\Serializer\Boolean; use CCMBenchmark\Ting\Query\QueryException; use CCMBenchmark\Ting\Repository\CollectionInterface; @@ -214,6 +216,70 @@ public function getAllTicketsForExport() ->query($this->getCollection(new HydratorSingleObject())); } + public function getTicketsForList(Event $event, ?string $filter, ?string $sort, ?string $direction): CollectionInterface + { + $availableSorts = [ + 'date' => 'i.date', + 'name' => 'i.nom', + 'societe' => 'f.societe', + 'type' => 'i.type_inscription', + 'etat' => 'i.etat', + ]; + + $params = [ + 'eventId' => $event->getId(), + ]; + + $sql = <<getPreparedQuery($sql) + ->setParams($params) + ->query($this->getCollection(new HydratorArrayCallable(function (mixed $key, array &$data): void { + if (!$data['lastsubscription']) { + return; + } + + $data['lastsubscription'] = (new DateTimeWithTimeZoneSerializer())->unserialize($data['lastsubscription'], ['format' => 'U']); + }))) + ; + } + /** * @inheritDoc */ @@ -242,6 +308,7 @@ public static function initMetadata(SerializerFactoryInterface $serializerFactor 'unserialize' => ['unSerializeUseFormat' => true, 'format' => 'U'], 'serialize' => ['format' => 'U'], ], + 'serializer' => DateTimeWithTimeZoneSerializer::class, ]) ->addField([ 'columnName' => 'reference', diff --git a/sources/AppBundle/Event/Ticket/Dto/TicketTypeDetailsCollectionDto.php b/sources/AppBundle/Event/Ticket/Dto/TicketTypeDetailsCollectionDto.php new file mode 100644 index 000000000..2a38764a5 --- /dev/null +++ b/sources/AppBundle/Event/Ticket/Dto/TicketTypeDetailsCollectionDto.php @@ -0,0 +1,33 @@ + $ticketTypeDetailsCollectionDto */ + public function __construct( + private array $ticketTypeDetailsCollectionDto = [], + public array $ticketTypeForMemberOnly = [], + ) {} + + public function addTicketTypeDetails(int $id, TicketTypeDetailsDto $ticketTypeDetailsDto, bool $isForMemberOnly): void + { + $this->ticketTypeDetailsCollectionDto[$id] = $ticketTypeDetailsDto; + + if ($isForMemberOnly) { + $this->ticketTypeForMemberOnly[$id] = $id; + } + } + + public function getTicketTypeDetailsCollectionDto(): array + { + return $this->ticketTypeDetailsCollectionDto; + } + + public function getTicketTypeDetails(int $id): ?TicketTypeDetailsDto + { + return $this->ticketTypeDetailsCollectionDto[$id] ?? null; + } +} diff --git a/sources/AppBundle/Event/Ticket/Dto/TicketTypeDetailsDto.php b/sources/AppBundle/Event/Ticket/Dto/TicketTypeDetailsDto.php new file mode 100644 index 000000000..474e0cccd --- /dev/null +++ b/sources/AppBundle/Event/Ticket/Dto/TicketTypeDetailsDto.php @@ -0,0 +1,15 @@ +getTicketType()->getTechnicalName() == TicketType::SPECIAL_PRICE_TECHNICAL_NAME) { diff --git a/sources/AppBundle/Event/Ticket/TicketTypeDetailsCollectionFactory.php b/sources/AppBundle/Event/Ticket/TicketTypeDetailsCollectionFactory.php new file mode 100644 index 000000000..031ae5b03 --- /dev/null +++ b/sources/AppBundle/Event/Ticket/TicketTypeDetailsCollectionFactory.php @@ -0,0 +1,64 @@ +ticketEventTypeRepository->getTicketsByEvent($event, false); + $ticketTypeDetailsCollectionDto = $this->createFromGlobals(); + + foreach ($ticketEventTypes as $ticketEventType) { + $id = $ticketEventType->getTicketTypeId(); + + $ticketTypeDetailsCollectionDto->addTicketTypeDetails($id, + new TicketTypeDetailsDto( + $id, + $ticketEventType->getTicketType()->getPrettyName(), + $ticketEventType->getPrice(), + $this->ticketTypeAvailability->getStock($ticketEventType, $event), + ), + $ticketEventType->getTicketType()->getIsRestrictedToMembers(), + ); + } + + + return $ticketTypeDetailsCollectionDto; + } + + // Compatibilité Legacy, à supprimer et remplacer par un simple "new TicketTypeDetailsCollectionDto()"; + private function createFromGlobals(): TicketTypeDetailsCollectionDto + { + global $AFUP_Tarifs_Forum, $AFUP_Tarifs_Forum_Lib; + + $ticketTypeDetailsCollectionDto = new TicketTypeDetailsCollectionDto(); + + foreach ($AFUP_Tarifs_Forum_Lib as $id => $tarifLabel) { + $ticketTypeDetailsCollectionDto->addTicketTypeDetails( + $id, + new TicketTypeDetailsDto( + $id, + $tarifLabel, + $AFUP_Tarifs_Forum[$id] ?? 0, + null, + ), + false, + ); + } + + return $ticketTypeDetailsCollectionDto; + } +} diff --git a/sources/AppBundle/Listener/ConvertLegacyFlashMessageKernelListener.php b/sources/AppBundle/Listener/ConvertLegacyFlashMessageKernelListener.php new file mode 100644 index 000000000..393cfe03c --- /dev/null +++ b/sources/AppBundle/Listener/ConvertLegacyFlashMessageKernelListener.php @@ -0,0 +1,39 @@ +requestStack->getSession(); + } catch (SessionNotFoundException) { + return; + } + + if (!$session instanceof FlashBagAwareSessionInterface) { + return; + } + + if (isset($_SESSION['flash']['message'])) { + $session->getFlashBag()->add('notice', $_SESSION['flash']['message']); + } + if (isset($_SESSION['flash']['erreur'])) { + $session->getFlashBag()->add('error', $_SESSION['flash']['erreur']); + } + unset($_SESSION['flash']); + } +} diff --git a/sources/AppBundle/Slack/MessageFactory.php b/sources/AppBundle/Slack/MessageFactory.php index 1133dacde..1a453e36a 100644 --- a/sources/AppBundle/Slack/MessageFactory.php +++ b/sources/AppBundle/Slack/MessageFactory.php @@ -203,7 +203,7 @@ public function createMessageForTicketStats(Event $event, EventStatsRepository $ $attachment = new Attachment(); $attachment ->setTitle('Total des inscriptions') - ->setTitleLink('https://afup.org/pages/administration/index.php?page=forum_inscriptions') + ->setTitleLink('https://afup.org/admin/event/inscription') ; diff --git a/templates/event/inscription/list.html.twig b/templates/event/inscription/list.html.twig new file mode 100644 index 000000000..26cdfd15c --- /dev/null +++ b/templates/event/inscription/list.html.twig @@ -0,0 +1,281 @@ +{% extends 'admin/base_with_header.html.twig' %} + +{% block content %} +

Inscriptions {{ event.title~' '~event.dateStart|date('Y') }}

+ + {% include 'admin/event/change_event.html.twig' with {form: event_select_form} only %} + + + +
+ + + + + + + + + + + + + + {% set inscritsTotal = 0 %} + {% set confirmesTotal = 0 %} + {% set payantsTotal = 0 %} + {% set montantTotal = 0 %} + + {% for ticketTypeId, ticketTypeDetails in ticketTypesDetailsCollection.ticketTypeDetailsCollectionDto %} + {% set inscrits = statistiques.types_inscriptions.inscrits[ticketTypeId]|default(0) %} + {% set confirmes = statistiques.types_inscriptions.confirmes[ticketTypeId]|default(0) %} + {% set payants = statistiques.types_inscriptions.payants[ticketTypeId]|default(0) %} + {% set montant = (statistiques.types_inscriptions.payants[ticketTypeId]|default(0)) * ticketTypeDetails.price %} + {% set inscritsTotal = inscritsTotal + inscrits %} + {% set confirmesTotal = confirmesTotal + confirmes %} + {% set payantsTotal = payantsTotal + payants %} + {% set montantTotal = montantTotal + montant %} + + {% if inscrits != 0 %} + + + + + + + + + + + {% endif %} + {% endfor %} + + + + + + + + + + + + +
TypeTarifNb inscritsNb ConfirmeNb payantsMontantPlaces restantes
+ {{ ticketTypeDetails.name }} + {{ ticketTypeDetails.price }} €{{ inscrits }}{{ confirmes }}{{ payants }}{{ montant }}{{ ticketTypeDetails.remainingTickets|default('') }}
{{ inscritsTotal }}{{ confirmesTotal }}{{ payantsTotal }}{{ montantTotal }}
+ + + + + + + + + + + + + + + + + + + + + + + + +
InscritsConfirmésEn attente de règlement
Jour 1{{ statistiques.premier_jour.inscrits }}{{ statistiques.premier_jour.confirmes }} + {% if statistiques.premier_jour.en_attente_de_reglement == '' %} + 0 + {% else %} + {{ statistiques.premier_jour.en_attente_de_reglement }} + {% endif %} +
Jour 2{{ statistiques.second_jour.inscrits }}{{ statistiques.second_jour.confirmes }} + {% if statistiques.second_jour.en_attente_de_reglement == '' %} + 0 + {% else %} + {{ statistiques.second_jour.en_attente_de_reglement }} + {% endif %} +
+
+ +
+
+
+
+
+ + + +
+
+ +
+
+
+
+ + {% if inscriptions|length > 0 %} + + + + + + + + + + + + + + + {% for key, inscription in inscriptions %} + + + + + + + + {% if inscription.type_inscription in ticketTypesDetailsCollection.ticketTypeForMemberOnly %} + {% if inscription.lastsubscription == null %} + + {% elseif inscription.lastsubscription < now %} + + {% elseif inscription.lastsubscription < event.dateEnd %} + + {% else %} + + {% endif %} + {% else %} + + {% endif %} + + + {% endfor %} + +
DateNom PrénomSociété (facturation)TypeEtatRèg.Statut cotisation 
{% if inscription.date > 0 %}{{ inscription.date|date("d/m/Y H:m:s") }}{% endif %} + {{ inscription.prenom }} {{ inscription.nom }} + + + + + {{ inscription.societe }} + {% if inscription.societe %} + + + + {% endif %} + {{ ticketTypesDetailsCollection.ticketTypeDetails(inscription.type_inscription).name|default() }} + {% if inscription.etat == 0 %} + Créé + {% elseif inscription.etat == 1 %} + Annulé + {% elseif inscription.etat == 2 %} + Erreur + {% elseif inscription.etat == 3 %} + Refusé + {% elseif inscription.etat == 4 %} + Reglé + {% elseif inscription.etat == 5 %} + Invité + {% elseif inscription.etat == 6 %} + Attente règlement + {% elseif inscription.etat == 7 %} + Facturé + {% endif %} + {% if inscription.type_reglement == 0 %}CB{% elseif inscription.type_reglement == 1 %}CHQ{% elseif inscription.type_reglement == 2 %}VIR{% endif %} + + Non trouvée + + + + A expiré le {{ inscription.lastsubscription|date('d/m/Y') }} + + + URL Paiement + + + + Expire le {{ inscription.lastsubscription|date('d/m/Y') }} + + + URL Paiement + + + OK + + n/a + + + + + + + + +
+ {% else %} +
+
+ + Aucune inscription +
+
+ {% endif %} +
+{% endblock %}