Commit 0b90b40d authored by Thomas Hamel's avatar Thomas Hamel
Browse files

Merge branch 'ameliorations_module_formation' into test

parents 8d088d17 3610a048
Loading
Loading
Loading
Loading
+2 −0
Changes for module/Application/config/module.config.php: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -327,6 +327,7 @@ return array(
            '061_uploader' => "/vendor/jquery.iframe-transport.js",
            '062_uploader' => "/vendor/jquery.fileupload.js",
            '063_uploader' => "/vendor/unicaen.uploader.widget.js",
            '090_datatables' => "/vendor/datatables/datatables.min.js",
        ],
        'inline_scripts' => [
            '070_bootstrap-select' => '/vendor/bootstrap-select-1.14.0-beta3/js/bootstrap-select.min.js',
@@ -344,6 +345,7 @@ return array(
            '500_select2' => "/vendor/select2-4.0.13/dist/css/select2.min.css",
            '900_faa' => '/css/rapport-activite.css',
            '910_priv' => '/css/privilege.css',
            '910_datatables' => '/vendor/datatables/datatables.min.css',
        ],
        'printable_stylesheets' => [
        ],
+12 −7
Changes for module/Formation/src/Formation/Controller/IndexController.php: 12 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -9,12 +9,12 @@ use Doctorant\Entity\Db\Doctorant;
use Doctorant\Service\DoctorantServiceAwareTrait;
use Formation\Entity\Db\Etat;
use Formation\Entity\Db\FormationExterne;
use Formation\Entity\Db\Inscription;
use Formation\Entity\Db\Session;
use Formation\Facade\Inscription\InscriptionFacadeAwareTrait;
use Formation\Provider\Parametre\FormationParametres;
use Formation\Provider\Validation\TypeValidation;
use Formation\Service\Formation\FormationExterne\FormationExterneServiceAwareTrait;
use Formation\Service\Justificatif\JustificatifServiceAwareTrait;
use Formation\Service\Session\SessionServiceAwareTrait;
use Formation\Service\Validation\ValidationFormationExterne\ValidationFormationExterneServiceAwareTrait;
use Individu\Entity\Db\Individu;
use Laminas\View\Model\ViewModel;
@@ -33,6 +33,8 @@ class IndexController extends AbstractController
    use AnneeUnivServiceAwareTrait;
    use FormationExterneServiceAwareTrait;
    use ValidationFormationExterneServiceAwareTrait;
    use JustificatifServiceAwareTrait;
    use SessionServiceAwareTrait;
    use SousCompetenceServiceAwareTrait;
    use InscriptionFacadeAwareTrait;

@@ -56,8 +58,8 @@ class IndexController extends AbstractController
        $formationsExternes = [];
        if($doctorant) {
            // formations ouvertes et en préparation SANS CRITÈRES DE DATES pour afficher aussi celles de l'année univ suivantes
            $ouvertes = $this->getEntityManager()->getRepository(Session::class)->findSessionsByDoctorant($doctorant, Etat::CODE_OUVERTE, verifDatePublication: true);
            $preparations = $this->getEntityManager()->getRepository(Session::class)->findSessionsByDoctorant($doctorant, Etat::CODE_PREPARATION, verifDatePublication: true);
            $ouvertes = $this->sessionService->getRepository()->findSessionsByDoctorant($doctorant, Etat::CODE_OUVERTE, verifDatePublication: true);
            $preparations = $this->sessionService->getRepository()->findSessionsByDoctorant($doctorant, Etat::CODE_PREPARATION, verifDatePublication: true);

            $inscriptionsAbsenceInjustifiees = [];

@@ -98,13 +100,15 @@ class IndexController extends AbstractController
        }

        if($individu) {
            $passees    = $this->getEntityManager()->getRepository(Session::class)->findSessionsPasseesByFormateur($individu);
            $courantes  = $this->getEntityManager()->getRepository(Session::class)->findSessionsCourantesByFormateur($individu);
            $futures    = $this->getEntityManager()->getRepository(Session::class)->findSessionsFuturesByFormateur($individu);
            $passees    = $this->sessionService->getRepository()->findSessionsPasseesByFormateur($individu);
            $courantes  = $this->sessionService->getRepository()->findSessionsCourantesByFormateur($individu);
            $futures    = $this->sessionService->getRepository()->findSessionsFuturesByFormateur($individu);
            $annulees    = $this->sessionService->getRepository()->findSessionsAnnuleesByFormateur($individu);
        } else {
            $passees = [];
            $courantes = [];
            $futures = [];
            $annulees = [];
        }

        return new ViewModel([
@@ -112,6 +116,7 @@ class IndexController extends AbstractController
            'passees' => $passees,
            'courantes' => $courantes,
            'futures' => $futures,
            'annulees' => $annulees,
        ]);
    }

+7 −0
Changes for module/Formation/src/Formation/Controller/IndexControllerFactory.php: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ use Formation\Facade\Inscription\InscriptionFacade;
use Formation\Service\Inscription\InscriptionService;
use Formation\Service\Justificatif\JustificatifService;
use Formation\Service\Formation\FormationExterne\FormationExterneService;
use Formation\Service\Session\SessionService;
use Formation\Service\Validation\ValidationFormationExterne\ValidationFormationExterneService;
use Interop\Container\ContainerInterface;
use Psr\Container\ContainerExceptionInterface;
@@ -35,6 +36,8 @@ class IndexControllerFactory {
         * @var ValidationFormationExterneService $validationFormationExterneService
         * @var SousCompetenceService $sousCompetenceService
         * @var InscriptionFacade $inscriptionFacade
         * @var JustificatifService $justificatifService
         * @var SessionService $sessionService
        */
        $entityManager = $container->get('doctrine.entitymanager.orm_default');
        $doctorantService = $container->get(DoctorantService::class);
@@ -44,6 +47,8 @@ class IndexControllerFactory {
        $validationFormationExterneService = $container->get(ValidationFormationExterneService::class);
        $sousCompetenceService = $container->get(SousCompetenceService::class);
        $inscriptionFacade = $container->get(InscriptionFacade::class);
        $justificatifService = $container->get(JustificatifService::class);
        $sessionService = $container->get(SessionService::class);

        $controller = new IndexController();
        $controller->setEntityManager($entityManager);
@@ -51,9 +56,11 @@ class IndexControllerFactory {
        $controller->setParametreService($parametreService);
        $controller->setAnneeUnivService($anneeUnivService);
        $controller->setFormationExterneService($formationExterneService);
        $controller->setJustificatifService($justificatifService);
        $controller->setValidationFormationExterneService($validationFormationExterneService);
        $controller->setSousCompetenceService($sousCompetenceService);
        $controller->setInscriptionFacade($inscriptionFacade);
        $controller->setSessionService($sessionService);

        return $controller;
    }
+23 −0
Changes for module/Formation/src/Formation/Entity/Db/Repository/SessionRepository.php: 23 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -203,6 +203,29 @@ class SessionRepository extends DefaultEntityRepository
       return $qb->getQuery()->getResult();
    }

    /**
     * @param Individu $individu
     * @return array
     */
    public function findSessionsAnnuleesByFormateur(Individu $individu) : array
    {
        $etats = [ Etat::CODE_ANNULEE];

        $qb = $this->createQueryBuilder('session')
            ->leftJoin('session.formateurs', 'formateur')
            ->leftJoin('session.formateurs', 'aformateur')->addSelect('aformateur')
            ->andWhere('formateur.individu = :individu')
            ->setParameter('individu', $individu)
            ->andWhere('session.etat in (:etats)')
            ->andWhere('session.histoDestruction IS NULL')
            ->andWhere('formateur.histoDestruction IS NULL')
            ->setParameter('etats', $etats)
            ->orderBy('session.id', 'ASC')
        ;

        return $qb->getQuery()->getResult();
    }

    /**
     * @param Formation|null $formation
     * @param string $champ
+145 −17
Changes for module/Formation/view/formation/index/index-formateur.phtml: 145 added lines, 17 removed lines.
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
 * @var Session[] $passees
 * @var Session[] $courantes
 * @var Session[] $futures
 * @var Session[] $annulees
 */

use Individu\Entity\Db\Individu;
@@ -30,7 +31,7 @@ $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModuleP
        <?php if ($canCatalogueAfficher) : ?>
            <?php /** @see \Formation\Controller\ModuleController::catalogueAction() */?>
            <a href="<?php echo $this->url('formation/catalogue',[],[], true); ?>" class="btn btn-primary" target="_blank">
                <span class="icon icon-voir"> Accéder au catalogue des formations</span>
                <span class="icon icon-voir"></span> Accéder au catalogue des formations
            </a>
        <?php endif; ?>
    </div>
@@ -78,6 +79,16 @@ $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModuleP
            Mes formations à venir
        </a>
    </li>
    <li role="presentation" class="nav-item">
        <a href="#annulees"
           class="nav-link"
           role="tab"
           aria-controls="annulees"
           data-bs-toggle="tab"
        >
            Mes formations annulées
        </a>
    </li>
</ul>

<div class="tab-content">
@@ -86,7 +97,7 @@ $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModuleP
            Formations en cours
        </h2>

        <table class="table table-sm">
        <table class="table table-sm" id="formationsEnCoursTable">
            <thead>
            <tr>
                <th> Module de formation </th>
@@ -102,10 +113,10 @@ $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModuleP
            <tbody>
            <?php foreach ($courantes as $session) : ?>
                <tr>
                    <td> <?php echo $this->sessionLibelle($session); ?> </td>
                    <td data-order="<?= $session->getFormation()->getLibelle()?>"> <?php echo $this->sessionLibelle($session); ?> </td>
                    <td> <?php echo $this->formateurs($session); ?> </td>
                    <td> <?php echo $this->site($session); ?> </td>
                    <td> <?php echo $this->seances($session); ?> </td>
                    <td data-order="<?= $session->getDateDebut()->getTimestamp()?>"> <?php echo $this->seances($session); ?> </td>
                    <td>
                        <?php echo $this->modalite($session); ?>
                        <br>
@@ -128,7 +139,7 @@ $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModuleP
    <div role="tabpanel" class="tab-pane" id="passees">
        <h2> Mes formations passées </h2>

        <table class="table table-sm">
        <table class="table table-sm" id="formationsPasseesTable">
            <thead>
            <tr>
                <th> Module de formation </th>
@@ -145,10 +156,10 @@ $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModuleP
            <tbody>
            <?php foreach ($passees as $session) : ?>
                <tr>
                    <td> <?php echo $this->sessionLibelle($session); ?> </td>
                    <td data-order="<?= $session->getFormation()->getLibelle()?>"> <?php echo $this->sessionLibelle($session); ?> </td>
                    <td> <?php echo $this->formateurs($session); ?> </td>
                    <td> <?php echo $this->site($session); ?> </td>
                    <td> <?php echo $this->seances($session); ?> </td>
                    <td data-order="<?= $session->getDateDebut()->getTimestamp()?>"> <?php echo $this->seances($session); ?> </td>
                    <td> <?php echo $this->modalite($session); ?></td>
                    <td> <?php echo $this->type($session); ?></td>
                    <td> <?php echo $this->etat($session); ?></td>
@@ -168,7 +179,7 @@ $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModuleP
    <div role="tabpanel" class="tab-pane" id="futures">
        <h2> Mes formations à venir</h2>

        <table class="table table-sm">
        <table class="table table-sm" id="formationsFuturesTable">
            <thead>
            <tr>
                <th> Module de formation </th>
@@ -185,13 +196,13 @@ $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModuleP
            <tbody>
            <?php foreach ($futures as $session) : ?>
                <tr>
                    <td> <?php echo $this->sessionLibelle($session); ?> </td>
                    <td data-order="<?= $session->getFormation()->getLibelle()?>"> <?php echo $this->sessionLibelle($session); ?> </td>
                    <td> <?php echo $this->formateurs($session); ?> </td>
                    <td> <?php echo $this->site($session); ?> </td>
                    <td> <?php echo $this->seances($session); ?> </td>
                    <td data-order="<?= $session->getDateDebut()->getTimestamp()?>"> <?php echo $this->seances($session); ?> </td>
                    <td> <?php echo $this->modalite($session); ?></td>
                    <td> <?php echo $this->type($session); ?></td>
                    <td> <?php echo $this->etat($session); ?></td>
                    <td data-order="<?= $session->getEtat()->getCode()?>"> <?php echo $this->etat($session); ?></td>
                    <td> <?php echo $this->sessionInscription($session, ['inscrits' => true]); ?> </td>
                    <td>
                        <?php if ($canSessionVoir) : ?>
@@ -206,13 +217,51 @@ $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModuleP
        </table>
        <?php endif; ?>
    </div>
</div>





    <div role="tabpanel" class="tab-pane in active" id="annulees">
        <h2>
            Formations annulées
        </h2>

        <table class="table table-sm" id="formationsAnnuleesTable">
            <thead>
            <tr>
                <th> Module de formation </th>
                <th> Formateur&middot;trice&middot;s </th>
                <th> Établissement </th>
                <th> Dates et lieux </th>
                <th> Modalité & type </th>
                <th> État </th>
                <th> Limite d’inscription </th>
                <th> Action </th>
            </tr>
            </thead>
            <tbody>
            <?php foreach ($annulees as $session) : ?>
                <tr>
                    <td data-order="<?= $session->getFormation()->getLibelle()?>"> <?php echo $this->sessionLibelle($session); ?> </td>
                    <td> <?php echo $this->formateurs($session); ?> </td>
                    <td> <?php echo $this->site($session); ?> </td>
                    <td data-order="<?= $session->getDateDebut()->getTimestamp()?>"> <?php echo $this->seances($session); ?> </td>
                    <td>
                        <?php echo $this->modalite($session); ?>
                        <br>
                        <?php echo $this->type($session); ?>
                    </td>
                    <td> <?php echo $this->etat($session); ?></td>
                    <td> <?php echo $this->sessionInscription($session, ['inscrits' => true]); ?> </td>
                    <td>
                        <?php if ($canSessionVoir) : ?>
                            <a href="<?php echo $this->url('formation/session/afficher', ['session' => $session->getId()], [], true); ?>"
                               title="Accéder à la session" data-bs-toggle="tooltip" data-bs-html="true"
                            ><span class="icon icon-voir"></span></a>
                        <?php endif; ?>
                    </td>
                </tr>
            <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</div>

<script>
    $(function() {
@@ -232,4 +281,83 @@ $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModuleP
            $(this).tab('show');
        });
    });

    $(document).ready(function () {
        $('#formationsEnCoursTable').DataTable({
            paging: false,
            searching: true,
            info: true,
            ordering: true,

            columnDefs: [
                { orderable: true,  targets: [0, 2, 3, 4, 5, 6] }, // colonnes triables
                { orderable: false, targets: [1, 7] }       // non triables
            ],

            order: [[3, 'asc']],

            language: {
                url: '/vendor/datatables/fr_language.json',
                emptyTable: "Aucune formation en cours n'a été trouvée"
            }
        });

        $('#formationsPasseesTable').DataTable({
            paging: false,
            searching: true,
            info: true,
            ordering: true,

            columnDefs: [
                { orderable: true,  targets: [0, 2, 3, 4, 5] }, // colonnes triables
                { orderable: false, targets: [1, 6, 7] }       // non triables
            ],

            order: [[3, 'asc']],

            language: {
                url: '/vendor/datatables/fr_language.json',
                emptyTable: "Aucune formation passée n'a été trouvée"
            }
        });

        $('#formationsFuturesTable').DataTable({
            paging: false,
            searching: true,
            info: true,
            ordering: true,

            columnDefs: [
                { orderable: true,  targets: [0, 2, 3, 4, 5, 6] }, // colonnes triables
                { orderable: false, targets: [1, 7] }       // non triables
            ],

            order: [[3, 'asc']],

            language: {
                url: '/vendor/datatables/fr_language.json',
                emptyTable: "Aucune formation passée n'a été trouvée"
            }
        });

        $('#formationsAnnuleesTable').DataTable({
            paging: false,
            searching: true,
            info: true,
            ordering: true,

            columnDefs: [
                { orderable: true,  targets: [0, 2, 3, 4, 5, 6] }, // colonnes triables
                { orderable: false, targets: [1, 7] }       // non triables
            ],

            order: [[3, 'asc']],

            language: {
                url: '/vendor/datatables/fr_language.json',
                emptyTable: "Aucune formation annulée n'a été trouvée"
            }
        });
    });

</script>
 No newline at end of file
Loading