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

Correction bug d'affichage sur le tableau d'affectation lorsque deux...

Correction bug d'affichage sur le tableau d'affectation lorsque deux catégories possèdent le même libellé
parent 02c77714
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -6,3 +6,7 @@ Journal des modifications
- Mise en place du changelog
- Réintégration de l'AssertionFactory, à utiliser pour les assertions
- [Fix] erreur ns \InvalidArgumentException : \ ajouté

5.0.7 (05/05/2023)
-----
- Correction bug d'affichage sur le tableau d'affectation lorsque deux catégories possèdent le même libellé
+1 −0
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ return [
                'options' => [
                    'route' => '/privilege',
                    'defaults' => [
                        /** @see PrivilegeController::indexAction() */
                        'controller' => PrivilegeController::class,
                        'action' => 'index',
                    ],
+1 −1
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ class PrivilegeService extends CommonService implements PrivilegeProviderInterfa
        foreach ($categories as $c) {
            $privileges = $this->findByCategorie($c);
            if(count($privileges) > 0) {
                $privilegesByCategorie[$c->getLibelle()] = $privileges;
                $privilegesByCategorie[$c->getId()] = $privileges;
            }
        }

+2 −1
Original line number Diff line number Diff line
@@ -90,9 +90,10 @@ class PrivilegeViewHelper extends AbstractHelper
    public function renderStatut($role)
    {
        $check = $this->privilege->hasRole($role);
        $html = '<td class="role-privilege-statut text-center %s" style="border-right: 1px solid #ddd;">%s</td>';
        $html = '<td class="role-privilege-statut text-center %s" style="border-right: 1px solid #ddd;" title="%s">%s</td>';
        return sprintf($html,
            $check ? 'success' : 'danger',
            ($check? 'Ajouter' : 'Retirer') . " le privilège [".$this->privilege->getCategorie()->getLibelle()."|".$this->privilege->getLibelle()."] au rôle [".$role->getLibelle()."]",
            $check ? $this->renderLienSupprimer($role) : $this->renderLienAjouter($role)
        );
    }
+6 −6
Original line number Diff line number Diff line
<?php

use UnicaenAuth\Entity\Db\RoleInterface;
use UnicaenPrivilege\Entity\Db\PrivilegeInterface;
use UnicaenPrivilege\Form\Privilege\CategorieFiltreForm;
use UnicaenPrivilege\Provider\Privilege\PrivilegePrivileges;
use UnicaenUtilisateur\Entity\Db\RoleInterface;

/**
 * @var RoleInterface[] $roles
@@ -89,11 +88,12 @@ $this->headTitle("Gestion des privilèges");
            </tr>
            </thead>
            <tbody>
            <?php foreach ($privilegesByCategorie as $libelleCategorie => $privileges) : ?>
            <?php foreach ($privilegesByCategorie as $categorieId => $privileges) : ?>
                <tr>
                    <th id="<?php echo current($privileges)->getCategorie()->getId(); ?>" class="categorie"
                        colspan="<?php echo 1 + count($roles); ?>"><?php echo $libelleCategorie; ?> <i
                                class="fas fa-caret-square-down text-muted"></i></th>
                    <th id="<?php echo $categorieId; ?>" class="categorie" colspan="<?php echo 1 + count($roles); ?>">
                        <?php echo current($privileges)->getCategorie()->getLibelle(); ?>
                        <i class="fas fa-caret-square-down text-muted"></i>
                    </th>
                </tr>
                <?php /** @var PrivilegeInterface $privilege */ ?>
                <?php foreach ($privileges as $privilege) : ?>