Skip to content
Snippets Groups Projects
Commit 4ad70315 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Merge branch 'master' of https://git.unicaen.fr/lib/unicaen/privilege into HEAD

parents e07e5c2c c396b136
Branches
Tags 8.1.1
No related merge requests found
Pipeline #22764 passed
......@@ -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é
......@@ -120,6 +120,7 @@ return [
'options' => [
'route' => '/privilege',
'defaults' => [
/** @see PrivilegeController::indexAction() */
'controller' => PrivilegeController::class,
'action' => 'index',
],
......
......@@ -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;
}
}
......
......@@ -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)
);
}
......
<?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) : ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment