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

Masquage de la colonne action en fonction des privileges accordés

parent fac0f790
Loading
Loading
Loading
Loading
+6 −0
Changes for module/Carriere/view/carriere/categorie/index.phtml: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@ $canModifier = $this->isAllowed(CorpsPrivileges::getResourceId(CorpsPrivilege
$canHistoriser  = $this->isAllowed(CorpsPrivileges::getResourceId(CorpsPrivileges::CORPS_MODIFIER));
$canDetruire    = $this->isAllowed(CorpsPrivileges::getResourceId(CorpsPrivileges::CORPS_MODIFIER));

$canAction = ($canAfficher OR $canAjouter OR $canModifier OR $canHistoriser OR $canDetruire);

$this->headTitle("Liste des catégories");
?>

@@ -38,7 +40,9 @@ $this->headTitle("Liste des catégories");
            <th> Code </th>
            <th> Libelle </th>
            <th> #Métier </th>
            <?php if ($canAction) : ?>
                <th class="action"> Action </th>
            <?php endif; ?>
        </tr>
    </thead>
    <tbody>
@@ -53,6 +57,7 @@ $this->headTitle("Liste des catégories");
            <td>
                <?php echo count($categorie->getMetiers()); ?>
            </td>
            <?php if ($canAction) : ?>
                <td class="action">
                <?php if ($canAfficher) : ?>
                    <a
@@ -114,6 +119,7 @@ $this->headTitle("Liste des catégories");
                    </a>
                <?php endif; ?>
            </td>
            <?php endif; ?>
        </tr>
    <?php endforeach; ?>
    </tbody>
+6 −0
Changes for module/Carriere/view/carriere/corps/index.phtml: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@ $this->headTitle("Liste des corps");

$canAfficher = $this->isAllowed(CorpsPrivileges::getResourceId(CorpsPrivileges::CORPS_AFFICHER));
$canModifier = $this->isAllowed(CorpsPrivileges::getResourceId(CorpsPrivileges::CORPS_MODIFIER));

$canAction = ($canAfficher OR $canModifier);
?>

<div class="row">
@@ -38,7 +40,9 @@ $canModifier = $this->isAllowed(CorpsPrivileges::getResourceId(CorpsPrivileges::
        <th> #Agent/Grade </th>
        <th> Catégorie </th>
        <th> Niveaux </th>
        <?php if ($canAction) : ?>
            <th class="action"> Action </th>
        <?php endif ?>
    </tr>
    </thead>
    <tbody>
@@ -77,6 +81,7 @@ $canModifier = $this->isAllowed(CorpsPrivileges::getResourceId(CorpsPrivileges::
                    <?php endif; ?>
                <?php endif; ?>
            </td>
            <?php if ($canAction) : ?>
            <td class="action">
                <?php if ($canAfficher) : ?>
                    <a
@@ -89,6 +94,7 @@ $canModifier = $this->isAllowed(CorpsPrivileges::getResourceId(CorpsPrivileges::
                    </a>
                <?php endif; ?>
            </td>
            <?php endif; ?>
        </tr>
    <?php endforeach; ?>
    </tbody>
+6 −0
Changes for module/Carriere/view/carriere/correspondance-type/index.phtml: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@ $this->headTitle("Types de correspondance");


$canAfficher = $this->isAllowed(CorrespondancePrivileges::getResourceId(CorrespondancePrivileges::CORRESPONDANCE_AFFICHER));

$canAction = ($canAfficher)
?>

<div class="row">
@@ -41,7 +43,9 @@ $canAfficher = $this->isAllowed(CorrespondancePrivileges::getResourceId(Correspo
        <th> Code </th>
        <th> Libellé court </th>
        <th> Libellé long </th>
        <?php if ($canAction) : ?>
            <th> Action </th>
        <?php endif ?>
    </tr>
    </thead>
    <tbody>
@@ -55,6 +59,7 @@ $canAfficher = $this->isAllowed(CorrespondancePrivileges::getResourceId(Correspo
            </td>
            <td> <?php echo $type->getLibelleCourt(); ?> </td>
            <td> <?php echo $type->getLibelleLong(); ?> </td>
            <?php if ($canAction) : ?>
            <td class="action">
                <?php if ($canAfficher) : ?>
                    <a href="<?php echo $this->url('carriere/correspondance-type/afficher', ['type' => $type->getId()], [], true); ?>"
@@ -64,6 +69,7 @@ $canAfficher = $this->isAllowed(CorrespondancePrivileges::getResourceId(Correspo
                    </a>
                <?php endif; ?>
            </td>
            <?php endif; ?>
        </tr>
        <?php endforeach; ?>
    </tbody>
+6 −0
Changes for module/Carriere/view/carriere/correspondance/index.phtml: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@ $correspondances = array_filter($correspondances, function (Correspondance $a) u

$canAfficher = $this->isAllowed(CorpsPrivileges::getResourceId(CorpsPrivileges::CORPS_AFFICHER));

$canAction = ($canAfficher);

$this->headTitle("Liste des correspondances");
?>

@@ -48,7 +50,9 @@ $this->headTitle("Liste des correspondances");
        <th > Libellé </th>
        <th> Type </th>
        <th> #Agent/Grade </th>
        <?php if ($canAction) : ?>
            <th > Action </th>
        <?php endif; ?>
    </tr>
    </thead>
    <tbody>
@@ -75,6 +79,7 @@ $this->headTitle("Liste des correspondances");
                <?php endif; ?>
            </td>
            <td> <?php echo count($correspondance->getAgentGrades()); ?> </td>
            <?php if ($canAction) : ?>
            <td class="action">
                <?php if ($canAfficher) : ?>
                    <a
@@ -87,6 +92,7 @@ $this->headTitle("Liste des correspondances");
                    </a>
                <?php endif; ?>
            </td>
            <?php endif; ?>
        </tr>
    <?php endforeach; ?>
    </tbody>
+6 −2
Changes for module/Carriere/view/carriere/grade/index.phtml: 6 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@ use Carriere\Provider\Privilege\CorpsPrivileges;

$canAfficher = $this->isAllowed(CorpsPrivileges::getResourceId(CorpsPrivileges::CORPS_AFFICHER));

$canAction = ($canAfficher);

$this->headTitle("Liste des grades");
?>

@@ -35,7 +37,9 @@ $this->headTitle("Liste des grades");
    <tr>
        <th > Libellé </th>
        <th> #Agent/Grade </th>
        <?php if ($canAction) : ?>
            <th> Action </th>
        <?php endif; ?>
    </tr>
    </thead>
    <tbody>
@@ -50,8 +54,8 @@ $this->headTitle("Liste des grades");
                </span>
            </td>
            <td> <?php echo count($grade->getAgentGrades()); ?> </td>
            <?php if ($canAction) : ?>
            <td class="action">
                <?php if ($canAfficher) : ?>
                    <a
                        <?php /** @see \Carriere\Controller\GradeController::afficherAgentsAction() */ ?>
                        href="<?php echo $this->url('grade/afficher-agents', ['grade' => $grade->getId()], [], true); ?>"
@@ -60,8 +64,8 @@ $this->headTitle("Liste des grades");
                            <span class="icon users"></span>
                        Lister les agents
                    </a>
                <?php endif; ?>
            </td>
            <?php endif; ?>
        </tr>
    <?php endforeach; ?>
    </tbody>
Loading