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

Merge branch 'master' of https://git.unicaen.fr/open-source/OSE into ll-v18

parents 74d5e1f1 c2a5b9da
Loading
Loading
Loading
Loading
+3 −3
Changes for admin/actions/update-employeur.php: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ $oseSource = $oa->getSourceOseId();
$oseId = $oa->getOseAppliId();
$c->println("Mise à jour de la table employeur");

ini_set('memory_limit', '8192M');
ini_set('memory_limit', '-1');
$importDirectory = $osedir . 'cache/employeurs/';
$importArchive = 'employeurs.tar.gz';
$importFilePath = $importDirectory . $importArchive;
@@ -34,7 +34,7 @@ exec('cd ' . $importDirectory . ' && tar -xvf ' . $importFilePath);
//Verification si des SIRET sont déjà chargé en base
$bdd = $oa->getBdd();
//$haveAlreadySiret     = $bdd->select("SELECT siret FROM employeur e WHERE siret IS NOT null FETCH FIRST 5 ROWS ONLY", [], ['fetch' => $bdd::FETCH_ONE]);
$haveAlreadySiret     = $bdd->select("select siret from (select siret, rownum as rn FROM employeur e WHERE siret IS NOT NULL) e where e.rn < 10", [], ['fetch' => $bdd::FETCH_ONE]);
$haveAlreadySiret = $bdd->select("SELECT siret FROM (SELECT siret, rownum AS rn FROM employeur e WHERE siret IS NOT NULL) e WHERE e.rn < 10", [], ['fetch' => $bdd::FETCH_ONE]);
$haveAlreadyEmployeur = $bdd->select("SELECT * FROM employeur e");


