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

Affichage du catalogue retravaillé

parent dbd57010
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ class SiteViewHelper extends AbstractHelper
    /**
     * @param HasSiteInterface|Etablissement $object
     * @param array $options
     * @desc $options['long'] si true le site est affiché avec le libellé et avec le sigle sinon
     * @return string|Partial
     */
    public function __invoke($object, array $options = [])
+7 −1
Original line number Diff line number Diff line
@@ -7,12 +7,18 @@ use Structure\Entity\Db\Etablissement;
 * @var Etablissement|null $site
 * @var array $options
 */

$long = $options['long']??false;
?>

<?php if ($site !== null) : ?>
    <span class="site" title="<?php echo $site->getStructure()->getLibelle(); ?>"
          data-bs-toggle="tooltip" data-bs-html="true">
        <?php if ($long) : ?>
            <?php echo $site->getStructure()->getLibelle(); ?>
        <?php else : ?>
            <?php echo $site->getStructure()->getSigle(); ?>
        <?php endif; ?>
    </span>
<?php else : ?>
    <span class="site" title="Formation dispensée pour tous les sites"
+13 −8
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ use Formation\Provider\Privilege\FormationPrivileges;


$canFormationAfficher = $this->isAllowed(FormationPrivileges::getResourceId(FormationPrivileges::FORMATION_AFFICHER));

?>

<h1 class="page-header">
@@ -34,7 +35,7 @@ $canFormationAfficher = $this->isAllowed(FormationPrivileges::getResourceId(Form
        <tbody>
        <?php /** @var Formation $formation */ ?>
        <?php foreach ($element['formations'] as $formation) : ?>
            <tr>
            <tr style="border-top:none;">
                <td class="formation-libelle">
                    <?php if ($canFormationAfficher) : ?>
                        <a
@@ -58,22 +59,26 @@ $canFormationAfficher = $this->isAllowed(FormationPrivileges::getResourceId(Form
                        Responsable non communiqué·e
                    <?php endif; ?>
                </td>
                <td class="formation-infos">
            </tr>
            <tr style="border-bottom:none;">
                <td></td>
                <td colspan="2" >
                    <ul>
                        <?php /** @var Session $session */ ?>
                        <?php foreach ($formation->getSessions() as $session) : ?>
                            <li>
                                <strong>Site :</strong> <?php echo $this->site($session,[ 'long' => true]); ?>
                                <strong>Modalité :</strong> <?php echo $this->modalite($session); ?>
                                <br/>
                                <?php if ($session->getDateDebut() and $session->getDateFin()) : ?>
                                    <strong>Durée :</strong> <?php echo $session->getDuree(); ?> h.
                                <?php endif; ?>
                                <strong>Période :</strong>
                                <?php if ($session->getDateDebut() and $session->getDateFin()) : ?>
                                    <?php echo $session->getDateDebut()->format('d/m/Y à H:i'); ?> &rightarrow; <?php echo $session->getDateFin()->format('d/m/Y à H:i'); ?>
                                <?php else : ?>
                                    À déterminer
                                <?php endif; ?>
                                <br/>
                                <strong>Modalité :</strong> <?php echo $this->modalite($session); ?>
                                <?php if ($session->getDateDebut() and $session->getDateFin()) : ?>
                                    <br/>
                                    <strong>Durée :</strong> <?php echo $session->getDuree(); ?> h.
                                <?php endif; ?>
                            </li>
                        <?php endforeach; ?>
                    </ul>