Loading module/Application/config/intervenant.config.php +28 −1 Changes for module/Application/config/intervenant.config.php: 28 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -249,6 +249,33 @@ return [ 'action' => 'validation-volume-horaire-type-intervenant', ], ], 'may_terminate' => true, 'child_routes' => [ 'delete' => [ 'type' => 'Segment', 'options' => [ 'route' => '/delete/:regleStructureValidation', 'constraints' => [ 'regleStructureValidation' => '[0-9]*', ], 'defaults' => [ 'action' => 'delete', ], ], ], 'saisie' => [ 'type' => 'Segment', 'options' => [ 'route' => '/saisie/[:regleStructureValidation]', 'constraints' => [ 'regleStructureValidation' => '[0-9]*', ], 'defaults' => [ 'action' => 'validation-volume-horaire-type-intervenant-saisie', ], ], ], ], ], ], ], Loading Loading @@ -446,7 +473,7 @@ return [ ], [ 'controller' => 'Application\Controller\Intervenant', 'action' => ['validation-volume-horaire-type-intervenant'], 'action' => ['validation-volume-horaire-type-intervenant', 'validation-volume-horaire-type-intervenant-saisie'], 'privileges' => [ Privileges::MODIF_SERVICE_DU_EDITION, ], Loading module/Application/src/Application/Controller/IntervenantController.php +32 −1 Changes for module/Application/src/Application/Controller/IntervenantController.php: 32 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -2,11 +2,13 @@ namespace Application\Controller; use Application\Entity\Db\RegleStructureValidation; use Application\Entity\Db\TypeVolumeHoraire; use Application\Entity\Db\Validation; use Application\Entity\Service\Recherche; use Application\Form\Intervenant\Traits\EditionFormAwareTrait; use Application\Form\Intervenant\Traits\HeuresCompFormAwareTrait; use Application\Form\Intervenant\Traits\RegleStructureValidationFormAwareTrait; use Application\Processus\Traits\IntervenantProcessusAwareTrait; use Application\Processus\Traits\PlafondProcessusAwareTrait; use Application\Processus\Traits\ServiceProcessusAwareTrait; Loading @@ -16,6 +18,7 @@ use Application\Service\Traits\CampagneSaisieServiceAwareTrait; use Application\Service\Traits\EtatVolumeHoraireServiceAwareTrait; use Application\Service\Traits\FormuleResultatServiceAwareTrait; use Application\Service\Traits\LocalContextServiceAwareTrait; use Application\Service\Traits\RegleStructureValidationServiceAwareTrait; use Application\Service\Traits\TypeVolumeHoraireServiceAwareTrait; use Application\Service\Traits\ValidationServiceAwareTrait; use Application\Service\Traits\WorkflowServiceAwareTrait; Loading Loading @@ -49,6 +52,8 @@ class IntervenantController extends AbstractController use ValidationServiceAwareTrait; use PlafondProcessusAwareTrait; use FormuleResultatServiceAwareTrait; use RegleStructureValidationServiceAwareTrait; use RegleStructureValidationFormAwareTrait; Loading Loading @@ -373,8 +378,34 @@ class IntervenantController extends AbstractController public function validationVolumeHoraireTypeIntervenantAction() { $serviceRVS = $this->getServiceRegleStructureValidation(); $listeRsv = $serviceRVS->getList(); return compact('listeRsv'); return []; } public function validationVolumeHoraireTypeIntervenantSaisieAction() { $regleStructureValidation = $this->getEvent()->getParam('regleStructureValidation'); $form = $this->getFormRegleStructureValidationSaisie(); if (empty($regleStructureValidation)) { $title = 'Création d\'une nouvelle régle'; $regleStructureValidation = $this->getServiceRegleStructureValidation()->newEntity(); } else { $title = 'Édition d\'une règle'; } $form->bindRequestSave($regleStructureValidation, $this->getRequest(), function (RegleStructureValidation $rsv) { try { $this->getServiceRegleStructureValidation()->save($rsv); $this->flashMessenger()->addSuccessMessage('Enregistrement effectué'); } catch (\Exception $e) { $this->flashMessenger()->addErrorMessage($this->translate($e)); } }); return compact('form', 'title'); } Loading module/Application/src/Application/Entity/Db/RegleStructureValidation.php +50 −2 Changes for module/Application/src/Application/Entity/Db/RegleStructureValidation.php: 50 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -10,8 +10,6 @@ use Application\Entity\Db\Traits\TypeVolumeHoraireAwareTrait; */ class RegleStructureValidation { use TypeVolumeHoraireAwareTrait; use TypeIntervenantAwareTrait; /** * @var integer Loading @@ -28,7 +26,16 @@ class RegleStructureValidation */ protected $message; /** * @var TypeVolumeHoraire */ protected $typeVolumeHoraire; /** * @var TypeIntervenant */ protected $typeIntervenant; /** * @return int Loading Loading @@ -100,4 +107,45 @@ class RegleStructureValidation return $this; } /** * @return TypeVolumeHoraire */ public function getTypeVolumeHoraire() { return $this->typeVolumeHoraire; } /** * @param TypeVolumeHoraire $typeVolumeHoraire */ public function setTypeVolumeHoraire(TypeVolumeHoraire $typeVolumeHoraire) { $this->typeVolumeHoraire = $typeVolumeHoraire; return $this; } /** * @return TypeIntervenant */ public function getTypeIntervenant() { return $this->typeIntervenant; } /** * @param TypeIntervenant $typeIntervenant */ public function setTypeIntervenant(TypeIntervenant $typeIntervenant) { $this->typeIntervenant = $typeIntervenant; return $this; } } module/Application/src/Application/Form/Intervenant/RegleStructureValidationForm.php +x+118 Changes for module/Application/src/Application/Form/Intervenant/RegleStructureValidationForm.php: 118 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Application\Form\Intervenant; use Application\Form\AbstractForm; use Application\Hydrator\RegleStructureValidationHydrator; use Application\Service\Traits\IntervenantServiceAwareTrait; use Application\Service\Traits\TypeIntervenantServiceAwareTrait; use Application\Service\Traits\TypeVolumeHoraireServiceAwareTrait; use Zend\Hydrator\HydratorInterface; /** * Description of RegleStructureValidationForm * * @author Antony LE COURTES <antony.lecourtes at unicaen.fr> */ class RegleStructureValidationForm extends AbstractForm { use TypeIntervenantServiceAwareTrait; use TypeVolumeHoraireServiceAwareTrait; public function init() { $hydrator = new RegleStructureValidationHydrator(); $this->setHydrator($hydrator); $this->setAttribute('action', $this->getCurrentUrl() ); $this->add([ 'name' => 'type-intervenant', 'options' => [ 'label' => 'Type intervenant', ], 'attributes' => [ 'class' => 'selectpicker', 'data-live-search' => 'false', ], 'type' => 'Select', ]); $this->add([ 'name' => 'type-volume-horaire', 'options' => [ 'label' => 'Type volume horaire', ], 'attributes' => [ 'class' => 'selectpicker', 'data-live-search' => 'false', ], 'type' => 'Select', ]); $this->get('type-volume-horaire') ->setValueOptions(\UnicaenApp\Util::collectionAsOptions($this->getServiceTypeVolumeHoraire()->getList())); $this->add([ 'name' => 'message', 'options' => [ 'label' => "Message", ], 'type' => 'Textarea', ]); $this->add([ 'name' => 'type-intervenant', 'options' => [ 'label' => 'Type intervenant', ], 'attributes' => [ 'class' => 'selectpicker', 'data-live-search' => 'false', ], 'type' => 'Select', ]); $this->get('type-intervenant') ->setValueOptions(\UnicaenApp\Util::collectionAsOptions($this->getServiceTypeIntervenant()->getList())); $this->add([ 'name' => 'priorite', 'options' => [ 'label' => 'Priorité', 'value_options' => [ 'affection' => 'Affection', 'enseignement' => 'Enseignement', ], ], 'attributes' => [ 'class' => 'selectpicker', 'data-live-search' => 'false', ], 'type' => 'Select', ]); $this->add(new \Zend\Form\Element\Csrf('security')); $this->add([ 'name' => 'submit', 'type' => 'Submit', 'attributes' => [ 'value' => 'Enregistrer', ], ]); return $this; } /** * Should return an array specification compatible with * {@link Zend\InputFilter\Factory::createInputFilter()}. * * @return array */ public function getInputFilterSpecification() { return []; } } No newline at end of file module/Application/src/Application/Form/Intervenant/Traits/RegleStructureValidationFormAwareTrait.php +47 Changes for module/Application/src/Application/Form/Intervenant/Traits/RegleStructureValidationFormAwareTrait.php: 47 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Application\Form\Intervenant\Traits; use Application\Form\Intervenant\RegleStructureValidationForm; /** * Description of RegleStructureValidationFormAwareTrait * * @author UnicaenCode */ trait RegleStructureValidationFormAwareTrait { /** * @var RegleStructureValidationForm */ private $formRegleStructureValidationSaisie; /** * @param RegleStructureValidationForm $formRegleStructureValidationSaisie * * @return self */ public function setFormRegleStructureValidationSaisie(RegleStructureValidationForm $formRegleStructureValidationSaisie) { $this->formRegleStructureValidationSaisie = $formRegleStructureValidationSaisie; return $this; } /** * * @return RegleStructureValidationForm */ public function getFormRegleStructureValidationSaisie() { if (!empty($this->formRegleStructureValidationSaisie)) { return $this->formRegleStructureValidationSaisie; } return \Application::$container->get('FormElementManager')->get(RegleStructureValidationForm::class); } } Loading
module/Application/config/intervenant.config.php +28 −1 Changes for module/Application/config/intervenant.config.php: 28 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -249,6 +249,33 @@ return [ 'action' => 'validation-volume-horaire-type-intervenant', ], ], 'may_terminate' => true, 'child_routes' => [ 'delete' => [ 'type' => 'Segment', 'options' => [ 'route' => '/delete/:regleStructureValidation', 'constraints' => [ 'regleStructureValidation' => '[0-9]*', ], 'defaults' => [ 'action' => 'delete', ], ], ], 'saisie' => [ 'type' => 'Segment', 'options' => [ 'route' => '/saisie/[:regleStructureValidation]', 'constraints' => [ 'regleStructureValidation' => '[0-9]*', ], 'defaults' => [ 'action' => 'validation-volume-horaire-type-intervenant-saisie', ], ], ], ], ], ], ], Loading Loading @@ -446,7 +473,7 @@ return [ ], [ 'controller' => 'Application\Controller\Intervenant', 'action' => ['validation-volume-horaire-type-intervenant'], 'action' => ['validation-volume-horaire-type-intervenant', 'validation-volume-horaire-type-intervenant-saisie'], 'privileges' => [ Privileges::MODIF_SERVICE_DU_EDITION, ], Loading
module/Application/src/Application/Controller/IntervenantController.php +32 −1 Changes for module/Application/src/Application/Controller/IntervenantController.php: 32 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -2,11 +2,13 @@ namespace Application\Controller; use Application\Entity\Db\RegleStructureValidation; use Application\Entity\Db\TypeVolumeHoraire; use Application\Entity\Db\Validation; use Application\Entity\Service\Recherche; use Application\Form\Intervenant\Traits\EditionFormAwareTrait; use Application\Form\Intervenant\Traits\HeuresCompFormAwareTrait; use Application\Form\Intervenant\Traits\RegleStructureValidationFormAwareTrait; use Application\Processus\Traits\IntervenantProcessusAwareTrait; use Application\Processus\Traits\PlafondProcessusAwareTrait; use Application\Processus\Traits\ServiceProcessusAwareTrait; Loading @@ -16,6 +18,7 @@ use Application\Service\Traits\CampagneSaisieServiceAwareTrait; use Application\Service\Traits\EtatVolumeHoraireServiceAwareTrait; use Application\Service\Traits\FormuleResultatServiceAwareTrait; use Application\Service\Traits\LocalContextServiceAwareTrait; use Application\Service\Traits\RegleStructureValidationServiceAwareTrait; use Application\Service\Traits\TypeVolumeHoraireServiceAwareTrait; use Application\Service\Traits\ValidationServiceAwareTrait; use Application\Service\Traits\WorkflowServiceAwareTrait; Loading Loading @@ -49,6 +52,8 @@ class IntervenantController extends AbstractController use ValidationServiceAwareTrait; use PlafondProcessusAwareTrait; use FormuleResultatServiceAwareTrait; use RegleStructureValidationServiceAwareTrait; use RegleStructureValidationFormAwareTrait; Loading Loading @@ -373,8 +378,34 @@ class IntervenantController extends AbstractController public function validationVolumeHoraireTypeIntervenantAction() { $serviceRVS = $this->getServiceRegleStructureValidation(); $listeRsv = $serviceRVS->getList(); return compact('listeRsv'); return []; } public function validationVolumeHoraireTypeIntervenantSaisieAction() { $regleStructureValidation = $this->getEvent()->getParam('regleStructureValidation'); $form = $this->getFormRegleStructureValidationSaisie(); if (empty($regleStructureValidation)) { $title = 'Création d\'une nouvelle régle'; $regleStructureValidation = $this->getServiceRegleStructureValidation()->newEntity(); } else { $title = 'Édition d\'une règle'; } $form->bindRequestSave($regleStructureValidation, $this->getRequest(), function (RegleStructureValidation $rsv) { try { $this->getServiceRegleStructureValidation()->save($rsv); $this->flashMessenger()->addSuccessMessage('Enregistrement effectué'); } catch (\Exception $e) { $this->flashMessenger()->addErrorMessage($this->translate($e)); } }); return compact('form', 'title'); } Loading
module/Application/src/Application/Entity/Db/RegleStructureValidation.php +50 −2 Changes for module/Application/src/Application/Entity/Db/RegleStructureValidation.php: 50 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -10,8 +10,6 @@ use Application\Entity\Db\Traits\TypeVolumeHoraireAwareTrait; */ class RegleStructureValidation { use TypeVolumeHoraireAwareTrait; use TypeIntervenantAwareTrait; /** * @var integer Loading @@ -28,7 +26,16 @@ class RegleStructureValidation */ protected $message; /** * @var TypeVolumeHoraire */ protected $typeVolumeHoraire; /** * @var TypeIntervenant */ protected $typeIntervenant; /** * @return int Loading Loading @@ -100,4 +107,45 @@ class RegleStructureValidation return $this; } /** * @return TypeVolumeHoraire */ public function getTypeVolumeHoraire() { return $this->typeVolumeHoraire; } /** * @param TypeVolumeHoraire $typeVolumeHoraire */ public function setTypeVolumeHoraire(TypeVolumeHoraire $typeVolumeHoraire) { $this->typeVolumeHoraire = $typeVolumeHoraire; return $this; } /** * @return TypeIntervenant */ public function getTypeIntervenant() { return $this->typeIntervenant; } /** * @param TypeIntervenant $typeIntervenant */ public function setTypeIntervenant(TypeIntervenant $typeIntervenant) { $this->typeIntervenant = $typeIntervenant; return $this; } }
module/Application/src/Application/Form/Intervenant/RegleStructureValidationForm.php +x+118 Changes for module/Application/src/Application/Form/Intervenant/RegleStructureValidationForm.php: 118 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Application\Form\Intervenant; use Application\Form\AbstractForm; use Application\Hydrator\RegleStructureValidationHydrator; use Application\Service\Traits\IntervenantServiceAwareTrait; use Application\Service\Traits\TypeIntervenantServiceAwareTrait; use Application\Service\Traits\TypeVolumeHoraireServiceAwareTrait; use Zend\Hydrator\HydratorInterface; /** * Description of RegleStructureValidationForm * * @author Antony LE COURTES <antony.lecourtes at unicaen.fr> */ class RegleStructureValidationForm extends AbstractForm { use TypeIntervenantServiceAwareTrait; use TypeVolumeHoraireServiceAwareTrait; public function init() { $hydrator = new RegleStructureValidationHydrator(); $this->setHydrator($hydrator); $this->setAttribute('action', $this->getCurrentUrl() ); $this->add([ 'name' => 'type-intervenant', 'options' => [ 'label' => 'Type intervenant', ], 'attributes' => [ 'class' => 'selectpicker', 'data-live-search' => 'false', ], 'type' => 'Select', ]); $this->add([ 'name' => 'type-volume-horaire', 'options' => [ 'label' => 'Type volume horaire', ], 'attributes' => [ 'class' => 'selectpicker', 'data-live-search' => 'false', ], 'type' => 'Select', ]); $this->get('type-volume-horaire') ->setValueOptions(\UnicaenApp\Util::collectionAsOptions($this->getServiceTypeVolumeHoraire()->getList())); $this->add([ 'name' => 'message', 'options' => [ 'label' => "Message", ], 'type' => 'Textarea', ]); $this->add([ 'name' => 'type-intervenant', 'options' => [ 'label' => 'Type intervenant', ], 'attributes' => [ 'class' => 'selectpicker', 'data-live-search' => 'false', ], 'type' => 'Select', ]); $this->get('type-intervenant') ->setValueOptions(\UnicaenApp\Util::collectionAsOptions($this->getServiceTypeIntervenant()->getList())); $this->add([ 'name' => 'priorite', 'options' => [ 'label' => 'Priorité', 'value_options' => [ 'affection' => 'Affection', 'enseignement' => 'Enseignement', ], ], 'attributes' => [ 'class' => 'selectpicker', 'data-live-search' => 'false', ], 'type' => 'Select', ]); $this->add(new \Zend\Form\Element\Csrf('security')); $this->add([ 'name' => 'submit', 'type' => 'Submit', 'attributes' => [ 'value' => 'Enregistrer', ], ]); return $this; } /** * Should return an array specification compatible with * {@link Zend\InputFilter\Factory::createInputFilter()}. * * @return array */ public function getInputFilterSpecification() { return []; } } No newline at end of file
module/Application/src/Application/Form/Intervenant/Traits/RegleStructureValidationFormAwareTrait.php +47 Changes for module/Application/src/Application/Form/Intervenant/Traits/RegleStructureValidationFormAwareTrait.php: 47 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Application\Form\Intervenant\Traits; use Application\Form\Intervenant\RegleStructureValidationForm; /** * Description of RegleStructureValidationFormAwareTrait * * @author UnicaenCode */ trait RegleStructureValidationFormAwareTrait { /** * @var RegleStructureValidationForm */ private $formRegleStructureValidationSaisie; /** * @param RegleStructureValidationForm $formRegleStructureValidationSaisie * * @return self */ public function setFormRegleStructureValidationSaisie(RegleStructureValidationForm $formRegleStructureValidationSaisie) { $this->formRegleStructureValidationSaisie = $formRegleStructureValidationSaisie; return $this; } /** * * @return RegleStructureValidationForm */ public function getFormRegleStructureValidationSaisie() { if (!empty($this->formRegleStructureValidationSaisie)) { return $this->formRegleStructureValidationSaisie; } return \Application::$container->get('FormElementManager')->get(RegleStructureValidationForm::class); } }