diff --git a/app/config/packages/backoffice_menu.yaml b/app/config/packages/backoffice_menu.yaml index 86a668798..169a34b8f 100644 --- a/app/config/packages/backoffice_menu.yaml +++ b/app/config/packages/backoffice_menu.yaml @@ -131,6 +131,8 @@ parameters: url: '/admin/event/tickets' extra_routes: - admin_event_ticket_list + - admin_event_ticket_add + - admin_event_ticket_edit 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 ef268bfb0..6c9d756b3 100644 --- a/app/config/routing/admin_event.yml +++ b/app/config/routing/admin_event.yml @@ -137,6 +137,5 @@ admin_event_sessions_delete: requirements: id: \d+ -admin_event_ticket_list: - path: /tickets - defaults: { _controller: AppBundle\Controller\Admin\Event\Ticket\IndexAction } \ No newline at end of file +admin_event_ticket: + resource: "admin_event_ticket.yml" diff --git a/app/config/routing/admin_event_ticket.yml b/app/config/routing/admin_event_ticket.yml new file mode 100644 index 000000000..77a98ecea --- /dev/null +++ b/app/config/routing/admin_event_ticket.yml @@ -0,0 +1,19 @@ +admin_event_ticket_list: + path: /tickets + defaults: { _controller: AppBundle\Controller\Admin\Event\Ticket\IndexAction } + +admin_event_ticket_edit: + path: /tickets/{id} + requirements: + id: \d+ + defaults: { _controller: AppBundle\Controller\Admin\Event\Ticket\EditAction } + +admin_event_ticket_add: + path: /tickets/add + defaults: { _controller: AppBundle\Controller\Admin\Event\Ticket\AddAction } + +admin_event_ticket_delete: + path: /tickets/delete/{id} + requirements: + id: \d+ + defaults: { _controller: AppBundle\Controller\Admin\Event\Ticket\DeleteAction } \ No newline at end of file diff --git a/compose.yml b/compose.yml index 32903be5e..d9fbecdc2 100644 --- a/compose.yml +++ b/compose.yml @@ -7,6 +7,8 @@ services: MYSQL_USER: afup MYSQL_PASSWORD: afup MYSQL_DATABASE: web + ports: + - "3606:3306" volumes: - ./data/mysql:/var/lib/mysql diff --git a/db/seeds/Inscriptions.php b/db/seeds/Inscriptions.php index e97075f92..982741725 100644 --- a/db/seeds/Inscriptions.php +++ b/db/seeds/Inscriptions.php @@ -15,8 +15,8 @@ public function run(): void [ 'date' => time(), 'reference' => 'REF-TEST-001', - 'type_inscription' => Ticket::TYPE_2_DAYS, - 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS], + 'type_inscription' => Tarif::TYPE_2_DAYS['id'], + 'montant' => Tarif::TYPE_2_DAYS['default_price'], 'civilite' => 'Mme', 'nom' => 'Michu', 'prenom' => 'Bernadette', @@ -32,8 +32,8 @@ public function run(): void [ 'date' => (new \DateTime("2023-06-25"))->getTimestamp(), 'reference' => 'REF-TEST-002', - 'type_inscription' => Ticket::TYPE_2_DAYS, - 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS], + 'type_inscription' => Tarif::TYPE_2_DAYS['id'], + 'montant' => Tarif::TYPE_2_DAYS['default_price'], 'civilite' => 'Mme', 'nom' => 'Jean', 'prenom' => 'Maurice', @@ -49,8 +49,8 @@ public function run(): void [ 'date' => (new \DateTime("2024-01-02"))->getTimestamp(), 'reference' => 'REF-TEST-003', - 'type_inscription' => Ticket::TYPE_2_DAYS, - 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS], + 'type_inscription' => Tarif::TYPE_2_DAYS['id'], + 'montant' => Tarif::TYPE_2_DAYS['default_price'], 'civilite' => 'Mme', 'nom' => 'Kirk', 'prenom' => 'James Tiberius', @@ -66,8 +66,8 @@ public function run(): void [ 'date' => (new \DateTime("2024-01-02"))->getTimestamp(), 'reference' => 'REF-TEST-004', - 'type_inscription' => Ticket::TYPE_2_DAYS_AFUP, - 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS_AFUP], + 'type_inscription' => Tarif::TYPE_2_DAYS_AFUP['id'], + 'montant' => Tarif::TYPE_2_DAYS_AFUP['default_price'], 'civilite' => 'Mme', 'nom' => 'Sans', 'prenom' => 'Cotisation', @@ -83,8 +83,8 @@ public function run(): void [ 'date' => time(), 'reference' => 'REF-TEST-005', - 'type_inscription' => Ticket::TYPE_2_DAYS_AFUP, - 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS_AFUP], + 'type_inscription' => Tarif::TYPE_2_DAYS_AFUP['id'], + 'montant' => Tarif::TYPE_2_DAYS_AFUP['default_price'], 'civilite' => 'M', 'nom' => 'Personne', 'prenom' => 'Paul', @@ -101,8 +101,8 @@ public function run(): void [ 'date' => time(), 'reference' => 'REF-TEST-006', - 'type_inscription' => Ticket::TYPE_2_DAYS_AFUP, - 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS_AFUP], + 'type_inscription' => Tarif::TYPE_2_DAYS_AFUP['id'], + 'montant' => Tarif::TYPE_2_DAYS_AFUP['default_price'], 'civilite' => 'M', 'nom' => 'Maurice', 'prenom' => 'Jean', @@ -119,8 +119,8 @@ public function run(): void [ 'date' => time(), 'reference' => 'REF-TEST-007', - 'type_inscription' => Ticket::TYPE_2_DAYS, - 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS], + 'type_inscription' => Tarif::TYPE_2_DAYS['id'], + 'montant' => Tarif::TYPE_2_DAYS['default_price'], 'civilite' => 'Mme', 'nom' => 'Annulé', 'prenom' => 'Lepaiement', @@ -136,8 +136,8 @@ public function run(): void [ 'date' => time(), 'reference' => 'REF-TEST-008', - 'type_inscription' => Ticket::TYPE_ORGANIZATION, - 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_ORGANIZATION], + 'type_inscription' => Tarif::TYPE_ORGANIZATION['id'], + 'montant' => Tarif::TYPE_ORGANIZATION['default_price'], 'civilite' => 'Mme', 'nom' => 'Super', 'prenom' => 'Bénévole', @@ -164,7 +164,7 @@ public function run(): void $data = [ [ 'reference' => 'REF-TEST-001', - 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS], + 'montant' => Tarif::TYPE_2_DAYS['default_price'], 'date_reglement' => time(), 'type_reglement' => Ticket::PAYMENT_CREDIT_CARD, 'email' => 'bernadette@yahoo.fr', @@ -184,7 +184,7 @@ public function run(): void ], [ 'reference' => 'REF-TEST-002', - 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS], + 'montant' => Tarif::TYPE_2_DAYS['default_price'], 'date_reglement' => (new \DateTime("2023-06-25"))->getTimestamp(), 'type_reglement' => Ticket::PAYMENT_CHEQUE, 'email' => 'jean@yahoo.fr', @@ -203,7 +203,7 @@ public function run(): void ], [ 'reference' => 'REF-TEST-003', - 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS], + 'montant' => Tarif::TYPE_2_DAYS['default_price'], 'date_reglement' => (new \DateTime("2024-01-02"))->getTimestamp(), 'type_reglement' => Ticket::PAYMENT_BANKWIRE, 'email' => 'james@starfleet.fr', @@ -222,7 +222,7 @@ public function run(): void ], [ 'reference' => 'REF-TEST-004', - 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS_AFUP], + 'montant' => Tarif::TYPE_2_DAYS_AFUP['default_price'], 'date_reglement' => (new \DateTime("2024-01-02"))->getTimestamp(), 'type_reglement' => Ticket::PAYMENT_CREDIT_CARD, 'email' => 'sans@cotisation.fr', @@ -241,7 +241,7 @@ public function run(): void ], [ 'reference' => 'REF-TEST-005', - 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS_AFUP], + 'montant' => Tarif::TYPE_2_DAYS_AFUP['default_price'], 'date_reglement' => (new \DateTime("2024-01-02"))->getTimestamp(), 'type_reglement' => Ticket::PAYMENT_CREDIT_CARD, 'nom' => 'Personne', @@ -260,7 +260,7 @@ public function run(): void ], [ 'reference' => 'REF-TEST-006', - 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS_AFUP], + 'montant' => Tarif::TYPE_2_DAYS_AFUP['default_price'], 'date_reglement' => (new \DateTime("2024-01-02"))->getTimestamp(), 'type_reglement' => Ticket::PAYMENT_CREDIT_CARD, 'nom' => 'Maurice', @@ -279,7 +279,7 @@ public function run(): void ], [ 'reference' => 'REF-TEST-007', - 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS], + 'montant' => Tarif::TYPE_2_DAYS['default_price'], 'date_reglement' => time(), 'type_reglement' => Ticket::PAYMENT_CREDIT_CARD, 'nom' => 'Annulé', @@ -298,7 +298,7 @@ public function run(): void ], [ 'reference' => 'REF-TEST-008', - 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_ORGANIZATION], + 'montant' => Tarif::TYPE_ORGANIZATION['default_price'], 'date_reglement' => time(), 'type_reglement' => Ticket::PAYMENT_NONE, 'societe' => 'AFUP', diff --git a/db/seeds/Tarif.php b/db/seeds/Tarif.php index ba4cf1047..78f88e33e 100644 --- a/db/seeds/Tarif.php +++ b/db/seeds/Tarif.php @@ -6,94 +6,595 @@ class Tarif extends AbstractSeed { + public const TYPE_2_DAYS = [ + 'id' => 2, + 'technical_name' => 'AFUP_FORUM_2_JOURNEES', + 'pretty_name' => '2 Jours', + 'public' => true, + 'members_only' => false, + 'default_price' => 250.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ]; + public const TYPE_2_DAYS_AFUP = [ + 'id' => 3, + 'technical_name' => 'AFUP_FORUM_2_JOURNEES_AFUP', + 'pretty_name' => '2 Jours AFUP', + 'public' => true, + 'members_only' => true, + 'default_price' => 150.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ]; + public const TYPE_ORGANIZATION = + [ + 'id' => 9, + 'technical_name' => 'AFUP_FORUM_ORGANISATION', + 'pretty_name' => 'Organisation', + 'public' => false, + 'members_only' => false, + 'default_price' => 0.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ]; + public function run(): void { $data = [ + [ + 'id' => 0, + 'technical_name' => 'AFUP_FORUM_PREMIERE_JOURNEE', + 'pretty_name' => 'Première journée', + 'public' => true, + 'members_only' => false, + 'default_price' => 150.0, + 'active' => true, + 'day' => 'one', + 'cfp_submitter_only' => false, + ], [ 'id' => 1, 'technical_name' => 'AFUP_FORUM_DEUXIEME_JOURNEE', 'pretty_name' => 'Deuxième journée', 'public' => true, - 'members_only' => 0, - 'default_price' => 150, + 'members_only' => false, + 'default_price' => 150.0, 'active' => true, 'day' => 'two', - 'cfp_submitter_only' => 0, + 'cfp_submitter_only' => false, + ], + self::TYPE_2_DAYS, + self::TYPE_2_DAYS_AFUP, + [ + 'id' => 4, + 'technical_name' => 'AFUP_FORUM_2_JOURNEES_ETUDIANT', + 'pretty_name' => '2 Jours étudiant', + 'public' => false, + 'members_only' => false, + 'default_price' => 150.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 5, + 'technical_name' => 'AFUP_FORUM_2_JOURNEES_PREVENTE', + 'pretty_name' => '2 Jours prévente', + 'public' => false, + 'members_only' => false, + 'default_price' => 150.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 6, + 'technical_name' => 'AFUP_FORUM_2_JOURNEES_AFUP_PREVENTE', + 'pretty_name' => '2 Jours prévente AFUP', + 'public' => false, + 'members_only' => true, + 'default_price' => 150.0, + 'active' => false, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 7, + 'technical_name' => 'AFUP_FORUM_2_JOURNEES_ETUDIANT_PREVENTE', + 'pretty_name' => '2 Jours étudiant prévente', + 'public' => false, + 'members_only' => false, + 'default_price' => 150.0, + 'active' => false, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 8, + 'technical_name' => 'AFUP_FORUM_2_JOURNEES_COUPON', + 'pretty_name' => '2 jours coupon', + 'public' => false, + 'members_only' => false, + 'default_price' => 200.0, + 'active' => false, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + self::TYPE_ORGANIZATION, + [ + 'id' => 10, + 'technical_name' => 'AFUP_FORUM_SPONSOR', + 'pretty_name' => 'Sponsor', + 'public' => false, + 'members_only' => false, + 'default_price' => 0.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 11, + 'technical_name' => 'AFUP_FORUM_PRESSE', + 'pretty_name' => 'Presse', + 'public' => false, + 'members_only' => false, + 'default_price' => 0.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 12, + 'technical_name' => 'AFUP_FORUM_CONFERENCIER', + 'pretty_name' => 'Conférencier', + 'public' => false, + 'members_only' => false, + 'default_price' => 0.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 13, + 'technical_name' => 'AFUP_FORUM_INVITATION', + 'pretty_name' => 'Invitation', + 'public' => false, + 'members_only' => false, + 'default_price' => 0.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, ], [ - 'id' => 2, - 'technical_name' => 'AFUP_FORUM_2_JOURNEES', - 'pretty_name' => '2 Jours', + 'id' => 14, + 'technical_name' => 'AFUP_FORUM_PROJET', + 'pretty_name' => 'Projet PHP', + 'public' => false, + 'members_only' => false, + 'default_price' => 0.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 15, + 'technical_name' => 'AFUP_FORUM_2_JOURNEES_SPONSOR', + 'pretty_name' => '2 Jours par sponsor', + 'public' => false, + 'members_only' => false, + 'default_price' => 200.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 16, + 'technical_name' => 'AFUP_FORUM_PROF', + 'pretty_name' => 'Enseignement supérieur', + 'public' => false, + 'members_only' => false, + 'default_price' => 0.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 17, + 'technical_name' => 'AFUP_FORUM_PREMIERE_JOURNEE_ETUDIANT_PREVENTE', + 'pretty_name' => '', + 'public' => false, + 'members_only' => false, + 'default_price' => 100.0, + 'active' => false, + 'day' => 'one', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 18, + 'technical_name' => 'AFUP_FORUM_DEUXIEME_JOURNEE_ETUDIANT_PREVENTE', + 'pretty_name' => '', + 'public' => false, + 'members_only' => false, + 'default_price' => 100.0, + 'active' => false, + 'day' => 'two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 19, + 'technical_name' => 'AFUP_FORUM_2_JOURNEES_PREVENTE_ADHESION', + 'pretty_name' => '', + 'public' => false, + 'members_only' => false, + 'default_price' => 150.0, + 'active' => false, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 20, + 'technical_name' => 'AFUP_FORUM_PREMIERE_JOURNEE_AFUP', + 'pretty_name' => 'Jour 1 AFUP', + 'public' => false, + 'members_only' => true, + 'default_price' => 100.0, + 'active' => false, + 'day' => 'one', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 21, + 'technical_name' => 'AFUP_FORUM_DEUXIEME_JOURNEE_AFUP', + 'pretty_name' => 'Jour 2 AFUP', + 'public' => false, + 'members_only' => true, + 'default_price' => 100.0, + 'active' => false, + 'day' => 'two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 22, + 'technical_name' => 'AFUP_FORUM_PREMIERE_JOURNEE_ETUDIANT', + 'pretty_name' => 'Jour 1 Etudiant', + 'public' => false, + 'members_only' => false, + 'default_price' => 100.0, + 'active' => false, + 'day' => 'one', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 23, + 'technical_name' => 'AFUP_FORUM_DEUXIEME_JOURNEE_ETUDIANT', + 'pretty_name' => 'Jour 2 Etudiant', + 'public' => false, + 'members_only' => false, + 'default_price' => 100.0, + 'active' => false, + 'day' => 'two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 100, + 'technical_name' => 'EARLY_BIRD', + 'pretty_name' => 'Les yeux fermés - 2 jours', 'public' => true, - 'members_only' => 0, - 'default_price' => 250, + 'members_only' => false, + 'default_price' => 250.0, 'active' => true, 'day' => 'one,two', - 'cfp_submitter_only' => 0, + 'cfp_submitter_only' => false, ], [ - 'id' => 3, - 'technical_name' => 'AFUP_FORUM_2_JOURNEES_AFUP', - 'pretty_name' => '2 Jours AFUP', + 'id' => 101, + 'technical_name' => 'EARLY_BIRD_AFUP', + 'pretty_name' => 'Les yeux fermés - 2 jours - AFUP', 'public' => true, - 'members_only' => 1, - 'default_price' => 150, + 'members_only' => true, + 'default_price' => 150.0, 'active' => true, 'day' => 'one,two', - 'cfp_submitter_only' => 0, + 'cfp_submitter_only' => false, ], [ - 'id' => 4, - 'technical_name' => 'AFUP_TEST', - 'pretty_name' => 'Pour les tests', + 'id' => 102, + 'technical_name' => 'LATE_BIRD', + 'pretty_name' => 'Tarif de soutien - 2 jours', 'public' => true, - 'members_only' => 1, - 'default_price' => 100, + 'members_only' => false, + 'default_price' => 325.0, 'active' => true, 'day' => 'one,two', - 'cfp_submitter_only' => 0, + 'cfp_submitter_only' => false, ], [ - 'id' => 5, - 'technical_name' => 'AFUP_CFP', - 'pretty_name' => 'Spécial CFP', + 'id' => 103, + 'technical_name' => 'LATE_BIRD_AFUP', + 'pretty_name' => 'Tarif de soutien - 2 jours - AFUP', 'public' => true, - 'members_only' => 0, - 'default_price' => 2, + 'members_only' => true, + 'default_price' => 225.0, 'active' => true, 'day' => 'one,two', - 'cfp_submitter_only' => 1, + 'cfp_submitter_only' => false, ], [ - 'id' => 9, - 'technical_name' => 'AFUP_FORUM_ORGANISATION', - 'pretty_name' => 'Organisation', + 'id' => 105, + 'technical_name' => 'LATE_BIRD_PREMIERE_JOURNEE', + 'pretty_name' => 'Late bird - Première journée', + 'public' => true, + 'members_only' => false, + 'default_price' => 225.0, + 'active' => true, + 'day' => 'one', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 106, + 'technical_name' => 'LATE_BIRD_DEUXIEME_JOURNEE', + 'pretty_name' => 'Late bird - Deuxième journée', + 'public' => true, + 'members_only' => false, + 'default_price' => 225.0, + 'active' => true, + 'day' => 'two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 107, + 'technical_name' => 'CFP_SUBMITTER', + 'pretty_name' => 'Personne ayant proposé une conférence - 2 jours', + 'public' => true, + 'members_only' => false, + 'default_price' => 150.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => true, + ], + [ + 'id' => 108, + 'technical_name' => 'SPECIAL_PRICE', + 'pretty_name' => 'Tarif spécial', 'public' => false, 'members_only' => false, - 'default_price' => 0, + 'default_price' => 0.0, 'active' => true, 'day' => 'one,two', 'cfp_submitter_only' => false, ], [ - 'id' => 108, - 'technical_name' => 'AFUP_FORUM_SPECIAL_PRICE', - 'pretty_name' => 'Spécial Forum', + 'id' => 109, + 'technical_name' => 'AFUP_DAY_EARLY', + 'pretty_name' => 'Les Yeux Fermés', + 'public' => true, + 'members_only' => false, + 'default_price' => 50.0, + 'active' => true, + 'day' => 'one', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 110, + 'technical_name' => 'AFUP_DAY_CROISIERE', + 'pretty_name' => 'Tarif de croisière', + 'public' => true, + 'members_only' => false, + 'default_price' => 70.0, + 'active' => true, + 'day' => 'one', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 111, + 'technical_name' => 'AFUP_DAY_LATE', + 'pretty_name' => 'Tarif de soutien', + 'public' => true, + 'members_only' => false, + 'default_price' => 90.0, + 'active' => true, + 'day' => 'one', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 112, + 'technical_name' => 'AFUP_DAY_CFP_SUBMITTER', + 'pretty_name' => 'Personne ayant proposé une conférence', + 'public' => true, + 'members_only' => false, + 'default_price' => 50.0, + 'active' => true, + 'day' => 'one', + 'cfp_submitter_only' => true, + ], + [ + 'id' => 113, + 'technical_name' => 'AFUP_DAY_LIVE_FREE', + 'pretty_name' => "J'aime l'AFUP, un peu !", + 'public' => true, + 'members_only' => false, + 'default_price' => 0.0, + 'active' => true, + 'day' => 'one', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 114, + 'technical_name' => 'AFUP_DAY_LIVE_SOUTIEN_1', + 'pretty_name' => "J'aime l'AFUP, beaucoup !", + 'public' => true, + 'members_only' => false, + 'default_price' => 5.0, + 'active' => true, + 'day' => 'one', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 115, + 'technical_name' => 'AFUP_DAY_LIVE_SOUTIEN_2', + 'pretty_name' => "J'aime l'AFUP, passionnément !", + 'public' => true, + 'members_only' => false, + 'default_price' => 10.0, + 'active' => true, + 'day' => 'one', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 116, + 'technical_name' => 'AFUP_DAY_LIVE_SOUTIEN_3', + 'pretty_name' => "J'aime l'AFUP, à la folie !", + 'public' => true, + 'members_only' => false, + 'default_price' => 20.0, + 'active' => true, + 'day' => 'one', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 117, + 'technical_name' => 'AFUP_DAY_LIVE_SOUTIEN_4', + 'pretty_name' => "Fan hardcore de l'AFUP", + 'public' => true, + 'members_only' => false, + 'default_price' => 50.0, + 'active' => true, + 'day' => 'one', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 118, + 'technical_name' => 'FORUM_PHP_LIVE_FREE', + 'pretty_name' => "J'aime l'AFUP, j'en suis membre !", 'public' => true, - 'members_only' => 0, - 'default_price' => 2, + 'members_only' => true, + 'default_price' => 0.0, 'active' => true, 'day' => 'one,two', - 'cfp_submitter_only' => 1, + 'cfp_submitter_only' => false, + ], + [ + 'id' => 119, + 'technical_name' => 'FORUM_PHP_LIVE_SOUTIEN_1', + 'pretty_name' => "J'aime l'AFUP, un peu !", + 'public' => true, + 'members_only' => false, + 'default_price' => 10.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 120, + 'technical_name' => 'FORUM_PHP_LIVE_SOUTIEN_2', + 'pretty_name' => "J'aime l'AFUP, beaucoup !", + 'public' => true, + 'members_only' => false, + 'default_price' => 30.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 121, + 'technical_name' => 'FORUM_PHP_LIVE_SOUTIEN_3', + 'pretty_name' => "J'aime l'AFUP, passionnément !", + 'public' => true, + 'members_only' => false, + 'default_price' => 50.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 122, + 'technical_name' => 'FORUM_PHP_LIVE_SOUTIEN_4', + 'pretty_name' => "J'aime l'AFUP, à la folie !", + 'public' => true, + 'members_only' => false, + 'default_price' => 70.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 123, + 'technical_name' => 'FORUM_PHP_LIVE_SOUTIEN_5', + 'pretty_name' => "Fan hardcore de l'AFUP", + 'public' => true, + 'members_only' => false, + 'default_price' => 100.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 124, + 'technical_name' => 'FORUM_PHP_LIVE_SOUTIEN_6', + 'pretty_name' => 'BFF de l’AFUP', + 'public' => true, + 'members_only' => false, + 'default_price' => 150.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 125, + 'technical_name' => 'AFUP_DAY_2021_LIVE_1', + 'pretty_name' => 'AFUP Day 2021 Lille / Rennes - édition en ligne, le vendredi 28 mai 2021', + 'public' => true, + 'members_only' => false, + 'default_price' => 25.0, + 'active' => true, + 'day' => 'one', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 126, + 'technical_name' => 'AFUP_DAY_2021_LIVE_2', + 'pretty_name' => 'AFUP Day 2021 Toulouse / Tours - édition en ligne, le vendredi 11 juin 2021', + 'public' => true, + 'members_only' => false, + 'default_price' => 25.0, + 'active' => true, + 'day' => 'two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 127, + 'technical_name' => 'AFUP_DAY_2021_LIVE_3', + 'pretty_name' => 'Le ticket combo AFUP Day 2021 Lille / Rennes + AFUP Day 2021 Toulouse / Tours - éditions en ligne, le 28 mai et le 11 juin 2021', + 'public' => true, + 'members_only' => false, + 'default_price' => 40.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, + ], + [ + 'id' => 128, + 'technical_name' => 'AFUP_DAY_2021_LIVE_4', + 'pretty_name' => 'Le ticket combo du coeur, AFUP Day 2021 Lille / Rennes + AFUP Day 2021 Toulouse / Tours - éditions en ligne et coup de pouce de soutien à l’AFUP', + 'public' => true, + 'members_only' => false, + 'default_price' => 70.0, + 'active' => true, + 'day' => 'one,two', + 'cfp_submitter_only' => false, ], ]; $table = $this->table('afup_forum_tarif'); $table->truncate(); + $this->query('ALTER TABLE afup_forum_tarif AUTO_INCREMENT = 10000;'); $table ->insert($data) - ->save() - ; + ->save(); + $this->query('UPDATE afup_forum_tarif SET id = 0 WHERE id = 10000;'); } } diff --git a/htdocs/pages/administration/forum_inscriptions.php b/htdocs/pages/administration/forum_inscriptions.php deleted file mode 100644 index 0d90dc83b..000000000 --- a/htdocs/pages/administration/forum_inscriptions.php +++ /dev/null @@ -1,421 +0,0 @@ -assign('action', $action); - -$eventRepository = $this->eventRepository; -$ticketEventTypeRepository = $this->ticketEventTypeRepository; -$ticketTypeAvailability = $this->ticketTypeAvailability; -$invoiceService = $this->invoiceService; -$invoiceRepository = $this->invoiceRepository; -$session = $this->requestStack->getSession(); -$urlGenerator = $this->urlGenerator; -$eventStatsRepository = $this->eventStatsRepository; -$ticketRepository = $this->ticketRepository; - -function updateGlobalsForTarif( - EventRepository $eventRepository, - TicketEventTypeRepository $ticketEventTypeRepository, - TicketTypeAvailability $ticketTypeAvailability, - $forumId, - &$membersTickets = [], -): array { - global $AFUP_Tarifs_Forum, $AFUP_Tarifs_Forum_Lib; - $event = $eventRepository->get($forumId); - $ticketTypes = $ticketEventTypeRepository->getTicketsByEvent($event, false); - $AFUP_Tarifs_Forum_Restantes = []; - - foreach ($ticketTypes as $ticketType) { - /** - * @var $ticketType \AppBundle\Event\Model\TicketEventType - */ - $AFUP_Tarifs_Forum[$ticketType->getTicketTypeId()] = $ticketType->getPrice(); - $AFUP_Tarifs_Forum_Lib[$ticketType->getTicketTypeId()] = $ticketType->getTicketType()->getPrettyName(); - $AFUP_Tarifs_Forum_Restantes[$ticketType->getTicketTypeId()] = $ticketTypeAvailability->getStock($ticketType, $event); - - if ($ticketType->getTicketType()->getIsRestrictedToMembers()) { - $membersTickets[] = $ticketType->getTicketTypeId(); - } - } - - return ['restantes' => $AFUP_Tarifs_Forum_Restantes]; -} - - - -$forum = new Forum($bdd); -$forum_inscriptions = new Inscriptions($bdd); -$forum_facturation = new Facturation($bdd, $this->pays); - -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') { - /** @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', '/admin/event/tickets?id=' . $_GET['id_forum']); - } else { - afficherMessage('Une erreur est survenue lors de la suppression de l\'inscription', '/admin/event/tickets?id=' . $_GET['id_forum'], true); - } -} else { - - $formulaire = instancierFormulaire(); - if ($action == 'ajouter') { - $formulaire->setDefaults( - [ - 'civilite' => 'M.', - 'id_pays_facturation' => 'FR', - 'type_inscription' => -1, - 'type_reglement' => -1, - 'citer_societe' => 1, - 'mail_partenaire' => 0, - 'newsletter_afup' => 0, - 'newsletter_nexen' => 0, - 'date_reglement' => (new \DateTime())->format('Y-m-d'), - ], - ); - } else { - $champs = $forum_inscriptions->obtenir($_GET['id']); - if ($champs == false) { - afficherMessage('L\'inscription n\'existe plus', '/admin/event/tickets?id=' . $_GET['id_forum']); - exit(0); - } - $champs2 = $forum_facturation->obtenir($champs['reference']); - $champs['type_reglement'] = $champs2['type_reglement']; - $champs['informations_reglement'] = $champs2['informations_reglement']; - $champs['date_reglement'] = $champs2['date_reglement']; - $champs['autorisation'] = $champs2['autorisation']; - $champs['transaction'] = $champs2['transaction']; - $champs['societe_facturation'] = $champs2['societe']; - $champs['nom_facturation'] = $champs2['nom']; - $champs['prenom_facturation'] = $champs2['prenom']; - $champs['adresse_facturation'] = $champs2['adresse']; - $champs['code_postal_facturation'] = $champs2['code_postal']; - $champs['ville_facturation'] = $champs2['ville']; - $champs['id_pays_facturation'] = $champs2['id_pays']; - $champs['email_facturation'] = $champs2['email']; - - /** @var Ticket $ticket */ - $ticket = $ticketRepository->get($_GET['id']); - if (null !== $ticket) { - $champs['commentaires'] = $ticket->getComments(); - } - - $formulaire->setDefaults($champs); - - if (isset($champs) && isset($champs['id_forum'])) { - $_GET['id_forum'] = $champs['id_forum']; - } - } - updateGlobalsForTarif($eventRepository, $ticketEventTypeRepository, $ticketTypeAvailability, $_GET['id_forum']); - - $formulaire->addElement('hidden', 'old_reference', (isset($champs) ? $champs['reference'] : '')); - $formulaire->addElement('hidden', 'id_forum', $_GET['id_forum']); - - $formulaire->addElement('header', null, 'Informations'); - $groupe = []; - foreach ($AFUP_Tarifs_Forum as $tarif_key => $tarifs) { - $groupe[] = $formulaire->createElement('radio', 'type_inscription', null, $AFUP_Tarifs_Forum_Lib[$tarif_key] . ' (' . $AFUP_Tarifs_Forum[$tarif_key] . ' €)' , $tarif_key); - } - - - $formulaire->addGroup($groupe, 'groupe_type_inscription', 'Formule', '
', false); - - $formulaire->addElement('select', 'civilite' , 'Civilité' , ['M.' => 'M.', 'Mme' => 'Mme']); - $formulaire->addElement('text' , 'nom' , 'Nom' , ['size' => 30, 'maxlength' => 40]); - $formulaire->addElement('text' , 'prenom' , 'Prénom' , ['size' => 30, 'maxlength' => 40]); - $formulaire->addElement('text' , 'email' , 'Email' , ['size' => 30, 'maxlength' => 100]); - $formulaire->addElement('text' , 'telephone' , 'Tél.' , ['size' => 20, 'maxlength' => 20]); - - $groupe = []; - - $formulaire->addElement('header', null , 'Réservé à l\'administration'); - $formulaire->addElement('static' , 'note' , '' , 'La reference est utilisée comme numéro de facture. Elle peut être commune à plusieurs inscriptions...

'); - - if ($action != 'ajouter') { - $formulaire->addElement('static', 'html', '', 'Rechercher la facture'); - } - - - $formulaire->addElement('text' , 'reference' , 'Référence' , ['size' => 50, 'maxlength' => 100]); - $formulaire->addElement('text' , 'autorisation', 'Autorisation', ['size' => 50, 'maxlength' => 100]); - $formulaire->addElement('text' , 'transaction' , 'Transaction' , ['size' => 50, 'maxlength' => 100]); - - $state = [ - Ticket::STATUS_CREATED => 'Inscription créée', - Ticket::STATUS_CANCELLED => 'Inscription annulée', - Ticket::STATUS_ERROR => 'Paiement CB erreur', - Ticket::STATUS_DECLINED => 'Paiement CB refusé', - Ticket::STATUS_PAID => 'Inscription réglée', - Ticket::STATUS_GUEST => 'Invitation', - Ticket::STATUS_WAITING => 'Attente règlement', - Ticket::STATUS_CONFIRMED => 'Inscription confirmée', - Ticket::STATUS_PAID_AFTER => 'Inscription à posteriori', - ]; - $formulaire->addElement('select', 'etat' , 'Etat' , $state); - - $facturation = [ - Ticket::INVOICE_TODO => 'Facture à envoyer', - Ticket::INVOICE_SENT => 'Facture envoyée', - Ticket::INVOICE_RECEIVED => 'Facture reçue', - ]; - $formulaire->addElement('select', 'facturation' , 'Facturation' , $facturation); - - $formulaire->addElement('header' , '' , 'Règlement'); - $groupe = []; - $groupe[] = $formulaire->createElement('radio', 'type_reglement', null, 'Carte bancaire', Ticket::PAYMENT_CREDIT_CARD); - $groupe[] = $formulaire->createElement('radio', 'type_reglement', null, 'Chèque' , Ticket::PAYMENT_CHEQUE); - $groupe[] = $formulaire->createElement('radio', 'type_reglement', null, 'Virement' , Ticket::PAYMENT_BANKWIRE); - $groupe[] = $formulaire->createElement('radio', 'type_reglement', null, 'Aucun' , Ticket::PAYMENT_NONE); - $formulaire->addGroup($groupe, 'groupe_type_reglement', 'Règlement', ' ', false); - $formulaire->addElement('textarea' , 'informations_reglement', 'Informations règlement', ['cols' => 42, 'rows' => 4]); - - - $current = $forum->obtenir($_GET['id_forum']); - $formulaire->addElement('date' , 'date_reglement' , 'Date', ['language' => 'fr', 'minYear' => $current['forum_annee'] - 2, 'maxYear' => $current['forum_annee'] + 2]); - - - $formulaire->addElement('header' , '' , 'Facturation'); - $formulaire->addElement('static' , 'note' , '' , 'Ces informations concernent la personne ou la société qui sera facturée

'); - $formulaire->addElement('text' , 'societe_facturation' , 'Société' , ['size' => 50, 'maxlength' => 100]); - $formulaire->addElement('text' , 'nom_facturation' , 'Nom' , ['size' => 30, 'maxlength' => 40]); - $formulaire->addElement('text' , 'prenom_facturation' , 'Prénom' , ['size' => 30, 'maxlength' => 40]); - $formulaire->addElement('textarea', 'adresse_facturation' , 'Adresse' , ['cols' => 42, 'rows' => 10]); - $formulaire->addElement('text' , 'code_postal_facturation', 'Code postal' , ['size' => 6, 'maxlength' => 10]); - $formulaire->addElement('text' , 'ville_facturation' , 'Ville' , ['size' => 30, 'maxlength' => 50]); - $formulaire->addElement('select' , 'id_pays_facturation' , 'Pays' , $this->pays->obtenirPays()); - $formulaire->addElement('text' , 'email_facturation' , 'Email (facture)', ['size' => 30, 'maxlength' => 100]); - $formulaire->addElement('text' , 'coupon' , 'Coupon' , ['size' => 30, 'maxlength' => 200]); - - $formulaire->addElement('header', null, 'Divers'); - $formulaire->addElement('textarea', 'commentaires' , 'Commentaires', ['cols' => 42, 'rows' => 5]); - $formulaire->addElement('static', 'label', null, "J'accepte que ma compagnie soit citée comme participant à la conférence"); - $groupe = []; - $groupe[] = $formulaire->createElement('radio', 'citer_societe', null, 'oui', 1); - $groupe[] = $formulaire->createElement('radio', 'citer_societe', null, 'non', 0); - $formulaire->addGroup($groupe, 'groupe_citer_societe', null, ' ', false); - $formulaire->addElement('static', 'label', null, "Je souhaite être tenu au courant des rencontres de l'AFUP sur des sujets afférents à PHP"); - $groupe = []; - $groupe[] = $formulaire->createElement('radio', 'newsletter_afup', null, 'oui', 1); - $groupe[] = $formulaire->createElement('radio', 'newsletter_afup', null, 'non', 0); - $formulaire->addGroup($groupe, 'groupe_newsletter_afup', null, ' ', false); - $formulaire->addElement('static', 'label', null, "Je souhaite être tenu au courant de l'actualité PHP via la newsletter de notre sponsor"); - $groupe = []; - $groupe[] = $formulaire->createElement('radio', 'newsletter_nexen', null, 'oui', 1); - $groupe[] = $formulaire->createElement('radio', 'newsletter_nexen', null, 'non', 0); - $formulaire->addGroup($groupe, 'groupe_newsletter_nexen', null, ' ', false); - $formulaire->addElement('static', 'label', null, "Je souhaite recevoir des informations de la part de vos partenaires presse/media"); - $groupe = []; - $groupe[] = $formulaire->createElement('radio', 'mail_partenaire', null, 'oui', 1); - $groupe[] = $formulaire->createElement('radio', 'mail_partenaire', null, 'non', 0); - $formulaire->addGroup($groupe, 'groupe_mail_partenaire', null, ' ', false); - - $formulaire->addElement('header', null, 'Transport'); - $formulaire->addElement('select', 'transport_mode', 'Quel est votre mode de transport ?', Ticket::TRANSPORT_MODES); - $formulaire->addElement('select', 'transport_distance', 'Quelle sera la distance parcourue ?', Ticket::TRANSPORT_DISTANCES); - - $formulaire->addElement('header', 'boutons' , ''); - $formulaire->addElement('submit', 'soumettre', 'Soumettre'); - - // On ajoute les règles - $formulaire->addGroupRule('groupe_type_inscription', 'Formule non sélectionnée' , 'required', null, 1); - $formulaire->addGroupRule('groupe_type_reglement' , 'Règlement non sélectionné', 'required', null, 1); - $formulaire->addRule('civilite' , 'Civilité non sélectionnée', 'required'); - $formulaire->addRule('nom' , 'Nom manquant' , 'required'); - $formulaire->addRule('prenom' , 'Prénom manquant' , 'required'); - $formulaire->addRule('email' , 'Email manquant' , 'required'); - $formulaire->addRule('email' , 'Email invalide' , 'email'); - - if ($formulaire->validate()) { - $valeurs = $formulaire->exportValues(); - - // Date de réglement au 01/01 => non defini - if ($valeurs['date_reglement']['d'] == 1 && $valeurs['date_reglement']['M'] == 1) { - $valeurs['date_reglement'] = null; - } else { - $valeurs['date_reglement'] = mktime(0,0,0, (int) $valeurs['date_reglement']['M'], (int) $valeurs['date_reglement']['d'], (int) $valeurs['date_reglement']['Y']); - } - - if ($action == 'ajouter') { - // On génére la référence si nécessaire - if (empty($valeurs['reference'])) { - $label = (empty($valeurs['societe_facturation']) ? (empty($valeurs['nom_facturation']) ? $valeurs['nom'] : $valeurs['nom_facturation']) : $valeurs['societe_facturation']); - $valeurs['reference'] = $forum_facturation->creerReference($valeurs['id_forum'], $label); - } - - // On ajoute l'inscription dans la base de données - $ticket = new Ticket(); - $ticket->setDate(new DateTime()); - $ticket->setAmount($GLOBALS['AFUP_Tarifs_Forum'][$valeurs['type_inscription']]); - $ticket->setForumId($valeurs['id_forum']); - $ticket->setReference($valeurs['reference']); - $ticket->setTicketTypeId($valeurs['type_inscription']); - $ticket->setCivility($valeurs['civilite']); - $ticket->setLastname($valeurs['nom']); - $ticket->setFirstname($valeurs['prenom']); - $ticket->setEmail($valeurs['email']); - $ticket->setPhoneNumber($valeurs['telephone']); - $ticket->setVoucher($valeurs['coupon']); - $ticket->setCompanyCitation($valeurs['citer_societe']); - $ticket->setNewsletter($valeurs['newsletter_afup']); - $ticket->setOptin((bool) $valeurs['mail_partenaire']); - $ticket->setComments($valeurs['commentaires']); - $ticket->setStatus($valeurs['etat']); - $ticket->setInvoiceStatus($valeurs['facturation']); - $ticket->setTransportMode($valeurs['transport_mode']); - $ticket->setTransportDistance($valeurs['transport_distance']); - try { - $ticketRepository->save($ticket); - $ok = true; - } catch (Exception) { - $ok = false; - } - } else { - $ok = $forum_inscriptions->modifierInscription($_GET['id'], - $valeurs['reference'], - $valeurs['type_inscription'], - $valeurs['civilite'], - $valeurs['nom'], - $valeurs['prenom'], - $valeurs['email'], - $valeurs['telephone'], - $valeurs['coupon'], - $valeurs['citer_societe'], - $valeurs['newsletter_afup'], - $valeurs['newsletter_nexen'], - $valeurs['mail_partenaire'], - $valeurs['commentaires'], - $valeurs['etat'], - $valeurs['facturation'], - (int) $valeurs['transport_mode'], - (int) $valeurs['transport_distance']); - - /** @var Ticket $ticket */ - $ticket = $ticketRepository->get($_GET['id']); - if (null !== $ticket) { - $ticket->setComments($valeurs['commentaires']); - $ticketRepository->save($ticket); - } - } - - try { - $paymentDate = null; - if (is_numeric($valeurs['date_reglement'])) { - $paymentDate = new DateTime('@' . $valeurs['date_reglement']); - } else { - $paymentDate = null !== $valeurs['date_reglement'] ? new DateTime('@' . $valeurs['date_reglement']) : null; - } - $invoiceService->handleInvoicing($valeurs['reference'], - $valeurs['type_reglement'], - $valeurs['informations_reglement'], - $paymentDate, - $valeurs['email_facturation'], - $valeurs['societe_facturation'], - $valeurs['nom_facturation'], - $valeurs['prenom_facturation'], - $valeurs['adresse_facturation'], - $valeurs['code_postal_facturation'], - $valeurs['ville_facturation'], - $valeurs['id_pays_facturation'], - $valeurs['id_forum'], - $valeurs['old_reference'], - $valeurs['autorisation'], - $valeurs['transaction'], - $valeurs['etat']); - } catch (Exception) { - $ok = false; - } - - if ($ok) { - if ($action == 'ajouter') { - Logs::log('Ajout de l\'inscription de ' . $formulaire->exportValue('prenom') . ' ' . $formulaire->exportValue('nom')); - } 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'), '/admin/event/tickets?id=' . $_GET['id_forum']); - } else { - $smarty->assign('erreur', 'Une erreur est survenue lors de ' . (($action == 'ajouter') ? "l'ajout" : 'la modification') . ' de l\'inscription'); - } - } - - $current = $forum->obtenir($_GET['id_forum'], 'titre'); - $smarty->assign('forum_name', $current['titre']); - $smarty->assign('formulaire', genererFormulaire($formulaire)); -} diff --git a/htdocs/templates/administration/forum_inscriptions.html b/htdocs/templates/administration/forum_inscriptions.html deleted file mode 100644 index 748b90607..000000000 --- a/htdocs/templates/administration/forum_inscriptions.html +++ /dev/null @@ -1,279 +0,0 @@ -{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} -
-{else} - {if $action == 'ajouter'} -

Ajouter une inscription pour le {$forum_name}

- {else} -

Modifier une inscription pour le {$forum_name}

- {/if} - {include file="formulaire.html"} -{/if} diff --git a/sources/Afup/Bootstrap/commonStart.php b/sources/Afup/Bootstrap/commonStart.php index 39bf1bac5..280a7b611 100644 --- a/sources/Afup/Bootstrap/commonStart.php +++ b/sources/Afup/Bootstrap/commonStart.php @@ -65,66 +65,6 @@ define('AFUP_TRANSPORT_MODE_AVION_BUSINESS', 100); define('AFUP_TRANSPORT_MODE_COMMUN', 110); -$AFUP_Tarifs_Forum = [ - Ticket::TYPE_INVITATION => 0, - Ticket::TYPE_ORGANIZATION => 0, - Ticket::TYPE_SPONSOR => 0, - Ticket::TYPE_PRESS => 0, - Ticket::TYPE_SPEAKER => 0, - Ticket::TYPE_PROJECT => 0, - Ticket::TYPE_TEACHER => 0, - Ticket::TYPE_DAY_1 => 150, - Ticket::TYPE_DAY_2 => 150, - Ticket::TYPE_2_DAYS => 250, - Ticket::TYPE_2_DAYS_AFUP => 150, - Ticket::TYPE_DAY_1_AFUP => 100, - Ticket::TYPE_DAY_2_AFUP => 100, - Ticket::TYPE_2_DAYS_STUDENT => 150, - Ticket::TYPE_DAY_1_STUDENT => 100, - Ticket::TYPE_DAY_2_STUDENT => 100, - Ticket::TYPE_2_DAYS_EARLY => 150, - Ticket::TYPE_2_DAYS_AFUP_EARLY => 150, - Ticket::TYPE_EARLY_PLUS_MEMBERSHIP => 150, - Ticket::TYPE_DAY_1_STUDENT_EARLY => 100, - Ticket::TYPE_DAY_2_STUDENT_EARLY => 100, - Ticket::TYPE_2_DAYS_STUDENT_EARLY => 150, - Ticket::TYPE_2_DAYS_VOUCHER => 200, - Ticket::TYPE_2_DAYS_SPONSOR => 200, - Ticket::TYPE_SPECIAL_PRICE => 0, -]; - -$GLOBALS['AFUP_Tarifs_Forum'] = $AFUP_Tarifs_Forum; - -$AFUP_Tarifs_Forum_Lib = [ - Ticket::TYPE_INVITATION => 'Invitation', - Ticket::TYPE_ORGANIZATION => 'Organisation', - Ticket::TYPE_PROJECT => 'Projet PHP', - Ticket::TYPE_SPONSOR => 'Sponsor', - Ticket::TYPE_PRESS => 'Presse', - Ticket::TYPE_TEACHER => 'Enseignement supérieur', - Ticket::TYPE_SPEAKER => 'Conferencier', - Ticket::TYPE_DAY_1 => 'Jour 1 ', - Ticket::TYPE_DAY_2 => 'Jour 2', - Ticket::TYPE_2_DAYS => '2 Jours', - Ticket::TYPE_2_DAYS_AFUP => '2 Jours AFUP', - Ticket::TYPE_DAY_1_AFUP => 'Jour 1 AFUP', - Ticket::TYPE_DAY_2_AFUP => 'Jour 2 AFUP', - Ticket::TYPE_2_DAYS_STUDENT => '2 Jours Etudiant', - Ticket::TYPE_DAY_1_STUDENT => 'Jour 1 Etudiant', - Ticket::TYPE_DAY_2_STUDENT => 'Jour 2 Etudiant', - Ticket::TYPE_2_DAYS_EARLY => '2 Jours prévente', - Ticket::TYPE_2_DAYS_AFUP_EARLY => '2 Jours AFUP prévente', - Ticket::TYPE_EARLY_PLUS_MEMBERSHIP => '2 Jours prévente + adhésion', - Ticket::TYPE_2_DAYS_STUDENT_EARLY => '2 Jours Etudiant prévente', - Ticket::TYPE_2_DAYS_VOUCHER => '2 Jours avec coupon de réduction', - Ticket::TYPE_2_DAYS_SPONSOR => '2 Jours par Sponsor', - Ticket::TYPE_DAY_1_STUDENT_EARLY => '', - Ticket::TYPE_DAY_2_STUDENT_EARLY => '', - Ticket::TYPE_SPECIAL_PRICE => 'Tarif Spécial', -]; - -$GLOBALS['AFUP_Tarifs_Forum_Lib'] = $AFUP_Tarifs_Forum_Lib; - // Initialisation de ting $services = new Services(); diff --git a/sources/Afup/Forum/Inscriptions.php b/sources/Afup/Forum/Inscriptions.php index 9437e550e..611f6dcf9 100644 --- a/sources/Afup/Forum/Inscriptions.php +++ b/sources/Afup/Forum/Inscriptions.php @@ -10,61 +10,6 @@ class Inscriptions { public function __construct(private readonly Base_De_Donnees $_bdd) {} - /** - * Renvoit les informations concernant une inscription - *$inscrits = - * @param int $id Identifiant de la personne - * @param string $champs Champs � renvoyer - * @return array - */ - public function obtenir($id, string $champs = 'i.*') - { - $requete = 'SELECT'; - $requete .= ' ' . $champs . ' '; - $requete .= 'FROM'; - $requete .= ' afup_inscription_forum i '; - $requete .= 'LEFT JOIN'; - $requete .= ' afup_facturation_forum f ON i.reference = f.reference '; - - $requete .= 'WHERE i.id=' . intval($id); - return $this->_bdd->obtenirEnregistrement($requete); - } - - /** - * Renvoie la liste des inscriptions pour lesquels md5(concat('id', 'reference')) = $code_md5 (1er argument) - * (concaténation des champs 'id' et 'reference', passée à la fonction md5) - * - * @param $code_md5 string Md5 de la concaténation des champs "id" et "reference" - * @param string $champs Liste des champs à récupérer en BD - * @return array - */ - public function obtenirInscription($code_md5, $champs = 'i.*') - { - $requete = "SELECT $champs FROM afup_inscription_forum i "; - $requete .= "LEFT JOIN afup_facturation_forum f ON i.reference = f.reference "; - $requete .= "WHERE md5(CONCAT(i.id, i.reference)) = '$code_md5'"; - - return $this->_bdd->obtenirEnregistrement($requete); - } - - /** - * Retrieve the registrations associated to the same reference - *

Used by example to send a confirmation email to every people associated - * to the same payment.

- * @param string $reference The reference shared - * @return array The people we want ;) - */ - public function getRegistrationsByReference($reference) - { - $ref = $this->_bdd->echapper($reference); - $sql = <<_bdd->obtenirTous($sql); - } - /** * @param int $idForum * @param int $idForumPrecedent @@ -151,190 +96,4 @@ public function obtenirSuivi($idForum, $idForumPrecedent = null): array 'daysToEndOfSales' => $daysToEndOfSales, ]; } - - /** - * @return mixed[] - */ - public function obtenirListePourEmargement($id_forum = null): array - { - $requete = 'SELECT'; - $requete .= ' i.*, f.societe '; - $requete .= 'FROM'; - $requete .= ' afup_inscription_forum i '; - $requete .= 'LEFT JOIN'; - $requete .= ' afup_facturation_forum f ON i.reference = f.reference '; - $requete .= 'WHERE i.id_forum =' . $id_forum . ' '; - $requete .= 'AND i.type_inscription NOT IN (9, 10, 11, 12, 15) '; // pas orga, conférencier, sponsor, presse - $requete .= 'ORDER BY i.nom ASC'; - $liste_emargement = []; - $liste = $this->_bdd->obtenirTous($requete); - - $derniere_lettre = ""; - foreach ($liste as $inscrit) { - $premiere_lettre = strtoupper((string) $inscrit['nom'][0]); - if ($derniere_lettre !== $premiere_lettre) { - $liste_emargement[] = [ - 'nom' => $premiere_lettre, - 'etat' => -1, - ]; - $derniere_lettre = $premiere_lettre; - } - $liste_emargement[] = $inscrit; - } - - return $liste_emargement; - } - - /** - * @return mixed[] - */ - public function obtenirListePourEmargementConferencierOrga($id_forum = null): array - { - $requete = 'SELECT'; - $requete .= ' i.*, f.societe '; - $requete .= 'FROM'; - $requete .= ' afup_inscription_forum i '; - $requete .= 'LEFT JOIN'; - $requete .= ' afup_facturation_forum f ON i.reference = f.reference '; - $requete .= 'WHERE i.id_forum =' . $id_forum . ' '; - $requete .= 'AND i.type_inscription IN (9, 10, 11, 12, 15) '; // seulement orga, conférencier, sponsor, presse - $requete .= 'ORDER BY i.nom ASC'; - $liste_emargement = []; - $liste = $this->_bdd->obtenirTous($requete); - - $derniere_lettre = ""; - foreach ($liste as $inscrit) { - $premiere_lettre = strtoupper((string) $inscrit['nom'][0]); - if ($derniere_lettre !== $premiere_lettre) { - $liste_emargement[] = [ - 'nom' => $premiere_lettre, - 'etat' => -1, - ]; - $derniere_lettre = $premiere_lettre; - } - $liste_emargement[] = $inscrit; - } - - return $liste_emargement; - } - - /** - * Renvoit la liste des inscriptions au forum - * - * @param string $champs Champs � renvoyer - * @param string $ordre Tri des enregistrements - * @param bool $associatif Renvoyer un tableau associatif ? - * @return array - */ - public function obtenirListe($id_forum = null, - string $champs = 'i.*', - string $ordre = 'i.date', - $associatif = false, - $filtre = false) - { - $requete = 'SELECT - ' . $champs . ' , - - CASE WHEN i.id_member IS NOT NULL - THEN ( SELECT MAX(ac.date_fin) AS lastsubcription FROM afup_cotisations ac WHERE ac.type_personne = i.member_type AND ac.id_personne = i.id_member ) - ELSE (SELECT MAX(ac.date_fin) AS lastsubcription - FROM afup_personnes_physiques app - LEFT JOIN afup_personnes_morales apm ON apm.id = app.id_personne_morale - LEFT JOIN afup_cotisations ac ON ac.type_personne = IF(apm.id IS NULL, 0, 1) AND ac.id_personne = IFNULL(apm.id, app.id) - WHERE app.email = i.email - GROUP BY app.`id` - ) - END AS lastsubscription - FROM - afup_inscription_forum i - LEFT JOIN afup_facturation_forum f ON i.reference = f.reference - - WHERE 1=1 - AND i.id_forum =' . $id_forum . ' '; - if ($filtre) { - $requete .= sprintf('AND CONCAT(i.nom, i.prenom) LIKE %1$s OR f.societe LIKE %1$s ', $this->_bdd->echapper('%' . $filtre . '%')); - } - $requete .= 'ORDER BY ' . $ordre; - - if ($associatif) { - return $this->_bdd->obtenirAssociatif($requete); - } else { - return $this->_bdd->obtenirTous($requete); - } - } - - public function modifierInscription(string $id, $reference, $type_inscription, $civilite, $nom, $prenom, - $email, $telephone, $coupon, $citer_societe, $newsletter_afup, - $newsletter_nexen, $mail_partenaire, $commentaires, $etat, $facturation, - int $transportMode, int $transportDistance) - { - $requete = 'UPDATE '; - $requete .= ' afup_inscription_forum '; - $requete .= 'SET'; - $requete .= ' reference=' . $this->_bdd->echapper($reference) . ','; - $requete .= ' type_inscription=' . $this->_bdd->echapper($type_inscription) . ','; - $requete .= ' montant=' . $GLOBALS['AFUP_Tarifs_Forum'][$type_inscription] . ','; - $requete .= ' civilite=' . $this->_bdd->echapper($civilite) . ','; - $requete .= ' nom=' . $this->_bdd->echapper($nom) . ','; - $requete .= ' prenom=' . $this->_bdd->echapper($prenom) . ','; - $requete .= ' email=' . $this->_bdd->echapper($email) . ','; - $requete .= ' telephone=' . $this->_bdd->echapper($telephone) . ','; - $requete .= ' coupon=' . $this->_bdd->echapper($coupon) . ','; - $requete .= ' citer_societe=' . $this->_bdd->echapper($citer_societe) . ','; - $requete .= ' newsletter_afup=' . $this->_bdd->echapper($newsletter_afup) . ','; - $requete .= ' newsletter_nexen=' . $this->_bdd->echapper($newsletter_nexen) . ','; - $requete .= ' mail_partenaire=' . $this->_bdd->echapper($mail_partenaire) . ','; - $requete .= ' commentaires=' . $this->_bdd->echapper($commentaires) . ','; - $requete .= ' etat=' . $this->_bdd->echapper($etat) . ','; - $requete .= ' facturation=' . $this->_bdd->echapper($facturation) . ','; - $requete .= ' transport_mode=' . $this->_bdd->echapper($transportMode) . ','; - $requete .= ' transport_distance=' . $this->_bdd->echapper($transportDistance); - $requete .= ' WHERE'; - $requete .= ' id=' . $id; - - $this->modifierEtatInscription($reference, $etat); - - return $this->_bdd->executer($requete); - } - - public function supprimerInscription(string $id) - { - $requete = 'DELETE FROM afup_inscription_forum WHERE id=' . $id; - return $this->_bdd->executer($requete); - } - - public function modifierEtatInscription($reference, string $etat) - { - $requete = 'UPDATE afup_inscription_forum '; - $requete .= 'SET etat=' . $etat . ' '; - $requete .= 'WHERE reference=' . $this->_bdd->echapper($reference); - $this->_bdd->executer($requete); - - $requete = 'UPDATE afup_facturation_forum '; - $requete .= 'SET etat=' . $etat . ' '; - $requete .= 'WHERE reference=' . $this->_bdd->echapper($reference); - return $this->_bdd->executer($requete); - } - - public function ajouterRappel($email, $id_forum = null) - { - if ($id_forum == null) { - require_once __DIR__ . '/Forum.php'; - $forum = new Forum($this->_bdd); - $id_forum = $forum->obtenirDernier(); - } - $requete = 'INSERT INTO afup_inscriptions_rappels (email, date, id_forum) VALUES (' . $this->_bdd->echapper($email) . ', ' . time() . ', ' . $id_forum . ')'; - return $this->_bdd->executer($requete); - } - - public function obtenirListeEmailAncienVisiteurs() - { - $requete = "SELECT group_concat(DISTINCT email SEPARATOR ';') - FROM afup_inscription_forum - WHERE `email` <> '' - AND right(email, 9) <> '@afup.org' - AND type_inscription <> 12 - AND locate('xxx', email) = 0"; - return $this->_bdd->obtenirUn($requete); - } } diff --git a/sources/AppBundle/Controller/Admin/Event/Ticket/AddAction.php b/sources/AppBundle/Controller/Admin/Event/Ticket/AddAction.php new file mode 100644 index 000000000..3447d1d0e --- /dev/null +++ b/sources/AppBundle/Controller/Admin/Event/Ticket/AddAction.php @@ -0,0 +1,87 @@ +query->getInt('eventId'); + $event = $this->eventRepository->get($eventId); + if (!$event instanceof Event) { + throw $this->createNotFoundException(sprintf('Event not found with id "%s"', $eventId)); + } + + $offers = $this->ticketOffers->getAllOffersForEvent($event); + + $form = $this->createForm(TicketAdminWithInvoiceType::class, [], [ + 'event' => $event, + 'offers' => $offers + ]); + + $form->handleRequest($request); + if ($form->isSubmitted() && $form->isValid()) { + /** @var Ticket $ticket */ + /** @var Invoice $invoice */ + ['ticket' => $ticket, 'invoice' => $invoice] = $form->getData(); + + $ticketTypeId = $ticket->getTicketTypeId(); + $offer = array_find($offers, function (TicketOffer $offer) use ($ticketTypeId): bool { + return $offer->ticketTypeId === $ticketTypeId; + }); + if (!$offer instanceof TicketOffer) { + throw new NotFoundHttpException(sprintf('Offer not found with ticketTypeId "%s"', $ticketTypeId)); + } + + if ($offer->ticketEventType) { + $ticket->setTicketEventType($offer->ticketEventType); + } + $ticket->setAmount($offer->price); + $ticket->setDate(new \DateTime()); + $reference = $this->facturation->creerReference($event->getId(), $ticket->getLabel()); + $ticket->setReference($reference); + $invoice->setReference($reference); + + $this->ticketRepository->save($ticket); + $this->invoiceRepository->saveWithTickets($invoice); + + $this->audit->log(sprintf("Modification de l'inscription de %s (%d)", $ticket->getLabel(), $ticket->getId())); + $this->addFlash('notice', "L'inscription a été modifiée."); + + return $this->redirectToRoute('admin_event_ticket_list'); + } + + return $this->render('admin/event/ticket/edit.html.twig', [ + 'event' => $event, + 'form' => $form->createView(), + ]); + } +} diff --git a/sources/AppBundle/Controller/Admin/Event/Ticket/DeleteAction.php b/sources/AppBundle/Controller/Admin/Event/Ticket/DeleteAction.php new file mode 100644 index 000000000..6f124a5c6 --- /dev/null +++ b/sources/AppBundle/Controller/Admin/Event/Ticket/DeleteAction.php @@ -0,0 +1,41 @@ +ticketRepository->get($id); + if (!$ticket instanceof Ticket) { + throw $this->createNotFoundException(sprintf('Ticket not found with id "%s"', $id)); + } + + $invoice = $this->invoiceRepository->getByReference($id); + if ($invoice) { + $this->invoiceRepository->delete($invoice); + } + $this->ticketRepository->delete($ticket); + + $this->audit->log("Suppression de l'inscription ".$id); + $this->addFlash('notice', "L'inscription a été supprimée"); + + return $this->redirectToRoute('admin_event_ticket_list'); + } +} diff --git a/sources/AppBundle/Controller/Admin/Event/Ticket/EditAction.php b/sources/AppBundle/Controller/Admin/Event/Ticket/EditAction.php new file mode 100644 index 000000000..b8b985174 --- /dev/null +++ b/sources/AppBundle/Controller/Admin/Event/Ticket/EditAction.php @@ -0,0 +1,74 @@ +ticketRepository->get($id); + if (!$ticket instanceof Ticket) { + throw $this->createNotFoundException(sprintf('Ticket not found with id "%s"', $id)); + } + $event = $this->eventRepository->get($ticket->getForumId()); + if (!$event instanceof Event) { + throw $this->createNotFoundException(sprintf('Event not found with id "%s"', $ticket->getForumId())); + } + $invoice = $this->invoiceRepository->getByReference($ticket->getReference()); + if (!$invoice instanceof Invoice) { + throw $this->createNotFoundException(sprintf('Invoice not found with id "%s"', $ticket->getReference())); + } + + $offers = $this->ticketOffers->getAllOffersForEvent($event); + + $form = $this->createForm(TicketAdminWithInvoiceType::class, [ + 'ticket' => $ticket, + 'invoice' => $invoice, + ], [ + 'event' => $event, + 'offers' => $offers, + ]); + + $form->handleRequest($request); + if ($form->isSubmitted() && $form->isValid()) { + $data = $form->getData(); + $this->ticketRepository->save($data['ticket']); + $this->invoiceRepository->save($data['invoice']); + + $this->audit->log(sprintf("Modification de l'inscription de %s (%d)", $ticket->getLabel(), $ticket->getId())); + $this->addFlash('notice', "L'inscription a été modifiée."); + + return $this->redirectToRoute('admin_event_ticket_list'); + } + + return $this->render('admin/event/ticket/edit.html.twig', [ + 'event' => $event, + 'ticket' => $ticket, + 'invoice' => $invoice, + 'form' => $form->createView(), + ]); + } +} diff --git a/sources/AppBundle/Controller/Admin/HomeAction.php b/sources/AppBundle/Controller/Admin/HomeAction.php index 69a43197d..7270580cc 100644 --- a/sources/AppBundle/Controller/Admin/HomeAction.php +++ b/sources/AppBundle/Controller/Admin/HomeAction.php @@ -73,7 +73,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'] = $this->generateUrl('admin_event_ticket_list', ['id' => $event->getId()]); $cards[] = $info; diff --git a/sources/AppBundle/Controller/LegacyController.php b/sources/AppBundle/Controller/LegacyController.php index 093e0e4af..3891fe036 100644 --- a/sources/AppBundle/Controller/LegacyController.php +++ b/sources/AppBundle/Controller/LegacyController.php @@ -62,7 +62,7 @@ public function backOffice() /** * All global variables (as defined in commonStart and others) should be declared here */ - global $smarty, $bdd, $conf, $droits, $AFUP_Tarifs_Forum_Lib, $AFUP_Tarifs_Forum, $debug, $translator, $services; + global $smarty, $bdd, $droits; $droits = Utils::fabriqueDroits($this->tokenStorage, $this->authorizationChecker); $pages = $this->backOfficePages; /** @var Session $session */ diff --git a/sources/AppBundle/Event/Form/TicketAdminType.php b/sources/AppBundle/Event/Form/TicketAdminType.php new file mode 100644 index 000000000..ccc1c6c49 --- /dev/null +++ b/sources/AppBundle/Event/Form/TicketAdminType.php @@ -0,0 +1,116 @@ +name > $b->name ? 1 : -1; + }); + + $builder + ->add('civility', ChoiceType::class, [ + 'label' => 'Civilité', + 'choices' => [ + 'M.' => 'M.', + 'Mme' => 'Mme', + ], + ]) + ->add('firstname', TextType::class, [ + 'label' => 'Prénom', + ]) + ->add('lastname', TextType::class, [ + 'label' => 'Nom', + ]) + ->add('email', EmailType::class, [ + 'label' => 'Email', + ]) + ->add('phoneNumber', TextType::class, [ + 'label' => 'Téléphone', + 'required' => false, + ]) + ->add('comments', TextareaType::class, [ + 'label' => 'Commentaires', + 'required' => false, + ]) + ->add('companyCitation', BooleanType::class, [ + 'label' => "J'accepte que ma compagnie soit citée comme participant à la conférence", + ]) + ->add('newsletter', BooleanType::class, [ + 'label' => "Je souhaite être tenu au courant des rencontres de l'AFUP sur des sujets afférents à PHP", + ]) + ->add('optin', BooleanType::class, [ + 'label' => "Je souhaite recevoir des informations de la part de vos partenaires presse/media", + ]) + ->add('ticketTypeId', ChoiceType::class, [ + 'label' => 'Formule', + 'choices' => $ticketOffers, + 'choice_label' => fn(TicketOffer $offer) => sprintf('%s - [%d €]', $offer->name, $offer->price), + 'choice_value' => fn(TicketOffer|null $offer) => $offer->ticketTypeId ?? null, + 'group_by' => fn(TicketOffer $choice) => $choice->event ? 'Offre de l\'évènement' : 'Offre global', + ]); + + if ($event->getTransportInformationEnabled()) { + $transportMode = Ticket::TRANSPORT_MODES; + asort($transportMode); + + $builder->add('transportMode', ChoiceType::class, [ + 'label' => 'Quel est votre mode de transport ?', + 'required' => true, + 'choices' => ['' => null] + array_flip($transportMode), + ]); + + $builder->add('transportDistance', ChoiceType::class, [ + 'label' => 'Quelle sera la distance parcourue ?', + 'required' => true, + 'choices' => ['' => null] + array_flip(Ticket::TRANSPORT_DISTANCES), + ]); + } + + $builder->get('ticketTypeId') + ->addModelTransformer(new CallbackTransformer( + function ($id) use ($ticketOffers): TicketOffer|null { + foreach ($ticketOffers as $ticketOffer) { + if ($ticketOffer->ticketTypeId === $id) { + return $ticketOffer; + } + } + return null; + }, + function ($ticketOffer): int { + return $ticketOffer->ticketTypeId; + } + )) + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Ticket::class, + 'event' => Event::class, + 'offers' => TicketOffer::class.'[]', + ]); + } +} diff --git a/sources/AppBundle/Event/Form/TicketAdminWithInvoiceType.php b/sources/AppBundle/Event/Form/TicketAdminWithInvoiceType.php new file mode 100644 index 000000000..2968cc9a3 --- /dev/null +++ b/sources/AppBundle/Event/Form/TicketAdminWithInvoiceType.php @@ -0,0 +1,39 @@ +add('ticket', TicketAdminType::class, [ + 'label' => 'Ticket', + 'required' => false, + 'event' => $options['event'], + 'offers' => $options['offers'], + 'data' => $options['data']['ticket'] ?? null, + ]) + ->add('invoice', TicketInvoiceType::class, [ + 'label' => 'Facture', + 'required' => false, + 'data' => $options['data']['invoice'] ?? null, + ]); + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'event' => Event::class, + 'offers' => TicketOffer::class.'[]', + ]); + } +} diff --git a/sources/AppBundle/Event/Form/TicketInvoiceType.php b/sources/AppBundle/Event/Form/TicketInvoiceType.php new file mode 100644 index 000000000..e39282fce --- /dev/null +++ b/sources/AppBundle/Event/Form/TicketInvoiceType.php @@ -0,0 +1,115 @@ + Ticket::STATUS_CREATED, + 'Inscription annulée' => Ticket::STATUS_CANCELLED, + 'Paiement CB erreur' => Ticket::STATUS_ERROR, + 'Paiement CB refusé' => Ticket::STATUS_DECLINED, + 'Inscription réglée' => Ticket::STATUS_PAID, + 'Invitation' => Ticket::STATUS_GUEST, + 'Attente règlement' => Ticket::STATUS_WAITING, + 'Inscription confirmée' => Ticket::STATUS_CONFIRMED, + 'Inscription à posteriori' => Ticket::STATUS_PAID_AFTER, + ]; + + $invoiceStatuses = [ + 'Facture à envoyer' => Ticket::INVOICE_TODO, + 'Facture envoyée' => Ticket::INVOICE_SENT, + 'Facture reçue' => Ticket::INVOICE_RECEIVED, + ]; + + $paymentTypes = [ + 'Carte bancaire' => Ticket::PAYMENT_CREDIT_CARD, + 'Chèque' => Ticket::PAYMENT_CHEQUE, + 'Virement' => Ticket::PAYMENT_BANKWIRE, + 'Aucun' => Ticket::PAYMENT_NONE, + ]; + + $builder + ->add('reference', TextType::class, [ + 'label' => 'Référence', + 'disabled' => !$options['data'], + ]) + ->add('authorization', TextType::class, [ + 'label' => 'Autorisation', + ]) + ->add('transaction', TextType::class, [ + 'label' => 'Transaction', + ]) + ->add('status', ChoiceType::class, [ + 'label' => 'État du paiement', + 'choices' => $paymentStatuses, + ]) + ->add('invoice', ChoiceType::class, [ + 'label' => 'État de la facturation', + 'choices' => $invoiceStatuses, + 'mapped' => false, + ]) + + ->add('paymentType', ChoiceType::class, [ + 'label' => 'Règlement', + 'expanded' => true, + 'row_attr' => ['class' => 'fields inline'], + 'choices' => $paymentTypes, + ]) + ->add('paymentInfos', TextareaType::class, [ + 'label' => 'Informations règlement', + 'required' => false, + ]) + ->add('paymentDate', DateType::class, [ + 'label' => 'Date', + ]) + + ->add('company', TextType::class, [ + 'label' => 'Société', + ]) + ->add('company', TextType::class, [ + 'label' => 'Société', + ]) + ->add('firstname', TextType::class, [ + 'label' => 'Prénom', + ]) + ->add('lastname', TextType::class, [ + 'label' => 'Nom', + ]) + ->add('address', TextareaType::class, [ + 'label' => 'Adresse', + ]) + ->add('zipcode', TextType::class, [ + 'label' => 'Code postal', + ]) + ->add('city', TextType::class, [ + 'label' => 'Ville', + ]) + ->add('email', EmailType::class, [ + 'label' => 'Email', + ]) + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Invoice::class, + ]); + } +} diff --git a/sources/AppBundle/Event/Model/Ticket.php b/sources/AppBundle/Event/Model/Ticket.php index 12e1e9953..30ef3995d 100644 --- a/sources/AppBundle/Event/Model/Ticket.php +++ b/sources/AppBundle/Event/Model/Ticket.php @@ -52,60 +52,11 @@ class Ticket implements NotifyPropertyInterface public const INVOICE_SENT = 1; public const INVOICE_RECEIVED = 2; - public const TYPE_DAY_1 = 0; - public const TYPE_DAY_2 = 1; - public const TYPE_2_DAYS = 2; - public const TYPE_2_DAYS_AFUP = 3; - public const TYPE_2_DAYS_STUDENT = 4; - public const TYPE_2_DAYS_EARLY = 5; - public const TYPE_2_DAYS_AFUP_EARLY = 6; - public const TYPE_2_DAYS_STUDENT_EARLY = 7; - public const TYPE_2_DAYS_VOUCHER = 8; public const TYPE_ORGANIZATION = 9; public const TYPE_SPONSOR = 10; public const TYPE_PRESS = 11; public const TYPE_SPEAKER = 12; - public const TYPE_INVITATION = 13; - public const TYPE_PROJECT = 14; - public const TYPE_2_DAYS_SPONSOR = 15; - public const TYPE_TEACHER = 16; - public const TYPE_DAY_1_STUDENT_EARLY = 17; - public const TYPE_DAY_2_STUDENT_EARLY = 18; - public const TYPE_EARLY_PLUS_MEMBERSHIP = 19; - public const TYPE_DAY_1_AFUP = 20; - public const TYPE_DAY_2_AFUP = 21; - public const TYPE_DAY_1_STUDENT = 22; - public const TYPE_DAY_2_STUDENT = 23; - public const TYPE_EARLY_BIRD = 100; - public const TYPE_EARLY_BIRD_AFUP = 101; - public const TYPE_LATE_BIRD = 102; - public const TYPE_LATE_BIRD_AFUP = 103; - public const TYPE_LATE_DAY_1 = 105; - public const TYPE_LATE_DAY_2 = 106; - public const TYPE_CFP_SUBMITTER = 107; public const TYPE_SPECIAL_PRICE = 108; - public const TYPE_AFUP_DAY_EARLY_BIRD = 109; - public const TYPE_AFUP_DAY_CROISIERE = 110; - public const TYPE_AFUP_DAY_LATE = 111; - public const TYPE_AFUP_DAY_CFP_SUBMITTER = 112; - public const TYPE_AFUP_DAY_LIVE_FREE = 113; - public const TYPE_AFUP_DAY_LIVE_SOUTIEN_1 = 114; - public const TYPE_AFUP_DAY_LIVE_SOUTIEN_2 = 115; - public const TYPE_AFUP_DAY_LIVE_SOUTIEN_3 = 116; - public const TYPE_AFUP_DAY_LIVE_SOUTIEN_4 = 117; - - public const TYPE_FORUM_PHP_LIVE_FREE = 118; - public const TYPE_FORUM_PHP_LIVE_SOUTIEN_1 = 119; - public const TYPE_FORUM_PHP_LIVE_SOUTIEN_2 = 120; - public const TYPE_FORUM_PHP_LIVE_SOUTIEN_3 = 121; - public const TYPE_FORUM_PHP_LIVE_SOUTIEN_4 = 122; - public const TYPE_FORUM_PHP_LIVE_SOUTIEN_5 = 123; - public const TYPE_FORUM_PHP_LIVE_SOUTIEN_6 = 124; - - public const TYPE_AFUP_DAY_2021_LIVE_1 = 125; - public const TYPE_AFUP_DAY_2021_LIVE_2 = 126; - public const TYPE_AFUP_DAY_2021_LIVE_3 = 127; - public const TYPE_AFUP_DAY_2021_LIVE_4 = 128; public const PAYMENT_CREDIT_CARD = 0; public const PAYMENT_CHEQUE = 1; diff --git a/sources/AppBundle/Event/Model/TicketOffer.php b/sources/AppBundle/Event/Model/TicketOffer.php index 3c6303750..ac97198bf 100644 --- a/sources/AppBundle/Event/Model/TicketOffer.php +++ b/sources/AppBundle/Event/Model/TicketOffer.php @@ -7,10 +7,11 @@ final readonly class TicketOffer { public function __construct( - public int $id, + public int $ticketTypeId, public string $name, public float $price, public int $availableTickets, - public Event $event, + public ?Event $event = null, + public ?TicketEventType $ticketEventType = null, ) {} } diff --git a/sources/AppBundle/Event/Ticket/RegistrationsExportGenerator.php b/sources/AppBundle/Event/Ticket/RegistrationsExportGenerator.php index 767fcd10d..01ec099bc 100644 --- a/sources/AppBundle/Event/Ticket/RegistrationsExportGenerator.php +++ b/sources/AppBundle/Event/Ticket/RegistrationsExportGenerator.php @@ -8,20 +8,22 @@ use AppBundle\Association\Model\User; use AppBundle\Association\UserMembership\SeniorityComputer; use AppBundle\Event\Model\Event; +use AppBundle\Event\Model\Invoice; use AppBundle\Event\Model\Repository\InvoiceRepository; use AppBundle\Event\Model\Repository\TicketRepository; use AppBundle\Event\Model\Ticket; +use AppBundle\Event\Model\TicketType; use AppBundle\Offices\OfficeFinder; use Symfony\Component\Security\Core\Exception\UserNotFoundException; -class RegistrationsExportGenerator +readonly class RegistrationsExportGenerator { public function __construct( - private readonly OfficeFinder $officeFinder, - private readonly SeniorityComputer $seniorityComputer, - private readonly TicketRepository $ticketRepository, - private readonly InvoiceRepository $invoiceRepository, - private readonly UserRepository $userRepository, + private OfficeFinder $officeFinder, + private SeniorityComputer $seniorityComputer, + private TicketRepository $ticketRepository, + private InvoiceRepository $invoiceRepository, + private UserRepository $userRepository, ) {} public function export(Event $event, \SplFileObject $toFile): void @@ -71,6 +73,9 @@ protected function getFromRegistrationsOnEvent(Event $event) } $invoice = $this->invoiceRepository->getByReference($ticket->getReference()); + if (!$invoice instanceof Invoice) { + continue; + } try { $user = $this->userRepository->loadUserByUsername($ticket->getEmail()); @@ -89,9 +94,9 @@ protected function getFromRegistrationsOnEvent(Event $event) 'nom' => $ticket->getLastname(), 'societe' => $invoice->getCompany(), 'tags' => $this->extractAndCleanTags($ticket->getComments()), - 'type_pass' => $this->getTypePass($ticket->getTicketTypeId()), + 'type_pass' => $this->getTypePass($ticket), 'email' => $ticket->getEmail(), - 'member_since' => null !== $user ? $this->comptureSeniority($user) : null, + 'member_since' => null !== $user ? $this->computeSeniority($user) : null, 'office' => $office, 'distance' => null, 'error' => null, @@ -114,22 +119,34 @@ private function extractAndCleanTags(?string $comments): ?string return implode(' - ', array_filter($tags)); } - private function comptureSeniority(User $user): int + private function computeSeniority(User $user): int { return $this->seniorityComputer->compute($user); } - private function getTypePass($type): string + private function getTypePass(TicketType $ticketType): string { - return match ($type) { - Ticket::TYPE_DAY_1, Ticket::TYPE_LATE_DAY_1, Ticket::TYPE_AFUP_DAY_EARLY_BIRD, Ticket::TYPE_AFUP_DAY_CROISIERE, Ticket::TYPE_AFUP_DAY_LATE, Ticket::TYPE_AFUP_DAY_CFP_SUBMITTER, Ticket::TYPE_AFUP_DAY_LIVE_FREE, Ticket::TYPE_AFUP_DAY_LIVE_SOUTIEN_1, Ticket::TYPE_AFUP_DAY_LIVE_SOUTIEN_2, Ticket::TYPE_AFUP_DAY_LIVE_SOUTIEN_3, Ticket::TYPE_AFUP_DAY_LIVE_SOUTIEN_4, Ticket::TYPE_AFUP_DAY_2021_LIVE_1 => 'PASS JOUR 1', - Ticket::TYPE_DAY_2, Ticket::TYPE_LATE_DAY_2, Ticket::TYPE_AFUP_DAY_2021_LIVE_2 => 'PASS JOUR 2', - Ticket::TYPE_2_DAYS, Ticket::TYPE_2_DAYS_AFUP, Ticket::TYPE_2_DAYS_STUDENT, Ticket::TYPE_2_DAYS_EARLY, Ticket::TYPE_2_DAYS_AFUP_EARLY, Ticket::TYPE_2_DAYS_STUDENT_EARLY, Ticket::TYPE_2_DAYS_VOUCHER, Ticket::TYPE_INVITATION, Ticket::TYPE_EARLY_BIRD, Ticket::TYPE_EARLY_BIRD_AFUP, Ticket::TYPE_LATE_BIRD, Ticket::TYPE_LATE_BIRD_AFUP, Ticket::TYPE_CFP_SUBMITTER, Ticket::TYPE_SPECIAL_PRICE, Ticket::TYPE_FORUM_PHP_LIVE_SOUTIEN_1, Ticket::TYPE_FORUM_PHP_LIVE_FREE, Ticket::TYPE_FORUM_PHP_LIVE_SOUTIEN_2, Ticket::TYPE_FORUM_PHP_LIVE_SOUTIEN_3, Ticket::TYPE_FORUM_PHP_LIVE_SOUTIEN_4, Ticket::TYPE_FORUM_PHP_LIVE_SOUTIEN_5, Ticket::TYPE_FORUM_PHP_LIVE_SOUTIEN_6, Ticket::TYPE_AFUP_DAY_2021_LIVE_3, Ticket::TYPE_AFUP_DAY_2021_LIVE_4 => 'PASS 2 JOURS', + $typePass = match ($ticketType->getId()) { Ticket::TYPE_ORGANIZATION => 'ORGANISATION', Ticket::TYPE_PRESS => 'PRESSE', Ticket::TYPE_SPEAKER => 'CONFERENCIER', Ticket::TYPE_SPONSOR => 'SPONSOR', - default => throw new \RuntimeException(sprintf('Libellé du type %s non trouvé', var_export($type, true))), + default => false, }; + if ($typePass !== false) { + return $typePass; + } + + if ($ticketType->getDay() === 'one') { + return 'PASS JOUR 1'; + } + if ($ticketType->getDay() === 'two') { + return 'PASS JOUR 2'; + } + if ($ticketType->getDay() === 'one,two') { + return 'PASS 2 JOURS'; + } + + throw new \RuntimeException(sprintf('Libellé du type %s non trouvé', var_export($ticketType, true))); } } diff --git a/sources/AppBundle/Event/Ticket/TicketOffers.php b/sources/AppBundle/Event/Ticket/TicketOffers.php index b0da8aba3..7ac5025cc 100644 --- a/sources/AppBundle/Event/Ticket/TicketOffers.php +++ b/sources/AppBundle/Event/Ticket/TicketOffers.php @@ -6,13 +6,16 @@ use AppBundle\Event\Model\Event; use AppBundle\Event\Model\Repository\TicketEventTypeRepository; +use AppBundle\Event\Model\Repository\TicketTypeRepository; use AppBundle\Event\Model\TicketOffer; +use AppBundle\Event\Model\TicketType; readonly class TicketOffers { public function __construct( private TicketEventTypeRepository $ticketEventTypeRepository, private TicketTypeAvailability $ticketTypeAvailability, + private TicketTypeRepository $ticketTypeRepository, ) {} /** @@ -20,28 +23,30 @@ public function __construct( */ public function getAllOffersForEvent(Event $event): array { - global $AFUP_Tarifs_Forum, $AFUP_Tarifs_Forum_Lib; - - $ticketTypes = $this->ticketEventTypeRepository->getTicketsByEvent($event, false); - $offers = []; - foreach ($AFUP_Tarifs_Forum as $ticketType => $ticketPrice) { - $offers[$ticketType] = new TicketOffer( - (int) $ticketType, - $AFUP_Tarifs_Forum_Lib[$ticketType], - $ticketPrice, - $event->getSeats(), - $event, + + /** @var TicketType[] $ticketTypes */ + $ticketTypes = $this->ticketTypeRepository->getAll(); + foreach ($ticketTypes as $ticketType) { + $ticketTypeId = $ticketType->getId(); + $offers[$ticketTypeId] = new TicketOffer( + $ticketTypeId, + $ticketType->getPrettyName(), + $ticketType->getDefaultPrice(), + $event->getSeats() ); } - foreach ($ticketTypes as $ticketType) { - $offers[$ticketType->getTicketTypeId()] = new TicketOffer( - $ticketType->getTicketTypeId(), - $ticketType->getTicketType()->getPrettyName(), - $ticketType->getPrice(), - $this->ticketTypeAvailability->getStock($ticketType, $event), + $ticketTypes = $this->ticketEventTypeRepository->getTicketsByEvent($event, false); + foreach ($ticketTypes as $ticketEventType) { + $ticketTypeId = $ticketEventType->getTicketTypeId(); + $offers[$ticketTypeId] = new TicketOffer( + $ticketTypeId, + $ticketEventType->getTicketType()->getPrettyName(), + $ticketEventType->getPrice(), + $this->ticketTypeAvailability->getStock($ticketEventType, $event), $event, + $ticketEventType ); } diff --git a/sources/AppBundle/Form/BooleanType.php b/sources/AppBundle/Form/BooleanType.php new file mode 100644 index 000000000..1aca9409d --- /dev/null +++ b/sources/AppBundle/Form/BooleanType.php @@ -0,0 +1,29 @@ +setDefaults([ + 'expanded' => true, + 'row_attr' => ['class' => 'fields inline'], + 'choices' => [ + 'Oui' => true, + 'Non' => false, + ], + ]); + } + + public function getParent(): string + { + return ChoiceType::class; + } +} diff --git a/sources/AppBundle/Slack/MessageFactory.php b/sources/AppBundle/Slack/MessageFactory.php index 44676dd84..67a081660 100644 --- a/sources/AppBundle/Slack/MessageFactory.php +++ b/sources/AppBundle/Slack/MessageFactory.php @@ -208,7 +208,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&id_forum=' . $event->getId()) + ->setTitleLink($this->urlGenerator->generate('admin_event_ticket_list', ['id' => $event->getId()],UrlGeneratorInterface::ABSOLUTE_URL)) ; if ($event->lastsOneDay()) { diff --git a/templates/admin/accounting/search.html.twig b/templates/admin/accounting/search.html.twig index a4a3a2bbf..246b8e57d 100644 --- a/templates/admin/accounting/search.html.twig +++ b/templates/admin/accounting/search.html.twig @@ -157,7 +157,7 @@ {{ inscription.forum_titre }} - Voir diff --git a/templates/admin/event/ticket/add.html.twig b/templates/admin/event/ticket/add.html.twig new file mode 100644 index 000000000..0e0f6b9ba --- /dev/null +++ b/templates/admin/event/ticket/add.html.twig @@ -0,0 +1,6 @@ +{% extends 'admin/base_with_header.html.twig' %} + +{% block content %} +

Ajouter une inscription pour le {{ event.title }}

+ {% include 'admin/event/ticket/form.html.twig' %} +{% endblock %} diff --git a/templates/admin/event/ticket/edit.html.twig b/templates/admin/event/ticket/edit.html.twig new file mode 100644 index 000000000..ee6719b9f --- /dev/null +++ b/templates/admin/event/ticket/edit.html.twig @@ -0,0 +1,6 @@ +{% extends 'admin/base_with_header.html.twig' %} + +{% block content %} +

Modifier une inscription pour le {{ event.title }}

+ {% include 'admin/event/ticket/form.html.twig' %} +{% endblock %} diff --git a/templates/admin/event/ticket/form.html.twig b/templates/admin/event/ticket/form.html.twig new file mode 100644 index 000000000..9dcf2cba1 --- /dev/null +++ b/templates/admin/event/ticket/form.html.twig @@ -0,0 +1,89 @@ + +{% form_theme form 'form_theme_admin.html.twig' %} + {{ form_start(form) }} +
+
+

Informations

+ {{ form_row(form.ticket.ticketTypeId) }} + {{ form_row(form.ticket.civility) }} + {{ form_row(form.ticket.lastname) }} + {{ form_row(form.ticket.firstname) }} + {{ form_row(form.ticket.email) }} + {{ form_row(form.ticket.phoneNumber) }} +
+ +
+

Réservé à l'administration

+

+ La référence est utilisée comme numéro de facture. Elle peut être commune à plusieurs inscriptions. +

+ {% if invoice is defined %} +

+ Rechercher la facture +

+ {% endif %} + {{ form_row(form.invoice.reference) }} + {{ form_row(form.invoice.authorization) }} + {{ form_row(form.invoice.transaction) }} + {{ form_row(form.invoice.status) }} + {{ form_row(form.invoice.invoice) }} +
+ +
+

Règlement

+ {{ form_row(form.invoice.paymentType) }} + {{ form_row(form.invoice.paymentInfos) }} + {{ form_row(form.invoice.paymentDate) }} +
+ +
+

Facturation

+

+ Ces informations concernent la personne ou la société qui sera facturée +

+ {{ form_row(form.invoice.company) }} + {{ form_row(form.invoice.lastname) }} + {{ form_row(form.invoice.firstname) }} + {{ form_row(form.invoice.address) }} + {{ form_row(form.invoice.zipcode) }} + {{ form_row(form.invoice.city) }} + {{ form_row(form.invoice.email) }} +
+ +
+

Divers

+ {{ form_row(form.ticket.comments) }} + {{ form_row(form.ticket.companyCitation) }} + {{ form_row(form.ticket.newsletter) }} + {{ form_row(form.ticket.optin) }} +
+ +
+

Transports

+ {% if form.ticket.transportMode %} + {{ form_row(form.ticket.transportMode) }} + {{ form_row(form.ticket.transportDistance) }} + {% else %} +

+ Les informations sur le transport ne sont pas demandées pour cet évènement. +

+ {% endif %} +
+ +
+
+ +
+ +
+
+
+ +
+

* indique un champ obligatoire

+
+ + {{ form_rest(form) }} +
+{{ form_end(form) }} \ No newline at end of file diff --git a/templates/admin/event/ticket/index.html.twig b/templates/admin/event/ticket/index.html.twig index 77f2bcf1b..aa0f4959e 100644 --- a/templates/admin/event/ticket/index.html.twig +++ b/templates/admin/event/ticket/index.html.twig @@ -5,7 +5,7 @@ {% include 'admin/event/change_event.html.twig' with {form: event_select_form} only %}