Loading module/Lieu/src/Form/Element/Structure.php +18 −1 Changes for module/Lieu/src/Form/Element/Structure.php: 18 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -11,6 +11,8 @@ class Structure extends Select { use StructureServiceAwareTrait; private bool $enseignement = false; private array $optionsBuilding = []; public function init() Loading @@ -26,11 +28,26 @@ class Structure extends Select public function isEnseignement(): bool { return $this->enseignement; } public function setEnseignement(bool $enseignement): Structure { $this->enseignement = $enseignement; return $this; } protected function populateOptions() { $this->optionsBuilding = []; $tree = $this->getServiceStructure()->getTree(); $tree = $this->getServiceStructure()->getTree(null, $this->isEnseignement()); $this->subPopulate($tree, 1); $this->setValueOptions($this->optionsBuilding); Loading module/OffreFormation/src/Controller/Factory/OffreFormationControllerFactory.php +4 −2 Changes for module/OffreFormation/src/Controller/Factory/OffreFormationControllerFactory.php: 4 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ */ namespace OffreFormation\Controller\Factory; use Lieu\Form\Element\Structure; use OffreFormation\Controller\OffreFormationController; use Psr\Container\ContainerInterface; use UnicaenImport\Service\SchemaService; Loading @@ -19,8 +20,9 @@ class OffreFormationControllerFactory */ public function __invoke(ContainerInterface $container, $requestedName, $options = null) { $renderer = $container->get('ViewRenderer'); $controller = new OffreFormationController($renderer); $structureElement = $container->get('FormElementManager')->get(Structure::class); $controller = new OffreFormationController($structureElement); $controller->setServiceSchema($container->get(SchemaService::class)); return $controller; Loading module/OffreFormation/src/Controller/OffreFormationController.php +12 −2 Changes for module/OffreFormation/src/Controller/OffreFormationController.php: 12 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace OffreFormation\Controller; use Application\Service\Traits\AnneeServiceAwareTrait; use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\LocalContextServiceAwareTrait; use Lieu\Form\Element\Structure; use Lieu\Service\StructureServiceAwareTrait; use OffreFormation\Entity\Db\CheminPedagogique; use OffreFormation\Entity\Db\ElementPedagogique; Loading Loading @@ -40,6 +41,16 @@ class OffreFormationController extends \Application\Controller\AbstractControlle use OffreFormationServiceAwareTrait; use SchemaServiceAwareTrait; private Structure $structureElement; public function __construct(Structure $structureElement) { $this->structureElement = $structureElement; } public function indexAction() { Loading @@ -54,7 +65,6 @@ class OffreFormationController extends \Application\Controller\AbstractControlle ->setNiveau($niveau) ->setEtape($etape); $structures = $this->getServiceStructure()->getList($this->getServiceStructure()->finderByEnseignement()); [$niveaux, $etapes, $elements] = $this->getServiceOffreFormation()->getNeep($structure, $niveau, $etape); $params = []; Loading @@ -69,7 +79,7 @@ class OffreFormationController extends \Application\Controller\AbstractControlle } return [ 'structures' => $structures, 'structureElement' => $this->structureElement, 'niveaux' => $niveaux, 'etapes' => $etapes, 'elements' => $elements, Loading module/OffreFormation/view/offre-formation/offre-formation/index.phtml +8 −4 Changes for module/OffreFormation/view/offre-formation/offre-formation/index.phtml: 8 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ * @var $structure \Lieu\Entity\Db\Structure * @var $niveau \Application\Entity\NiveauEtape * @var $etape \OffreFormation\Entity\Db\Etape * @var $structures \Lieu\Entity\Db\Structure[] * @var $niveaux \Application\Entity\NiveauEtape[] * @var $etapes \OffreFormation\Entity\Db\Etape[] * @var $elements \OffreFormation\Entity\Db\ElementPedagogique[] Loading Loading @@ -102,6 +101,10 @@ $canSyncElement = $this->isAllowed(Privileges::getResourceId(Privileges::ODF_ELE div.card-body input.form-control { width: 75% } .bootstrap-select.struct { max-width: 200px; } </style> <?php ?> Loading @@ -116,11 +119,12 @@ $canSyncElement = $this->isAllowed(Privileges::getResourceId(Privileges::ODF_ELE <div class="card-header">Structure</div> <div class="card-body"> <?php $selectStructure = new \Laminas\Form\Element\Select('structure'); $selectStructure = new \Lieu\Form\Element\Structure('structure'); $selectStructure->setEnseignement(true); $selectStructure->init(); $selectStructure ->setValueOptions(['' => "(Sélectionnez...)"] + \UnicaenApp\Util::collectionAsOptions($structures)) ->setValue($structure ? $structure->getId() : null) ->setAttributes(['class' => 'struct form-select']); ->setAttributes(['class' => 'struct selectpicker']); echo $this->formSelect($selectStructure); ?> <script> Loading Loading
module/Lieu/src/Form/Element/Structure.php +18 −1 Changes for module/Lieu/src/Form/Element/Structure.php: 18 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -11,6 +11,8 @@ class Structure extends Select { use StructureServiceAwareTrait; private bool $enseignement = false; private array $optionsBuilding = []; public function init() Loading @@ -26,11 +28,26 @@ class Structure extends Select public function isEnseignement(): bool { return $this->enseignement; } public function setEnseignement(bool $enseignement): Structure { $this->enseignement = $enseignement; return $this; } protected function populateOptions() { $this->optionsBuilding = []; $tree = $this->getServiceStructure()->getTree(); $tree = $this->getServiceStructure()->getTree(null, $this->isEnseignement()); $this->subPopulate($tree, 1); $this->setValueOptions($this->optionsBuilding); Loading
module/OffreFormation/src/Controller/Factory/OffreFormationControllerFactory.php +4 −2 Changes for module/OffreFormation/src/Controller/Factory/OffreFormationControllerFactory.php: 4 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ */ namespace OffreFormation\Controller\Factory; use Lieu\Form\Element\Structure; use OffreFormation\Controller\OffreFormationController; use Psr\Container\ContainerInterface; use UnicaenImport\Service\SchemaService; Loading @@ -19,8 +20,9 @@ class OffreFormationControllerFactory */ public function __invoke(ContainerInterface $container, $requestedName, $options = null) { $renderer = $container->get('ViewRenderer'); $controller = new OffreFormationController($renderer); $structureElement = $container->get('FormElementManager')->get(Structure::class); $controller = new OffreFormationController($structureElement); $controller->setServiceSchema($container->get(SchemaService::class)); return $controller; Loading
module/OffreFormation/src/Controller/OffreFormationController.php +12 −2 Changes for module/OffreFormation/src/Controller/OffreFormationController.php: 12 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace OffreFormation\Controller; use Application\Service\Traits\AnneeServiceAwareTrait; use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\LocalContextServiceAwareTrait; use Lieu\Form\Element\Structure; use Lieu\Service\StructureServiceAwareTrait; use OffreFormation\Entity\Db\CheminPedagogique; use OffreFormation\Entity\Db\ElementPedagogique; Loading Loading @@ -40,6 +41,16 @@ class OffreFormationController extends \Application\Controller\AbstractControlle use OffreFormationServiceAwareTrait; use SchemaServiceAwareTrait; private Structure $structureElement; public function __construct(Structure $structureElement) { $this->structureElement = $structureElement; } public function indexAction() { Loading @@ -54,7 +65,6 @@ class OffreFormationController extends \Application\Controller\AbstractControlle ->setNiveau($niveau) ->setEtape($etape); $structures = $this->getServiceStructure()->getList($this->getServiceStructure()->finderByEnseignement()); [$niveaux, $etapes, $elements] = $this->getServiceOffreFormation()->getNeep($structure, $niveau, $etape); $params = []; Loading @@ -69,7 +79,7 @@ class OffreFormationController extends \Application\Controller\AbstractControlle } return [ 'structures' => $structures, 'structureElement' => $this->structureElement, 'niveaux' => $niveaux, 'etapes' => $etapes, 'elements' => $elements, Loading
module/OffreFormation/view/offre-formation/offre-formation/index.phtml +8 −4 Changes for module/OffreFormation/view/offre-formation/offre-formation/index.phtml: 8 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ * @var $structure \Lieu\Entity\Db\Structure * @var $niveau \Application\Entity\NiveauEtape * @var $etape \OffreFormation\Entity\Db\Etape * @var $structures \Lieu\Entity\Db\Structure[] * @var $niveaux \Application\Entity\NiveauEtape[] * @var $etapes \OffreFormation\Entity\Db\Etape[] * @var $elements \OffreFormation\Entity\Db\ElementPedagogique[] Loading Loading @@ -102,6 +101,10 @@ $canSyncElement = $this->isAllowed(Privileges::getResourceId(Privileges::ODF_ELE div.card-body input.form-control { width: 75% } .bootstrap-select.struct { max-width: 200px; } </style> <?php ?> Loading @@ -116,11 +119,12 @@ $canSyncElement = $this->isAllowed(Privileges::getResourceId(Privileges::ODF_ELE <div class="card-header">Structure</div> <div class="card-body"> <?php $selectStructure = new \Laminas\Form\Element\Select('structure'); $selectStructure = new \Lieu\Form\Element\Structure('structure'); $selectStructure->setEnseignement(true); $selectStructure->init(); $selectStructure ->setValueOptions(['' => "(Sélectionnez...)"] + \UnicaenApp\Util::collectionAsOptions($structures)) ->setValue($structure ? $structure->getId() : null) ->setAttributes(['class' => 'struct form-select']); ->setAttributes(['class' => 'struct selectpicker']); echo $this->formSelect($selectStructure); ?> <script> Loading