Commit 172c5878 authored by root's avatar root
Browse files

Diverses modifications en attendant la verstion Php 8

parent fc18b3bb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6,3 +6,4 @@ composer.lock
vendor
!/public/vendor
/public/css/local.css
/public/css/logos.css
+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ return [
                        'rechercher-gestionnaire',
                    ],
                    'privileges' => [
                        AgentPrivileges::AGENT_AFFICHER,
                        AgentPrivileges::AGENT_RECHERCHER,
                    ],
                ],
                [
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ class AgentPrivileges extends Privileges
    const AGENT_AJOUTER           = 'agent-agent_ajouter';
    const AGENT_EDITER            = 'agent-agent_editer';
    const AGENT_EFFACER           = 'agent-agent_effacer';
    const AGENT_RECHERCHER           = 'agent-agent_rechercher';

    const AGENT_ELEMENT_VOIR                = 'agent-agent_element_voir';
    const AGENT_ELEMENT_AJOUTER             = 'agent-agent_element_ajouter';
+13 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ return [
                    'controller' => CorpsController::class,
                    'action' => [
                        'modifier-niveaux',
                        'toggle-superieur-autorite',
                    ],
                    'privileges' => [
                        CorpsPrivileges::CORPS_MODIFIER,
@@ -104,6 +105,18 @@ return [
                        ],
                        'may_terminate' => true,
                    ],
                    'toggle-superieur-autorite' => [
                        'type'  => Segment::class,
                        'options' => [
                            'route'    => '/toggle-superieur-autorite/:corps',
                            'defaults' => [
                                /** @see CorpsController::toggleSuperieurAutoriteAction() */
                                'controller' => CorpsController::class,
                                'action'     => 'toggle-superieur-autorite',
                            ],
                        ],
                        'may_terminate' => true,
                    ],
                ],
            ],
        ],
+10 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ use Carriere\Provider\Parametre\CarriereParametres;
use Carriere\Service\Categorie\CategorieServiceAwareTrait;
use Carriere\Service\Corps\CorpsServiceAwareTrait;
use Carriere\Service\NiveauEnveloppe\NiveauEnveloppeServiceAwareTrait;
use Laminas\Http\Response;
use UnicaenParametre\Service\Parametre\ParametreServiceAwareTrait;
use Laminas\Mvc\Controller\AbstractActionController;
use Laminas\View\Model\ViewModel;
@@ -87,4 +88,13 @@ class CorpsController extends AbstractActionController {
        $vm->setTemplate('default/default-form');
        return $vm;
    }

    public function toggleSuperieurAutoriteAction(): Response
    {
        $corps = $this->getCorpsService()->getRequestedCorps($this);
        $corps->setSuperieurAsAutorite(!$corps->isSuperieurAsAutorite());
        $this->getCorpsService()->update($corps);

        return $this->redirect()->toRoute('corps', [], [],true);
    }
}
 No newline at end of file
Loading