Commit 5335133b authored by Johnny Leveneur's avatar Johnny Leveneur
Browse files

gestion des places nominatives en auto-inscription et correction qr-scan

parent ad563ccb
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ use Evenementiel\Service\Notification\NotificationServiceFactory;
use Evenementiel\Service\Url\UrlService;
use Evenementiel\Service\Url\UrlServiceFactory;
use Evenementiel\View\Helper\InscriptionButtonHelper;
use Evenementiel\View\Helper\InscriptionPlaces;
use Evenementiel\View\Helper\PopulateCollection;
use Evenementiel\View\Helper\RenderPlacesCollection;

@@ -73,10 +74,12 @@ return array(
        'factories' => [
            PopulateCollection::class => Laminas\ServiceManager\Factory\InvokableFactory::class,
            RenderPlacesCollection::class => Laminas\ServiceManager\Factory\InvokableFactory::class,
            InscriptionPlaces::class => Laminas\ServiceManager\Factory\InvokableFactory::class,
        ],
        'aliases' => [
            'populateCollection' => PopulateCollection::class,
            'renderPlacesCollection' => RenderPlacesCollection::class
            'renderPlacesCollection' => RenderPlacesCollection::class,
            'inscriptionPlaces' => InscriptionPlaces::class,
        ],


+3 −2
Original line number Diff line number Diff line
@@ -579,6 +579,7 @@ class EvenementController extends AbstractActionController
                    if ($existingInscription !== null) {
                        $existingInscription->dehistoriser();
                        $existingInscription->setNombrePlacesDemandees($inscription->getNombrePlacesDemandees());
                        $existingInscription->setPlaces($inscription->getPlaces());
                        $inscription = $existingInscription;
                    } else {
                        $inscription->setParticipant($participant);
@@ -586,8 +587,8 @@ class EvenementController extends AbstractActionController
                    $this->getInscriptionService()->create($inscription);
                    $this->getEtatInstanceService()->setEtatActif($inscription, InscriptionEtats::INSCRIPTION_DEMANDE);

//                    $this->getNotificationService()->triggerInscriptionDemande($inscription);
//                    $this->getEtatInstanceService()->setEtatActif($inscription, InscriptionEtats::INSCRIPTION_VALIDER);
                    $this->getNotificationService()->triggerInscriptionDemande($inscription);
                    $this->getEtatInstanceService()->setEtatActif($inscription, InscriptionEtats::INSCRIPTION_VALIDER);
//                    $this->getNotificationService()->triggerListePrincipale($inscription);
//                    $this->flashMessenger()->addSuccessMessage("Inscription faite.");

+2 −1
Original line number Diff line number Diff line
@@ -362,7 +362,8 @@ class InscriptionController extends AbstractActionController
    public function autoInscriptionAction(): ViewModel
    {
        $participant = $this->getParticipantService()->getParticipantUsager();
        $evenements = $this->getEvenementService()->getEvenementsByEtat(EvenementEtats::ETAT_INSCRIPTION_OUVERTE);
//        $evenements = $this->getEvenementService()->getEvenementsByEtat(EvenementEtats::ETAT_INSCRIPTION_OUVERTE);
        $evenements = $this->getEvenementService()->getEvenementsActives();

        return new ViewModel([
            'participant' => $participant,
+7 −0
Original line number Diff line number Diff line
@@ -76,6 +76,13 @@ class Categorie implements HistoriqueAwareInterface
                  [EvenementEtats::ETAT_INSCRIPTION_OUVERTE])
                and $e->getDateTimeFin() > $date;
        });

        usort($evenements, function (Evenement $a,Evenement $b) {
            $da = $a->getDateTimeDebut() ?? PHP_INT_MAX;
            $db = $b->getDateTimeDebut() ?? PHP_INT_MAX;
            return $da <=> $db;
        });

        return $evenements ;
    }

+22 −0
Original line number Diff line number Diff line
@@ -138,6 +138,16 @@ class Inscription implements HistoriqueAwareInterface, HasEtatsInterface, Resour
        return $this->places;
    }

    public function setPlaces(?Collection $places): void
    {
        foreach ($places as $place)
        {
            /** @var InscriptionPlace $place */
            $place->setInscription($this);
        }
        $this->places = $places;
    }

    public function addPlace(InscriptionPlace $place): self
    {
        if (!$this->places->contains($place)) {
@@ -196,6 +206,18 @@ class Inscription implements HistoriqueAwareInterface, HasEtatsInterface, Resour
        return  $this->getNombrePlacesDemandees() . ' place' . ($this->getNombrePlacesDemandees() > 1 ? 's' : '');
    }

    public function getArrayDenominationPlaces(): array
    {
        $tab = [];
        foreach($this->getPlaces() as $place)
        {
            /** @var InscriptionPlace $place */
           $tab[] = $place->getDenomination();
        }
        sort($tab);
        return $tab;
    }

    public function getEtape(): ?string
    {
        return $this->etape;
Loading