Skip to content
Snippets Groups Projects
Commit e246bd68 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Mise à jour de l'infra formule round 1

parent dde21361
No related branches found
No related tags found
No related merge requests found
Showing
with 242 additions and 197 deletions
...@@ -104,7 +104,6 @@ $data = explode("\n", $data); ...@@ -104,7 +104,6 @@ $data = explode("\n", $data);
'heuresServiceStatutaire' => stringToFloat($c[5]), 'heuresServiceStatutaire' => stringToFloat($c[5]),
'depassementServiceDuSansHC' => stringToFloat($c[6]), 'depassementServiceDuSansHC' => stringToFloat($c[6]),
'heuresServiceModifie' => stringToFloat($c[7]), 'heuresServiceModifie' => stringToFloat($c[7]),
'heuresDecharge' => stringToFloat($c[8]),
'typeVolumeHoraire' => $c[9], 'typeVolumeHoraire' => $c[9],
'etatVolumeHoraire' => $c[10], 'etatVolumeHoraire' => $c[10],
]; ];
...@@ -118,7 +117,6 @@ $data = explode("\n", $data); ...@@ -118,7 +117,6 @@ $data = explode("\n", $data);
$fti->setStructureTest($bdd->getRepository(\Application\Entity\Db\FormuleTestStructure::class)->find(1)); $fti->setStructureTest($bdd->getRepository(\Application\Entity\Db\FormuleTestStructure::class)->find(1));
$fti->setTypeVolumeHoraire($bdd->getRepository(\Application\Entity\Db\TypeVolumeHoraire::class)->findOneBy(['libelle' => $fi['typeVolumeHoraire']])); $fti->setTypeVolumeHoraire($bdd->getRepository(\Application\Entity\Db\TypeVolumeHoraire::class)->findOneBy(['libelle' => $fi['typeVolumeHoraire']]));
$fti->setEtatVolumeHoraire($bdd->getRepository(\Application\Entity\Db\EtatVolumeHoraire::class)->findOneBy(['libelle' => $fi['etatVolumeHoraire']])); $fti->setEtatVolumeHoraire($bdd->getRepository(\Application\Entity\Db\EtatVolumeHoraire::class)->findOneBy(['libelle' => $fi['etatVolumeHoraire']]));
$fti->setHeuresDecharge($fi['heuresDecharge']);
$fti->setHeuresServiceStatutaire($fi['heuresServiceStatutaire']); $fti->setHeuresServiceStatutaire($fi['heuresServiceStatutaire']);
$fti->setHeuresServiceModifie($fi['heuresServiceModifie']); $fti->setHeuresServiceModifie($fi['heuresServiceModifie']);
$fti->setDepassementServiceDuSansHC($fi['depassementServiceDuSansHC'] == '1'); $fti->setDepassementServiceDuSansHC($fi['depassementServiceDuSansHC'] == '1');
......
...@@ -9,3 +9,6 @@ ...@@ -9,3 +9,6 @@
*/ */
$utilisateur = $controller->dentity()['db'];
var_dump($utilisateur);
\ No newline at end of file
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"require" : { "require" : {
"php" : ">=7.3 || >=7.4", "php" : ">=7.3 || >=7.4",
"mpdf/mpdf" : "8.0.4 as 7.1.7", "mpdf/mpdf" : "8.0.4 as 7.1.7",
"unicaen/app" : "3.0.7", "unicaen/app" : "3.0.8",
"unicaen/auth" : "3.0.9", "unicaen/auth" : "3.0.9",
"zendframework/zend-code": "3.3.2", "zendframework/zend-code": "3.3.2",
"unicaen/bjy-authorize" : "3.0.4", "unicaen/bjy-authorize" : "3.0.4",
......
...@@ -6639,17 +6639,6 @@ ...@@ -6639,17 +6639,6 @@
'default' => '1', 'default' => '1',
'commentaire' => NULL, 'commentaire' => NULL,
), ),
'HEURES_DECHARGE' =>
array (
'name' => 'HEURES_DECHARGE',
'type' => 'FLOAT',
'length' => 0,
'scale' => NULL,
'precision' => 126,
'nullable' => false,
'default' => NULL,
'commentaire' => NULL,
),
'HEURES_SERVICE_STATUTAIRE' => 'HEURES_SERVICE_STATUTAIRE' =>
array ( array (
'name' => 'HEURES_SERVICE_STATUTAIRE', 'name' => 'HEURES_SERVICE_STATUTAIRE',
...@@ -6921,7 +6910,7 @@ ...@@ -6921,7 +6910,7 @@
'length' => 0, 'length' => 0,
'scale' => '0', 'scale' => '0',
'precision' => NULL, 'precision' => NULL,
'nullable' => false, 'nullable' => true,
'default' => NULL, 'default' => NULL,
'commentaire' => NULL, 'commentaire' => NULL,
), ),
...@@ -7288,6 +7277,17 @@ ...@@ -7288,6 +7277,17 @@
'default' => NULL, 'default' => NULL,
'commentaire' => NULL, 'commentaire' => NULL,
), ),
'STRUCTURE_CODE' =>
array (
'name' => 'STRUCTURE_CODE',
'type' => 'VARCHAR2',
'length' => 100,
'scale' => NULL,
'precision' => NULL,
'nullable' => true,
'default' => NULL,
'commentaire' => NULL,
),
), ),
), ),
'GRADE' => 'GRADE' =>
...@@ -26963,10 +26963,11 @@ END OSE_EVENT;', ...@@ -26963,10 +26963,11 @@ END OSE_EVENT;',
etat_volume_horaire_id NUMERIC, etat_volume_horaire_id NUMERIC,
   
-- paramètres globaux -- paramètres globaux
heures_decharge FLOAT DEFAULT 0, type_volume_horaire_code VARCHAR(15),
heures_service_statutaire FLOAT DEFAULT 0, heures_service_statutaire FLOAT DEFAULT 0,
heures_service_modifie FLOAT DEFAULT 0, heures_service_modifie FLOAT DEFAULT 0,
depassement_service_du_sans_hc BOOLEAN DEFAULT FALSE, depassement_service_du_sans_hc BOOLEAN DEFAULT FALSE,
structure_code VARCHAR(100),
type_intervenant_code VARCHAR(2), type_intervenant_code VARCHAR(2),
   
-- paramètres spacifiques -- paramètres spacifiques
...@@ -26992,6 +26993,8 @@ END OSE_EVENT;', ...@@ -26992,6 +26993,8 @@ END OSE_EVENT;',
structure_id NUMERIC, structure_id NUMERIC,
   
-- paramètres globaux -- paramètres globaux
type_volume_horaire_code VARCHAR(15),
structure_code VARCHAR(100),
structure_is_affectation BOOLEAN DEFAULT TRUE, structure_is_affectation BOOLEAN DEFAULT TRUE,
structure_is_univ BOOLEAN DEFAULT FALSE, structure_is_univ BOOLEAN DEFAULT FALSE,
service_statutaire BOOLEAN DEFAULT TRUE, service_statutaire BOOLEAN DEFAULT TRUE,
...@@ -27142,7 +27145,6 @@ END OSE_FORMULE;', ...@@ -27142,7 +27145,6 @@ END OSE_FORMULE;',
intervenant.heures_service_statutaire, intervenant.heures_service_statutaire,
i_dep_service_du_sans_hc, i_dep_service_du_sans_hc,
intervenant.heures_service_modifie, intervenant.heures_service_modifie,
intervenant.heures_decharge,
intervenant.param_1, intervenant.param_1,
intervenant.param_2, intervenant.param_2,
intervenant.param_3, intervenant.param_3,
...@@ -27153,9 +27155,7 @@ END OSE_FORMULE;', ...@@ -27153,9 +27155,7 @@ END OSE_FORMULE;',
   
