Commit b5f08559 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Merge remote-tracking branch 'origin/master'

parents 1fbbe993 b900618d
Loading
Loading
Loading
Loading
+62 −39
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ class IntervenantService extends AbstractEntityService
    }



    /**
     * Retourne l'intervenant en fonction des paramètres de route transmis :
     * - soit code:<i>CODE</i>
@@ -87,6 +88,7 @@ class IntervenantService extends AbstractEntityService
    }



    /**
     * Retourne l'intervenant de l'année précédente
     *
@@ -108,6 +110,7 @@ class IntervenantService extends AbstractEntityService
    }



    public function getByCode(string $code): ?Intervenant
    {
        $anneeId     = $this->getServiceContext()->getAnnee()->getId();
@@ -121,6 +124,7 @@ class IntervenantService extends AbstractEntityService
    }



    public function getByCodeRh(string $codeRh): ?Intervenant
    {
        $anneeId     = $this->getServiceContext()->getAnnee()->getId();
@@ -134,6 +138,7 @@ class IntervenantService extends AbstractEntityService
    }



    /**
     *
     * @param string $sourceCode
@@ -161,6 +166,7 @@ class IntervenantService extends AbstractEntityService
    }



    private function getBones(array $params): array
    {
        $psql = '';
@@ -186,6 +192,7 @@ class IntervenantService extends AbstractEntityService
    }



    private function bestIntervenantByBones(array $bones, ?string $code, ?int $anneeId, ?int $statutId, ?int $structureId): ?Intervenant
    {
        $count = count($bones);
@@ -223,6 +230,7 @@ class IntervenantService extends AbstractEntityService
    }



    public function isImportable(Intervenant $intervenant): bool
    {
        $connection = $this->getEntityManager()->getConnection();
@@ -238,6 +246,7 @@ class IntervenantService extends AbstractEntityService
    }



    private function getIntervenantIdParDefaut(string $code, int $anneeId): ?int
    {
        if (!$code || !$anneeId) return null;
@@ -252,6 +261,7 @@ class IntervenantService extends AbstractEntityService
    }



    /**
     * Permet de définit une fiche intervenant comme celle étant à consulter par défaut
     *
@@ -284,6 +294,7 @@ class IntervenantService extends AbstractEntityService
    }



    /**
     * Permet de savoir si oui ou non cette fiche intervenant est définie comme étant celle par défaut.
     *
@@ -297,6 +308,7 @@ class IntervenantService extends AbstractEntityService
    }



    /**
     * Retourne les identifiants des données concernés
     *
@@ -326,6 +338,7 @@ class IntervenantService extends AbstractEntityService
    }



    /**
     * @param $intervenant Intervenant
     *
@@ -342,6 +355,7 @@ class IntervenantService extends AbstractEntityService
    }



    /**
     * Retourne l'alias d'entité courante
     *
@@ -353,6 +367,7 @@ class IntervenantService extends AbstractEntityService
    }



    public function finderByMiseEnPaiement(Structure $structure = null, Periode $periode = null, QueryBuilder $qb = null, $alias = null)
    {
        $serviceMIS = $this->getServiceMiseEnPaiementIntervenantStructure();
@@ -373,6 +388,7 @@ class IntervenantService extends AbstractEntityService
    }



    /**
     * @return Intervenant
     */
