Loading module/Application/config/merged/application.config.php +0 −12 Changes for module/Application/config/merged/application.config.php: 0 added lines, 12 removed lines. Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ return [ 'modifier-groupe', 'historiser-groupe', 'restaurer-groupe', 'changer-niveau', ], 'privileges' => [ ApplicationPrivileges::APPLICATION_EDITER, Loading Loading @@ -127,17 +126,6 @@ return [ ], 'may_terminate' => true, 'child_routes' => [ 'changer-niveau' => [ 'type' => Segment::class, 'options' => [ 'route' => '/changer-niveau/:application-element[/:clef]', 'defaults' => [ 'controller' => ApplicationController::class, 'action' => 'changer-niveau', ], ], 'may_terminate' => true, ], 'groupe' => [ 'type' => Literal::class, 'may_terminate' => false, Loading module/Application/config/merged/competence.config.php +0 −20 Changes for module/Application/config/merged/competence.config.php: 0 added lines, 20 removed lines. Original line number Diff line number Diff line Loading @@ -152,15 +152,6 @@ return [ CompetencePrivileges::COMPETENCE_EFFACER, ], ], [ 'controller' => CompetenceController::class, 'action' => [ 'changer-niveau', ], 'privileges' => [ CompetencePrivileges::COMPETENCE_EFFACER, ], ], ], ], ], Loading @@ -178,17 +169,6 @@ return [ ], 'may_terminate' => true, 'child_routes' => [ 'changer-niveau' => [ 'type' => Segment::class, 'options' => [ 'route' => '/changer-niveau/:competence-element[/:clef]', 'defaults' => [ 'controller' => CompetenceController::class, 'action' => 'changer-niveau', ], ], 'may_terminate' => true, ], 'ajouter' => [ 'type' => Segment::class, 'options' => [ Loading module/Application/config/merged/element.config.php +23 −0 Changes for module/Application/config/merged/element.config.php: 23 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -4,8 +4,10 @@ namespace Application; use Application\Controller\ElementController; use Application\Controller\ElementControllerFactory; use Application\Provider\Privilege\AgentPrivileges; use Application\Provider\Privilege\ApplicationPrivileges; use Application\Provider\Privilege\CompetencePrivileges; use Application\Provider\Privilege\FicheMetierPrivileges; use Formation\Provider\Privilege\FormationPrivileges; use UnicaenPrivilege\Guard\PrivilegeController; use Zend\Router\Http\Literal; Loading Loading @@ -37,6 +39,16 @@ return [ FormationPrivileges::FORMATION_SUPPRIMER, ], ], [ 'controller' => ElementController::class, 'action' => [ 'changer-niveau', ], 'privileges' => [ AgentPrivileges::AGENT_ELEMENT_MODIFIER, FicheMetierPrivileges::FICHEMETIER_MODIFIER, ], ], ], ], ], Loading Loading @@ -75,6 +87,17 @@ return [ ], 'may_terminate' => true, ], 'changer-niveau' => [ 'type' => Segment::class, 'options' => [ 'route' => '/changer-niveau/:type/:id[/:clef]', 'defaults' => [ 'controller' => ElementController::class, 'action' => 'changer-niveau', ], ], 'may_terminate' => true, ], ], ], ], Loading module/Application/src/Application/Controller/CompetenceController.php +0 −28 Changes for module/Application/src/Application/Controller/CompetenceController.php: 0 added lines, 28 removed lines. Original line number Diff line number Diff line Loading @@ -505,32 +505,4 @@ class CompetenceController extends AbstractActionController } exit(); } /** Niveau de maitrise d'un */ public function changerNiveauAction() { $competenceElement = $this->getCompetenceElementService()->getRequestedCompetenceElement($this); $clef=$this->params()->fromRoute('clef'); $form = $this->getSelectionCompetenceMaitriseForm(); $form->setAttribute('action', $this->url()->fromRoute('competence/changer-niveau', ['competence-element' => $competenceElement->getId(), 'clef' => $clef], [], true)); $form->bind($competenceElement); if ($clef === 'masquer') $form->masquerClef(); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { $this->getCompetenceElementService()->update($competenceElement); } } $vm = new ViewModel([ 'title' => "Changer le niveau de maîtrise", 'form' => $form, ]); $vm->setTemplate('application/default/default-form'); return $vm; } } No newline at end of file module/Application/src/Application/Controller/ElementController.php +40 −0 Changes for module/Application/src/Application/Controller/ElementController.php: 40 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Application\Controller; use Application\Form\SelectionCompetenceMaitrise\SelectionCompetenceMaitriseFormAwareTrait; use Application\Service\ApplicationElement\ApplicationElementServiceAwareTrait; use Application\Service\CompetenceElement\CompetenceElementServiceAwareTrait; use Formation\Service\FormationElement\FormationElementServiceAwareTrait; Loading @@ -13,6 +14,7 @@ class ElementController extends AbstractActionController { use ApplicationElementServiceAwareTrait; use CompetenceElementServiceAwareTrait; use FormationElementServiceAwareTrait; use SelectionCompetenceMaitriseFormAwareTrait; const TYPE_APPLICATION = 'Application'; const TYPE_COMPETENCE = 'Competence'; Loading Loading @@ -85,4 +87,42 @@ class ElementController extends AbstractActionController { return $vm; } public function changerNiveauAction() { $elementType = $this->params()->fromRoute('type'); $elementId = $this->params()->fromRoute('id'); $clef=$this->params()->fromRoute('clef'); $element = null; $service = null; switch ($elementType) { case ElementController::TYPE_APPLICATION : $element = $this->getApplicationElementService()->getApplicationElement($elementId); $service = $this->getApplicationElementService(); break; case ElementController::TYPE_COMPETENCE : $element = $this->getCompetenceElementService()->getCompetenceElement($elementId); $service = $this->getCompetenceElementService(); break; } $form = $this->getSelectionCompetenceMaitriseForm(); $form->setAttribute('action', $this->url()->fromRoute('element/changer-niveau', ['type' => $elementType, 'id' => $element->getId(), 'clef' => $clef], [], true)); $form->bind($element); if ($clef === 'masquer') $form->masquerClef(); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { $service->update($element); } } $vm = new ViewModel([ 'title' => "Changer le niveau de maîtrise", 'form' => $form, ]); $vm->setTemplate('application/default/default-form'); return $vm; } } No newline at end of file Loading
module/Application/config/merged/application.config.php +0 −12 Changes for module/Application/config/merged/application.config.php: 0 added lines, 12 removed lines. Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ return [ 'modifier-groupe', 'historiser-groupe', 'restaurer-groupe', 'changer-niveau', ], 'privileges' => [ ApplicationPrivileges::APPLICATION_EDITER, Loading Loading @@ -127,17 +126,6 @@ return [ ], 'may_terminate' => true, 'child_routes' => [ 'changer-niveau' => [ 'type' => Segment::class, 'options' => [ 'route' => '/changer-niveau/:application-element[/:clef]', 'defaults' => [ 'controller' => ApplicationController::class, 'action' => 'changer-niveau', ], ], 'may_terminate' => true, ], 'groupe' => [ 'type' => Literal::class, 'may_terminate' => false, Loading
module/Application/config/merged/competence.config.php +0 −20 Changes for module/Application/config/merged/competence.config.php: 0 added lines, 20 removed lines. Original line number Diff line number Diff line Loading @@ -152,15 +152,6 @@ return [ CompetencePrivileges::COMPETENCE_EFFACER, ], ], [ 'controller' => CompetenceController::class, 'action' => [ 'changer-niveau', ], 'privileges' => [ CompetencePrivileges::COMPETENCE_EFFACER, ], ], ], ], ], Loading @@ -178,17 +169,6 @@ return [ ], 'may_terminate' => true, 'child_routes' => [ 'changer-niveau' => [ 'type' => Segment::class, 'options' => [ 'route' => '/changer-niveau/:competence-element[/:clef]', 'defaults' => [ 'controller' => CompetenceController::class, 'action' => 'changer-niveau', ], ], 'may_terminate' => true, ], 'ajouter' => [ 'type' => Segment::class, 'options' => [ Loading
module/Application/config/merged/element.config.php +23 −0 Changes for module/Application/config/merged/element.config.php: 23 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -4,8 +4,10 @@ namespace Application; use Application\Controller\ElementController; use Application\Controller\ElementControllerFactory; use Application\Provider\Privilege\AgentPrivileges; use Application\Provider\Privilege\ApplicationPrivileges; use Application\Provider\Privilege\CompetencePrivileges; use Application\Provider\Privilege\FicheMetierPrivileges; use Formation\Provider\Privilege\FormationPrivileges; use UnicaenPrivilege\Guard\PrivilegeController; use Zend\Router\Http\Literal; Loading Loading @@ -37,6 +39,16 @@ return [ FormationPrivileges::FORMATION_SUPPRIMER, ], ], [ 'controller' => ElementController::class, 'action' => [ 'changer-niveau', ], 'privileges' => [ AgentPrivileges::AGENT_ELEMENT_MODIFIER, FicheMetierPrivileges::FICHEMETIER_MODIFIER, ], ], ], ], ], Loading Loading @@ -75,6 +87,17 @@ return [ ], 'may_terminate' => true, ], 'changer-niveau' => [ 'type' => Segment::class, 'options' => [ 'route' => '/changer-niveau/:type/:id[/:clef]', 'defaults' => [ 'controller' => ElementController::class, 'action' => 'changer-niveau', ], ], 'may_terminate' => true, ], ], ], ], Loading
module/Application/src/Application/Controller/CompetenceController.php +0 −28 Changes for module/Application/src/Application/Controller/CompetenceController.php: 0 added lines, 28 removed lines. Original line number Diff line number Diff line Loading @@ -505,32 +505,4 @@ class CompetenceController extends AbstractActionController } exit(); } /** Niveau de maitrise d'un */ public function changerNiveauAction() { $competenceElement = $this->getCompetenceElementService()->getRequestedCompetenceElement($this); $clef=$this->params()->fromRoute('clef'); $form = $this->getSelectionCompetenceMaitriseForm(); $form->setAttribute('action', $this->url()->fromRoute('competence/changer-niveau', ['competence-element' => $competenceElement->getId(), 'clef' => $clef], [], true)); $form->bind($competenceElement); if ($clef === 'masquer') $form->masquerClef(); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { $this->getCompetenceElementService()->update($competenceElement); } } $vm = new ViewModel([ 'title' => "Changer le niveau de maîtrise", 'form' => $form, ]); $vm->setTemplate('application/default/default-form'); return $vm; } } No newline at end of file
module/Application/src/Application/Controller/ElementController.php +40 −0 Changes for module/Application/src/Application/Controller/ElementController.php: 40 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Application\Controller; use Application\Form\SelectionCompetenceMaitrise\SelectionCompetenceMaitriseFormAwareTrait; use Application\Service\ApplicationElement\ApplicationElementServiceAwareTrait; use Application\Service\CompetenceElement\CompetenceElementServiceAwareTrait; use Formation\Service\FormationElement\FormationElementServiceAwareTrait; Loading @@ -13,6 +14,7 @@ class ElementController extends AbstractActionController { use ApplicationElementServiceAwareTrait; use CompetenceElementServiceAwareTrait; use FormationElementServiceAwareTrait; use SelectionCompetenceMaitriseFormAwareTrait; const TYPE_APPLICATION = 'Application'; const TYPE_COMPETENCE = 'Competence'; Loading Loading @@ -85,4 +87,42 @@ class ElementController extends AbstractActionController { return $vm; } public function changerNiveauAction() { $elementType = $this->params()->fromRoute('type'); $elementId = $this->params()->fromRoute('id'); $clef=$this->params()->fromRoute('clef'); $element = null; $service = null; switch ($elementType) { case ElementController::TYPE_APPLICATION : $element = $this->getApplicationElementService()->getApplicationElement($elementId); $service = $this->getApplicationElementService(); break; case ElementController::TYPE_COMPETENCE : $element = $this->getCompetenceElementService()->getCompetenceElement($elementId); $service = $this->getCompetenceElementService(); break; } $form = $this->getSelectionCompetenceMaitriseForm(); $form->setAttribute('action', $this->url()->fromRoute('element/changer-niveau', ['type' => $elementType, 'id' => $element->getId(), 'clef' => $clef], [], true)); $form->bind($element); if ($clef === 'masquer') $form->masquerClef(); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { $service->update($element); } } $vm = new ViewModel([ 'title' => "Changer le niveau de maîtrise", 'form' => $form, ]); $vm->setTemplate('application/default/default-form'); return $vm; } } No newline at end of file