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

Corrections refonte dossier intervenant

parent e2345c65
Loading
Loading
Loading
Loading
+2 −1
Changes for admin/migration/MigrationDossier.php: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -177,8 +177,9 @@ class MigrationDossier extends AbstractMigration
        $tableIntervenantDossier = $bdd->getTable('INTERVENANT_DOSSIER');
        //On merge toutes les données
        $tableIntervenantDossier->merge($datasIntervenantDossier, 'ID', $options);
        $console->end("Fin de migration des dossiers intervenants");
        $console->println("Nombre de dossiers migrés : " . $nbDossierMigration);
        //Mise à jour sequence
        $bdd->majSequences($this->manager->getRef());
        //Reste à faire de recalculer la complétude des dossiers 2019 et 2020 au minimum
        $console->println("Recalcul de la complétude des dossiers pour l'année 2019");
        $annee = '2019';
+11 −2
Changes for module/Application/config/intervenant-dossier.config.php: 11 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ return [
                    'dossier' => [
                        'type'          => 'Segment',
                        'options'       => [
                            'route'    => '/:intervenant/intervenant-dossier',
                            'route'    => '/:intervenant/dossier',
                            'defaults' => [
                                'controller' => 'Application\Controller\IntervenantDossier',
                                'action'     => 'index',
@@ -29,6 +29,15 @@ return [
                        ],
                        'may_terminate' => true,
                        'child_routes'  => [
                            'change-statut-dossier' => [
                                'type'    => 'Literal',
                                'options' => [
                                    'route'    => '/change-statut-dossier',
                                    'defaults' => [
                                        'action' => 'change-statut-dossier',
                                    ],
                                ],
                            ],
                            'valider'               => [
                                'type'    => 'Literal',
                                'options' => [
@@ -125,7 +134,7 @@ return [
                /* Dossier */
                [
                    'controller' => 'Application\Controller\IntervenantDossier',
                    'action'     => ['index'],
                    'action'     => ['index', 'change-statut-dossier'],
                    'privileges' => [Privileges::DOSSIER_VISUALISATION],
                    'assertion'  => IntervenantDossierAssertion::class,
                ],
+31
Changes for module/Application/src/Application/Controller/IntervenantDossierController.php: 31 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ use Application\Service\Traits\DossierAutreServiceAwareTrait;
use Application\Service\Traits\DossierServiceAwareTrait;
use Application\Service\Traits\IntervenantServiceAwareTrait;
use Application\Service\Traits\ServiceServiceAwareTrait;
use Application\Service\Traits\StatutIntervenantServiceAwareTrait;
use Application\Service\Traits\ValidationServiceAwareTrait;
use Application\Service\Traits\WorkflowServiceAwareTrait;
use UnicaenApp\Util;
@@ -36,6 +37,7 @@ class IntervenantDossierController extends AbstractController
    use DossierAutreServiceAwareTrait;
    use IntervenantServiceAwareTrait;
    use AnneeServiceAwareTrait;
    use StatutIntervenantServiceAwareTrait;


    protected function initFilters()
@@ -70,6 +72,7 @@ class IntervenantDossierController extends AbstractController
        if ($this->getRequest()->isPost()) {
            $data = $this->getRequest()->getPost();
            $form->setData($data);
            $valid = $form->isValid();
            if ($form->isValid()) {
                /* Traitement du formulaire */
                $completude = $this->getServiceDossier()->isComplete($intervenantDossier);
@@ -120,6 +123,7 @@ class IntervenantDossierController extends AbstractController
            );
        }


        return compact(
            'form',
            'role',
@@ -135,6 +139,33 @@ class IntervenantDossierController extends AbstractController



    public function changeStatutDossierAction()
    {
        if ($this->getRequest()->isPost()) {
            $data        = $this->getRequest()->getPost();
            $role        = $this->getServiceContext()->getSelectedIdentityRole();
            $intervenant = $role->getIntervenant() ?: $this->getEvent()->getParam('intervenant');
            if (!$intervenant) {
                throw new \LogicException('Intervenant non précisé ou inexistant');
            }
            $intervenantDossier = $this->getServiceDossier()->getByIntervenant($intervenant);
            $completude         = $this->getServiceDossier()->isComplete($intervenantDossier);
            $intervenantDossier->setCompletude($completude);
            $statutIntervenant = $this->getServiceStatutIntervenant()->get($data['DossierStatut']['statut']);
            if ($statutIntervenant) {
                $intervenantDossier->setStatut($statutIntervenant);
            }
            $intervenantDossier = $this->getServiceDossier()->save($intervenantDossier);
            $this->flashMessenger()->addSuccessMessage('Enregistrement de vos données effectué');

            return $this->redirect()->toUrl($this->url()->fromRoute('intervenant/dossier', [], [], true));
        }

        return $this->redirect()->toUrl($this->url()->fromRoute('intervenant/dossier', [], [], true));
    }



    public function validerAction()
    {
        $this->initFilters();
+2
Changes for module/Application/src/Application/Entity/Db/IntervenantDossier.php: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -882,6 +882,8 @@ class IntervenantDossier implements HistoriqueAwareInterface, ResourceInterface,
            ->setPaysNaissance($intervenant->getPaysNaissance())
            ->setDepartementNaissance($intervenant->getDepartementNaissance())
            ->setNumeroInsee($intervenant->getNumeroInsee())
            ->setNumeroInseeProvisoire($intervenant->getNumeroInseeProvisoire())
            ->setEmailPro($intervenant->getEmailPro())
            ->setEmailPerso($intervenant->getEmailPerso())
            ->setTelPerso($intervenant->getTelPerso())
            ->setTelPro($intervenant->getTelPro())
+1 −1
Changes for module/Application/src/Application/Form/Intervenant/Dossier/DossierAutresFieldset.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ class DossierAutresFieldset extends AbstractFieldset

                if ($champ->getType()->getCode() == self::SELECT_SQL) {
                    if (!empty($champ->getSqlValue())) {
                        $datas = ['' => '- NON RENSEIGNÉ -'] + $this->getServiceDossierAutre()->getValueOptionsBySql($champ);
                        $datas = ['' => '(Sélectionnez ' . $champ->getLibelle() . ')'] + $this->getServiceDossierAutre()->getValueOptionsBySql($champ);
                        $this->get('champ-autre-' . $champ->getId())
                            ->setValueOptions($datas);
                    }
Loading