diff --git "a/data/Sql/Changement ann\303\251e.sql" "b/data/Sql/Changement ann\303\251e.sql" new file mode 100644 index 0000000000000000000000000000000000000000..00a75c41ff4aa40554498e11982930195260d9b1 --- /dev/null +++ "b/data/Sql/Changement ann\303\251e.sql" @@ -0,0 +1,138 @@ +-- activer l'année : +UPDATE ANNEE SET ACTIVE = '1' WHERE ID = 2016; + + +-- mettre à jour les dates de campagne de saisie + +-- maj des paramètres + + + +SELECT + ' + INSERT INTO element_pedagogique ( + ID, + LIBELLE, + ETAPE_ID, + STRUCTURE_ID, + PERIODE_ID, + TAUX_FI, TAUX_FC, TAUX_FA, + TAUX_FOAD, + FI, FC, FA, + SOURCE_ID, SOURCE_CODE, + HISTO_CREATION, HISTO_CREATEUR_ID, + HISTO_MODIFICATION, HISTO_MODIFICATEUR_ID, + ANNEE_ID, + DISCIPLINE_ID + ) VALUES ( + element_pedagogique_id_seq.nextval, + q''[' || ep.libelle || ']'', + ' || ep.etape_id || ', + ' || ep.structure_id || ', + ' || NVL(to_char(ep.periode_id), 'NULL') || ', + ' || TRIM(TO_CHAR(ep.taux_fi, '999.99')) || ', ' || TRIM(TO_CHAR(ep.taux_fc, '999.99')) || ', ' || TRIM(TO_CHAR(ep.taux_fa, '999.99')) || ', + ' || TRIM(TO_CHAR(ep.taux_foad, '999.99')) || ', + ' || TRIM(TO_CHAR(ep.fi, '999.99')) || ', ' || TRIM(TO_CHAR(ep.fc, '999.99')) || ', ' || TRIM(TO_CHAR(ep.fa, '999.99')) || ', + ' || ep.source_id || ', q''[' || ep.source_code || ']'', + SYSDATE, ' || u.id || ', + SYSDATE, ' || u.id || ', + ' || (ep.annee_id + 1) || ', + ' || NVL(to_char(ep.discipline_id), 'NULL') || ' + ); + + INSERT INTO chemin_pedagogique( + ID, + ELEMENT_PEDAGOGIQUE_ID, + ETAPE_ID, + ORDRE, + SOURCE_ID, SOURCE_CODE, + HISTO_CREATION, HISTO_CREATEUR_ID, + HISTO_MODIFICATION, HISTO_MODIFICATEUR_ID + ) VALUES ( + chemin_pedagogique_id_seq.nextval, + element_pedagogique_id_seq.currval, + ' || ep.etape_id || ', + ' || rownum || ', + ' || ep.source_id || ', q''[' || e.source_code || '_' || ep.source_code || '_' || (ep.annee_id + 1) || ']'', + SYSDATE, ' || u.id || ', + SYSDATE, ' || u.id || ' + ); + + ' isql +FROM + element_pedagogique ep + JOIN etape e ON e.id = ep.etape_id + JOIN source s ON ep.source_id = s.id AND s.code = 'OSE' + JOIN utilisateur u ON u.username = 'lecluse' +WHERE + ep.annee_id = 2015 + AND 1 = ose_divers.comprise_entre( ep.histo_creation, ep.histo_destruction ) +; + + +-- réaliser l'import + + +-- modulateurs +SELECT + 'INSERT INTO ELEMENT_MODULATEUR( + ID, + ELEMENT_ID, + MODULATEUR_ID, + HISTO_CREATION, HISTO_CREATEUR_ID, + HISTO_MODIFICATION, HISTO_MODIFICATEUR_ID +)VALUES( + ELEMENT_MODULATEUR_ID_SEQ.NEXTVAL, + ' || ep2.id || ', + ' || m.id || ', + SYSDATE, (SELECT id FROM utilisateur WHERE username=''lecluse''), + SYSDATE, (SELECT id FROM utilisateur WHERE username=''lecluse'') +);' isql +FROM + element_modulateur em + JOIN element_pedagogique ep ON ep.id = em.element_id + JOIN element_pedagogique ep2 ON ep2.source_code = ep.source_code + AND ep2.annee_id = ep.annee_id + 1 + JOIN modulateur m ON m.id = em.modulateur_id + AND 1 = ose_divers.comprise_entre( m.histo_creation, m.histo_destruction ) + JOIN type_modulateur tm ON tm.id = m.type_modulateur_id + AND 1 = ose_divers.comprise_entre( tm.histo_creation, tm.histo_destruction ) + JOIN type_modulateur_ep tmep ON tmep.type_modulateur_id = m.type_modulateur_id + AND tmep.element_pedagogique_id = ep2.id + AND 1 = ose_divers.comprise_entre( tmep.histo_creation, tmep.histo_destruction ) +WHERE + 1 = ose_divers.comprise_entre( em.histo_creation, em.histo_destruction ) + AND ep.annee_id = 2015; + + + +-- centres de coûts +SELECT +'INSERT INTO CENTRE_COUT_EP( + ID, + CENTRE_COUT_ID, + ELEMENT_PEDAGOGIQUE_ID, + TYPE_HEURES_ID, + SOURCE_ID, + SOURCE_CODE, + HISTO_CREATION, HISTO_CREATEUR_ID, + HISTO_MODIFICATION, HISTO_MODIFICATEUR_ID +)VALUES( + CENTRE_COUT_EP_ID_SEQ.NEXTVAL, + ' || CCE.CENTRE_COUT_ID || ', + ' || ep2.id || ', + ' || CCE.type_heures_id || ', + ' || CCE.source_id || ', + ''N-1toN_'' || CENTRE_COUT_EP_ID_SEQ.CURRVAL, + SYSDATE, (SELECT id FROM utilisateur WHERE username=''lecluse''), + SYSDATE, (SELECT id FROM utilisateur WHERE username=''lecluse'') +);' isql +FROM + centre_cout_ep cce + JOIN element_pedagogique ep ON ep.id = CCE.ELEMENT_PEDAGOGIQUE_ID + JOIN element_pedagogique ep2 ON ep2.source_code = ep.source_code + AND ep2.annee_id = ep.annee_id + 1 +WHERE + 1 = ose_divers.comprise_entre( cce.histo_creation, cce.histo_destruction ) + AND ep.annee_id = 2015; + diff --git "a/data/Sql/Changement d'ann\303\251e : prolongement d'un an des modulateurs.sql" "b/data/Sql/Changement d'ann\303\251e : prolongement d'un an des modulateurs.sql" index eaf9b33562bfd242bda0e94961fabaa6ac6e2794..500b5d85924ff37c41f1dc72f8a4816210981353 100644 --- "a/data/Sql/Changement d'ann\303\251e : prolongement d'un an des modulateurs.sql" +++ "b/data/Sql/Changement d'ann\303\251e : prolongement d'un an des modulateurs.sql" @@ -26,4 +26,4 @@ FROM AND 1 = ose_divers.comprise_entre( tmep.histo_creation, tmep.histo_destruction ) WHERE 1 = ose_divers.comprise_entre( em.histo_creation, em.histo_destruction ) - AND ep.annee_id = 2014; \ No newline at end of file + AND ep.annee_id = 2015; \ No newline at end of file diff --git "a/data/Sql/__pense b\303\252te.sql" "b/data/Sql/__pense b\303\252te.sql" index e409f1b77b55bb5248a51bd32062a13e5a109aa9..4e64650dbdecc0df85cc3a77fad895aacb23bd6f 100644 --- "a/data/Sql/__pense b\303\252te.sql" +++ "b/data/Sql/__pense b\303\252te.sql" @@ -1,5 +1,6 @@ select q'[o'connor]' from dual; +SELECT TRIM(TO_CHAR(100, '9999999.99')) FROM DUAL; select diff --git a/module/Application/src/Application/Assertion/ServiceAssertion.php b/module/Application/src/Application/Assertion/ServiceAssertion.php index b0dfabea9b03d48543bebf0b4a9d4681cf424234..5b1352ccc4b0fc402a8ff548f0719b52d7fdd64b 100755 --- a/module/Application/src/Application/Assertion/ServiceAssertion.php +++ b/module/Application/src/Application/Assertion/ServiceAssertion.php @@ -52,7 +52,8 @@ class ServiceAssertion extends AbstractAssertion $intervenant = $this->getMvcEvent()->getParam('intervenant'); if ( - $role->getStructure() + $intervenant + && $role->getStructure() && (WfEtape::CODE_SERVICE_VALIDATION == $etape || WfEtape::CODE_SERVICE_VALIDATION_REALISE == $etape) ){ // dans ce cas ce n'est pas le WF qui agit mais on voit la validation dès qu'on a des services directement... // car on peut très bien avoir à visualiser cette page sans pour autant avoir de services à soi à valider!! diff --git a/module/Application/src/Application/Controller/OffreFormationController.php b/module/Application/src/Application/Controller/OffreFormationController.php index 175282b81ba493257507c6da1c5743fd7b48cf3f..fde0c31c345800eba5075995892e6a8a2a65babc 100644 --- a/module/Application/src/Application/Controller/OffreFormationController.php +++ b/module/Application/src/Application/Controller/OffreFormationController.php @@ -80,15 +80,13 @@ class OffreFormationController extends AbstractController partial e.{id,libelle,sourceCode,niveau,histoDestruction}, partial tf.{id}, partial gtf.{id, libelleCourt, ordre}, - partial ep.{id,libelle,sourceCode,etape,periode,tauxFoad,fi,fc,fa,tauxFi,tauxFc,tauxFa}, - partial eff.{id,fi,fa,fc} + partial ep.{id,libelle,sourceCode,etape,periode,tauxFoad,fi,fc,fa,tauxFi,tauxFc,tauxFa} FROM Application\Entity\Db\Etape e JOIN e.structure s JOIN e.typeFormation tf - JOIN tf.groupe gtf + JOIN tf.groupe gtf LEFT JOIN e.elementPedagogique ep - LEFT JOIN ep.effectifs eff WHERE s = :structure ORDER BY diff --git a/module/Application/src/Application/Provider/Role/RoleProvider.php b/module/Application/src/Application/Provider/Role/RoleProvider.php index ef9e27e79e00ac2d6616e9befacb55c4215ba146..2c9119df7bb65050b965a928b60b9693f08f1510 100644 --- a/module/Application/src/Application/Provider/Role/RoleProvider.php +++ b/module/Application/src/Application/Provider/Role/RoleProvider.php @@ -110,7 +110,7 @@ class RoleProvider implements ProviderInterface, EntityManagerAwareInterface if ($ldapUser = $serviceAuthUserContext->getLdapUser()) { $supannEmpId = (integer)$ldapUser->getSupannEmpId(); - $intervenant = $this->getServiceIntervenant()->getBySourceCode($supannEmpId); + $intervenant = $this->getServiceIntervenant()->getBySourceCode($supannEmpId, null, false); $personnel = $this->getServicePersonnel()->getBySourceCode($supannEmpId); } else { $intervenant = null; diff --git a/module/Application/src/Application/Service/Context.php b/module/Application/src/Application/Service/Context.php index 4635da534009892a796b95a1f3321e84242b5ac1..67fe2d41254935eeacf3aeaf7753d643be0b642d 100644 --- a/module/Application/src/Application/Service/Context.php +++ b/module/Application/src/Application/Service/Context.php @@ -6,7 +6,6 @@ use Application\Acl\Role; use Application\Entity\Db\Etablissement as EntityEtablissement; use Application\Entity\Db\Annee as AnneeEntity; use Application\Entity\Db\Structure as StructureEntity; -use Doctrine\ORM\QueryBuilder; use UnicaenApp\Traits\SessionContainerTrait; use DateTime; @@ -253,43 +252,6 @@ class Context extends AbstractService - /** - * - * @return DateTime - */ - function getDateFinSaisiePermanents() - { - $sc = $this->getSessionContainer(); - if (!$sc->offsetExists('dateFinSaisiePermanents')) { - $sc->dateFinSaisiePermanents = DateTime::createFromFormat( - 'd/m/Y', - $this->getServiceParametres()->date_fin_saisie_permanents - ); - } - - return $sc->dateFinSaisiePermanents; - } - - - - /** - * - * @param DateTime $dateFinSaisiePermanents - * - * @return self - */ - public function setDateFinSaisiePermanents(DateTime $dateFinSaisiePermanents, $updateParametres = false) - { - $sc->dateFinSaisiePermanents = $dateFinSaisiePermanents; - if ($updateParametres) { - $this->getServiceParametres()->date_fin_saisie_permanents = $sc->dateFinSaisiePermanents->format('d/m/Y'); - } - - return $this; - } - - - /** * * @return StructureEntity