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

Ajout de pribilege pour la gestion manuelle des chaines de validations

parent 46ebd2d2
No related branches found
No related tags found
No related merge requests found
INSERT INTO unicaen_privilege_categorie (code, libelle, namespace, ordre)
VALUES ('agent', 'Gestion des agents', 'Agent\Provider\Privilege', 100);
INSERT INTO unicaen_privilege_privilege(CATEGORIE_ID, CODE, LIBELLE, ORDRE)
WITH d(code, lib, ordre) AS (
SELECT 'agent_gerer_valideur_importe', 'Gérer les valideur·deuses importé·es', 60 UNION
SELECT 'agent_gerer_valideur_saisi', 'Gérer les valideur·deuses saisi·es', 70
)
SELECT cp.id, d.code, d.lib, d.ordre
FROM d
JOIN unicaen_privilege_categorie cp ON cp.CODE = 'agent';
\ No newline at end of file
...@@ -325,6 +325,8 @@ WITH d(code, lib, ordre) AS ( ...@@ -325,6 +325,8 @@ WITH d(code, lib, ordre) AS (
SELECT 'agent_index', 'Accéder à l''index', 0 UNION SELECT 'agent_index', 'Accéder à l''index', 0 UNION
SELECT 'agent_afficher', 'Afficher un agent', 10 UNION SELECT 'agent_afficher', 'Afficher un agent', 10 UNION
SELECT 'agent_modifier', 'Modifier un agent', 30 UNION SELECT 'agent_modifier', 'Modifier un agent', 30 UNION
SELECT 'agent_gerer_valideur_importe', 'Gérer les valideur·deuses importé·es', 60 UNION
SELECT 'agent_gerer_valideur_saisi', 'Gérer les valideur·deuses saisi·es', 70 UNION
SELECT 'agent_rechercher', 'Rechercher un agent', 100 UNION SELECT 'agent_rechercher', 'Rechercher un agent', 100 UNION
SELECT 'agent_mesagents', 'Menu - Mes Agent·es -', 200 SELECT 'agent_mesagents', 'Menu - Mes Agent·es -', 200
) )
......
...@@ -35,11 +35,19 @@ return [ ...@@ -35,11 +35,19 @@ return [
'ajouter', 'ajouter',
'modifier', 'modifier',
'supprimer', 'supprimer',
],
'privilege' => [
AgentPrivileges::getResourceId(AgentPrivileges::AGENT_GERER_VALIDEUR_IMPORTE),
],
],
[
'controller' => ValidateurController::class,
'action' => [
'historiser', 'historiser',
'restaurer', 'restaurer',
], ],
'privilege' => [ 'privilege' => [
AgentPrivileges::getResourceId(AgentPrivileges::AGENT_MODIFIER), AgentPrivileges::getResourceId(AgentPrivileges::AGENT_GERER_VALIDEUR_SAISI),
], ],
], ],
], ],
......
...@@ -11,4 +11,7 @@ class AgentPrivileges extends Privileges ...@@ -11,4 +11,7 @@ class AgentPrivileges extends Privileges
const AGENT_MODIFIER = 'agent-agent_modifier'; const AGENT_MODIFIER = 'agent-agent_modifier';
const AGENT_RECHERCHER = 'agent-agent_rechercher'; const AGENT_RECHERCHER = 'agent-agent_rechercher';
const AGENT_MESAGENTS = 'agent-agent_mesagents'; const AGENT_MESAGENTS = 'agent-agent_mesagents';
const AGENT_GERER_VALIDEUR_IMPORTE = 'agent-agent_gerer_valideur_importe';
const AGENT_GERER_VALIDEUR_SAISI = 'agent-agent_gerer_valideur_saisi';
} }
\ No newline at end of file
...@@ -27,6 +27,8 @@ $this->headTitle("Afficher l'agent " . $agent->getDenomination()); ...@@ -27,6 +27,8 @@ $this->headTitle("Afficher l'agent " . $agent->getDenomination());
$statuts = AgentStatut::generateStatutsArray($agentStatuts); $statuts = AgentStatut::generateStatutsArray($agentStatuts);
$canGererValideurSaisi = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges::AGENT_GERER_VALIDEUR_SAISI));
$canGererValideurImporte = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges::AGENT_GERER_VALIDEUR_IMPORTE));
$canModifier = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges::AGENT_MODIFIER)); $canModifier = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges::AGENT_MODIFIER));
?> ?>
...@@ -118,7 +120,7 @@ $canModifier = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges:: ...@@ -118,7 +120,7 @@ $canModifier = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges::
<?php endif; ?> <?php endif; ?>
<dt class="col-md-4"> Validateur·trices<br> <dt class="col-md-4"> Validateur·trices<br>
<?php if ($canModifier) : ?> <?php if ($canGererValideurSaisi) : ?>
<?php /** @see \Agent\Controller\ValidateurController::ajouterAction() */ ?> <?php /** @see \Agent\Controller\ValidateurController::ajouterAction() */ ?>
<a href="<?php echo $this->url('agent/validateur/ajouter', ['agent' => $agent->getId()], [], true); ?>" <a href="<?php echo $this->url('agent/validateur/ajouter', ['agent' => $agent->getId()], [], true); ?>"
class="btn btn-primary ajax-modal" data-event="modification"> class="btn btn-primary ajax-modal" data-event="modification">
...@@ -137,13 +139,13 @@ $canModifier = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges:: ...@@ -137,13 +139,13 @@ $canModifier = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges::
<?php else: ?> <?php else: ?>
<ul> <ul>
<?php foreach ($validateurs as $validateur) : ?> <?php foreach ($validateurs as $validateur) : ?>
<?php if (!$validateur->estHistorise() or $canModifier) : ?> <?php if (!$validateur->estHistorise() or $canGererValideurSaisi or $canGererValideurImporte) : ?>
<li <li
title="Sur la période du <?php echo $validateur->getDateDebut()->format('d/m/Y'); ?> au <?php echo $validateur->getDateFin() ? $validateur->getDateFin()->format('d/m/y') : " ---"; ?>"> title="Sur la période du <?php echo $validateur->getDateDebut()->format('d/m/Y'); ?> au <?php echo $validateur->getDateFin() ? $validateur->getDateFin()->format('d/m/y') : " ---"; ?>">
<span class="<?php if ($validateur->estHistorise()) echo "historise"; ?>"><?php echo $validateur->getValidateur()->getDenomination(); ?></span> <span class="<?php if ($validateur->estHistorise()) echo "historise"; ?>"><?php echo $validateur->getValidateur()->getDenomination(); ?></span>
<span <span
class="badge"> <?php echo $validateur->getSourceId(); ?> </span> class="badge"> <?php echo $validateur->getSourceId(); ?> </span>
<?php if ($validateur->getSourceId() === 'MES FORMATIONS' and $canModifier) : ?> <?php if ($validateur->getSourceId() === 'MES FORMATIONS' and $canGererValideurSaisi) : ?>
<?php /** @see \Agent\Controller\ValidateurController::modifierAction() */ ?> <?php /** @see \Agent\Controller\ValidateurController::modifierAction() */ ?>
<a href="<?php echo $this->url('agent/validateur/modifier', ['agent-validateur' => $validateur->getId()], [], true); ?>" <a href="<?php echo $this->url('agent/validateur/modifier', ['agent-validateur' => $validateur->getId()], [], true); ?>"
class="ajax-modal action primary" data-event="modification"> class="ajax-modal action primary" data-event="modification">
...@@ -157,6 +159,7 @@ $canModifier = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges:: ...@@ -157,6 +159,7 @@ $canModifier = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges::
Supprimer Supprimer
</a> </a>
<?php else : ?> <?php else : ?>
<?php if ($canGererValideurImporte AND $validateur->getSourceId() !== 'MES FORMATIONS') : ?>
<?php if ($validateur->estHistorise()) : ?> <?php if ($validateur->estHistorise()) : ?>
<?php /** @see \Agent\Controller\ValidateurController::restaurerAction() */ ?> <?php /** @see \Agent\Controller\ValidateurController::restaurerAction() */ ?>
<a href="<?php echo $this->url('agent/validateur/restaurer', ['agent-validateur' => $validateur->getId()], [], true); ?>" <a href="<?php echo $this->url('agent/validateur/restaurer', ['agent-validateur' => $validateur->getId()], [], true); ?>"
...@@ -172,6 +175,7 @@ $canModifier = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges:: ...@@ -172,6 +175,7 @@ $canModifier = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges::
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>
<?php endif; ?>
</li> </li>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
......
...@@ -89,7 +89,7 @@ if (!$displayDocument) $etatSize += 2; ...@@ -89,7 +89,7 @@ if (!$displayDocument) $etatSize += 2;
<?php if ($inscription->isRqth()) : ?> <?php if ($inscription->isRqth()) : ?>
<br> <br>
<span class="text-info" data-bs-toggle="tooltip" data-bs-html="true" <span class="text-info" data-bs-toggle="tooltip" data-bs-html="true"
title="<?php echo $inscription->getPrecisionRqth(); ?>"> title="<?php echo ($inscription->getPrecisionRqth())??"Aucune précision"; ?>">
<span class="icon icon-rqth"></span> <span class="icon icon-rqth"></span>
RQTH RQTH
</span> </span>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment