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

Etat et autre aides de vue

parent 0afbd410
Loading
Loading
Loading
Loading
+4
Changes for module/Formation/config/module.config.php: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -6,7 +6,9 @@ use Application\Navigation\ApplicationNavigationFactory;
use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain;
use Doctrine\DBAL\Driver\OCI8\Driver as OCI8;
use Doctrine\ORM\Mapping\Driver\XmlDriver;
use Formation\View\Helper\EtatViewHelper;
use Formation\View\Helper\ModaliteViewHelper;
use Formation\View\Helper\SeancesViewHelper;
use Formation\View\Helper\SiteViewHelper;
use Formation\View\Helper\TypeViewHelper;
use Soutenance\Controller\AvisController;
@@ -79,6 +81,8 @@ return array(
            'modalite' => ModaliteViewHelper::class,
            'site' => SiteViewHelper::class,
            'type' => TypeViewHelper::class,
            'etat' => EtatViewHelper::class,
            'seances' => SeancesViewHelper::class,
        ]
    ],

+22
Changes for module/Formation/config/others/index.config.php: 22 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ return [
                    'controller' => IndexController::class,
                    'action' => [
                        'index',
                        'index-doctorant',
                    ],
                    'privileges' => [
                        IndexPrivileges::INDEX_AFFICHER,
@@ -35,6 +36,14 @@ return [
                        'route'    => 'formation',
                        'resource' => PrivilegeController::getResourceId(IndexController::class, 'index') ,
                        'order'    => 9999,
                        'pages' => [
                            'Index Doctorants' => [
                                'label'    => 'Mes formations',
                                'route'    => 'formation/index-doctorant',
                                'resource' => PrivilegeController::getResourceId(IndexController::class, 'index-doctorant') ,
                                'order'    => 10,
                            ],
                        ],
                    ],
                ],
            ],
@@ -53,6 +62,19 @@ return [
                        'action'     => 'index',
                    ],
                ],
                'child_routes' => [
                    'index-doctorant' => [
                        'type'  => Segment::class,
                        'may_terminate' => true,
                        'options' => [
                            'route'    => '/index-doctorant[/:doctorant]',
                            'defaults' => [
                                'controller' => IndexController::class,
                                'action'     => 'index-doctorant',
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
+26
Changes for module/Formation/src/Formation/Controller/IndexController.php: 26 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -3,13 +3,39 @@
namespace Formation\Controller;

use Application\Controller\AbstractController;
use Application\Entity\Db\Doctorant;
use Application\Service\Doctorant\DoctorantServiceAwareTrait;
use Formation\Entity\Db\Inscription;
use Formation\Entity\Db\Session;
use UnicaenApp\Service\EntityManagerAwareTrait;
use Zend\View\Model\ViewModel;

class IndexController extends AbstractController
{
    use EntityManagerAwareTrait;


    public function indexAction()
    {
        return new ViewModel();
    }

    public function indexDoctorantAction()
    {
        /** @var Doctorant $doctorant */
        $doctorant = $this->getEntityManager()->getRepository(Doctorant::class)->find(38765);

        /** @var Session[] $session */
        $sessions = $this->getEntityManager()->getRepository(Session::class)->findSessionsDisponiblesByDoctorant($doctorant);

        /** @var Inscription[] $inscription */
        $inscriptions = $this->getEntityManager()->getRepository(Inscription::class)->findInscriptionsByDoctorant($doctorant);

        return new ViewModel([
            'doctorant' => $doctorant,
            'sessions' => $sessions,
            'inscriptions' => $inscriptions,
        ]);
    }

}
 No newline at end of file
+7
Changes for module/Formation/src/Formation/Controller/IndexControllerFactory.php: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace Formation\Controller;

use Doctrine\ORM\EntityManager;
use Interop\Container\ContainerInterface;

class IndexControllerFactory {
@@ -12,7 +13,13 @@ class IndexControllerFactory {
     */
    public function __invoke(ContainerInterface $container)
    {
        /**
         * @var EntityManager $entityManager
         */
        $entityManager = $container->get('doctrine.entitymanager.orm_default');

        $controller = new IndexController();
        $controller->setEntityManager($entityManager);
        return $controller;
    }

+63
Changes for module/Formation/src/Formation/Entity/Db/Etat.php: 63 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace Formation\Entity\Db;

class Etat {

    const CODE_PREPARATION = 'P';
    const CODE_OUVERTE = 'O';
    const CODE_FERME = 'F';
    const CODE_ANNULE = 'A';

    /** @var string */
    private $code;
    /** @var string */
    private $libelle;
    /** @var string|null */
    private $description;
    /** @var string|null */
    private $icone;
    /** @var string|null */
    private $couleur;

    /**
     * @return string
     */
    public function getCode(): string
    {
        return $this->code;
    }

    /**
     * @return string
     */
    public function getLibelle(): string
    {
        return $this->libelle;
    }

    /**
     * @return string|null
     */
    public function getDescription(): ?string
    {
        return $this->description;
    }

    /**
     * @return string|null
     */
    public function getIcone(): ?string
    {
        return $this->icone;
    }

    /**
     * @return string|null
     */
    public function getCouleur(): ?string
    {
        return $this->couleur;
    }

}
 No newline at end of file
Loading