@@ -86,7 +86,7 @@ foreach ($listFiles as $file) {
        //SIREN
        $siren = $data[0];
        //SIRET
        $siret = $data[0] . $data[12];
        $siret = (isset($data[12])) ? $data[0] . $data[12] : '';

        //IDENTIFIANT ASSOCIATION
        $identifiantAssociation = $data[10];
+3 −3
Changes for data/ddl/table/NOTE.php: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -11,9 +11,9 @@ return [
    'columns'     => [
        'CONTENU'               => [
            'name'        => 'CONTENU',
            'type'        => 'string',
            'bdd-type'    => 'VARCHAR2',
            'length'      => 4000,
            'type'        => 'clob',
            'bdd-type'    => 'CLOB',
            'length'      => 0,
            'scale'       => NULL,
            'precision'   => NULL,
            'nullable'    => FALSE,
+287
Changes for data/ddl/view/V_INTERVENANT_HISTORIQUE.sql: 287 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 (
--Initialisation des données personnelles
    SELECT d.intervenant_id                              intervenant_id,
           '1 - Données personnelles'                    categorie,
           'Début de la saisie des données personnelles' label,
           d.histo_creation                              histo_date,
           d.histo_createur_id                           histo_createur_id,
           u.display_name                                histo_user,
           'glyphicon glyphicon-ok'                      icon,
           1                                             ordre
    FROM intervenant_dossier d
             JOIN utilisateur u ON u.id = d.histo_createur_id
    WHERE d.histo_destruction IS NULL

    UNION ALL
--Dernière modification des données personnelles
    SELECT d.intervenant_id                                 intervenant_id,
           '1 - Données personnelles'                       categorie,
           'Dernière modification des données personnelles' label,
           d.histo_modification                             histo_date,
           d.histo_modificateur_id                          histo_createur_id,
           u.display_name                                   histo_user,
           'glyphicon glyphicon-ok'                         icon,
           1                                                ordre
    FROM intervenant_dossier d
             JOIN utilisateur u ON u.id = d.histo_modificateur_id
    WHERE d.histo_destruction IS NULL
      AND d.histo_modification != d.histo_creation

UNION ALL

--Validation des données personnelles
SELECT d.intervenant_id                      intervenant_id,
       '1 - Données personnelles'            categorie,
       '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,
       1                                     ordre
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
--Dépôt des pièces justificatives
SELECT pj.intervenant_id                             intervenant_id,
       '2 - Pièces justificatives'                   categorie,
       '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,
       2                                             ordre
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
--Validation des pièces justificatives
SELECT pj.intervenant_id                                  intervenant_id,
       '2 - Pièces justificatives'                        categorie,
       '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,
       2                                                  ordre
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
--Dernière modification du service prévisionnel par composante
SELECT s.intervenant_id                                                                          intervenant_id,
       '3 - Service prévisionnel et/ou service référentiel'                                                              categorie,
       'Modification/Ajout du service prévisionnel pour la composante ' || MAX(st.libelle_court) label,
       MAX(vh.histo_modification)                                                                histo_date,
       MAX(vh.histo_modificateur_id)                                                             KEEP (dense_rank FIRST ORDER BY vh.histo_modification DESC)   histo_createur_id, MAX(u.display_name) KEEP (dense_rank FIRST ORDER BY vh.histo_modification DESC)    histo_user,
       'glyphicon glyphicon-ok'                           icon,
       3                                                                                         ordre
FROM volume_horaire vh
         JOIN service s ON s.id = vh.service_id
         JOIN element_pedagogique ep ON s.element_pedagogique_id = ep.id
         JOIN structure st ON st.id = ep.structure_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_modificateur_id
         LEFT JOIN motif_non_paiement mnp ON mnp.id = vh.motif_non_paiement_id
GROUP BY s.intervenant_id, ep.structure_id

UNION ALL
--Service référentiel uniquement pour les permanents
SELECT  s.intervenant_id                                                                     intervenant_id,
       '3 - Service prévisionnel et/ou service référentiel'                                 categorie,
        'Service référentiel : ' || fr.libelle_court || ' pour la composante ' || str.libelle_court                      label,
       s.histo_modification                                                                histo_date,
       s.histo_modificateur_id                                                             histo_createur_id,
       u.display_name                                     								   histo_user,
       'glyphicon glyphicon-ok'                           								   icon,
       3            										ordre
FROM
  service_referentiel s
  JOIN fonction_referentiel fr ON fr.id = s.fonction_id
  JOIN utilisateur u ON u.id = s.histo_modificateur_id
  LEFT JOIN structure str ON str.id = s.structure_id
WHERE
 s.histo_destruction IS NULL

 UNION ALL
 --Modification de service dû
  SELECT
	   msd.intervenant_id                                                                     intervenant_id,
       '3 - Service prévisionnel et/ou service référentiel'                                 categorie,
        'Modification de service dû : ' || mss.libelle                              label,
       msd.histo_modification                                                                histo_date,
       msd.histo_modificateur_id                                                             histo_createur_id,
       u.display_name                                     								   histo_user,
       'glyphicon glyphicon-ok'                           								   icon,
       3            										ordre
FROM
  modification_service_du msd
  JOIN motif_modification_service mss ON mss.id = msd.motif_id
  JOIN utilisateur u ON u.id = msd.histo_modificateur_id
WHERE
	msd.histo_destruction IS NULL


UNION ALL
--Agrément conseil restreint et conseil académique
SELECT tbla.intervenant_id         intervenant_id,
       '4 - Agréments'          categorie,
       ta.libelle || CASE
                         WHEN s.id IS NULL THEN ''
                         ELSE ' ' ||
                              s.libelle_court END ||
       CASE
           WHEN a.date_decision IS NULL THEN ''
           ELSE ' (décision du ' ||
                to_char(a.date_decision, 'dd/mm/YYYY')
               || ')' END       label,
       a.histo_modification     histo_date,
       a.histo_modificateur_id  histo_createur_id,
       u.display_name           histo_user,
       'glyphicon glyphicon-ok' icon,
       4                        ordre
FROM tbl_agrement tbla
JOIN agrement a ON tbla.agrement_id = a.id
JOIN type_agrement ta ON ta.id = a.type_agrement_id
         JOIN utilisateur u ON u.id = a.histo_modificateur_id
         LEFT JOIN structure s ON s.id = a.structure_id
WHERE a.histo_destruction IS NULL

UNION ALL
--Création du contrat par composante
SELECT C.intervenant_id                          intervenant_id,
       '5 - Contractualisation'                  categorie,
       'Création ' || CASE WHEN tc.code = 'CONTRAT' THEN 'du contrat' ELSE 'de l''avenant' END || ' N° ' || C.id ||
       ' pour la composante ' || s.libelle_court label,
       C.histo_creation                          histo_date,
       C.histo_createur_id                       histo_createur_id,
       u.display_name                            histo_user,
       'fas fa-book'                             icon,
       5                                         ordre
FROM contrat C
         JOIN type_contrat tc ON tc.id = C.type_contrat_id
         JOIN structure s ON s.id = C.structure_id
         JOIN utilisateur u ON u.id = C.histo_createur_id
WHERE C.histo_destruction IS NULL

UNION ALL
--Validation du contrat par composante
SELECT C.intervenant_id                          intervenant_id,
       '5 - Contractualisation'                  categorie,
       'Validation ' || CASE WHEN tc.code = 'CONTRAT' THEN 'du contrat' ELSE 'de l''avenant' END || ' N° ' || C.id ||
       ' pour la composante ' || s.libelle_court label,
       v.histo_creation                          histo_date,
       v.histo_createur_id                       histo_createur_id,
       u.display_name                            histo_user,
       'fas fa-book'                             icon,
       5                                         ordre
FROM validation v
         JOIN utilisateur u ON u.id = v.histo_createur_id
         JOIN contrat C ON C.validation_id = v.id AND C.histo_destruction IS NULL
         JOIN type_contrat tc ON tc.id = C.type_contrat_id
         JOIN structure s ON s.id = C.structure_id
WHERE v.histo_destruction IS NULL

UNION ALL
--Dépôt du contrat signé par composante
SELECT C.intervenant_id                                intervenant_id,
       '5 - Contractualisation'                        categorie,
       'Dépôt ' || CASE WHEN tc.code = 'CONTRAT' THEN 'du contrat' ELSE 'de l''avenant' END || ' N° ' || C.id ||
       ' signé pour la composante ' || s.libelle_court || ' (' || f.nom ||  ')' label,
       f.histo_creation                                histo_date,
       f.histo_createur_id                             histo_createur_id,
       u.display_name                                  histo_user,
       'fas fa-book'                                   icon,
       5                                               ordre
FROM fichier f
         JOIN contrat_fichier cf ON cf.fichier_id = f.id AND histo_destruction IS NULL
         JOIN fichier f ON f.id = cf.fichier_id AND f.histo_destruction IS NULL
         JOIN contrat C ON C.id = cf.contrat_id
         JOIN type_contrat tc ON tc.id = C.type_contrat_id
         JOIN structure s ON s.id = C.structure_id
         JOIN utilisateur u ON u.id = f.histo_createur_id
WHERE f.histo_destruction IS NULL

UNION ALL
--Date de retour signé du contrat par composante
SELECT C.intervenant_id                                  intervenant_id,
       '5 - Contractualisation'                          categorie,
       'Date de retour signée ' || CASE WHEN tc.code = 'CONTRAT' THEN 'du contrat' ELSE 'de l''avenant' END || ' N° ' ||
       C.id || ' pour la composante ' || s.libelle_court label,
       C.histo_modification                              histo_date,
       C.histo_modificateur_id                           histo_createur_id,
       u.display_name                                    histo_user,
       'fas fa-book'                                     icon,
       5                                                 ordre
FROM contrat C
         JOIN type_contrat tc ON tc.id = C.type_contrat_id
         JOIN structure s ON s.id = C.structure_id
         JOIN utilisateur u ON u.id = C.histo_modificateur_id
WHERE C.histo_destruction IS NULL
  AND C.date_retour_signe IS NOT NULL

UNION ALL

--Dernière modification du service réalisé par composante
SELECT s.intervenant_id                                                                     intervenant_id,
       '5 - Services réalisés'                                                              categorie,
       'Modification/Ajout du service réalisé pour la composante ' || MAX(st.libelle_court) label,
       MAX(vh.histo_modification)                                                           histo_date,
       MAX(vh.histo_modificateur_id)                                                        KEEP (dense_rank FIRST ORDER BY vh.histo_modification DESC)   histo_createur_id, MAX(u.display_name) KEEP (dense_rank FIRST ORDER BY vh.histo_modification DESC)    histo_user, 'glyphicon glyphicon-calendar' icon,
       5                                                                                    ordre
FROM volume_horaire vh
         JOIN service s ON s.id = vh.service_id
         JOIN element_pedagogique ep ON s.element_pedagogique_id = ep.id
         JOIN structure st ON st.id = ep.structure_id
         JOIN type_volume_horaire tvh ON tvh.id = vh.type_volume_horaire_id AND tvh.code = 'REALISE'
         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_modificateur_id
         LEFT JOIN motif_non_paiement mnp ON mnp.id = vh.motif_non_paiement_id
GROUP BY s.intervenant_id, ep.structure_id

UNION ALL
--Mise en paiement
SELECT
	 s.intervenant_id                                                                     intervenant_id,
       '6 - Mise en paiement'                                 categorie,
       mep.heures || 'h ' || th.libelle_court || CASE WHEN p.id IS NULL THEN '' ELSE ' (paiement en ' || p.libelle_court || ')' END                      label,
       mep.histo_modification                                                                histo_date,
       mep.histo_modificateur_id                                                             histo_createur_id,
       u.display_name                                     								   histo_user,
       'glyphicon glyphicon-ok'                           								   icon,
       6            										ordre
FROM
  mise_en_paiement mep
  JOIN formule_resultat_service frs ON frs.id = mep.formule_res_service_id
  JOIN service s ON s.id = frs.service_id
  JOIN type_heures th ON th.id = mep.type_heures_id
  JOIN utilisateur u ON u.id = mep.histo_modificateur_id
  LEFT JOIN periode p ON p.id = mep.periode_paiement_id
  WHERE
  mep.histo_destruction IS NULL



)
SELECT rownum id,
       categorie,
       ordre,
       intervenant_id,
       label,
       histo_date,
       histo_createur_id,
       histo_user,
       icon
FROM historique
ORDER BY intervenant_id, ordre ASC, histo_date ASC
 No newline at end of file
+4
Changes for data/privileges.php: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -57,6 +57,10 @@ return [
            'autres-visualisation'     => 'Champs autres (Visualisation)',
            'autres-edition'           => 'Champs autres (Edition)',
            'lien-systeme-information' => 'Afficher le lien vers le système d\'information dans la fiche',
            'note-visualisation'       => 'Visualiser des notes',
            'note-ajout'               => 'Ajouter des notes',
            'note-administration'      => 'Administrer les notes',
            'note-email'               => 'Envoyer un email à l\'intervenant',
        ],
    ],

+5 −21
Changes for module/Application/src/Controller/ContratController.php: 5 added lines, 21 removed lines.
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ use Application\Service\Traits\TauxHoraireHETDServiceAwareTrait;
use Application\Service\Traits\TypeVolumeHoraireServiceAwareTrait;
use Application\Service\Traits\ContextServiceAwareTrait;
use Application\Service\Traits\WorkflowServiceAwareTrait;
use Intervenant\Service\NoteServiceAwareTrait;
use UnicaenApp\Controller\Plugin\Upload\UploaderPlugin;
use UnicaenApp\Util;
use UnicaenApp\View\Model\MessengerViewModel;
@@ -56,11 +57,11 @@ class ContratController extends AbstractController
    use ModeleContratServiceAwareTrait;
    use ModeleFormAwareTrait;
    use EnvoiMailContratFormAwareTrait;
    use NoteServiceAwareTrait;

    private $renderer;



    public function __construct(PhpRenderer $renderer)
    {

@@ -68,7 +69,6 @@ class ContratController extends AbstractController
    }



    /**
     * Initialisation des filtres Doctrine pour les historique.
     * Objectif : laisser passer les enregistrements passés en historique pour mettre en évidence ensuite les erreurs
@@ -86,7 +86,6 @@ class ContratController extends AbstractController
    }



    /**
     * Point d'entrée sur les contrats/avenants.
     *
@@ -140,7 +139,6 @@ class ContratController extends AbstractController
    }



    public function creerAction()
    {
        $this->initFilters();
@@ -176,7 +174,6 @@ class ContratController extends AbstractController
    }



    /**
     * Suppression d'un projet de contrat/avenant par la composante d'intervention.
     *
@@ -210,7 +207,6 @@ class ContratController extends AbstractController
    }



    public function validerAction()
    {
        $this->initFilters();
@@ -253,7 +249,6 @@ class ContratController extends AbstractController
    }



    /**
     * Dévalidation du contrat/avenant par la composante d'intervention.
     *
@@ -288,7 +283,6 @@ class ContratController extends AbstractController
    }



    /**
     * Saisie de la date de retour du contrat/avenant signé par l'intervenant.
     *
@@ -330,7 +324,6 @@ class ContratController extends AbstractController
    }



    public function exporterAction()
    {
        /* @var Contrat $contrat */
@@ -345,7 +338,6 @@ class ContratController extends AbstractController
    }



    public function envoyerMailAction()
    {
        /**
@@ -363,7 +355,7 @@ class ContratController extends AbstractController
        $emailDossierPerso = ($dossierIntervenant) ? $dossierIntervenant->getEmailPerso() : '';
        $emailIntervenant = (!empty($emailDossierPerso)) ? $emailDossierPerso : $intervenant->getEmailPro();
        $emailExpediteur = (!empty($this->getServiceParametres()->get('contrat_mail_expediteur'))) ? $this->getServiceParametres()->get('contrat_mail_expediteur') : $this->getServiceContext()->getUtilisateur()->getEmail();
        $form               = $this->getFormEnvoiMailContrat();
        $form = $this->getFormContratEnvoiMailContrat();
        $form->get('destinataire-mail')->setValue($emailIntervenant);
        $form->get('destinataire-mail-hide')->setValue($emailIntervenant);
        $form->get('expediteur-mail')->setValue($emailExpediteur);
@@ -388,7 +380,8 @@ class ContratController extends AbstractController
                    $cci = $this->getRequest()->getPost('destinataire-cc-mail');

                    $message = $this->getServiceModeleContrat()->prepareMail($contrat, $html, $from, $to, $cci, $subject);

                    /*Create Note from email for this intervenant*/
                    $this->getServiceNote()->createNoteFromEmail($intervenant, $subject, $html);
                    $mail = $this->mail()->send($message);
                    $dateEnvoiEmail = new DateTime();
                    $contrat->setDateEnvoiEmail($dateEnvoiEmail);
@@ -406,7 +399,6 @@ class ContratController extends AbstractController
    }



    /**
     * Dépôt du contrat signé.
     *
@@ -435,7 +427,6 @@ class ContratController extends AbstractController
    }



    /**
     * Listing des fichiers déposés pour le contrat.
     *
@@ -456,7 +447,6 @@ class ContratController extends AbstractController
    }



    /**
     * Téléchargement d'un fichier.
     *
@@ -477,7 +467,6 @@ class ContratController extends AbstractController
    }



    /**
     * Suppression d'un fichier déposé.
     *
@@ -509,7 +498,6 @@ class ContratController extends AbstractController
    }



    private function updateTableauxBord(Intervenant $intervenant)
    {
        $this->getServiceWorkflow()->calculerTableauxBord([
@@ -519,7 +507,6 @@ class ContratController extends AbstractController
    }



    public function modelesListeAction()
    {
        $modeles = $this->getServiceModeleContrat()->getList();
@@ -528,7 +515,6 @@ class ContratController extends AbstractController
    }



    public function modelesEditerAction()
    {
        /* @var $modeleContrat ModeleContrat */
@@ -556,7 +542,6 @@ class ContratController extends AbstractController
    }



    public function modelesSupprimerAction()
    {
        /* @var $modeleContrat ModeleContrat */
@@ -573,7 +558,6 @@ class ContratController extends AbstractController
    }



    public function modelesTelechargerAction()
    {
        /* @var $modeleContrat ModeleContrat */
Loading