Loading data/privileges.php +4 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,9 @@ return [ 'types-diplome-visualisation' => 'Types de diplômes (visualisation)', 'types-diplome-edition' => 'Types de diplômes (édition)', 'reconduction-offre' => 'Prolongation de l\'offre l\'année suivante', 'reconduction-centre-cout' => 'Reconduction des centres de coûts de l\'offre de formation', 'reconduction-modulateur' => 'Reconduction des modualteurs de l\'offre de formation', ], ], Loading Loading @@ -330,6 +333,7 @@ return [ 'privileges' => [ 'administration-visualisation' => 'Administration (visualisation)', 'administration-edition' => 'Administration (édition)', 'administration-reconduction' => 'Administration (reconduction)', ], ], Loading module/Application/config/contrat.config.php +16 −3 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Application; use Application\Assertion\ContratAssertion; use Application\Controller\Factory\ContratControllerFactory; use Application\Provider\Privilege\Privileges; use UnicaenAuth\Guard\PrivilegeController; use UnicaenAuth\Provider\Rule\PrivilegeRuleProvider; Loading Loading @@ -93,6 +94,18 @@ return [ ], ], ], 'envoyer-mail' => [ 'type' => 'Segment', 'options' => [ 'route' => '/:contrat/mail', 'constraints' => [ 'contrat' => '[0-9]*', ], 'defaults' => [ 'action' => 'envoyer-mail', ], ], ], 'deposer-fichier' => [ 'type' => 'Segment', 'options' => [ Loading Loading @@ -211,7 +224,7 @@ return [ ], [ 'controller' => 'Application\Controller\Contrat', 'action' => ['exporter'], 'action' => ['exporter', 'envoyer-mail'], 'privileges' => [Privileges::CONTRAT_CONTRAT_GENERATION, Privileges::CONTRAT_PROJET_GENERATION], 'assertion' => Assertion\ContratAssertion::class, ], Loading Loading @@ -318,8 +331,8 @@ return [ ], ], 'controllers' => [ 'invokables' => [ 'Application\Controller\Contrat' => Controller\ContratController::class, 'factories' => [ 'Application\Controller\Contrat' => Controller\Factory\ContratControllerFactory::class, ], ], 'service_manager' => [ Loading module/Application/config/offre-formation.config.php +122 −20 Original line number Diff line number Diff line Loading @@ -3,12 +3,53 @@ namespace Application; use Application\Provider\Privilege\Privileges; use Application\Service\OffreFormationService; use UnicaenAuth\Guard\PrivilegeController; use UnicaenAuth\Provider\Rule\PrivilegeRuleProvider; return [ 'router' => [ 'routes' => [ 'aof' => [ 'type' => 'Literal', 'options' => [ 'route' => '/administration-offre', 'defaults' => [ 'controller' => 'Application\Controller\OffreFormation', 'action' => 'administrationOffre', ], ], 'may_terminate' => true, 'child_routes' => [ 'reconduction' => [ 'type' => 'Segment', 'options' => [ 'route' => '/reconduction', 'defaults' => [ 'action' => 'reconduction', ], ], ], 'reconduction-centre-cout' => [ 'type' => 'Segment', 'options' => [ 'route' => '/reconduction-centre-cout', 'defaults' => [ 'action' => 'reconductionCentreCout', ], ], ], 'reconduction-modulateur' => [ 'type' => 'Segment', 'options' => [ 'route' => '/reconduction-modulateur', 'defaults' => [ 'action' => 'reconductionModulateur', ], ], ], ], ], 'of' => [ 'type' => 'Literal', 'options' => [ Loading @@ -33,15 +74,7 @@ return [ ], ], ], 'reconduction' => [ 'type' => 'Segment', 'options' => [ 'route' => '/reconduction', 'defaults' => [ 'action' => 'reconduction', ], ], ], 'element' => [ 'type' => 'Literal', 'options' => [ Loading Loading @@ -111,6 +144,31 @@ return [ ], ], ], 'modulateurs-centres-couts' => [ 'type' => 'Segment', 'options' => [ 'route' => '/modulateurs-centres-couts/:elementPedagogique', 'constraints' => [ 'elementPedagogique' => '[0-9]*', ], 'defaults' => [ 'action' => 'modulateurs-centres-couts', ], ], ], 'modifier-modulateurs' => [ 'type' => 'Segment', 'options' => [ 'route' => '/modulateurs/modifier/:elementPedagogique', 'constraints' => [ 'elementPedagogique' => '[0-9]*', ], 'defaults' => [ 'action' => 'modifier-modulateur', ], ], ], ], ], 'etape' => [ Loading Loading @@ -210,12 +268,35 @@ return [ ], 'administration' => [ 'pages' => [ 'reconduction-offre' => [ 'label' => 'Reconduction de l\'offre de formation', 'offre-formation' => [ 'label' => 'Administration de l\'offre de formation', 'icon' => 'glyphicon glyphicon - list-alt', 'route' => 'of/reconduction', 'route' => 'aof', 'resource' => PrivilegeController::getResourceId('Application\Controller\OffreFormation', 'administrationOffre'), 'order' => 0, 'border - color' => '#111', 'pages' => [ 'reconduction-offre' => [ 'label' => 'Reconduction de l\'offre de formation complémentaire', 'title' => 'Reconduction de l\'offre de formation complémentaire', 'route' => 'aof/reconduction', 'resource' => PrivilegeController::getResourceId('Application\Controller\OffreFormation', 'reconduction'), ], 'reconduction-centre-cout' => [ 'label' => 'Reconduction des centres de coûts de l\'offre de formation', 'title' => 'Reconduction des centres de coûts de l\'offre de formation', 'route' => 'aof/reconduction-centre-cout', 'resource' => PrivilegeController::getResourceId('Application\Controller\OffreFormation', 'reconductionCentreCout'), ], 'reconduction-modulateur' => [ 'label' => 'Reconduction des modulateurs de l\'offre de formation', 'title' => 'Reconduction des modulateurs de l\'offre de formation', 'route' => 'aof/reconduction-modulateur', 'resource' => PrivilegeController::getResourceId('Application\Controller\OffreFormation', 'reconductionModulateur'), ], ], ], ], ], ], Loading @@ -228,7 +309,7 @@ return [ /* Global */ [ 'controller' => 'Application\Controller\OffreFormation', 'action' => ['index', 'search-structures', 'search-niveaux'], 'action' => ['index', 'search-structures', 'search-niveaux', 'administrationOffre'], 'privileges' => Privileges::ODF_VISUALISATION, ], [ Loading @@ -241,6 +322,17 @@ return [ 'action' => ['reconduction'], 'privileges' => Privileges::ODF_RECONDUCTION_OFFRE, ], [ 'controller' => 'Application\Controller\OffreFormation', 'action' => ['reconductionCentreCout'], 'privileges' => Privileges::ODF_RECONDUCTION_CENTRE_COUT, ], [ 'controller' => 'Application\Controller\OffreFormation', 'action' => ['reconductionModulateur'], 'privileges' => Privileges::ODF_RECONDUCTION_MODULATEUR, ], /* Etapes */ [ 'controller' => 'Application\Controller\OffreFormation\Etape', Loading Loading @@ -274,6 +366,15 @@ return [ Privileges::ODF_ELEMENT_VH_EDITION, ], ], [ 'controller' => 'Application\Controller\OffreFormation\ElementPedagogique', 'action' => ['modulateurs-centres-couts'], 'privileges' => [ Privileges::ODF_CENTRES_COUT_EDITION, Privileges::ODF_MODULATEURS_EDITION, ], ], [ 'controller' => 'Application\Controller\OffreFormation\ElementPedagogique', Loading Loading @@ -370,8 +471,8 @@ return [ Service\ElementModulateurService::class => Service\ElementModulateurService::class, Service\TypeModulateurService::class => Service\TypeModulateurService::class, Service\DomaineFonctionnelService::class => Service\DomaineFonctionnelService::class, Assertion\OffreDeFormationAssertion::class => Assertion\OffreDeFormationAssertion::class, Service\OffreFormationService::class => Service\OffreFormationService::class, Assertion\OffreDeFormationAssertion::class => Assertion\OffreDeFormationAssertion::class, Processus\ReconductionProcessus::class => Processus\ReconductionProcessus::class, ], 'factories' => [ Loading @@ -384,6 +485,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/ContratController.php +34 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ use UnicaenApp\View\Model\MessengerViewModel; use Application\Entity\Db\Contrat; use Zend\View\Model\JsonModel; use BjyAuthorize\Exception\UnAuthorizedException; use Zend\View\Renderer\PhpRenderer; /** * Description of ContratController Loading @@ -53,6 +54,16 @@ class ContratController extends AbstractController use ModeleContratServiceAwareTrait; use ModeleFormAwareTrait; private $renderer; public function __construct(PhpRenderer $renderer) { $this->renderer = $renderer; } /** Loading Loading @@ -323,6 +334,28 @@ class ContratController extends AbstractController public function envoyerMailAction() { $contrat = $this->getEvent()->getParam('contrat'); if (!$this->isAllowed($contrat, ContratAssertion::PRIV_EXPORT)) { throw new UnAuthorizedException("Interdiction d'envoyer le contrat par email"); } if (!empty($contrat->getIntervenant()->getEmail())) { $html = $this->renderer->render('application/contrat/mail/contrat', [ 'contrat' => $contrat, ]); $message = $this->getServiceModeleContrat()->prepareMail($contrat, $html); $mail = $this->mail()->send($message); $here=""; } return $this->getResponse(); } /** * Dépôt du contrat signé. * Loading module/Application/src/Application/Controller/Factory/ContratControllerFactory.php 0 → 100644 +27 −0 Original line number Diff line number Diff line <?php namespace Application\Controller\Factory; use Application\Controller\ContratController; use Psr\Container\ContainerInterface; class ContratControllerFactory { /** * Create controller * * @param ContainerInterface $container * * @return ContratController */ public function __invoke(ContainerInterface $container, $requestedName, $options = null) { $renderer = $container->get('ViewRenderer'); $controller = new ContratController($renderer); return $controller; } } No newline at end of file Loading
data/privileges.php +4 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,9 @@ return [ 'types-diplome-visualisation' => 'Types de diplômes (visualisation)', 'types-diplome-edition' => 'Types de diplômes (édition)', 'reconduction-offre' => 'Prolongation de l\'offre l\'année suivante', 'reconduction-centre-cout' => 'Reconduction des centres de coûts de l\'offre de formation', 'reconduction-modulateur' => 'Reconduction des modualteurs de l\'offre de formation', ], ], Loading Loading @@ -330,6 +333,7 @@ return [ 'privileges' => [ 'administration-visualisation' => 'Administration (visualisation)', 'administration-edition' => 'Administration (édition)', 'administration-reconduction' => 'Administration (reconduction)', ], ], Loading
module/Application/config/contrat.config.php +16 −3 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Application; use Application\Assertion\ContratAssertion; use Application\Controller\Factory\ContratControllerFactory; use Application\Provider\Privilege\Privileges; use UnicaenAuth\Guard\PrivilegeController; use UnicaenAuth\Provider\Rule\PrivilegeRuleProvider; Loading Loading @@ -93,6 +94,18 @@ return [ ], ], ], 'envoyer-mail' => [ 'type' => 'Segment', 'options' => [ 'route' => '/:contrat/mail', 'constraints' => [ 'contrat' => '[0-9]*', ], 'defaults' => [ 'action' => 'envoyer-mail', ], ], ], 'deposer-fichier' => [ 'type' => 'Segment', 'options' => [ Loading Loading @@ -211,7 +224,7 @@ return [ ], [ 'controller' => 'Application\Controller\Contrat', 'action' => ['exporter'], 'action' => ['exporter', 'envoyer-mail'], 'privileges' => [Privileges::CONTRAT_CONTRAT_GENERATION, Privileges::CONTRAT_PROJET_GENERATION], 'assertion' => Assertion\ContratAssertion::class, ], Loading Loading @@ -318,8 +331,8 @@ return [ ], ], 'controllers' => [ 'invokables' => [ 'Application\Controller\Contrat' => Controller\ContratController::class, 'factories' => [ 'Application\Controller\Contrat' => Controller\Factory\ContratControllerFactory::class, ], ], 'service_manager' => [ Loading
module/Application/config/offre-formation.config.php +122 −20 Original line number Diff line number Diff line Loading @@ -3,12 +3,53 @@ namespace Application; use Application\Provider\Privilege\Privileges; use Application\Service\OffreFormationService; use UnicaenAuth\Guard\PrivilegeController; use UnicaenAuth\Provider\Rule\PrivilegeRuleProvider; return [ 'router' => [ 'routes' => [ 'aof' => [ 'type' => 'Literal', 'options' => [ 'route' => '/administration-offre', 'defaults' => [ 'controller' => 'Application\Controller\OffreFormation', 'action' => 'administrationOffre', ], ], 'may_terminate' => true, 'child_routes' => [ 'reconduction' => [ 'type' => 'Segment', 'options' => [ 'route' => '/reconduction', 'defaults' => [ 'action' => 'reconduction', ], ], ], 'reconduction-centre-cout' => [ 'type' => 'Segment', 'options' => [ 'route' => '/reconduction-centre-cout', 'defaults' => [ 'action' => 'reconductionCentreCout', ], ], ], 'reconduction-modulateur' => [ 'type' => 'Segment', 'options' => [ 'route' => '/reconduction-modulateur', 'defaults' => [ 'action' => 'reconductionModulateur', ], ], ], ], ], 'of' => [ 'type' => 'Literal', 'options' => [ Loading @@ -33,15 +74,7 @@ return [ ], ], ], 'reconduction' => [ 'type' => 'Segment', 'options' => [ 'route' => '/reconduction', 'defaults' => [ 'action' => 'reconduction', ], ], ], 'element' => [ 'type' => 'Literal', 'options' => [ Loading Loading @@ -111,6 +144,31 @@ return [ ], ], ], 'modulateurs-centres-couts' => [ 'type' => 'Segment', 'options' => [ 'route' => '/modulateurs-centres-couts/:elementPedagogique', 'constraints' => [ 'elementPedagogique' => '[0-9]*', ], 'defaults' => [ 'action' => 'modulateurs-centres-couts', ], ], ], 'modifier-modulateurs' => [ 'type' => 'Segment', 'options' => [ 'route' => '/modulateurs/modifier/:elementPedagogique', 'constraints' => [ 'elementPedagogique' => '[0-9]*', ], 'defaults' => [ 'action' => 'modifier-modulateur', ], ], ], ], ], 'etape' => [ Loading Loading @@ -210,12 +268,35 @@ return [ ], 'administration' => [ 'pages' => [ 'reconduction-offre' => [ 'label' => 'Reconduction de l\'offre de formation', 'offre-formation' => [ 'label' => 'Administration de l\'offre de formation', 'icon' => 'glyphicon glyphicon - list-alt', 'route' => 'of/reconduction', 'route' => 'aof', 'resource' => PrivilegeController::getResourceId('Application\Controller\OffreFormation', 'administrationOffre'), 'order' => 0, 'border - color' => '#111', 'pages' => [ 'reconduction-offre' => [ 'label' => 'Reconduction de l\'offre de formation complémentaire', 'title' => 'Reconduction de l\'offre de formation complémentaire', 'route' => 'aof/reconduction', 'resource' => PrivilegeController::getResourceId('Application\Controller\OffreFormation', 'reconduction'), ], 'reconduction-centre-cout' => [ 'label' => 'Reconduction des centres de coûts de l\'offre de formation', 'title' => 'Reconduction des centres de coûts de l\'offre de formation', 'route' => 'aof/reconduction-centre-cout', 'resource' => PrivilegeController::getResourceId('Application\Controller\OffreFormation', 'reconductionCentreCout'), ], 'reconduction-modulateur' => [ 'label' => 'Reconduction des modulateurs de l\'offre de formation', 'title' => 'Reconduction des modulateurs de l\'offre de formation', 'route' => 'aof/reconduction-modulateur', 'resource' => PrivilegeController::getResourceId('Application\Controller\OffreFormation', 'reconductionModulateur'), ], ], ], ], ], ], Loading @@ -228,7 +309,7 @@ return [ /* Global */ [ 'controller' => 'Application\Controller\OffreFormation', 'action' => ['index', 'search-structures', 'search-niveaux'], 'action' => ['index', 'search-structures', 'search-niveaux', 'administrationOffre'], 'privileges' => Privileges::ODF_VISUALISATION, ], [ Loading @@ -241,6 +322,17 @@ return [ 'action' => ['reconduction'], 'privileges' => Privileges::ODF_RECONDUCTION_OFFRE, ], [ 'controller' => 'Application\Controller\OffreFormation', 'action' => ['reconductionCentreCout'], 'privileges' => Privileges::ODF_RECONDUCTION_CENTRE_COUT, ], [ 'controller' => 'Application\Controller\OffreFormation', 'action' => ['reconductionModulateur'], 'privileges' => Privileges::ODF_RECONDUCTION_MODULATEUR, ], /* Etapes */ [ 'controller' => 'Application\Controller\OffreFormation\Etape', Loading Loading @@ -274,6 +366,15 @@ return [ Privileges::ODF_ELEMENT_VH_EDITION, ], ], [ 'controller' => 'Application\Controller\OffreFormation\ElementPedagogique', 'action' => ['modulateurs-centres-couts'], 'privileges' => [ Privileges::ODF_CENTRES_COUT_EDITION, Privileges::ODF_MODULATEURS_EDITION, ], ], [ 'controller' => 'Application\Controller\OffreFormation\ElementPedagogique', Loading Loading @@ -370,8 +471,8 @@ return [ Service\ElementModulateurService::class => Service\ElementModulateurService::class, Service\TypeModulateurService::class => Service\TypeModulateurService::class, Service\DomaineFonctionnelService::class => Service\DomaineFonctionnelService::class, Assertion\OffreDeFormationAssertion::class => Assertion\OffreDeFormationAssertion::class, Service\OffreFormationService::class => Service\OffreFormationService::class, Assertion\OffreDeFormationAssertion::class => Assertion\OffreDeFormationAssertion::class, Processus\ReconductionProcessus::class => Processus\ReconductionProcessus::class, ], 'factories' => [ Loading @@ -384,6 +485,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/ContratController.php +34 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ use UnicaenApp\View\Model\MessengerViewModel; use Application\Entity\Db\Contrat; use Zend\View\Model\JsonModel; use BjyAuthorize\Exception\UnAuthorizedException; use Zend\View\Renderer\PhpRenderer; /** * Description of ContratController Loading @@ -53,6 +54,16 @@ class ContratController extends AbstractController use ModeleContratServiceAwareTrait; use ModeleFormAwareTrait; private $renderer; public function __construct(PhpRenderer $renderer) { $this->renderer = $renderer; } /** Loading Loading @@ -323,6 +334,28 @@ class ContratController extends AbstractController public function envoyerMailAction() { $contrat = $this->getEvent()->getParam('contrat'); if (!$this->isAllowed($contrat, ContratAssertion::PRIV_EXPORT)) { throw new UnAuthorizedException("Interdiction d'envoyer le contrat par email"); } if (!empty($contrat->getIntervenant()->getEmail())) { $html = $this->renderer->render('application/contrat/mail/contrat', [ 'contrat' => $contrat, ]); $message = $this->getServiceModeleContrat()->prepareMail($contrat, $html); $mail = $this->mail()->send($message); $here=""; } return $this->getResponse(); } /** * Dépôt du contrat signé. * Loading
module/Application/src/Application/Controller/Factory/ContratControllerFactory.php 0 → 100644 +27 −0 Original line number Diff line number Diff line <?php namespace Application\Controller\Factory; use Application\Controller\ContratController; use Psr\Container\ContainerInterface; class ContratControllerFactory { /** * Create controller * * @param ContainerInterface $container * * @return ContratController */ public function __invoke(ContainerInterface $container, $requestedName, $options = null) { $renderer = $container->get('ViewRenderer'); $controller = new ContratController($renderer); return $controller; } } No newline at end of file