Commit d2edf50a authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Merge branch 'master' into alc-agrement-duree-vie

parents 26351c1e 7b3af5e3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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',

        ],
    ],

@@ -330,6 +333,7 @@ return [
        'privileges' => [
            'administration-visualisation' => 'Administration (visualisation)',
            'administration-edition'       => 'Administration (édition)',
            'administration-reconduction'  => 'Administration (reconduction)',
        ],
    ],

+16 −3
Original line number Diff line number Diff line
@@ -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;
@@ -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' => [
@@ -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,
                ],
@@ -318,8 +331,8 @@ return [
        ],
    ],
    'controllers'     => [
        'invokables' => [
            'Application\Controller\Contrat' => Controller\ContratController::class,
        'factories' => [
            'Application\Controller\Contrat' => Controller\Factory\ContratControllerFactory::class,
        ],
    ],
    'service_manager' => [
+122 −20
Original line number Diff line number Diff line
@@ -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'       => [
@@ -33,15 +74,7 @@ return [
                            ],
                        ],
                    ],
                    'reconduction' => [
                        'type'    => 'Segment',
                        'options' => [
                            'route'    => '/reconduction',
                            'defaults' => [
                                'action' => 'reconduction',
                            ],
                        ],
                    ],

                    'element' => [
                        'type'          => 'Literal',
                        'options'       => [
@@ -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'   => [
@@ -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'),
                                    ],

                                ],
                            ],
                        ],
                    ],
                ],
@@ -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,
                ],
                [
@@ -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',
@@ -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',
@@ -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'  => [
@@ -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,
+34 −1
Original line number Diff line number Diff line
@@ -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
@@ -53,6 +54,16 @@ class ContratController extends AbstractController
    use ModeleContratServiceAwareTrait;
    use ModeleFormAwareTrait;

    private $renderer;



    public function __construct(PhpRenderer $renderer)
    {

        $this->renderer = $renderer;
    }



    /**
@@ -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é.
     *
+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