intervenant.depassement_service_du_sans_hc := (i_dep_service_du_sans_hc = 1); intervenant.depassement_service_du_sans_hc := (i_dep_service_du_sans_hc = 1);
intervenant.service_du := CASE intervenant.service_du := CASE
WHEN intervenant.depassement_service_du_sans_hc -- HC traitées comme du service WHEN intervenant.depassement_service_du_sans_hc
OR intervenant.heures_decharge < 0 -- s\'il y a une décharge => aucune HC
THEN 9999 THEN 9999
ELSE intervenant.heures_service_statutaire + intervenant.heures_service_modifie ELSE intervenant.heures_service_statutaire + intervenant.heures_service_modifie
END; END;
...@@ -27169,7 +27169,6 @@ END OSE_FORMULE;', ...@@ -27169,7 +27169,6 @@ END OSE_FORMULE;',
intervenant.heures_service_statutaire := 0; intervenant.heures_service_statutaire := 0;
intervenant.depassement_service_du_sans_hc := FALSE; intervenant.depassement_service_du_sans_hc := FALSE;
intervenant.heures_service_modifie := 0; intervenant.heures_service_modifie := 0;
intervenant.heures_decharge := 0;
intervenant.type_intervenant_code := \'E\'; intervenant.type_intervenant_code := \'E\';
intervenant.service_du := 0; intervenant.service_du := 0;
intervenant.param_1 := NULL; intervenant.param_1 := NULL;
...@@ -27193,7 +27192,6 @@ END OSE_FORMULE;', ...@@ -27193,7 +27192,6 @@ END OSE_FORMULE;',
fti.structure_test_id, fti.structure_test_id,
fti.type_volume_horaire_id, fti.type_volume_horaire_id,
fti.etat_volume_horaire_id, fti.etat_volume_horaire_id,
fti.heures_decharge,
fti.heures_service_statutaire, fti.heures_service_statutaire,
fti.heures_service_modifie, fti.heures_service_modifie,
fti.depassement_service_du_sans_hc, fti.depassement_service_du_sans_hc,
...@@ -27210,7 +27208,6 @@ END OSE_FORMULE;', ...@@ -27210,7 +27208,6 @@ END OSE_FORMULE;',
intervenant.structure_id, intervenant.structure_id,
intervenant.type_volume_horaire_id, intervenant.type_volume_horaire_id,
intervenant.etat_volume_horaire_id, intervenant.etat_volume_horaire_id,
intervenant.heures_decharge,
intervenant.heures_service_statutaire, intervenant.heures_service_statutaire,
intervenant.heures_service_modifie, intervenant.heures_service_modifie,
dsdushc, dsdushc,
...@@ -27229,9 +27226,7 @@ END OSE_FORMULE;', ...@@ -27229,9 +27226,7 @@ END OSE_FORMULE;',
   
intervenant.depassement_service_du_sans_hc := (dsdushc = 1); intervenant.depassement_service_du_sans_hc := (dsdushc = 1);
intervenant.service_du := CASE intervenant.service_du := CASE
WHEN intervenant.depassement_service_du_sans_hc -- HC traitées comme du service WHEN intervenant.depassement_service_du_sans_hc
OR intervenant.heures_decharge < 0 -- s\'il y a une décharge => aucune HC
THEN 9999 THEN 9999
ELSE intervenant.heures_service_statutaire + intervenant.heures_service_modifie ELSE intervenant.heures_service_statutaire + intervenant.heures_service_modifie
END; END;
...@@ -27243,7 +27238,6 @@ END OSE_FORMULE;', ...@@ -27243,7 +27238,6 @@ END OSE_FORMULE;',
intervenant.heures_service_statutaire := 0; intervenant.heures_service_statutaire := 0;
intervenant.depassement_service_du_sans_hc := FALSE; intervenant.depassement_service_du_sans_hc := FALSE;
intervenant.heures_service_modifie := 0; intervenant.heures_service_modifie := 0;
intervenant.heures_decharge := 0;
intervenant.type_intervenant_code := \'E\'; intervenant.type_intervenant_code := \'E\';
intervenant.service_du := 0; intervenant.service_du := 0;
intervenant.param_1 := null; intervenant.param_1 := null;
...@@ -27289,10 +27283,12 @@ END OSE_FORMULE;', ...@@ -27289,10 +27283,12 @@ END OSE_FORMULE;',
vh_type_intervention_id, vh_type_intervention_id,
vh_type_volume_horaire_id, vh_type_volume_horaire_id,
vh_etat_volume_horaire_id, vh_etat_volume_horaire_id,
vh.type_volume_horaire_code,
vh.taux_fi, vh.taux_fi,
vh.taux_fa, vh.taux_fa,
vh.taux_fc, vh.taux_fc,
vh.structure_id, vh.structure_id,
vh.structure_code,
vh_structure_is_affectation, vh_structure_is_affectation,
vh_structure_is_univ, vh_structure_is_univ,
vh.ponderation_service_du, vh.ponderation_service_du,
...@@ -27648,7 +27644,7 @@ END OSE_FORMULE;', ...@@ -27648,7 +27644,7 @@ END OSE_FORMULE;',
); );
   
fr.service_du := ROUND(CASE fr.service_du := ROUND(CASE
WHEN intervenant.depassement_service_du_sans_hc OR intervenant.heures_decharge < 0 WHEN intervenant.depassement_service_du_sans_hc
THEN GREATEST(fr.total, intervenant.heures_service_statutaire + intervenant.heures_service_modifie) THEN GREATEST(fr.total, intervenant.heures_service_statutaire + intervenant.heures_service_modifie)
ELSE intervenant.heures_service_statutaire + intervenant.heures_service_modifie ELSE intervenant.heures_service_statutaire + intervenant.heures_service_modifie
END,2); END,2);
...@@ -27909,7 +27905,6 @@ END OSE_FORMULE;', ...@@ -27909,7 +27905,6 @@ END OSE_FORMULE;',
ose_test.echo(\'annee_id = \' || intervenant.annee_id); ose_test.echo(\'annee_id = \' || intervenant.annee_id);
ose_test.echo(\'structure_id = \' || intervenant.structure_id); ose_test.echo(\'structure_id = \' || intervenant.structure_id);
ose_test.echo(\'type_volume_horaire_id = \' || intervenant.type_volume_horaire_id); ose_test.echo(\'type_volume_horaire_id = \' || intervenant.type_volume_horaire_id);
ose_test.echo(\'heures_decharge = \' || intervenant.heures_decharge);
ose_test.echo(\'heures_service_statutaire = \' || intervenant.heures_service_statutaire); ose_test.echo(\'heures_service_statutaire = \' || intervenant.heures_service_statutaire);
ose_test.echo(\'heures_service_modifie = \' || intervenant.heures_service_modifie); ose_test.echo(\'heures_service_modifie = \' || intervenant.heures_service_modifie);
ose_test.echo(\'depassement_service_du_sans_hc = \' || CASE WHEN intervenant.depassement_service_du_sans_hc THEN \'OUI\' ELSE \'NON\' END); ose_test.echo(\'depassement_service_du_sans_hc = \' || CASE WHEN intervenant.depassement_service_du_sans_hc THEN \'OUI\' ELSE \'NON\' END);
...@@ -33173,12 +33168,16 @@ SELECT ...@@ -33173,12 +33168,16 @@ SELECT
i.annee_id annee_id, i.annee_id annee_id,
CASE WHEN ti.code = \'P\' THEN i.structure_id ELSE NULL END structure_id, CASE WHEN ti.code = \'P\' THEN i.structure_id ELSE NULL END structure_id,
ti.code type_intervenant_code, ti.code type_intervenant_code,
s.code structure_code,
si.service_statutaire heures_service_statutaire, si.service_statutaire heures_service_statutaire,
si.depassement_service_du_sans_hc depassement_service_du_sans_hc, CASE WHEN
COALESCE( SUM( msd.heures * mms.multiplicateur ), 0 ) heures_service_modifie, si.depassement_service_du_sans_hc = 1
COALESCE( SUM( msd.heures * mms.multiplicateur * mms.decharge ), 0 ) heures_decharge OR COALESCE( SUM( msd.heures * mms.multiplicateur * mms.decharge ), 0 ) <> 0
THEN 1 ELSE 0 END depassement_service_du_sans_hc,
COALESCE( SUM( msd.heures * mms.multiplicateur ), 0 ) heures_service_modifie
FROM FROM
intervenant i intervenant i
LEFT JOIN structure s ON s.id = i.structure_id
LEFT JOIN modification_service_du msd ON msd.intervenant_id = i.id AND msd.histo_destruction IS NULL LEFT JOIN modification_service_du msd ON msd.intervenant_id = i.id AND msd.histo_destruction IS NULL
LEFT JOIN motif_modification_service mms ON mms.id = msd.motif_id LEFT JOIN motif_modification_service mms ON mms.id = msd.motif_id
JOIN statut_intervenant si ON si.id = i.statut_id JOIN statut_intervenant si ON si.id = i.statut_id
...@@ -33187,7 +33186,7 @@ WHERE ...@@ -33187,7 +33186,7 @@ WHERE
i.histo_destruction IS NULL i.histo_destruction IS NULL
AND i.id = COALESCE( OSE_FORMULE.GET_INTERVENANT_ID, i.id ) AND i.id = COALESCE( OSE_FORMULE.GET_INTERVENANT_ID, i.id )
GROUP BY GROUP BY
i.id, i.annee_id, i.structure_id, ti.code, si.service_statutaire, si.depassement_service_du_sans_hc', i.id, i.annee_id, i.structure_id, ti.code, s.code, si.service_statutaire, si.depassement_service_du_sans_hc',
), ),
'V_FORMULE_VOLUME_HORAIRE' => 'V_FORMULE_VOLUME_HORAIRE' =>
array ( array (
...@@ -33204,10 +33203,12 @@ SELECT ...@@ -33204,10 +33203,12 @@ SELECT
t.TYPE_INTERVENTION_ID, t.TYPE_INTERVENTION_ID,
t.TYPE_VOLUME_HORAIRE_ID, t.TYPE_VOLUME_HORAIRE_ID,
t.ETAT_VOLUME_HORAIRE_ID, t.ETAT_VOLUME_HORAIRE_ID,
t.type_volume_horaire_code,
t.TAUX_FI, t.TAUX_FI,
t.TAUX_FA, t.TAUX_FA,
t.TAUX_FC, t.TAUX_FC,
t.STRUCTURE_ID, t.STRUCTURE_ID,
t.structure_code,
t.structure_is_affectation, t.structure_is_affectation,
t.structure_is_univ, t.structure_is_univ,
t.PONDERATION_SERVICE_DU, t.PONDERATION_SERVICE_DU,
...@@ -33231,12 +33232,14 @@ SELECT ...@@ -33231,12 +33232,14 @@ SELECT
vh.type_volume_horaire_id type_volume_horaire_id, vh.type_volume_horaire_id type_volume_horaire_id,
vhe.etat_volume_horaire_id etat_volume_horaire_id, vhe.etat_volume_horaire_id etat_volume_horaire_id,
   
tvh.code type_volume_horaire_code,
CASE WHEN ep.id IS NOT NULL THEN ep.taux_fi ELSE 1 END taux_fi, CASE WHEN ep.id IS NOT NULL THEN ep.taux_fi ELSE 1 END taux_fi,
CASE WHEN ep.id IS NOT NULL THEN ep.taux_fa ELSE 0 END taux_fa, CASE WHEN ep.id IS NOT NULL THEN ep.taux_fa ELSE 0 END taux_fa,
CASE WHEN ep.id IS NOT NULL THEN ep.taux_fc ELSE 0 END taux_fc, CASE WHEN ep.id IS NOT NULL THEN ep.taux_fc ELSE 0 END taux_fc,
ep.structure_id structure_id, s.id structure_id,
CASE WHEN COALESCE(ep.structure_id,0) = COALESCE(i.structure_id,0) THEN 1 ELSE 0 END structure_is_affectation, s.code structure_code,
CASE WHEN COALESCE(ep.structure_id,0) = COALESCE(to_number(p.valeur),0) THEN 1 ELSE 0 END structure_is_univ, CASE WHEN COALESCE(s.id,0) = COALESCE(i.structure_id,0) THEN 1 ELSE 0 END structure_is_affectation,
CASE WHEN COALESCE(s.id,0) = COALESCE(to_number(p.valeur),0) THEN 1 ELSE 0 END structure_is_univ,
MAX(COALESCE( m.ponderation_service_du, 1)) ponderation_service_du, MAX(COALESCE( m.ponderation_service_du, 1)) ponderation_service_du,
MAX(COALESCE( m.ponderation_service_compl, 1)) ponderation_service_compl, MAX(COALESCE( m.ponderation_service_compl, 1)) ponderation_service_compl,
COALESCE(tf.service_statutaire,1) service_statutaire, COALESCE(tf.service_statutaire,1) service_statutaire,
...@@ -33254,8 +33257,10 @@ FROM ...@@ -33254,8 +33257,10 @@ FROM
JOIN intervenant i ON i.id = s.intervenant_id AND i.histo_destruction IS NULL JOIN intervenant i ON i.id = s.intervenant_id AND i.histo_destruction IS NULL
JOIN type_intervention ti ON ti.id = vh.type_intervention_id JOIN type_intervention ti ON ti.id = vh.type_intervention_id
JOIN v_volume_horaire_etat vhe ON vhe.volume_horaire_id = vh.id JOIN v_volume_horaire_etat vhe ON vhe.volume_horaire_id = vh.id
JOIN type_volume_horaire tvh ON tvh.id = vh.type_volume_horaire_id
   
LEFT JOIN element_pedagogique ep ON ep.id = s.element_pedagogique_id LEFT JOIN element_pedagogique ep ON ep.id = s.element_pedagogique_id
LEFT JOIN structure s ON s.id = ep.structure_id
LEFT JOIN etape e ON e.id = ep.etape_id LEFT JOIN etape e ON e.id = ep.etape_id
LEFT JOIN type_formation tf ON tf.id = e.type_formation_id LEFT JOIN type_formation tf ON tf.id = e.type_formation_id
LEFT JOIN element_modulateur em ON em.element_id = s.element_pedagogique_id LEFT JOIN element_modulateur em ON em.element_id = s.element_pedagogique_id
...@@ -33269,8 +33274,8 @@ WHERE ...@@ -33269,8 +33274,8 @@ WHERE
AND vh.motif_non_paiement_id IS NULL AND vh.motif_non_paiement_id IS NULL
AND s.intervenant_id = COALESCE( OSE_FORMULE.GET_INTERVENANT_ID, s.intervenant_id ) AND s.intervenant_id = COALESCE( OSE_FORMULE.GET_INTERVENANT_ID, s.intervenant_id )
GROUP BY GROUP BY
vh.id, s.id, s.intervenant_id, ti.id, vh.type_volume_horaire_id, vhe.etat_volume_horaire_id, ep.id, vh.id, s.id, s.intervenant_id, ti.id, vh.type_volume_horaire_id, vhe.etat_volume_horaire_id, tvh.code,
ep.taux_fi, ep.taux_fa, ep.taux_fc, ep.structure_id, tf.service_statutaire, vh.heures, ep.id, ep.taux_fi, ep.taux_fa, ep.taux_fc, s.id, s.code, tf.service_statutaire, vh.heures,
vh.horaire_debut, vh.horaire_fin, tis.taux_hetd_service, tis.taux_hetd_complementaire, vh.horaire_debut, vh.horaire_fin, tis.taux_hetd_service, tis.taux_hetd_complementaire,
ti.code, ti.taux_hetd_service, ti.taux_hetd_complementaire, i.structure_id, p.valeur ti.code, ti.taux_hetd_service, ti.taux_hetd_complementaire, i.structure_id, p.valeur
   
...@@ -33287,10 +33292,12 @@ SELECT ...@@ -33287,10 +33292,12 @@ SELECT
vhr.type_volume_horaire_id type_volume_horaire_id, vhr.type_volume_horaire_id type_volume_horaire_id,
evh.id etat_volume_horaire_id, evh.id etat_volume_horaire_id,
   
tvh.code type_volume_horaire_code,
0 taux_fi, 0 taux_fi,
0 taux_fa, 0 taux_fa,
0 taux_fc, 0 taux_fc,
sr.structure_id structure_id, s.id structure_id,
s.code structure_code,
CASE WHEN COALESCE(sr.structure_id,0) = COALESCE(i.structure_id,0) THEN 1 ELSE 0 END structure_is_affectation, CASE WHEN COALESCE(sr.structure_id,0) = COALESCE(i.structure_id,0) THEN 1 ELSE 0 END structure_is_affectation,
CASE WHEN COALESCE(sr.structure_id,0) = COALESCE(to_number(p.valeur),0) THEN 1 ELSE 0 END structure_is_univ, CASE WHEN COALESCE(sr.structure_id,0) = COALESCE(to_number(p.valeur),0) THEN 1 ELSE 0 END structure_is_univ,
1 ponderation_service_du, 1 ponderation_service_du,
...@@ -33311,6 +33318,8 @@ FROM ...@@ -33311,6 +33318,8 @@ FROM
JOIN v_volume_horaire_ref_etat vher ON vher.volume_horaire_ref_id = vhr.id JOIN v_volume_horaire_ref_etat vher ON vher.volume_horaire_ref_id = vhr.id
JOIN etat_volume_horaire evh ON evh.id = vher.etat_volume_horaire_id JOIN etat_volume_horaire evh ON evh.id = vher.etat_volume_horaire_id
JOIN fonction_referentiel fr ON fr.id = sr.fonction_id JOIN fonction_referentiel fr ON fr.id = sr.fonction_id
JOIN type_volume_horaire tvh ON tvh.id = vhr.type_volume_horaire_id
LEFT JOIN structure s ON s.id = sr.structure_id
WHERE WHERE
vhr.histo_destruction IS NULL vhr.histo_destruction IS NULL
AND sr.histo_destruction IS NULL AND sr.histo_destruction IS NULL
...@@ -38913,18 +38922,6 @@ WHERE ...@@ -38913,18 +38922,6 @@ WHERE
'INTERVENANT_TEST_ID' => 'ID', 'INTERVENANT_TEST_ID' => 'ID',
), ),
), ),
'FTVH_FORMULE_TEST_STRUCTURE_FK' =>
array (
'name' => 'FTVH_FORMULE_TEST_STRUCTURE_FK',
'table' => 'FORMULE_TEST_VOLUME_HORAIRE',
'rtable' => 'FORMULE_TEST_STRUCTURE',
'delete_rule' => 'CASCADE',
'index' => NULL,
'columns' =>
array (
'STRUCTURE_TEST_ID' => 'ID',
),
),
'GRADE_CORPS_FK' => 'GRADE_CORPS_FK' =>
array ( array (
'name' => 'GRADE_CORPS_FK', 'name' => 'GRADE_CORPS_FK',
...@@ -100,7 +100,6 @@ return [ ...@@ -100,7 +100,6 @@ return [
4 => [ 4 => [
'LIBELLE' => 'Université de Nanterre', 'LIBELLE' => 'Université de Nanterre',
'PACKAGE_NAME' => 'FORMULE_NANTERRE', 'PACKAGE_NAME' => 'FORMULE_NANTERRE',
'VH_PARAM_1_LIBELLE' => 'Code composante',
], ],
5 => [ 5 => [
'LIBELLE' => 'Université de Bretagne Occidentale', 'LIBELLE' => 'Université de Bretagne Occidentale',
...@@ -115,8 +114,6 @@ return [ ...@@ -115,8 +114,6 @@ return [
7 => [ 7 => [
'LIBELLE' => 'Université Lumière Lyon 2', 'LIBELLE' => 'Université Lumière Lyon 2',
'PACKAGE_NAME' => 'FORMULE_LYON2', 'PACKAGE_NAME' => 'FORMULE_LYON2',
'VH_PARAM_1_LIBELLE' => 'Code composante',
'VH_PARAM_2_LIBELLE' => 'Structure interne',
], ],
], ],
......
...@@ -601,7 +601,6 @@ return [ ...@@ -601,7 +601,6 @@ return [
'Application\Provider\Privilege\Privileges' => __DIR__ . '/src/Application/Provider/Privilege/Privileges.php', 'Application\Provider\Privilege\Privileges' => __DIR__ . '/src/Application/Provider/Privilege/Privileges.php',
'Application\Provider\Identity\IdentityProviderFactory' => __DIR__ . '/src/Application/Provider/Identity/IdentityProviderFactory.php', 'Application\Provider\Identity\IdentityProviderFactory' => __DIR__ . '/src/Application/Provider/Identity/IdentityProviderFactory.php',
'Application\Provider\Identity\IdentityProvider' => __DIR__ . '/src/Application/Provider/Identity/IdentityProvider.php', 'Application\Provider\Identity\IdentityProvider' => __DIR__ . '/src/Application/Provider/Identity/IdentityProvider.php',
'Application\Form\Interfaces\DisciplineFormAwareInterface' => __DIR__ . '/src/Application/Form/Interfaces/DisciplineFormAwareInterface.php',
'Application\Form\Intervenant\Interfaces\ModificationServiceDuFieldsetAwareInterface' => __DIR__ . '/src/Application/Form/Intervenant/Interfaces/ModificationServiceDuFieldsetAwareInterface.php', 'Application\Form\Intervenant\Interfaces\ModificationServiceDuFieldsetAwareInterface' => __DIR__ . '/src/Application/Form/Intervenant/Interfaces/ModificationServiceDuFieldsetAwareInterface.php',
'Application\Form\Intervenant\Interfaces\EditionFormAwareInterface' => __DIR__ . '/src/Application/Form/Intervenant/Interfaces/EditionFormAwareInterface.php', 'Application\Form\Intervenant\Interfaces\EditionFormAwareInterface' => __DIR__ . '/src/Application/Form/Intervenant/Interfaces/EditionFormAwareInterface.php',
'Application\Form\Intervenant\Interfaces\ModificationServiceDuFormAwareInterface' => __DIR__ . '/src/Application/Form/Intervenant/Interfaces/ModificationServiceDuFormAwareInterface.php', 'Application\Form\Intervenant\Interfaces\ModificationServiceDuFormAwareInterface' => __DIR__ . '/src/Application/Form/Intervenant/Interfaces/ModificationServiceDuFormAwareInterface.php',
......
...@@ -7,7 +7,6 @@ use Application\Entity\Db\Annee; ...@@ -7,7 +7,6 @@ use Application\Entity\Db\Annee;
use Application\Entity\Db\EtatVolumeHoraire; use Application\Entity\Db\EtatVolumeHoraire;
use Application\Entity\Db\Formule; use Application\Entity\Db\Formule;
use Application\Entity\Db\FormuleTestIntervenant; use Application\Entity\Db\FormuleTestIntervenant;
use Application\Entity\Db\FormuleTestStructure;
use Application\Entity\Db\TypeIntervenant; use Application\Entity\Db\TypeIntervenant;
use Application\Entity\Db\TypeVolumeHoraire; use Application\Entity\Db\TypeVolumeHoraire;
use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\ContextServiceAwareTrait;
...@@ -43,7 +42,6 @@ class FormuleController extends AbstractController ...@@ -43,7 +42,6 @@ class FormuleController extends AbstractController
/* @var $formuleTestIntervenant FormuleTestIntervenant */ /* @var $formuleTestIntervenant FormuleTestIntervenant */
$formuleTestIntervenant = $this->getEvent()->getParam('formuleTestIntervenant'); $formuleTestIntervenant = $this->getEvent()->getParam('formuleTestIntervenant');
$structures = $this->em()->createQuery("SELECT s FROM " . FormuleTestStructure::class . " s ORDER BY s.libelle")->execute();
$formules = $this->em()->createQuery("SELECT f FROM " . Formule::class . " f ORDER BY f.id")->execute(); $formules = $this->em()->createQuery("SELECT f FROM " . Formule::class . " f ORDER BY f.id")->execute();
$annees = $this->em()->createQuery("SELECT a FROM " . Annee::class . " a WHERE a.id BETWEEN 2013 AND 2030 ORDER BY a.id")->execute(); $annees = $this->em()->createQuery("SELECT a FROM " . Annee::class . " a WHERE a.id BETWEEN 2013 AND 2030 ORDER BY a.id")->execute();
$typesIntervenants = $this->em()->createQuery("SELECT ti FROM " . TypeIntervenant::class . " ti ORDER BY ti.id")->execute(); $typesIntervenants = $this->em()->createQuery("SELECT ti FROM " . TypeIntervenant::class . " ti ORDER BY ti.id")->execute();
...@@ -64,6 +62,11 @@ class FormuleController extends AbstractController ...@@ -64,6 +62,11 @@ class FormuleController extends AbstractController
} }
} }
$structures = $formuleTestIntervenant->getStructures();
$structures['__UNIV__'] = 'Université (établissement))'; // Établissement
$structures['__EXTERIEUR__'] = 'Extérieur (autre établissement))'; // Autre établissement
$structures['__new_structure__'] = '- Ajout d\'une nouvelle structure -'; // Pour pouvoir ajouter une structure
return compact('formuleTestIntervenant', 'title', 'annee', 'formuleId', 'structures', 'formules', 'annees', 'typesIntervenants', 'typesVh', 'etatsVh'); return compact('formuleTestIntervenant', 'title', 'annee', 'formuleId', 'structures', 'formules', 'annees', 'typesIntervenants', 'typesVh', 'etatsVh');
} }
...@@ -94,7 +97,7 @@ class FormuleController extends AbstractController ...@@ -94,7 +97,7 @@ class FormuleController extends AbstractController
$formuleTestIntervenant = new FormuleTestIntervenant(); $formuleTestIntervenant = new FormuleTestIntervenant();
} }
$result = ['errors' => '', 'data' => []]; $result = ['errors' => [], 'data' => []];
$data = json_decode($this->params()->fromPost('data'), true); $data = json_decode($this->params()->fromPost('data'), true);
$formuleTestIntervenant->fromArray($data); $formuleTestIntervenant->fromArray($data);
...@@ -116,7 +119,7 @@ class FormuleController extends AbstractController ...@@ -116,7 +119,7 @@ class FormuleController extends AbstractController
$passed = false; $passed = false;
} }
if ($formuleTestIntervenant->getTypeIntervenant()->getCode() == TypeIntervenant::CODE_PERMANENT if ($formuleTestIntervenant->getTypeIntervenant()->getCode() == TypeIntervenant::CODE_PERMANENT
&& !$formuleTestIntervenant->getStructureTest() && !$formuleTestIntervenant->getStructureCode()
) { ) {
$result['errors'][] = 'La structure doit être renseignée'; $result['errors'][] = 'La structure doit être renseignée';
$passed = false; $passed = false;
......
...@@ -15,7 +15,6 @@ class FormuleTestIntervenant ...@@ -15,7 +15,6 @@ class FormuleTestIntervenant
use FormuleAwareTrait; use FormuleAwareTrait;
use AnneeAwareTrait; use AnneeAwareTrait;
use TypeIntervenantAwareTrait; use TypeIntervenantAwareTrait;
use FormuleTestStructureAwareTrait;
use TypeVolumeHoraireAwareTrait; use TypeVolumeHoraireAwareTrait;
use EtatVolumeHoraireAwareTrait; use EtatVolumeHoraireAwareTrait;
...@@ -30,9 +29,9 @@ class FormuleTestIntervenant ...@@ -30,9 +29,9 @@ class FormuleTestIntervenant
private $libelle; private $libelle;
/** /**
* @var float * @var string|null
*/ */
private $heuresDecharge = 0; private $structureCode;
/** /**
* @var float * @var float
...@@ -159,27 +158,50 @@ class FormuleTestIntervenant ...@@ -159,27 +158,50 @@ class FormuleTestIntervenant
/** /**
* @return float * @return string|null
*/ */
public function getHeuresDecharge() public function getStructureCode(): ?string
{ {
return $this->heuresDecharge; return $this->structureCode;
} }
/** /**
* @param float $heuresDecharge * @param string|null $structureCode
*
* @return FormuleTestIntervenant
*/ */
public function setHeuresDecharge(float $heuresDecharge): FormuleTestIntervenant public function setStructureCode(?string $structureCode): FormuleTestIntervenant
{ {
$this->heuresDecharge = $heuresDecharge; $this->structureCode = $structureCode;
return $this; return $this;
} }
/**
* @return string[]
*/
public function getStructures(): array
{
$structures = [];
if ($this->getStructureCode()) {
$structures[$this->getStructureCode()] = $this->getStructureCode();
}
foreach ($this->getVolumeHoraireTest() as $vht) {
if ($vht->getStructureCode()) {
$structures[$vht->getStructureCode()] = $vht->getStructureCode();
}
}
asort($structures);
return $structures;
}
/** /**
* @return float * @return float
*/ */
...@@ -975,6 +997,7 @@ class FormuleTestIntervenant ...@@ -975,6 +997,7 @@ class FormuleTestIntervenant
usort($data['cols'], function ($a, $b) { usort($data['cols'], function ($a, $b) {
$diffLen = strlen($a) - strlen($b); $diffLen = strlen($a) - strlen($b);
if ($diffLen) return $diffLen; if ($diffLen) return $diffLen;
return $a > $b; return $a > $b;
}); });
......
...@@ -3,12 +3,10 @@ ...@@ -3,12 +3,10 @@
namespace Application\Entity\Db; namespace Application\Entity\Db;
use Application\Entity\Db\Traits\FormuleTestIntervenantAwareTrait; use Application\Entity\Db\Traits\FormuleTestIntervenantAwareTrait;
use Application\Entity\Db\Traits\FormuleTestStructureAwareTrait;
class FormuleTestVolumeHoraire class FormuleTestVolumeHoraire
{ {
use FormuleTestIntervenantAwareTrait; use FormuleTestIntervenantAwareTrait;
use FormuleTestStructureAwareTrait;
/** /**
* @var integer * @var integer
...@@ -30,6 +28,11 @@ class FormuleTestVolumeHoraire ...@@ -30,6 +28,11 @@ class FormuleTestVolumeHoraire
*/ */
private $typeInterventionCode; private $typeInterventionCode;
/**
* @var string|null
*/
private $structureCode;
/** /**
* @var float * @var float
*/ */
...@@ -264,6 +267,30 @@ class FormuleTestVolumeHoraire ...@@ -264,6 +267,30 @@ class FormuleTestVolumeHoraire
/**
* @return string|null
*/
public function getStructureCode(): ?string
{
return $this->structureCode;
}
/**
* @param string|null $structureCode
*
* @return FormuleTestVolumeHoraire
*/
public function setStructureCode(?string $structureCode): FormuleTestVolumeHoraire
{
$this->structureCode = $structureCode;
return $this;
}
/** /**
* @return float * @return float
*/ */
......
...@@ -18,9 +18,6 @@ ...@@ -18,9 +18,6 @@
<many-to-one field="typeIntervenant" target-entity="Application\Entity\Db\TypeIntervenant"> <many-to-one field="typeIntervenant" target-entity="Application\Entity\Db\TypeIntervenant">
<join-column name="TYPE_INTERVENANT_ID" referenced-column-name="ID"/> <join-column name="TYPE_INTERVENANT_ID" referenced-column-name="ID"/>
</many-to-one> </many-to-one>
<many-to-one field="structureTest" target-entity="Application\Entity\Db\FormuleTestStructure">
<join-column name="STRUCTURE_TEST_ID" referenced-column-name="ID"/>
</many-to-one>
<many-to-one field="typeVolumeHoraire" target-entity="Application\Entity\Db\TypeVolumeHoraire"> <many-to-one field="typeVolumeHoraire" target-entity="Application\Entity\Db\TypeVolumeHoraire">
<join-column name="TYPE_VOLUME_HORAIRE_ID" referenced-column-name="ID"/> <join-column name="TYPE_VOLUME_HORAIRE_ID" referenced-column-name="ID"/>
</many-to-one> </many-to-one>
...@@ -28,7 +25,7 @@ ...@@ -28,7 +25,7 @@
<join-column name="ETAT_VOLUME_HORAIRE_ID" referenced-column-name="ID"/> <join-column name="ETAT_VOLUME_HORAIRE_ID" referenced-column-name="ID"/>
</many-to-one> </many-to-one>
<field name="heuresDecharge" type="float" column="HEURES_DECHARGE" precision="126" scale="0"/> <field name="structureCode" type="string" column="STRUCTURE_CODE" length="100" nullable="true"/>
<field name="heuresServiceStatutaire" type="float" column="HEURES_SERVICE_STATUTAIRE" precision="126" scale="0"/> <field name="heuresServiceStatutaire" type="float" column="HEURES_SERVICE_STATUTAIRE" precision="126" scale="0"/>
<field name="heuresServiceModifie" type="float" column="HEURES_SERVICE_MODIFIE" precision="126" scale="0"/> <field name="heuresServiceModifie" type="float" column="HEURES_SERVICE_MODIFIE" precision="126" scale="0"/>
<field name="depassementServiceDuSansHC" type="boolean" column="DEPASSEMENT_SERVICE_DU_SANS_HC"/> <field name="depassementServiceDuSansHC" type="boolean" column="DEPASSEMENT_SERVICE_DU_SANS_HC"/>
......
...@@ -11,12 +11,11 @@ ...@@ -11,12 +11,11 @@
<many-to-one field="intervenantTest" target-entity="Application\Entity\Db\FormuleTestIntervenant"> <many-to-one field="intervenantTest" target-entity="Application\Entity\Db\FormuleTestIntervenant">
<join-column name="INTERVENANT_TEST_ID" referenced-column-name="ID"/> <join-column name="INTERVENANT_TEST_ID" referenced-column-name="ID"/>
</many-to-one> </many-to-one>
<many-to-one field="structureTest" target-entity="Application\Entity\Db\FormuleTestStructure">
<join-column name="STRUCTURE_TEST_ID" referenced-column-name="ID"/>
</many-to-one>
<field name="referentiel" type="boolean" column="REFERENTIEL" nullable="false"/> <field name="referentiel" type="boolean" column="REFERENTIEL" nullable="false"/>
<field name="serviceStatutaire" type="boolean" column="SERVICE_STATUTAIRE" nullable="false"/> <field name="serviceStatutaire" type="boolean" column="SERVICE_STATUTAIRE" nullable="false"/>
<field name="typeInterventionCode" type="string" column="TYPE_INTERVENTION_CODE" length="15" nullable="true"/> <field name="typeInterventionCode" type="string" column="TYPE_INTERVENTION_CODE" length="15" nullable="true"/>
<field name="structureCode" type="string" column="STRUCTURE_CODE" length="100" nullable="true"/>
<field name="tauxFi" type="float" column="TAUX_FI" precision="126" scale="0" nullable="false"/> <field name="tauxFi" type="float" column="TAUX_FI" precision="126" scale="0" nullable="false"/>
<field name="tauxFa" type="float" column="TAUX_FA" precision="126" scale="0" nullable="false"/> <field name="tauxFa" type="float" column="TAUX_FA" precision="126" scale="0" nullable="false"/>
<field name="tauxFc" type="float" column="TAUX_FC" precision="126" scale="0" nullable="false"/> <field name="tauxFc" type="float" column="TAUX_FC" precision="126" scale="0" nullable="false"/>
......
...@@ -59,9 +59,6 @@ class FormuleTestIntervenantHydrator implements HydratorInterface ...@@ -59,9 +59,6 @@ class FormuleTestIntervenantHydrator implements HydratorInterface
case 'typeIntervenant': case 'typeIntervenant':
$object->$method($this->findEntity(TypeIntervenant::class, $data[$property])); $object->$method($this->findEntity(TypeIntervenant::class, $data[$property]));
break; break;
case 'structureTest':
$object->$method($this->findEntity(FormuleTestStructure::class,$data[$property]));
break;
case 'typeVolumeHoraire': case 'typeVolumeHoraire':
$object->$method($this->findEntity(TypeVolumeHoraire::class, $data[$property])); $object->$method($this->findEntity(TypeVolumeHoraire::class, $data[$property]));
break; break;
...@@ -85,7 +82,7 @@ class FormuleTestIntervenantHydrator implements HydratorInterface ...@@ -85,7 +82,7 @@ class FormuleTestIntervenantHydrator implements HydratorInterface
$vhs = $object->getVolumeHoraireTest()->toArray(); $vhs = $object->getVolumeHoraireTest()->toArray();
foreach ($data['volumeHoraireTest'] as $index => $vhta) { foreach ($data['volumeHoraireTest'] as $index => $vhta) {
$exists = isset($vhs[$index]); $exists = isset($vhs[$index]);
$toDelete = $vhta['structureTest'] == null; $toDelete = $vhta['structureCode'] == null;
if ($exists && $toDelete) { if ($exists && $toDelete) {
$object->removeVolumeHoraireTest($vhs[$index]); $object->removeVolumeHoraireTest($vhs[$index]);
...@@ -126,7 +123,6 @@ class FormuleTestIntervenantHydrator implements HydratorInterface ...@@ -126,7 +123,6 @@ class FormuleTestIntervenantHydrator implements HydratorInterface
case 'formule': case 'formule':
case 'annee': case 'annee':
case 'typeIntervenant': case 'typeIntervenant':
case 'structureTest':
case 'typeVolumeHoraire': case 'typeVolumeHoraire':
case 'etatVolumeHoraire': case 'etatVolumeHoraire':
$dep = $object->$method(); $dep = $object->$method();
...@@ -169,9 +165,6 @@ class FormuleTestIntervenantHydrator implements HydratorInterface ...@@ -169,9 +165,6 @@ class FormuleTestIntervenantHydrator implements HydratorInterface
case 'heures': case 'heures':
$object->setHeures($data[$property] == null ? 0 : $data[$property]); $object->setHeures($data[$property] == null ? 0 : $data[$property]);
break; break;
case 'structureTest':
$object->$method($this->findEntity(FormuleTestStructure::class,$data[$property]));
break;
default: default:
$object->$method($data[$property]); $object->$method($data[$property]);
} }
...@@ -217,10 +210,6 @@ class FormuleTestIntervenantHydrator implements HydratorInterface ...@@ -217,10 +210,6 @@ class FormuleTestIntervenantHydrator implements HydratorInterface
switch ($property) { switch ($property) {
case 'intervenantTest': case 'intervenantTest':
break; break;
case 'structureTest':
$dep = $object->$method();
$data[$property] = $dep ? $dep->getId() : null;
break;
default: default:
$data[$property] = $object->$method(); $data[$property] = $object->$method();
} }
......
...@@ -74,7 +74,7 @@ class FormuleResultatService extends AbstractEntityService ...@@ -74,7 +74,7 @@ class FormuleResultatService extends AbstractEntityService
'annee' => (integer)$this->getServiceContext()->getAnnee()->getId(), 'annee' => (integer)$this->getServiceContext()->getAnnee()->getId(),
]; ];
$sql = 'SELECT heures FROM V_HETD_PREV_VAL_STRUCT WHERE structure_id = :structure AND annee_id = :annee'; $sql = 'SELECT HEURES FROM V_HETD_PREV_VAL_STRUCT WHERE STRUCTURE_ID = :structure AND ANNEE_ID = :annee';
$sr = $this->getEntityManager()->getConnection()->executeQuery($sql, $params)->fetch(); $sr = $this->getEntityManager()->getConnection()->executeQuery($sql, $params)->fetch();
if (isset($sr['HEURES'])) { if (isset($sr['HEURES'])) {
...@@ -92,7 +92,7 @@ class FormuleResultatService extends AbstractEntityService ...@@ -92,7 +92,7 @@ class FormuleResultatService extends AbstractEntityService
'annee' => (integer)$this->getServiceContext()->getAnnee()->getId(), 'annee' => (integer)$this->getServiceContext()->getAnnee()->getId(),
]; ];
$sql = 'SELECT structure_id, heures FROM V_HETD_PREV_VAL_STRUCT WHERE annee_id = :annee'; $sql = 'SELECT STRUCTURE_ID, HEURES FROM V_HETD_PREV_VAL_STRUCT WHERE ANNEE_ID = :annee';
$stmt = $this->getEntityManager()->getConnection()->executeQuery($sql, $params); $stmt = $this->getEntityManager()->getConnection()->executeQuery($sql, $params);
$res = ['total' => 0]; $res = ['total' => 0];
...@@ -134,7 +134,6 @@ class FormuleResultatService extends AbstractEntityService ...@@ -134,7 +134,6 @@ class FormuleResultatService extends AbstractEntityService
'etatVolumeHoraire' => $etatVolumeHoraire, 'etatVolumeHoraire' => $etatVolumeHoraire,
'HEURES_SERVICE_STATUTAIRE' => $intervenant->getStatut()->getServiceStatutaire(), 'HEURES_SERVICE_STATUTAIRE' => $intervenant->getStatut()->getServiceStatutaire(),
'HEURES_SERVICE_MODIFIE' => 0, 'HEURES_SERVICE_MODIFIE' => 0,
'HEURES_DECHARGE' => 0,
'DEPASSEMENT_SERVICE_DU_SANS_HC' => false, 'DEPASSEMENT_SERVICE_DU_SANS_HC' => false,
's' => [], 's' => [],
'r' => [], 'r' => [],
...@@ -143,21 +142,20 @@ class FormuleResultatService extends AbstractEntityService ...@@ -143,21 +142,20 @@ class FormuleResultatService extends AbstractEntityService
'has-calcul' => false, 'has-calcul' => false,
]; ];
$sql = "SELECT * FROM v_formule_intervenant WHERE intervenant_id = :intervenant"; $sql = "SELECT * FROM V_FORMULE_INTERVENANT WHERE INTERVENANT_ID = :intervenant";
$id = $conn->fetchAssoc($sql, $params); $id = $conn->fetchAssoc($sql, $params);
if ($id) { if ($id) {
$data['HEURES_SERVICE_STATUTAIRE'] = $id['HEURES_SERVICE_STATUTAIRE']; $data['HEURES_SERVICE_STATUTAIRE'] = $id['HEURES_SERVICE_STATUTAIRE'];
$data['HEURES_SERVICE_MODIFIE'] = $id['HEURES_SERVICE_MODIFIE']; $data['HEURES_SERVICE_MODIFIE'] = $id['HEURES_SERVICE_MODIFIE'];
$data['HEURES_DECHARGE'] = $id['HEURES_DECHARGE'];
$data['DEPASSEMENT_SERVICE_DU_SANS_HC'] = $id['DEPASSEMENT_SERVICE_DU_SANS_HC'] == '1'; $data['DEPASSEMENT_SERVICE_DU_SANS_HC'] = $id['DEPASSEMENT_SERVICE_DU_SANS_HC'] == '1';
} }
/* Volumes horaires */ /* Volumes horaires */
$sql = " $sql = "
SELECT fvh.* FROM v_formule_volume_horaire fvh WHERE SELECT FVH.* FROM V_FORMULE_VOLUME_HORAIRE FVH WHERE
fvh.intervenant_id = :intervenant FVH.INTERVENANT_ID = :intervenant
AND fvh.type_volume_horaire_id = :typeVolumeHoraire AND FVH.TYPE_VOLUME_HORAIRE_ID = :typeVolumeHoraire
AND fvh.etat_volume_horaire_id >= :etatVolumeHoraire AND FVH.ETAT_VOLUME_HORAIRE_ID >= :etatVolumeHoraire
"; ";
$vhds = $conn->fetchAll($sql, $params); $vhds = $conn->fetchAll($sql, $params);
foreach ($vhds as $vhd) { foreach ($vhds as $vhd) {
...@@ -204,9 +202,9 @@ class FormuleResultatService extends AbstractEntityService ...@@ -204,9 +202,9 @@ class FormuleResultatService extends AbstractEntityService
} }
/* Résultats de formule */ /* Résultats de formule */
$sql = "SELECT * FROM formule_resultat WHERE intervenant_id = :intervenant $sql = "SELECT * FROM FORMULE_RESULTAT WHERE INTERVENANT_ID = :intervenant
AND type_volume_horaire_id = :typeVolumeHoraire AND TYPE_VOLUME_HORAIRE_ID = :typeVolumeHoraire
AND etat_volume_horaire_id = :etatVolumeHoraire"; AND ETAT_VOLUME_HORAIRE_ID = :etatVolumeHoraire";
$fr = $conn->fetchAssoc($sql, $params); $fr = $conn->fetchAssoc($sql, $params);
if ($fr) { if ($fr) {
$data['has-calcul'] = true; $data['has-calcul'] = true;
...@@ -224,7 +222,7 @@ class FormuleResultatService extends AbstractEntityService ...@@ -224,7 +222,7 @@ class FormuleResultatService extends AbstractEntityService
+ $data['HEURES_COMPL_FC'] + $data['HEURES_COMPL_FC']
+ $data['HEURES_COMPL_FC_MAJOREES'] + $data['HEURES_COMPL_FC_MAJOREES']
+ $data['HEURES_COMPL_REFERENTIEL']; + $data['HEURES_COMPL_REFERENTIEL'];
$sql = "SELECT * FROM formule_resultat_service WHERE formule_resultat_id = :frId"; $sql = "SELECT * FROM FORMULE_RESULTAT_SERVICE WHERE FORMULE_RESULTAT_ID = :frId";
$frss = $conn->fetchAll($sql, compact('frId')); $frss = $conn->fetchAll($sql, compact('frId'));
foreach ($frss as $frs) { foreach ($frss as $frs) {
$dsId = $frs['SERVICE_ID']; $dsId = $frs['SERVICE_ID'];
...@@ -237,7 +235,7 @@ class FormuleResultatService extends AbstractEntityService ...@@ -237,7 +235,7 @@ class FormuleResultatService extends AbstractEntityService
} }
} }
$sql = "SELECT * FROM formule_resultat_service_ref WHERE formule_resultat_id = :frId"; $sql = "SELECT * FROM FORMULE_RESULTAT_SERVICE_REF WHERE FORMULE_RESULTAT_ID = :frId";
$frss = $conn->fetchAll($sql, compact('frId')); $frss = $conn->fetchAll($sql, compact('frId'));
foreach ($frss as $frs) { foreach ($frss as $frs) {
$drId = $frs['SERVICE_REFERENTIEL_ID']; $drId = $frs['SERVICE_REFERENTIEL_ID'];
......
...@@ -149,7 +149,7 @@ echo $this->tag('h1', ['class' => 'page-header'])->html($title); ...@@ -149,7 +149,7 @@ echo $this->tag('h1', ['class' => 'page-header'])->html($title);
</tr> </tr>
<tr> <tr>
<th>Structure</th> <th>Structure</th>
<td class="saisie"><?= $lf->select('structureTest', [], $structures) ?></td> <td class="saisie"><?= $lf->select('structureCode', ['data-type' => 'string'], $structures) ?></td>
</tr> </tr>
<tr> <tr>
<th>Type de volume horaire</th> <th>Type de volume horaire</th>
...@@ -159,10 +159,6 @@ echo $this->tag('h1', ['class' => 'page-header'])->html($title); ...@@ -159,10 +159,6 @@ echo $this->tag('h1', ['class' => 'page-header'])->html($title);
<th>État de volume horaire</th> <th>État de volume horaire</th>
<td class="saisie"><?= $lf->select('etatVolumeHoraire', ['data-default' => 1], $etatsVh) ?></td> <td class="saisie"><?= $lf->select('etatVolumeHoraire', ['data-default' => 1], $etatsVh) ?></td>
</tr> </tr>
<tr>
<th>Heures de décharge</th>
<td class="saisie"><?= $lf->input('heuresDecharge') ?></td>
</tr>
<tr> <tr>
<th>Heures de service statutaire</th> <th>Heures de service statutaire</th>
<td class="saisie"><?= $lf->input('heuresServiceStatutaire') ?></td> <td class="saisie"><?= $lf->input('heuresServiceStatutaire') ?></td>
...@@ -327,7 +323,7 @@ echo $this->tag('h1', ['class' => 'page-header'])->html($title); ...@@ -327,7 +323,7 @@ echo $this->tag('h1', ['class' => 'page-header'])->html($title);
<?php for ($i = 0; $i < $maxLignes; $i++): $lf->index = $i; ?> <?php for ($i = 0; $i < $maxLignes; $i++): $lf->index = $i; ?>
<tr> <tr>
<th><?= $i + 1 ?></th> <th><?= $i + 1 ?></th>
<td class="saisie"><?= $lf->select('structureTest', [], $structures) ?></td> <td class="saisie"><?= $lf->select('structureCode', ['data-type' => 'string'], $structures) ?></td>
<td class="saisie"><?= $lf->select('serviceStatutaire', ['data-type' => 'bool', 'data-default' => true]) ?></td> <td class="saisie"><?= $lf->select('serviceStatutaire', ['data-type' => 'bool', 'data-default' => true]) ?></td>
<td class="saisie"><?= $lf->select('typeInterventionCode', ['data-type' => 'string'], $typesInterventions) ?></td> <td class="saisie"><?= $lf->select('typeInterventionCode', ['data-type' => 'string'], $typesInterventions) ?></td>
<td><?= $lf->input('tauxFi', [ <td><?= $lf->input('tauxFi', [
...@@ -492,6 +488,7 @@ echo $this->tag('h1', ['class' => 'page-header'])->html($title); ...@@ -492,6 +488,7 @@ echo $this->tag('h1', ['class' => 'page-header'])->html($title);
$.widget("ose.formuleTestIntervenant", { $.widget("ose.formuleTestIntervenant", {
id: null, id: null,
saving: false, saving: false,
structures: [],
valueToVariable: function (value, type) valueToVariable: function (value, type)
{ {
...@@ -653,7 +650,7 @@ echo $this->tag('h1', ['class' => 'page-header'])->html($title); ...@@ -653,7 +650,7 @@ echo $this->tag('h1', ['class' => 'page-header'])->html($title);
if ('typeInterventionCode' == name) { if ('typeInterventionCode' == name) {
that.changementTypeIntervention($(this)); that.changementTypeIntervention($(this));
} }
if ('structureTest' == name) { if ('structureCode' == name) {
that.changementStructure($(this)); that.changementStructure($(this));
} }
}); });
...@@ -768,10 +765,22 @@ echo $this->tag('h1', ['class' => 'page-header'])->html($title); ...@@ -768,10 +765,22 @@ echo $this->tag('h1', ['class' => 'page-header'])->html($title);
initStructures: function ()
{
this.structures = [];
},
changementStructure: function (select) changementStructure: function (select)
{ {
var tr = select.parent().parent(); var tr = select.parent().parent();
var value = select.val(); var value = select.val();
if (value === '__new_structure__') {
this.ajoutStructure(select);
}
if (!value) { if (!value) {
tr.find('.dinput[data-name=serviceStatutaire]').parent().css('visibility', 'hidden'); tr.find('.dinput[data-name=serviceStatutaire]').parent().css('visibility', 'hidden');
tr.find('.dinput[data-name=typeInterventionCode]').parent().css('visibility', 'hidden'); tr.find('.dinput[data-name=typeInterventionCode]').parent().css('visibility', 'hidden');
...@@ -785,6 +794,25 @@ echo $this->tag('h1', ['class' => 'page-header'])->html($title); ...@@ -785,6 +794,25 @@ echo $this->tag('h1', ['class' => 'page-header'])->html($title);
ajoutStructure: function (element)
{
var structure = prompt("Ajout d'une nouvelle structure");
if (structure && -1 === this.structures.indexOf(structure)) {
this.structures.push(structure);
this.element.find(".dinput[data-name=structureCode]").each(function () {
var option = $('<option>');
option.val(structure);
option.text(structure);
$(this).find("[value='__new_structure__']").before(option);
});
}
element.val(structure);
},
affLignes: function () affLignes: function ()
{ {
// TODO : cacher les lignes en trop // TODO : cacher les lignes en trop
...@@ -878,16 +906,10 @@ echo $this->tag('h1', ['class' => 'page-header'])->html($title); ...@@ -878,16 +906,10 @@ echo $this->tag('h1', ['class' => 'page-header'])->html($title);
that.changementTypeIntervention($(this)); that.changementTypeIntervention($(this));
}); });
this.element.find(".dinput[data-name='structureTest']").change(function () { this.element.find(".dinput[data-name='structureCode']").change(function () {
that.changementStructure($(this)); that.changementStructure($(this));
}); });
// Désactivé, car si on saisit une deuxième valeur, elle est remplacée par le rés de l'AJAX précédant...
// this.element.find(".dinput").change(function () {
// that.autoSave();
// });
this.element.find(".enregistrer").click(function () { this.element.find(".enregistrer").click(function () {
that.save(true); that.save(true);
}); });
......
...@@ -84,15 +84,6 @@ function vn(array $array, $key, $type = 's') ...@@ -84,15 +84,6 @@ function vn(array $array, $key, $type = 's')
étant du service dû. étant du service dû.
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php if (vn($data, 'HEURES_DECHARGE', 'f') < 0): ?>
<div class="alert alert-info alert-dismissible" role="alert" style="margin-top:1em">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<strong>* </strong>
Cet intervenant bénéficie d'une décharge de service et ne peut, par conséquent, prétendre au versement d'heures
complémentaires.
</div>
<?php endif; ?>
<?php endif; ?> <?php endif; ?>
...@@ -260,7 +251,9 @@ function vn(array $array, $key, $type = 's') ...@@ -260,7 +251,9 @@ function vn(array $array, $key, $type = 's')
<div class="row"> <div class="row">
<div class="col-sm-4">Solde</div> <div class="col-sm-4">Solde</div>
<div class="col-sm-2 nombre"><span class="label label-<?php $hs = (float)vn($data, 'SOLDE', 'f'); <div class="col-sm-2 nombre"><span class="label label-<?php $hs = (float)vn($data, 'SOLDE', 'f');
if ($hs == 0) echo 'info'; elseif ($hs < 0) echo 'danger'; if ($hs == 0) {
echo 'info';
} elseif ($hs < 0) echo 'danger';
else echo 'warning'; ?>" else echo 'warning'; ?>"
style="font-size:12pt"><?= vn($data, 'SOLDE') ?></span> style="font-size:12pt"><?= vn($data, 'SOLDE') ?></span>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment