Commit c3507260 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

[FIX] Formations : plantage possible en cas de session sans séance (car en...

[FIX] Formations : plantage possible en cas de session sans séance (car en préparation par ex) donc sans date de début/fin.
parent 49c3c7b4
Loading
Loading
Loading
Loading
+1 −0
Changes for CHANGELOG.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ Journal des modifications
- [FIX] Notification de thèse déposée : warning 'Undefined variable' à cause d'une variable non fournie au template.
- [FIX] Notification 'Corrections attendues' et 'Résultats de thèses modifiés' : correction de l'erreur 'Typed property Notification\Notification::$subject must not be accessed before initialization'.
- [FIX] Notification 'Corrections attendues' et 'Résultats de thèses modifiés' : problème dans l'algo de préparation des données (partie émergée : 'Warning: Undefined array key').
- [FIX] Formations : plantage possible en cas de session sans séance (car en préparation par ex) donc sans date de début/fin. 

13.1.0
------
+1 −1
Changes for module/Formation/src/Formation/Controller/SessionController.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -605,7 +605,7 @@ class SessionController extends AbstractController
            $records[] = $entry;
        }

        $filename = (new DateTime())->format('Ymd-His') . '-session-' . str_replace(' ','_',$session->getFormation()->getLibelle()) . '-'. $session->getDateDebut()->format('d_m_Y') .'.csv';
        $filename = (new DateTime())->format('Ymd-His') . '-session-' . str_replace(' ','_',$session->getFormation()->getLibelle()) . '-'. $session->getDateDebut()?->format('d_m_Y') .'.csv';
        $CSV = new CsvModel();
        $CSV->setDelimiter(';');
        $CSV->setEnclosure('"');
+3 −3
Changes for module/Formation/src/Formation/Renderer/FormationSessionTemplateVariable.php: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -19,11 +19,11 @@ class FormationSessionTemplateVariable extends AbstractTemplateVariable

    /** @noinspection PhpUnused */
    public function getPeriode() : string {
        $jour_debut = $this->session->getDateDebut()->format('d/m/Y');
        $jour_fin = $this->session->getDateFin()->format('d/m/Y');
        $jour_debut = $this->session->getDateDebut()?->format('d/m/Y');
        $jour_fin = $this->session->getDateFin()?->format('d/m/Y');

        if ($jour_debut === $jour_fin) return $jour_debut;
        return $jour_debut." au ".$jour_fin;
        return ($jour_debut ?: '?') . " au " . ($jour_fin ?: '?');
    }

    /** @noinspection PhpUnused */
+4 −4
Changes for module/Formation/view/formation/index/index-formateur.phtml: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModuleP
                    <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 data-order="<?= $session->getDateDebut()?->getTimestamp()?>"> <?php echo $this->seances($session); ?> </td>
                    <td>
                        <?php echo $this->modalite($session); ?>
                        <br>
@@ -159,7 +159,7 @@ $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModuleP
                    <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 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>
@@ -199,7 +199,7 @@ $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModuleP
                    <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 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 data-order="<?= $session->getEtat()->getCode()?>"> <?php echo $this->etat($session); ?></td>
@@ -241,7 +241,7 @@ $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModuleP
                    <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 data-order="<?= $session->getDateDebut()?->getTimestamp()?>"> <?php echo $this->seances($session); ?> </td>
                    <td>
                        <?php echo $this->modalite($session); ?>
                        <br>