Commit 9b8159f7 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

WIP note par intervenant + Vue sur historique intervenant + divers corrections...

WIP note par intervenant + Vue sur historique intervenant + divers corrections suite refactoring traits
parent d3503493
Loading
Loading
Loading
Loading
+83
Changes for data/ddl/view/V_INTERVENANT_HISTORIQUE.sql: 83 added lines, 0 removed lines.
Original line number Diff line number Diff line
CREATE
OR REPLACE FORCE VIEW V_INTERVENANT_HISTORIQUE AS
WITH historique AS(
SELECT
  d.intervenant_id   intervenant_id,
  'Saisie des données personnelles'              label,
  d.histo_modification                          histo_date,
  d.histo_createur_id                              histo_createur_id,
  u.display_name                       histo_user,
  'glyphicon glyphicon-ok' icon
FROM
  intervenant_dossier d
  JOIN utilisateur u ON u.id = d.histo_createur_id
  WHERE d.histo_destruction IS NULL

  UNION ALL
--Validation des données personnelles
SELECT
  d.intervenant_id   intervenant_id,
  'Validation des données personnelles'              label,
  v.histo_creation                     histo_date,
v.histo_createur_id                       histo_createur_id,
  u.display_name                       histo_user,
  'glyphicon glyphicon-ok' icon
FROM
  validation v
  JOIN utilisateur u ON u.id = v.histo_createur_id
  JOIN type_validation tv ON tv.id = v.type_validation_id AND tv.code = 'DONNEES_PERSO_PAR_COMP'
  JOIN intervenant_dossier d ON d.histo_destruction IS NULL AND d.intervenant_id = v.intervenant_id

  UNION ALL

 SELECT
  pj.intervenant_id   intervenant_id,
  'Validation pièce justificative : ' || tpj.libelle               label,
  v.histo_creation           histo_date,
  v.histo_createur_id        histo_createur_id,
  u.display_name     histo_user,
  'glyphicon glyphicon-ok' icon
FROM
  validation v
  JOIN utilisateur u ON u.id = v.histo_createur_id
  JOIN piece_jointe pj ON pj.validation_id = v.id
  JOIN type_piece_jointe tpj ON pj.type_piece_jointe_id = tpj.id

  UNION ALL

SELECT pj.intervenant_id                                      intervenant_id,
       'Dépôt pièce justificative : ' || tpj.libelle          label,
       pj.histo_creation                                      histo_date,
       pj.histo_createur_id                                   histo_createur_id,
       u.display_name                                         histo_user,
       'glyphicon glyphicon-ok'                               icon
FROM piece_jointe pj
         JOIN type_piece_jointe tpj ON pj.type_piece_jointe_id = tpj.id
         JOIN utilisateur u ON u.id = pj.histo_createur_id
WHERE pj.histo_destruction IS NULL

UNION ALL

SELECT s.intervenant_id                                                               intervenant_id,
       'Saisi de service prévisionnel : ' || vh.heures || ' heures ' || ti.code || ', ' || p.libelle_court ||
       CASE WHEN mnp.id IS NULL THEN '' ELSE ' (NP: ' || mnp.libelle_court || ')' END label,
       vh.histo_creation                                                 histo_date,
       vh.histo_createur_id                                              histo_createur_id,
       u.display_name                                                                 histo_user,
       'glyphicon glyphicon-calendar'                                                 icon
FROM volume_horaire vh
         JOIN service s ON s.id = vh.service_id
         JOIN type_volume_horaire tvh ON tvh.id = vh.type_volume_horaire_id AND tvh.code = 'PREVU'
         JOIN periode p ON p.id = vh.periode_id
         JOIN type_intervention ti ON ti.id = vh.type_intervention_id
         JOIN utilisateur u ON u.id = vh.histo_createur_id
         LEFT JOIN motif_non_paiement mnp ON mnp.id = vh.motif_non_paiement_id )
SELECT rownum id,
       intervenant_id,
       label,
       histo_date,
       histo_createur_id,
       histo_user,
       icon
FROM historique
ORDER BY rownum ASC
+6 −22
Changes for module/Application/src/Controller/IntervenantController.php: 6 added lines, 22 removed lines.
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ use Application\Form\Intervenant\Traits\EditionFormAwareTrait;
use Application\Form\Intervenant\Traits\HeuresCompFormAwareTrait;
use Application\Form\Intervenant\Traits\RegleStructureValidationFormAwareTrait;
use Application\Processus\Traits\IntervenantProcessusAwareTrait;
use Intervenant\Service\NoteServiceAwareTrait;
use Plafond\Processus\PlafondProcessusAwareTrait;
use Application\Processus\Traits\ServiceProcessusAwareTrait;
use Application\Processus\Traits\ServiceReferentielProcessusAwareTrait;
@@ -67,6 +68,7 @@ class IntervenantController extends AbstractController
    use DossierServiceAwareTrait;
    use ImportProcessusAwareTrait;
    use DifferentielServiceAwareTrait;
    use NoteServiceAwareTrait;


    public function indexAction()
@@ -89,7 +91,6 @@ class IntervenantController extends AbstractController
    }



    public function rechercherAction()
    {
        $recents = $this->getIntervenantsRecents();
@@ -98,7 +99,6 @@ class IntervenantController extends AbstractController
    }



    public function rechercheAction()
    {
        $this->em()->getFilters()->enable('historique')->init([
@@ -117,7 +117,6 @@ class IntervenantController extends AbstractController
    }



    public function voirAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -134,13 +133,13 @@ class IntervenantController extends AbstractController
            return $vh;
        }

        $notificationNote = $this->getServiceNote()->countNote($intervenant);
        $this->addIntervenantRecent($intervenant);

        return compact('intervenant', 'tab');
        return compact('intervenant', 'tab', 'notificationNote');
    }



    public function definirParDefautAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -153,7 +152,6 @@ class IntervenantController extends AbstractController
    }



    public function servicesAction()
    {
        $this->em()->getFilters()->enable('historique')->init([
@@ -209,14 +207,14 @@ class IntervenantController extends AbstractController
        $this->getServiceLocalContext()->setIntervenant($intervenant); // passage au contexte pour le présaisir dans le formulaire de saisie
        $recherche = new Recherche($typeVolumeHoraire, $etatVolumeHoraire);

        if ($intervenant->getStatut()->getService() && $this->isAllowed($intervenant, Privileges::ENSEIGNEMENT_VISUALISATION)) {
        if ($intervenant->getStatut()->getServicePrevu() && $this->isAllowed($intervenant, Privileges::ENSEIGNEMENT_VISUALISATION)) {
            $services = $this->getProcessusService()->getServices($intervenant, $recherche);
        } else {
            $services = false;
        }

        /* Services référentiels (si nécessaire) */
        if ($intervenant->getStatut()->getReferentiel() && $this->isAllowed($intervenant, Privileges::REFERENTIEL_VISUALISATION)) {
        if ($intervenant->getStatut()->getReferentielPrevu() && $this->isAllowed($intervenant, Privileges::REFERENTIEL_VISUALISATION)) {
            $servicesReferentiel = $this->getProcessusServiceReferentiel()->getServices($intervenant, $recherche);
        } else {
            $servicesReferentiel = false;
@@ -243,7 +241,6 @@ class IntervenantController extends AbstractController
    }



    public function cloturerAction()
    {
        $this->em()->getFilters()->enable('historique')->init([
@@ -285,7 +282,6 @@ class IntervenantController extends AbstractController
    }



    public function ficheAction()
    {
        $role = $this->getServiceContext()->getSelectedIdentityRole();
@@ -295,7 +291,6 @@ class IntervenantController extends AbstractController
    }



    public function saisirAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -385,7 +380,6 @@ class IntervenantController extends AbstractController
    }



    public function synchronisationAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -410,7 +404,6 @@ class IntervenantController extends AbstractController
    }



    public function synchroniserAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -421,7 +414,6 @@ class IntervenantController extends AbstractController
    }



    public function voirHeuresCompAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -460,7 +452,6 @@ class IntervenantController extends AbstractController
    }



    public function formuleTotauxHetdAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -473,7 +464,6 @@ class IntervenantController extends AbstractController
    }



    public function supprimerAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -511,7 +501,6 @@ class IntervenantController extends AbstractController
    }



    public function historiserAction()
    {
        /* @var $intervenant \Application\Entity\Db\Intervenant */
@@ -526,7 +515,6 @@ class IntervenantController extends AbstractController
    }



    public function restaurerAction()
    {
        /* @var $intervenant \Application\Entity\Db\Intervenant */
@@ -543,7 +531,6 @@ class IntervenantController extends AbstractController
    }



    public function validationVolumeHoraireTypeIntervenantAction()
    {
        $serviceRVS = $this->getServiceRegleStructureValidation();
@@ -553,7 +540,6 @@ class IntervenantController extends AbstractController
    }



    public function validationVolumeHoraireTypeIntervenantSaisieAction()
    {
        $regleStructureValidation = $this->getEvent()->getParam('regleStructureValidation');
@@ -578,7 +564,6 @@ class IntervenantController extends AbstractController
    }



    /**
     *
     * @return array
@@ -608,7 +593,6 @@ class IntervenantController extends AbstractController
    }



    /**
     *
     * @param \Application\Entity\Db\Intervenant $intervenant
+2 −10
Changes for module/Application/src/Controller/IntervenantDossierController.php: 2 added lines, 10 removed lines.
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ class IntervenantDossierController extends AbstractController
    }



    public function indexAction()
    {
        $this->initFilters();
@@ -76,7 +75,7 @@ class IntervenantDossierController extends AbstractController
        $lastCompleted = (!empty($tblDossier)) ? $tblDossier->getCompletude() : '';

        /* Initialisation du formulaire */
        $form = $this->getIntervenantDossierForm($intervenant);
        $form = $this->getFormIntervenantIntervenantDossier()->setIntervenant($intervenant)->initForm();
        $form->bind($intervenantDossier);

        //si on vient de post et que le dossier n'est pas encore validé
@@ -88,7 +87,7 @@ class IntervenantDossierController extends AbstractController
                $intervenantDossier = $this->getServiceDossier()->save($intervenantDossier);
                /*On reinitialise le formulaire car le statut du dossier a
                pu être changé donc les règles d'affichage ne sont plus les mêmes*/
                $form = $this->getIntervenantDossierForm($intervenant);
                $form = $this->getFormIntervenantIntervenantDossier($intervenant);
                $form->bind($intervenantDossier);
                //Alimentation de la table INDIC_MODIF_DOSSIER
                $this->getServiceDossier()->updateIndicModifDossier($intervenant, $intervenantDossier);
@@ -155,7 +154,6 @@ class IntervenantDossierController extends AbstractController
    }



    public function changeStatutDossierAction()
    {
        if ($this->getRequest()->isPost()) {
@@ -191,7 +189,6 @@ class IntervenantDossierController extends AbstractController
    }



    public function validerAction()
    {
        $this->initFilters();
@@ -216,7 +213,6 @@ class IntervenantDossierController extends AbstractController
    }



    public function devaliderAction()
    {
        $this->initFilters();
@@ -236,7 +232,6 @@ class IntervenantDossierController extends AbstractController
    }



    public function supprimerAction()
    {
        $this->initFilters();
@@ -257,7 +252,6 @@ class IntervenantDossierController extends AbstractController
    }



    public function differencesAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -285,7 +279,6 @@ class IntervenantDossierController extends AbstractController
    }



    public function purgerDifferencesAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -311,7 +304,6 @@ class IntervenantDossierController extends AbstractController
    }



    private function updateTableauxBord(Intervenant $intervenant, $validation = false)
    {
        $this->getServiceWorkflow()->calculerTableauxBord([
+1 −20
Changes for module/Application/src/Controller/PieceJointeController.php: 1 added line, 20 removed lines.
Original line number Diff line number Diff line
@@ -56,7 +56,6 @@ class PieceJointeController extends AbstractController
    }



    /**
     *
     * @return ViewModel
@@ -98,7 +97,6 @@ class PieceJointeController extends AbstractController
    }



    /**
     *
     * @return ViewModel
@@ -119,7 +117,6 @@ class PieceJointeController extends AbstractController
    }



    /**
     * @param TblPieceJointe[] $synthesePiecesJointes
     */
@@ -157,14 +154,13 @@ class PieceJointeController extends AbstractController
            $msgs['success'][] = "Toutes les pièces justificatives obligatoires ont été fournies et validées.";
        } elseif ($nbFournies == $nbDemandees && $nbValidees < $nbFournies) {
            $msgs['success'][] = "Toutes les pièces justificatives obligatoires ont été fournies.";
            $msgs['warning'][] = "Mais certaines doivent encore être validées " . ($isIntervenant ? 'par votre' : 'la') . " composante.";
            $msgs['warning'][] = "Mais certaines doivent encore être validées par un gestionnaire.";
        }

        return $msgs;
    }



    public function validationAction()
    {
        $this->initFilters();
@@ -177,7 +173,6 @@ class PieceJointeController extends AbstractController
    }



    public function validerAction()
    {
        $this->initFilters();
@@ -195,7 +190,6 @@ class PieceJointeController extends AbstractController
    }



    public function archiverAction()
    {
        $this->initFilters();
@@ -217,7 +211,6 @@ class PieceJointeController extends AbstractController
    }



    public function devaliderAction()
    {
        $this->initFilters();
@@ -235,7 +228,6 @@ class PieceJointeController extends AbstractController
    }



    public function listerAction()
    {
        $this->initFilters();
@@ -256,7 +248,6 @@ class PieceJointeController extends AbstractController
    }



    public function televerserAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -280,7 +271,6 @@ class PieceJointeController extends AbstractController
    }



    public function telechargerAction()
    {
        /** @var Fichier $fichier */
@@ -301,7 +291,6 @@ class PieceJointeController extends AbstractController
    }



    public function supprimerAction()
    {
        if (!$this->getRequest()->isPost()) {
@@ -328,7 +317,6 @@ class PieceJointeController extends AbstractController
    }



    /* Actions liées à la configuration des PJ */

    public function configurationAction()
@@ -337,7 +325,6 @@ class PieceJointeController extends AbstractController
    }



    public function typePieceJointeStatutAction()
    {
        $this->em()->getFilters()->enable('historique')->init(entity: [
@@ -387,7 +374,6 @@ class PieceJointeController extends AbstractController
    }



    public function typePieceJointeDeleteAction()
    {
        $typePieceJointe = $this->getEvent()->getParam('typePieceJointe');
@@ -403,7 +389,6 @@ class PieceJointeController extends AbstractController
    }



    public function typePieceJointeSaisieAction()
    {
        /* @var $typePieceJointe TypePieceJointe */
@@ -423,7 +408,6 @@ class PieceJointeController extends AbstractController
    }



    public function modifierTypePieceJointeStatutAction()
    {
        /* @var $tpjs TypePieceJointeStatut */
@@ -448,7 +432,6 @@ class PieceJointeController extends AbstractController
    }



    public function typePieceJointeTrierAction()
    {
        /* @var $tpj TypePieceJointe */
@@ -474,7 +457,6 @@ class PieceJointeController extends AbstractController
    }



    public function deleteTypePieceJointeStatutAction()
    {
        $typePieceJointeStatut = $this->getEvent()->getParam('typePieceJointeStatut');
@@ -490,7 +472,6 @@ class PieceJointeController extends AbstractController
    }



    private function updateTableauxBord(Intervenant $intervenant, $validation = false)
    {
        $this->getServiceWorkflow()->calculerTableauxBord([
+1 −2
Changes for module/Application/src/Form/Intervenant/Factory/IntervenantDossierFormFactory.php: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -17,10 +17,9 @@ class IntervenantDossierFormFactory
    protected $options;



    public function __invoke(ContainerInterface $container, $requestedName, $options = null)
    {
        $form = new IntervenantDossierForm($options['intervenant']);
        $form = new IntervenantDossierForm;

        return $form;
    }
Loading