@@ -390,6 +406,7 @@ class IntervenantService extends AbstractEntityService
    }



    /**
     * Sauvegarde une entité
     *
@@ -411,6 +428,7 @@ class IntervenantService extends AbstractEntityService
    }



    /**
     *
     * @param QueryBuilder|null $qb
@@ -426,6 +444,7 @@ class IntervenantService extends AbstractEntityService
    }



    /**
     * Filtre par le type d'intervenant
     *
@@ -447,6 +466,7 @@ class IntervenantService extends AbstractEntityService
    }



    /**
     * Supprime (historise par défaut) le service spécifié.
     *
@@ -510,6 +530,7 @@ class IntervenantService extends AbstractEntityService
    }



    public function getSystemeInformationUrl(Intervenant $intervenant): ?string
    {
        if (!$intervenant->getSource()->getImportable()) return null;
@@ -529,6 +550,7 @@ class IntervenantService extends AbstractEntityService
    }



    /**
     * @param string    $nom
     * @param string    $prenom
@@ -580,6 +602,7 @@ class IntervenantService extends AbstractEntityService
    }



    public function updateExportDate(Intervenant $intervenant): Intervenant
    {
        $date = new \DateTime();
@@ -590,17 +613,17 @@ class IntervenantService extends AbstractEntityService
        return $intervenant;
    }



    public function updateCode(Intervenant $intervenant, $code): Intervenant
    {
        if (!empty($code)) {
            if (empty($intervenant->getExportDate())) {
            $intervenant->setCode($code);
            $this->getEntityManager()->persist($intervenant);
            $this->getEntityManager()->flush();
            //On recalcul les tablaeux de bords de l'intervenant
            $this->getServiceWorkflow()->calculerTableauxBord([], $intervenant);
        }
        }

        return $intervenant;
    }
+2 −1
Original line number Diff line number Diff line
@@ -552,10 +552,11 @@ class EnseignementController extends AbstractController
            'formule',
            'validation_enseignement',
            'contrat',
            'service',
        ], $intervenant);

        if (!$validation) {
            $this->getServiceWorkflow()->calculerTableauxBord(['service', 'piece_jointe_demande', 'piece_jointe_fournie'], $intervenant);
            $this->getServiceWorkflow()->calculerTableauxBord(['piece_jointe_demande', 'piece_jointe_fournie'], $intervenant);
        }
    }
}
+8 −1
Original line number Diff line number Diff line
@@ -308,6 +308,13 @@ return [
                    ],
                    'action'      => 'saisie',
                ],
                'ajout'           => [
                    'route'       => '/ajout/:groupeTypeFormation',
                    'constraints' => [
                        'typeFormation' => '[0-9]*',
                    ],
                    'action'      => 'ajout',
                ],
                'supprimer'        => [
                    'route'       => '/supprimer/:typeFormation',
                    'constraints' => [
@@ -550,7 +557,7 @@ return [
        ],
        [
            'controller' => TypeFormationController::class,
            'action'     => ['saisie', 'supprimer', 'saisieGroupe', 'supprimerGroupe', "trier"],
            'action'     => ['saisie', 'ajout', 'supprimer', 'saisieGroupe', 'supprimerGroupe', "trier"],
            'privileges' => [Privileges::ODF_TYPE_FORMATION_EDITION],
        ],
    ],
+29 −4
Original line number Diff line number Diff line
@@ -56,7 +56,6 @@ class TypeFormationController extends AbstractController
        ]);

        $typeFormation = $this->getEvent()->getParam('typeFormation');

        $form          = $this->getFormTypeFormationTypeFormationSaisie();

        if (empty($typeFormation)) {
@@ -82,6 +81,32 @@ class TypeFormationController extends AbstractController



    public function ajoutAction()
    {
        $this->em()->getFilters()->enable('historique')->init([
            GroupeTypeFormation::class,
        ]);

        $form  = $this->getFormTypeFormationTypeFormationSaisie();
        $title = "Création d'un nouveau type de formation";
        /** @var TypeFormation $typeFormation */
        $typeFormation       = $this->getServiceTypeFormation()->newEntity();
        $groupeTypeFormation = $this->getEvent()->getParam('groupeTypeFormation');
        $typeFormation->setGroupe($groupeTypeFormation);

        $form->bindRequestSave($typeFormation, $this->getRequest(), function () use ($typeFormation, $form) {

            $this->getServiceTypeFormation()->save($typeFormation);
            $this->flashMessenger()->addSuccessMessage(
                "Ajout réussi"
            );
        });

        return compact('form', 'title');
    }



    public function saisieGroupeAction()
    {
        $groupeTypeFormation = $this->getEvent()->getParam('groupeTypeFormation');
+7 −0
Original line number Diff line number Diff line
<?php
/**
 * @var $this  \Application\View\Renderer\PhpRenderer
 */

echo $this->messenger()->addCurrentMessagesFromFlashMessenger();
echo $this->form($form);
Loading