Loading module/Application/config/merged/formation.config.php +8 −2 Changes for module/Application/config/merged/formation.config.php: 8 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ use Application\Service\Formation\FormationThemeService; use Application\Service\Formation\FormationThemeServiceFactory; use Application\Service\ParcoursDeFormation\ParcoursDeFormationService; use Application\Service\ParcoursDeFormation\ParcoursDeFormationServiceFactory; use Application\View\Helper\FormationGroupeViewHelper; use Application\View\Helper\SpecificitePosteViewHelper; use UnicaenPrivilege\Guard\PrivilegeController; use Zend\Router\Http\Literal; use Zend\Router\Http\Segment; Loading Loading @@ -374,6 +376,10 @@ return [ FormationHydrator::class => FormationHydratorFactory::class, FormationGroupeHydrator::class => FormationGroupeHydratorFactory::class, ], ] ], 'view_helpers' => [ 'invokables' => [ 'formationGroupe' => FormationGroupeViewHelper::class, ], ], ]; No newline at end of file module/Application/src/Application/Service/Formation/FormationGroupeService.php +21 −1 Changes for module/Application/src/Application/Service/Formation/FormationGroupeService.php: 21 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Application\Service\Formation; use Application\Entity\Db\FormationGroupe; use Application\Service\GestionEntiteHistorisationTrait; use Application\Service\RendererAwareTrait; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\QueryBuilder; use UnicaenApp\Exception\RuntimeException; Loading @@ -14,6 +15,7 @@ class FormationGroupeService { // use UserServiceAwareTrait; // use DateTimeAwareTrait; use GestionEntiteHistorisationTrait; use RendererAwareTrait; /** GESTION DES ENTITES *******************************************************************************************/ Loading Loading @@ -94,6 +96,23 @@ class FormationGroupeService { return $result; } /** * @param FormationGroupe $groupe * @return array */ public function optionify(FormationGroupe $groupe) { $res = $this->renderer->formationGroupe($groupe); $this_option = [ 'value' => $groupe->getId(), 'attributes' => [ 'data-content' => $res . " ".$groupe->getLibelle(), ], 'label' => $groupe->getLibelle(), ]; return $this_option; } /** * @return array */ Loading @@ -102,7 +121,8 @@ class FormationGroupeService { $groupes = $this->getFormationsGroupes(); $array = []; foreach ($groupes as $groupe) { $array[$groupe->getId()] = $groupe->getLibelle(); $option = $this->optionify($groupe); $array[$groupe->getId()] = $option; } return $array; } Loading module/Application/src/Application/Service/Formation/FormationGroupeServiceFactory.php +5 Changes for module/Application/src/Application/Service/Formation/FormationGroupeServiceFactory.php: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Application\Service\Formation; use Doctrine\ORM\EntityManager; use Interop\Container\ContainerInterface; use UnicaenUtilisateur\Service\User\UserService; use Zend\View\Renderer\PhpRenderer; class FormationGroupeServiceFactory { Loading @@ -17,10 +18,14 @@ class FormationGroupeServiceFactory { $entityManager = $container->get('doctrine.entitymanager.orm_default'); $userService = $container->get(UserService::class); /* @var PhpRenderer $renderer */ $renderer = $container->get('ViewRenderer'); /** @var FormationGroupeService $service */ $service = new FormationGroupeService(); $service->setEntityManager($entityManager); $service->setUserService($userService); $service->setRenderer($renderer); return $service; } } module/Application/src/Application/View/Helper/FormationGroupeViewHelper.php +29 Changes for module/Application/src/Application/View/Helper/FormationGroupeViewHelper.php: 29 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Application\View\Helper; use Application\Entity\Db\FormationGroupe; use Application\Service\FicheMetierEtat\FicheMetierEtatServiceAwareTrait; use Application\View\Renderer\PhpRenderer; use Zend\View\Helper\AbstractHelper; use Zend\View\Helper\Partial; use Zend\View\Resolver\TemplatePathStack; class FormationGroupeViewHelper extends AbstractHelper { use FicheMetierEtatServiceAwareTrait; /** * @param FormationGroupe $groupe * @param array $options * @return string|Partial */ public function __invoke($groupe, $options = ['mode' => 'affichage']) { /** @var PhpRenderer $view */ $view = $this->getView(); $view->resolver()->attach(new TemplatePathStack(['script_paths' => [__DIR__ . "/partial"]])); return $view->partial('formation-groupe', ['groupe' => $groupe, 'options' => $options]); } } No newline at end of file module/Application/src/Application/View/Helper/partial/fiche-metier.phtml +1 −2 Changes for module/Application/src/Application/View/Helper/partial/fiche-metier.phtml: 1 added line, 2 removed lines. Original line number Diff line number Diff line Loading @@ -63,7 +63,6 @@ if (isset($options['sans-titre'])) $sansTitre = ($options['sans-titre'] === true <?php endif; ?> </div> </div> <?php endif; ?> <div class="row"> <div class="col-md-8"> Loading Loading @@ -101,7 +100,7 @@ if (isset($options['sans-titre'])) $sansTitre = ($options['sans-titre'] === true </div> </div> </div> <?php endif; ?> <br/> <div class="main"> Loading Loading
module/Application/config/merged/formation.config.php +8 −2 Changes for module/Application/config/merged/formation.config.php: 8 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ use Application\Service\Formation\FormationThemeService; use Application\Service\Formation\FormationThemeServiceFactory; use Application\Service\ParcoursDeFormation\ParcoursDeFormationService; use Application\Service\ParcoursDeFormation\ParcoursDeFormationServiceFactory; use Application\View\Helper\FormationGroupeViewHelper; use Application\View\Helper\SpecificitePosteViewHelper; use UnicaenPrivilege\Guard\PrivilegeController; use Zend\Router\Http\Literal; use Zend\Router\Http\Segment; Loading Loading @@ -374,6 +376,10 @@ return [ FormationHydrator::class => FormationHydratorFactory::class, FormationGroupeHydrator::class => FormationGroupeHydratorFactory::class, ], ] ], 'view_helpers' => [ 'invokables' => [ 'formationGroupe' => FormationGroupeViewHelper::class, ], ], ]; No newline at end of file
module/Application/src/Application/Service/Formation/FormationGroupeService.php +21 −1 Changes for module/Application/src/Application/Service/Formation/FormationGroupeService.php: 21 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Application\Service\Formation; use Application\Entity\Db\FormationGroupe; use Application\Service\GestionEntiteHistorisationTrait; use Application\Service\RendererAwareTrait; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\QueryBuilder; use UnicaenApp\Exception\RuntimeException; Loading @@ -14,6 +15,7 @@ class FormationGroupeService { // use UserServiceAwareTrait; // use DateTimeAwareTrait; use GestionEntiteHistorisationTrait; use RendererAwareTrait; /** GESTION DES ENTITES *******************************************************************************************/ Loading Loading @@ -94,6 +96,23 @@ class FormationGroupeService { return $result; } /** * @param FormationGroupe $groupe * @return array */ public function optionify(FormationGroupe $groupe) { $res = $this->renderer->formationGroupe($groupe); $this_option = [ 'value' => $groupe->getId(), 'attributes' => [ 'data-content' => $res . " ".$groupe->getLibelle(), ], 'label' => $groupe->getLibelle(), ]; return $this_option; } /** * @return array */ Loading @@ -102,7 +121,8 @@ class FormationGroupeService { $groupes = $this->getFormationsGroupes(); $array = []; foreach ($groupes as $groupe) { $array[$groupe->getId()] = $groupe->getLibelle(); $option = $this->optionify($groupe); $array[$groupe->getId()] = $option; } return $array; } Loading
module/Application/src/Application/Service/Formation/FormationGroupeServiceFactory.php +5 Changes for module/Application/src/Application/Service/Formation/FormationGroupeServiceFactory.php: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Application\Service\Formation; use Doctrine\ORM\EntityManager; use Interop\Container\ContainerInterface; use UnicaenUtilisateur\Service\User\UserService; use Zend\View\Renderer\PhpRenderer; class FormationGroupeServiceFactory { Loading @@ -17,10 +18,14 @@ class FormationGroupeServiceFactory { $entityManager = $container->get('doctrine.entitymanager.orm_default'); $userService = $container->get(UserService::class); /* @var PhpRenderer $renderer */ $renderer = $container->get('ViewRenderer'); /** @var FormationGroupeService $service */ $service = new FormationGroupeService(); $service->setEntityManager($entityManager); $service->setUserService($userService); $service->setRenderer($renderer); return $service; } }
module/Application/src/Application/View/Helper/FormationGroupeViewHelper.php +29 Changes for module/Application/src/Application/View/Helper/FormationGroupeViewHelper.php: 29 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Application\View\Helper; use Application\Entity\Db\FormationGroupe; use Application\Service\FicheMetierEtat\FicheMetierEtatServiceAwareTrait; use Application\View\Renderer\PhpRenderer; use Zend\View\Helper\AbstractHelper; use Zend\View\Helper\Partial; use Zend\View\Resolver\TemplatePathStack; class FormationGroupeViewHelper extends AbstractHelper { use FicheMetierEtatServiceAwareTrait; /** * @param FormationGroupe $groupe * @param array $options * @return string|Partial */ public function __invoke($groupe, $options = ['mode' => 'affichage']) { /** @var PhpRenderer $view */ $view = $this->getView(); $view->resolver()->attach(new TemplatePathStack(['script_paths' => [__DIR__ . "/partial"]])); return $view->partial('formation-groupe', ['groupe' => $groupe, 'options' => $options]); } } No newline at end of file
module/Application/src/Application/View/Helper/partial/fiche-metier.phtml +1 −2 Changes for module/Application/src/Application/View/Helper/partial/fiche-metier.phtml: 1 added line, 2 removed lines. Original line number Diff line number Diff line Loading @@ -63,7 +63,6 @@ if (isset($options['sans-titre'])) $sansTitre = ($options['sans-titre'] === true <?php endif; ?> </div> </div> <?php endif; ?> <div class="row"> <div class="col-md-8"> Loading Loading @@ -101,7 +100,7 @@ if (isset($options['sans-titre'])) $sansTitre = ($options['sans-titre'] === true </div> </div> </div> <?php endif; ?> <br/> <div class="main"> Loading