Commit 5a487843 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Merge branch 'master' of git.unicaen.fr:open-source/inscription_suac

parents 80bd9235 36fd9da7
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ namespace Atelier\Entity\Db;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Fichier\Entity\Db\Fichier;
use Site\Entity\Db\Ville;
use UnicaenUtilisateur\Entity\Db\HistoriqueAwareInterface;
use UnicaenUtilisateur\Entity\Db\HistoriqueAwareTrait;

@@ -75,6 +76,28 @@ class Atelier implements HistoriqueAwareInterface
        return $this->sessions->toArray();
    }

    /** @return Ville[] */
    public function getVilles(): array
    {
        $villes = new ArrayCollection();
        foreach ($this->getSessions() as $session) {
            $ville = $session->getSite()?->getVille();
            if($ville and !$villes->contains($ville)) $villes[] = $ville;
        }
        return  $villes->toArray();
    }

    public function getLibelleEtVilles(): string
    {
        $libelle = $this->getLibelle();

        foreach ($this->getVilles() as $ville) {
            if ($ville) $libelle .= ' ( ' . $ville->getNom() . ' )';
        }

        return $libelle;
    }

    /** @return Programme[] */
    public function getProgrammes(): array
    {
+27 −24
Original line number Diff line number Diff line
@@ -40,10 +40,11 @@ foreach ($listing as $atelier) {
                        <?php $canAfficherAtelier = $this->isAllowed(AtelierPrivileges::getResourceId(AtelierPrivileges::ATELIER_AFFICHER)); ?>
                        <?php if ($canAfficherAtelier) : ?>
                            <?php /** @see \Atelier\Controller\AtelierController::afficherAction() */ ?>
                    <a href="<?php echo $this->url('atelier/atelier/afficher', ['atelier' => $atelier->getId()], [], true); ?>" class="ajax-modal">
                        <?php echo $atelier->getLibelle(); ?></a>
                            <a href="<?php echo $this->url('atelier/atelier/afficher', ['atelier' => $atelier->getId()], [], true); ?>"
                               class="ajax-modal">
                                <?php echo $atelier->getLibelleEtVilles(); ?></a>
                        <?php else: ?>
                    <?php echo $atelier->getLibelle(); ?>
                            <?php echo $atelier->getLibelleEtVilles(); ?>
                        <?php endif; ?>
                    </li>
                <?php endforeach; ?>
@@ -58,12 +59,14 @@ foreach ($listing as $atelier) {
                <?php foreach ($ateliersByGroupes[-1] as $atelier) : ?>
                    <li>
                        <?php $canAfficherAtelier = $this->isAllowed(AtelierPrivileges::getResourceId(AtelierPrivileges::ATELIER_AFFICHER)); ?>

                        <?php if ($canAfficherAtelier) : ?>
                            <?php /** @see \Formation\Controller\AtelierController::afficherAction() */ ?>
                            <a href="<?php echo $this->url('atelier/atelier/afficher', ['atelier' => $atelier->getId()], [], true); ?>" class="ajax-modal">
                                <?php echo $atelier->getLibelle(); ?></a>
                            <a href="<?php echo $this->url('atelier/atelier/afficher', ['atelier' => $atelier->getId()], [], true); ?>"
                               class="ajax-modal">
                                <?php echo $atelier->getLibelleEtVilles(); ?></a>
                        <?php else: ?>
                            <?php echo $atelier->getLibelle(); ?>
                            <?php echo $atelier->getLibelleEtVilles(); ?>
                        <?php endif; ?>
                    </li>
                <?php endforeach; ?>
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ class AnneeUnivIAService
     */
    public function getAnneeUnivIAasOptions() : array
    {
        $anneeUnivIAs = $this->getAnneeUnivIAs();
        $anneeUnivIAs = $this->getAnneeUnivIAs('annee_univ');
        $options = [];
        foreach ($anneeUnivIAs as $anneeUnivIA) {
            $options[$anneeUnivIA->getId()] = $anneeUnivIA->getAnneeUniv();
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ class ComposanteIAService

    public function getComposanteIAasOptions() : array
    {
        $composanteIAs = $this->getComposanteIAs();
        $composanteIAs = $this->getComposanteIAs('composante');
        $options = [];
        foreach ($composanteIAs as $composanteIA) {
            $options[$composanteIA->getId()] = $composanteIA->getComposante();
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ class CycleIAService

    public function getCycleIAasOptions() : array
    {
        $cycleIAs = $this->getCycleIAs();
        $cycleIAs = $this->getCycleIAs('cycle');
        $options = [];
        foreach ($cycleIAs as $cycleIA) {
            $options[$cycleIA->getId()] = $cycleIA->getCycle();
Loading