Loading data/privileges.php +15 −18 Original line number Diff line number Diff line Loading @@ -19,9 +19,6 @@ return [ 'grands-types-diplome-edition' => 'Grands types de diplômes (édition)', 'types-diplome-visualisation' => 'Types de diplômes (visualisation)', 'types-diplome-edition' => 'Types de diplômes (édition)', 'element-cc-edition' => 'Enseignements - Centre de coût - Édition', 'element-modulateur-edition' => 'Enseignements - Modulateur - Édition', 'element-modulateur-cc-visualisation' => 'Enseignement - Centre de coût et Modulateur - Visualisation', ], ], Loading module/Application/config/offre-formation.config.php +10 −13 Original line number Diff line number Diff line Loading @@ -2,9 +2,11 @@ namespace Application; use Application\Form\OffreFormation\ElementModulateurCCSaisie; use Application\Provider\Privilege\Privileges; use UnicaenAuth\Guard\PrivilegeController; use UnicaenAuth\Provider\Rule\PrivilegeRuleProvider; use Zend\Form\Form; return [ 'router' => [ Loading Loading @@ -103,15 +105,15 @@ return [ ], ], 'voir-modulateurs-centres-couts' => [ 'modulateurs-centres-couts' => [ 'type' => 'Segment', 'options' => [ 'route' => '/voir-modulateurs-centres-couts/:elementPedagogique', 'route' => '/modulateurs-centres-couts/:elementPedagogique', 'constraints' => [ 'elementPedagogique' => '[0-9]*', ], 'defaults' => [ 'action' => 'voir-modulateurs-centres-couts', 'action' => 'modulateurs-centres-couts', ], ], ], Loading Loading @@ -278,11 +280,10 @@ return [ ], [ 'controller' => 'Application\Controller\OffreFormation\ElementPedagogique', 'action' => ['voir-modulateurs-centres-couts'], 'action' => ['modulateurs-centres-couts'], 'privileges' => [ Privileges::ODF_ELEMENT_CC_EDITION, Privileges::ODF_ELEMENT_MODULATEUR_EDITION, Privileges::ODF_ELEMENT_MODULATEUR_CC_VISUALISATION, Privileges::ODF_CENTRES_COUT_EDITION, Privileges::ODF_MODULATEURS_EDITION, ], ], Loading Loading @@ -353,11 +354,6 @@ return [ 'resources' => ['Etape', 'Structure', 'ElementPedagogique', 'VolumeHoraireEns', 'TypeIntervention'], 'assertion' => Assertion\OffreDeFormationAssertion::class, ], [ 'privileges' => Privileges::ODF_ELEMENT_MODULATEUR_CC_VISUALISATION, 'resources' => ['Etape', 'Structure', 'ElementPedagogique', 'CentreCoutEp', 'ElementModulateur'], 'assertion' => Assertion\OffreDeFormationAssertion::class, ], ], ], ], Loading Loading @@ -397,6 +393,7 @@ return [ Form\OffreFormation\EtapeSaisie::class => Form\OffreFormation\EtapeSaisie::class, Form\OffreFormation\ElementPedagogiqueSaisie::class => Form\OffreFormation\ElementPedagogiqueSaisie::class, Form\OffreFormation\EtapeModulateursSaisie::class => Form\OffreFormation\EtapeModulateursSaisie::class, Form\OffreFormation\ElementModulateurCCSaisie::class => Form\OffreFormation\ElementModulateurCCSaisie::class, Form\OffreFormation\ElementModulateursFieldset::class => Form\OffreFormation\ElementModulateursFieldset::class, Form\OffreFormation\EtapeCentreCout\EtapeCentreCoutForm::class => Form\OffreFormation\EtapeCentreCout\EtapeCentreCoutForm::class, Form\OffreFormation\EtapeCentreCout\ElementCentreCoutFieldset::class => Form\OffreFormation\EtapeCentreCout\ElementCentreCoutFieldset::class, Loading module/Application/src/Application/Controller/OffreFormation/ElementPedagogiqueController.php +5 −19 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ namespace Application\Controller\OffreFormation; use Application\Controller\AbstractController; use Application\Entity\Db\ElementPedagogique; use Application\Filter\FloatFromString; use Application\Form\OffreFormation\Traits\ElementModulateursSaisieAwareTrait; use Application\Form\OffreFormation\Traits\ElementModulateurCCSaisieAwareTrait; use Application\Form\OffreFormation\Traits\ElementPedagogiqueSaisieAwareTrait; use Application\Form\OffreFormation\Traits\VolumeHoraireEnsFormAwareTrait; use Application\Provider\Privilege\Privileges; Loading @@ -24,7 +24,7 @@ class ElementPedagogiqueController extends AbstractController use ContextServiceAwareTrait; use VolumeHoraireEnsFormAwareTrait; use VolumeHoraireEnsServiceAwareTrait; use ElementModulateursSaisieAwareTrait; use ElementModulateurCCSaisieAwareTrait; Loading Loading @@ -259,12 +259,12 @@ class ElementPedagogiqueController extends AbstractController public function voirModulateursCentresCoutsAction() public function modulateursCentresCoutsAction() { $element = $this->getEvent()->getParam('elementPedagogique'); $modulateurs = $element->getElementModulateur(); $form = $this->getFormOffreFormationElementModulateurSaisie(); $form = $this->getFormOffreFormationElementModulateurCCSaisie(); $form->setElement($element); $form->setAttribute('action', $this->url()->fromRoute('of/element/volume-horaire', ['elementPedagogique' => $element->getId()])); $form->build(); Loading @@ -277,18 +277,4 @@ class ElementPedagogiqueController extends AbstractController ]; } public function modifierModulateurAction() { $this->em()->getFilters()->enable('historique')->init([ \Application\Entity\Db\Modulateur::class, \Application\Entity\Db\CentreCoutEp::class, ]); $element = $this->getEvent()->getParam('elementPedagogique'); return []; } } module/Application/src/Application/Form/OffreFormation/ElementModulateursSaisie.php→module/Application/src/Application/Form/OffreFormation/ElementModulateurCCSaisie.php +27 −8 Original line number Diff line number Diff line Loading @@ -11,20 +11,20 @@ use Application\Service\Traits\ElementPedagogiqueServiceAwareTrait; use Zend\Form\Element\Select; /** * Description of ElementModulateursSaisie * Description of ElementModulateurSaisie * * @author Antony Le Courtes <antony.lecourtes@unicaen.fr> */ class ElementModulateursSaisie extends AbstractForm class ElementModulateurCCSaisie extends AbstractForm { use TypeModulateurServiceAwareTrait; use ElementPedagogiqueServiceAwareTrait; use ElementModulateursFieldsetAwareTrait; /** * Etape * Element * * @var Etape * @var Element */ protected $element; Loading @@ -32,7 +32,7 @@ class ElementModulateursSaisie extends AbstractForm public function __construct($name = null, $options = []) { if (!$name) $name = "element-modulateurs-saisie"; if (!$name) $name = "element-modulateur-cc-saisie"; parent::__construct($name, $options); } Loading @@ -41,7 +41,7 @@ class ElementModulateursSaisie extends AbstractForm public function init() { $this->setAttribute('class', 'element-modulateurs'); $this->setAttribute('class', 'element-modulateur-cc'); $this->setAttribute('action', $this->getCurrentUrl()); $this->add([ Loading Loading @@ -70,15 +70,27 @@ class ElementModulateursSaisie extends AbstractForm $typeModulateur = $elementModulateur->getModulateur()->getTypeModulateur(); $modulateurs = $typeModulateur->getModulateur(); foreach ($modulateurs as $m) { $modulateursValues[$typeModulateur->getCode()][] = $m->getLibelle(); $modulateursValues[$typeModulateur->getCode()][$m->getId()] = $m->getLibelle(); } } $elementCentresCouts = $element->getCentreCoutEp(); $typesHeures = $element->getTypeHeures(); foreach ($typesHeures as $type) { $libelle[] = $type->getLibelleCourt(); } //Récupération des centres de coût pour chaque type d'heure //Select pour le modulateur de l'élément pédagogique $select = new Select('modulateur'); $select->setLabel($typeModulateur->getLibelle() . " : "); $select->setValueOptions($modulateursValues[$typeModulateur->getCode()]); $select->setValue(3); $select->setValue(1); $this->add($select); //Select pour le centre de cout de l'élément pédagogique $this->add([ 'name' => 'id', Loading Loading @@ -140,4 +152,11 @@ class ElementModulateursSaisie extends AbstractForm return $this; } public function getInputFilterSpecification() { } } No newline at end of file module/Application/src/Application/Form/OffreFormation/Traits/ElementModulateursSaisieAwareTrait.php→module/Application/src/Application/Form/OffreFormation/Traits/ElementModulateurCCSaisieAwareTrait.php +14 −13 Original line number Diff line number Diff line Loading @@ -2,30 +2,31 @@ namespace Application\Form\OffreFormation\Traits; use Application\Form\OffreFormation\ElementModulateursSaisie; use Application\Form\OffreFormation\ElementModulateurCCSaisie; /** * Description of ElementModulateurSaisieAwareTrait * Description of ElementModulateurCCSaisieAwareTrait * * @author UnicaenCode */ trait ElementModulateursSaisieAwareTrait trait ElementModulateurCCSaisieAwareTrait { /** * @var ElementModulateurSaisie * @var ElementModulateurCCSaisie */ private $formOffreFormationElementModulateurSaisie; private $formOffreFormationElementModulateurCCSaisie; /** * @param ElementModulateurSaisie $formOffreFormationElementModulateurSaisie * @param ElementModulateurSaisie $formOffreFormationElementModulateurCCSaisie * * @return self */ public function setFormOffreFormationElementModulateurSaisie(ElementModulateurSaisie $formOffreFormationElementModulateurSaisie) public function setFormOffreFormationElementModulateurCCSaisie(ElementModulateurSaisie $formOffreFormationElementModulateurCCSaisie) { $this->formOffreFormationElementModulateurSaisie = $formOffreFormationElementModulateurSaisie; $this->formOffreFormationElementModulateurCCSaisie = $formOffreFormationElementModulateurCCSaisie; return $this; } Loading @@ -35,14 +36,14 @@ trait ElementModulateursSaisieAwareTrait /** * Retourne un nouveau formulaire ou fieldset systématiquement, sauf si ce dernier a été fourni manuellement. * * @return ElementModulateurSaisie * @return ElementModulateurCCSaisie */ public function getFormOffreFormationElementModulateurSaisie() public function getFormOffreFormationElementModulateurCCSaisie() { if (!empty($this->formOffreFormationElementModulateurSaisie)) { return $this->formOffreFormationElementModulateurSaisie; if (!empty($this->formOffreFormationElementModulateurCCSaisie)) { return $this->formOffreFormationElementModulateurCCSaisie; } return \Application::$container->get('FormElementManager')->get(ElementModulateursSaisie::class); return \Application::$container->get('FormElementManager')->get(ElementModulateurCCSaisie::class); } } No newline at end of file Loading
data/privileges.php +15 −18 Original line number Diff line number Diff line Loading @@ -19,9 +19,6 @@ return [ 'grands-types-diplome-edition' => 'Grands types de diplômes (édition)', 'types-diplome-visualisation' => 'Types de diplômes (visualisation)', 'types-diplome-edition' => 'Types de diplômes (édition)', 'element-cc-edition' => 'Enseignements - Centre de coût - Édition', 'element-modulateur-edition' => 'Enseignements - Modulateur - Édition', 'element-modulateur-cc-visualisation' => 'Enseignement - Centre de coût et Modulateur - Visualisation', ], ], Loading
module/Application/config/offre-formation.config.php +10 −13 Original line number Diff line number Diff line Loading @@ -2,9 +2,11 @@ namespace Application; use Application\Form\OffreFormation\ElementModulateurCCSaisie; use Application\Provider\Privilege\Privileges; use UnicaenAuth\Guard\PrivilegeController; use UnicaenAuth\Provider\Rule\PrivilegeRuleProvider; use Zend\Form\Form; return [ 'router' => [ Loading Loading @@ -103,15 +105,15 @@ return [ ], ], 'voir-modulateurs-centres-couts' => [ 'modulateurs-centres-couts' => [ 'type' => 'Segment', 'options' => [ 'route' => '/voir-modulateurs-centres-couts/:elementPedagogique', 'route' => '/modulateurs-centres-couts/:elementPedagogique', 'constraints' => [ 'elementPedagogique' => '[0-9]*', ], 'defaults' => [ 'action' => 'voir-modulateurs-centres-couts', 'action' => 'modulateurs-centres-couts', ], ], ], Loading Loading @@ -278,11 +280,10 @@ return [ ], [ 'controller' => 'Application\Controller\OffreFormation\ElementPedagogique', 'action' => ['voir-modulateurs-centres-couts'], 'action' => ['modulateurs-centres-couts'], 'privileges' => [ Privileges::ODF_ELEMENT_CC_EDITION, Privileges::ODF_ELEMENT_MODULATEUR_EDITION, Privileges::ODF_ELEMENT_MODULATEUR_CC_VISUALISATION, Privileges::ODF_CENTRES_COUT_EDITION, Privileges::ODF_MODULATEURS_EDITION, ], ], Loading Loading @@ -353,11 +354,6 @@ return [ 'resources' => ['Etape', 'Structure', 'ElementPedagogique', 'VolumeHoraireEns', 'TypeIntervention'], 'assertion' => Assertion\OffreDeFormationAssertion::class, ], [ 'privileges' => Privileges::ODF_ELEMENT_MODULATEUR_CC_VISUALISATION, 'resources' => ['Etape', 'Structure', 'ElementPedagogique', 'CentreCoutEp', 'ElementModulateur'], 'assertion' => Assertion\OffreDeFormationAssertion::class, ], ], ], ], Loading Loading @@ -397,6 +393,7 @@ return [ Form\OffreFormation\EtapeSaisie::class => Form\OffreFormation\EtapeSaisie::class, Form\OffreFormation\ElementPedagogiqueSaisie::class => Form\OffreFormation\ElementPedagogiqueSaisie::class, Form\OffreFormation\EtapeModulateursSaisie::class => Form\OffreFormation\EtapeModulateursSaisie::class, Form\OffreFormation\ElementModulateurCCSaisie::class => Form\OffreFormation\ElementModulateurCCSaisie::class, Form\OffreFormation\ElementModulateursFieldset::class => Form\OffreFormation\ElementModulateursFieldset::class, Form\OffreFormation\EtapeCentreCout\EtapeCentreCoutForm::class => Form\OffreFormation\EtapeCentreCout\EtapeCentreCoutForm::class, Form\OffreFormation\EtapeCentreCout\ElementCentreCoutFieldset::class => Form\OffreFormation\EtapeCentreCout\ElementCentreCoutFieldset::class, Loading
module/Application/src/Application/Controller/OffreFormation/ElementPedagogiqueController.php +5 −19 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ namespace Application\Controller\OffreFormation; use Application\Controller\AbstractController; use Application\Entity\Db\ElementPedagogique; use Application\Filter\FloatFromString; use Application\Form\OffreFormation\Traits\ElementModulateursSaisieAwareTrait; use Application\Form\OffreFormation\Traits\ElementModulateurCCSaisieAwareTrait; use Application\Form\OffreFormation\Traits\ElementPedagogiqueSaisieAwareTrait; use Application\Form\OffreFormation\Traits\VolumeHoraireEnsFormAwareTrait; use Application\Provider\Privilege\Privileges; Loading @@ -24,7 +24,7 @@ class ElementPedagogiqueController extends AbstractController use ContextServiceAwareTrait; use VolumeHoraireEnsFormAwareTrait; use VolumeHoraireEnsServiceAwareTrait; use ElementModulateursSaisieAwareTrait; use ElementModulateurCCSaisieAwareTrait; Loading Loading @@ -259,12 +259,12 @@ class ElementPedagogiqueController extends AbstractController public function voirModulateursCentresCoutsAction() public function modulateursCentresCoutsAction() { $element = $this->getEvent()->getParam('elementPedagogique'); $modulateurs = $element->getElementModulateur(); $form = $this->getFormOffreFormationElementModulateurSaisie(); $form = $this->getFormOffreFormationElementModulateurCCSaisie(); $form->setElement($element); $form->setAttribute('action', $this->url()->fromRoute('of/element/volume-horaire', ['elementPedagogique' => $element->getId()])); $form->build(); Loading @@ -277,18 +277,4 @@ class ElementPedagogiqueController extends AbstractController ]; } public function modifierModulateurAction() { $this->em()->getFilters()->enable('historique')->init([ \Application\Entity\Db\Modulateur::class, \Application\Entity\Db\CentreCoutEp::class, ]); $element = $this->getEvent()->getParam('elementPedagogique'); return []; } }
module/Application/src/Application/Form/OffreFormation/ElementModulateursSaisie.php→module/Application/src/Application/Form/OffreFormation/ElementModulateurCCSaisie.php +27 −8 Original line number Diff line number Diff line Loading @@ -11,20 +11,20 @@ use Application\Service\Traits\ElementPedagogiqueServiceAwareTrait; use Zend\Form\Element\Select; /** * Description of ElementModulateursSaisie * Description of ElementModulateurSaisie * * @author Antony Le Courtes <antony.lecourtes@unicaen.fr> */ class ElementModulateursSaisie extends AbstractForm class ElementModulateurCCSaisie extends AbstractForm { use TypeModulateurServiceAwareTrait; use ElementPedagogiqueServiceAwareTrait; use ElementModulateursFieldsetAwareTrait; /** * Etape * Element * * @var Etape * @var Element */ protected $element; Loading @@ -32,7 +32,7 @@ class ElementModulateursSaisie extends AbstractForm public function __construct($name = null, $options = []) { if (!$name) $name = "element-modulateurs-saisie"; if (!$name) $name = "element-modulateur-cc-saisie"; parent::__construct($name, $options); } Loading @@ -41,7 +41,7 @@ class ElementModulateursSaisie extends AbstractForm public function init() { $this->setAttribute('class', 'element-modulateurs'); $this->setAttribute('class', 'element-modulateur-cc'); $this->setAttribute('action', $this->getCurrentUrl()); $this->add([ Loading Loading @@ -70,15 +70,27 @@ class ElementModulateursSaisie extends AbstractForm $typeModulateur = $elementModulateur->getModulateur()->getTypeModulateur(); $modulateurs = $typeModulateur->getModulateur(); foreach ($modulateurs as $m) { $modulateursValues[$typeModulateur->getCode()][] = $m->getLibelle(); $modulateursValues[$typeModulateur->getCode()][$m->getId()] = $m->getLibelle(); } } $elementCentresCouts = $element->getCentreCoutEp(); $typesHeures = $element->getTypeHeures(); foreach ($typesHeures as $type) { $libelle[] = $type->getLibelleCourt(); } //Récupération des centres de coût pour chaque type d'heure //Select pour le modulateur de l'élément pédagogique $select = new Select('modulateur'); $select->setLabel($typeModulateur->getLibelle() . " : "); $select->setValueOptions($modulateursValues[$typeModulateur->getCode()]); $select->setValue(3); $select->setValue(1); $this->add($select); //Select pour le centre de cout de l'élément pédagogique $this->add([ 'name' => 'id', Loading Loading @@ -140,4 +152,11 @@ class ElementModulateursSaisie extends AbstractForm return $this; } public function getInputFilterSpecification() { } } No newline at end of file
module/Application/src/Application/Form/OffreFormation/Traits/ElementModulateursSaisieAwareTrait.php→module/Application/src/Application/Form/OffreFormation/Traits/ElementModulateurCCSaisieAwareTrait.php +14 −13 Original line number Diff line number Diff line Loading @@ -2,30 +2,31 @@ namespace Application\Form\OffreFormation\Traits; use Application\Form\OffreFormation\ElementModulateursSaisie; use Application\Form\OffreFormation\ElementModulateurCCSaisie; /** * Description of ElementModulateurSaisieAwareTrait * Description of ElementModulateurCCSaisieAwareTrait * * @author UnicaenCode */ trait ElementModulateursSaisieAwareTrait trait ElementModulateurCCSaisieAwareTrait { /** * @var ElementModulateurSaisie * @var ElementModulateurCCSaisie */ private $formOffreFormationElementModulateurSaisie; private $formOffreFormationElementModulateurCCSaisie; /** * @param ElementModulateurSaisie $formOffreFormationElementModulateurSaisie * @param ElementModulateurSaisie $formOffreFormationElementModulateurCCSaisie * * @return self */ public function setFormOffreFormationElementModulateurSaisie(ElementModulateurSaisie $formOffreFormationElementModulateurSaisie) public function setFormOffreFormationElementModulateurCCSaisie(ElementModulateurSaisie $formOffreFormationElementModulateurCCSaisie) { $this->formOffreFormationElementModulateurSaisie = $formOffreFormationElementModulateurSaisie; $this->formOffreFormationElementModulateurCCSaisie = $formOffreFormationElementModulateurCCSaisie; return $this; } Loading @@ -35,14 +36,14 @@ trait ElementModulateursSaisieAwareTrait /** * Retourne un nouveau formulaire ou fieldset systématiquement, sauf si ce dernier a été fourni manuellement. * * @return ElementModulateurSaisie * @return ElementModulateurCCSaisie */ public function getFormOffreFormationElementModulateurSaisie() public function getFormOffreFormationElementModulateurCCSaisie() { if (!empty($this->formOffreFormationElementModulateurSaisie)) { return $this->formOffreFormationElementModulateurSaisie; if (!empty($this->formOffreFormationElementModulateurCCSaisie)) { return $this->formOffreFormationElementModulateurCCSaisie; } return \Application::$container->get('FormElementManager')->get(ElementModulateursSaisie::class); return \Application::$container->get('FormElementManager')->get(ElementModulateurCCSaisie::class); } } No newline at end of file