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

Fix bug application-bloc et competence-bloc lorsque l'element est une formation

parent d6f5d143
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ use Application\Provider\Privilege\AgentPrivileges;
use Application\Provider\Privilege\FicheMetierPrivileges;
use Application\View\Helper\CompetenceBlocViewHelper;
use Formation\Entity\Db\Formation;
use Formation\Provider\Privilege\FormationPrivileges;
/**
* @see \Application\View\Helper\ApplicationBlocViewHelper
......@@ -39,10 +40,15 @@ $canAcquisModifier = false;
if ($objet instanceof FicheMetier) {
$canAcquisAfficher = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPrivileges::FICHEMETIER_AFFICHER));
$canAcquisModifier = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPrivileges::FICHEMETIER_MODIFIER));
} else {
if ($objet instanceof Formation) {
$canAcquisAfficher = $this->isAllowed(FormationPrivileges::getResourceId(FormationPrivileges::FORMATION_AFFICHER));
$canAcquisModifier = $this->isAllowed(FormationPrivileges::getResourceId(FormationPrivileges::FORMATION_MODIFIER));
} else {
$canAcquisAfficher = $this->isAllowed($objet, AgentPrivileges::AGENT_ACQUIS_AFFICHER);
$canAcquisModifier = $this->isAllowed($objet, AgentPrivileges::AGENT_ACQUIS_MODIFIER);
}
}
$canAfficher = (CompetenceBlocViewHelper::isActionActivee($options, 'afficher') AND $canAcquisAfficher);
$canAjouter = (CompetenceBlocViewHelper::isActionActivee($options, 'ajouter') AND $canAcquisModifier);
......
......@@ -12,6 +12,7 @@ use Application\Provider\Privilege\CompetencePrivileges;
use Application\Provider\Privilege\FicheMetierPrivileges;
use Application\View\Helper\CompetenceBlocViewHelper;
use Formation\Entity\Db\Formation;
use Formation\Provider\Privilege\FormationPrivileges;
/**
* @see \Application\View\Helper\CompetenceBlocViewHelper
......@@ -41,10 +42,15 @@ $canAcquisModifier = false;
if ($objet instanceof FicheMetier) {
$canAcquisAfficher = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPrivileges::FICHEMETIER_AFFICHER));
$canAcquisModifier = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPrivileges::FICHEMETIER_MODIFIER));
} else {
if ($objet instanceof Formation) {
$canAcquisAfficher = $this->isAllowed(FormationPrivileges::getResourceId(FormationPrivileges::FORMATION_AFFICHER));
$canAcquisModifier = $this->isAllowed(FormationPrivileges::getResourceId(FormationPrivileges::FORMATION_MODIFIER));
} else {
$canAcquisAfficher = $this->isAllowed($objet, AgentPrivileges::AGENT_ACQUIS_AFFICHER);
$canAcquisModifier = $this->isAllowed($objet, AgentPrivileges::AGENT_ACQUIS_MODIFIER);
}
}
$canAfficher = (CompetenceBlocViewHelper::isActionActivee($options, 'afficher') AND $canAcquisAfficher);
$canAjouter = (CompetenceBlocViewHelper::isActionActivee($options, 'ajouter') AND $canAcquisModifier);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment