Commit e246bd68 authored by Laurent Lécluse's avatar Laurent Lécluse
Browse files

Mise à jour de l'infra formule round 1

parent dde21361
......@@ -104,7 +104,6 @@ $data = explode("\n", $data);
'heuresServiceStatutaire' => stringToFloat($c[5]),
'depassementServiceDuSansHC' => stringToFloat($c[6]),
'heuresServiceModifie' => stringToFloat($c[7]),
'heuresDecharge' => stringToFloat($c[8]),
'typeVolumeHoraire' => $c[9],
'etatVolumeHoraire' => $c[10],
];
......@@ -118,7 +117,6 @@ $data = explode("\n", $data);
$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->setEtatVolumeHoraire($bdd->getRepository(\Application\Entity\Db\EtatVolumeHoraire::class)->findOneBy(['libelle' => $fi['etatVolumeHoraire']]));
$fti->setHeuresDecharge($fi['heuresDecharge']);
$fti->setHeuresServiceStatutaire($fi['heuresServiceStatutaire']);
$fti->setHeuresServiceModifie($fi['heuresServiceModifie']);
$fti->setDepassementServiceDuSansHC($fi['depassementServiceDuSansHC'] == '1');
......
......@@ -7,5 +7,8 @@
* @var $viewName string
* @var $viewFile string
*/
$utilisateur = $controller->dentity()['db'];
var_dump($utilisateur);
\ No newline at end of file
......@@ -10,7 +10,7 @@
"require" : {
"php" : ">=7.3 || >=7.4",
"mpdf/mpdf" : "8.0.4 as 7.1.7",
"unicaen/app" : "3.0.7",
"unicaen/app" : "3.0.8",
"unicaen/auth" : "3.0.9",
"zendframework/zend-code": "3.3.2",
"unicaen/bjy-authorize" : "3.0.4",
......
......@@ -6639,18 +6639,7 @@
'default' => '1',
'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 (
'name' => 'HEURES_SERVICE_STATUTAIRE',
'type' => 'FLOAT',
......@@ -6921,7 +6910,7 @@
'length' => 0,
'scale' => '0',
'precision' => NULL,
'nullable' => false,
'nullable' => true,
'default' => NULL,
'commentaire' => NULL,
),
......@@ -7288,6 +7277,17 @@
'default' => NULL,
'commentaire' => NULL,
),
'STRUCTURE_CODE' =>
array (
'name' => 'STRUCTURE_CODE',
'type' => 'VARCHAR2',
'length' => 100,
'scale' => NULL,
'precision' => NULL,
'nullable' => true,
'default' => NULL,
'commentaire' => NULL,
),
),
),
'GRADE' =>
......@@ -26963,10 +26963,11 @@ END OSE_EVENT;',
etat_volume_horaire_id NUMERIC,
 
-- paramètres globaux
heures_decharge FLOAT DEFAULT 0,
type_volume_horaire_code VARCHAR(15),
heures_service_statutaire FLOAT DEFAULT 0,
heures_service_modifie FLOAT DEFAULT 0,
depassement_service_du_sans_hc BOOLEAN DEFAULT FALSE,
structure_code VARCHAR(100),
type_intervenant_code VARCHAR(2),
 
-- paramètres spacifiques
......@@ -26992,6 +26993,8 @@ END OSE_EVENT;',
structure_id NUMERIC,
 
-- paramètres globaux
type_volume_horaire_code VARCHAR(15),
structure_code VARCHAR(100),
structure_is_affectation BOOLEAN DEFAULT TRUE,
structure_is_univ BOOLEAN DEFAULT FALSE,
service_statutaire BOOLEAN DEFAULT TRUE,
......@@ -27142,7 +27145,6 @@ END OSE_FORMULE;',
intervenant.heures_service_statutaire,
i_dep_service_du_sans_hc,
intervenant.heures_service_modifie,
intervenant.heures_decharge,
intervenant.param_1,
intervenant.param_2,
intervenant.param_3,
......@@ -27153,9 +27155,7 @@ END OSE_FORMULE;',
 
intervenant.depassement_service_du_sans_hc := (i_dep_service_du_sans_hc = 1);
intervenant.service_du := CASE
WHEN intervenant.depassement_service_du_sans_hc -- HC traitées comme du service
OR intervenant.heures_decharge < 0 -- s\'il y a une décharge => aucune HC
WHEN intervenant.depassement_service_du_sans_hc
THEN 9999
ELSE intervenant.heures_service_statutaire + intervenant.heures_service_modifie
END;
......@@ -27169,7 +27169,6 @@ END OSE_FORMULE;',
intervenant.heures_service_statutaire := 0;
intervenant.depassement_service_du_sans_hc := FALSE;
intervenant.heures_service_modifie := 0;
intervenant.heures_decharge := 0;
intervenant.type_intervenant_code := \'E\';
intervenant.service_du := 0;
intervenant.param_1 := NULL;
......@@ -27193,7 +27192,6 @@ END OSE_FORMULE;',
fti.structure_test_id,
fti.type_volume_horaire_id,
fti.etat_volume_horaire_id,
fti.heures_decharge,
fti.heures_service_statutaire,
fti.heures_service_modifie,
fti.depassement_service_du_sans_hc,
......@@ -27210,7 +27208,6 @@ END OSE_FORMULE;',
intervenant.structure_id,
intervenant.type_volume_horaire_id,
intervenant.etat_volume_horaire_id,
intervenant.heures_decharge,
intervenant.heures_service_statutaire,
intervenant.heures_service_modifie,
dsdushc,
......@@ -27229,9 +27226,7 @@ END OSE_FORMULE;',
 
intervenant.depassement_service_du_sans_hc := (dsdushc = 1);
intervenant.service_du := CASE
WHEN intervenant.depassement_service_du_sans_hc -- HC traitées comme du service
OR intervenant.heures_decharge < 0 -- s\'il y a une décharge => aucune HC
WHEN intervenant.depassement_service_du_sans_hc
THEN 9999
ELSE intervenant.heures_service_statutaire + intervenant.heures_service_modifie
END;
......@@ -27243,7 +27238,6 @@ END OSE_FORMULE;',
intervenant.heures_service_statutaire := 0;
intervenant.depassement_service_du_sans_hc := FALSE;
intervenant.heures_service_modifie := 0;
intervenant.heures_decharge := 0;
intervenant.type_intervenant_code := \'E\';
intervenant.service_du := 0;
intervenant.param_1 := null;
......@@ -27289,10 +27283,12 @@ END OSE_FORMULE;',
vh_type_intervention_id,
vh_type_volume_horaire_id,
vh_etat_volume_horaire_id,
vh.type_volume_horaire_code,
vh.taux_fi,
vh.taux_fa,
vh.taux_fc,
vh.structure_id,
vh.structure_code,
vh_structure_is_affectation,
vh_structure_is_univ,
vh.ponderation_service_du,
......@@ -27648,7 +27644,7 @@ END OSE_FORMULE;',
);
 
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)
ELSE intervenant.heures_service_statutaire + intervenant.heures_service_modifie
END,2);
......@@ -27909,7 +27905,6 @@ END OSE_FORMULE;',
ose_test.echo(\'annee_id = \' || intervenant.annee_id);
ose_test.echo(\'structure_id = \' || intervenant.structure_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_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);
......@@ -33171,14 +33166,18 @@ GROUP BY
SELECT
i.id intervenant_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,
s.code structure_code,
si.service_statutaire heures_service_statutaire,
si.depassement_service_du_sans_hc depassement_service_du_sans_hc,
COALESCE( SUM( msd.heures * mms.multiplicateur ), 0 ) heures_service_modifie,
COALESCE( SUM( msd.heures * mms.multiplicateur * mms.decharge ), 0 ) heures_decharge
CASE WHEN
si.depassement_service_du_sans_hc = 1
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
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 motif_modification_service mms ON mms.id = msd.motif_id
JOIN statut_intervenant si ON si.id = i.statut_id
......@@ -33187,7 +33186,7 @@ WHERE
i.histo_destruction IS NULL
AND i.id = COALESCE( OSE_FORMULE.GET_INTERVENANT_ID, i.id )
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' =>
array (
......@@ -33204,10 +33203,12 @@ SELECT
t.TYPE_INTERVENTION_ID,
t.TYPE_VOLUME_HORAIRE_ID,
t.ETAT_VOLUME_HORAIRE_ID,
t.type_volume_horaire_code,
t.TAUX_FI,
t.TAUX_FA,
t.TAUX_FC,
t.STRUCTURE_ID,
t.structure_code,
t.structure_is_affectation,
t.structure_is_univ,
t.PONDERATION_SERVICE_DU,
......@@ -33231,12 +33232,14 @@ SELECT
vh.type_volume_horaire_id type_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_fa ELSE 0 END taux_fa,
CASE WHEN ep.id IS NOT NULL THEN ep.taux_fc ELSE 0 END taux_fc,
ep.structure_id structure_id,
CASE WHEN COALESCE(ep.structure_id,0) = COALESCE(i.structure_id,0) THEN 1 ELSE 0 END structure_is_affectation,
CASE WHEN COALESCE(ep.structure_id,0) = COALESCE(to_number(p.valeur),0) THEN 1 ELSE 0 END structure_is_univ,
s.id structure_id,
s.code structure_code,
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_compl, 1)) ponderation_service_compl,
COALESCE(tf.service_statutaire,1) service_statutaire,
......@@ -33254,8 +33257,10 @@ FROM
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 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 structure s ON s.id = ep.structure_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 element_modulateur em ON em.element_id = s.element_pedagogique_id
......@@ -33269,8 +33274,8 @@ WHERE
AND vh.motif_non_paiement_id IS NULL
AND s.intervenant_id = COALESCE( OSE_FORMULE.GET_INTERVENANT_ID, s.intervenant_id )
GROUP BY
vh.id, s.id, s.intervenant_id, ti.id, vh.type_volume_horaire_id, vhe.etat_volume_horaire_id, ep.id,
ep.taux_fi, ep.taux_fa, ep.taux_fc, ep.structure_id, tf.service_statutaire, vh.heures,
vh.id, s.id, s.intervenant_id, ti.id, vh.type_volume_horaire_id, vhe.etat_volume_horaire_id, tvh.code,
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,
ti.code, ti.taux_hetd_service, ti.taux_hetd_complementaire, i.structure_id, p.valeur
 
......@@ -33287,10 +33292,12 @@ SELECT
vhr.type_volume_horaire_id type_volume_horaire_id,
evh.id etat_volume_horaire_id,
 
tvh.code type_volume_horaire_code,
0 taux_fi,
0 taux_fa,
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(to_number(p.valeur),0) THEN 1 ELSE 0 END structure_is_univ,
1 ponderation_service_du,
......@@ -33304,13 +33311,15 @@ SELECT
1 taux_service_du,
1 taux_service_compl
FROM
volume_horaire_ref vhr
JOIN parametre p ON p.nom = \'structure_univ\'
JOIN service_referentiel sr ON sr.id = vhr.service_referentiel_id
JOIN intervenant i ON i.id = sr.intervenant_id AND i.histo_destruction IS NULL
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 fonction_referentiel fr ON fr.id = sr.fonction_id
volume_horaire_ref vhr
JOIN parametre p ON p.nom = \'structure_univ\'
JOIN service_referentiel sr ON sr.id = vhr.service_referentiel_id
JOIN intervenant i ON i.id = sr.intervenant_id AND i.histo_destruction IS NULL
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 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
vhr.histo_destruction IS NULL
AND sr.histo_destruction IS NULL
......@@ -38913,19 +38922,7 @@ WHERE
'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 (
'name' => 'GRADE_CORPS_FK',
'table' => 'GRADE',
......@@ -98,9 +98,8 @@ return [
'PACKAGE_NAME' => 'FORMULE_ULHN',
],
4 => [
'LIBELLE' => 'Université de Nanterre',
'PACKAGE_NAME' => 'FORMULE_NANTERRE',
'VH_PARAM_1_LIBELLE' => 'Code composante',
'LIBELLE' => 'Université de Nanterre',
'PACKAGE_NAME' => 'FORMULE_NANTERRE',
],
5 => [
'LIBELLE' => 'Université de Bretagne Occidentale',
......@@ -113,10 +112,8 @@ return [
'PACKAGE_NAME' => 'FORMULE_ENSICAEN',
],
7 => [
'LIBELLE' => 'Université Lumière Lyon 2',
'PACKAGE_NAME' => 'FORMULE_LYON2',
'VH_PARAM_1_LIBELLE' => 'Code composante',
'VH_PARAM_2_LIBELLE' => 'Structure interne',
'LIBELLE' => 'Université Lumière Lyon 2',
'PACKAGE_NAME' => 'FORMULE_LYON2',
],
],
......
......@@ -601,7 +601,6 @@ return [
'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\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\EditionFormAwareInterface' => __DIR__ . '/src/Application/Form/Intervenant/Interfaces/EditionFormAwareInterface.php',
'Application\Form\Intervenant\Interfaces\ModificationServiceDuFormAwareInterface' => __DIR__ . '/src/Application/Form/Intervenant/Interfaces/ModificationServiceDuFormAwareInterface.php',
......
......@@ -7,7 +7,6 @@ use Application\Entity\Db\Annee;
use Application\Entity\Db\EtatVolumeHoraire;
use Application\Entity\Db\Formule;
use Application\Entity\Db\FormuleTestIntervenant;
use Application\Entity\Db\FormuleTestStructure;
use Application\Entity\Db\TypeIntervenant;
use Application\Entity\Db\TypeVolumeHoraire;
use Application\Service\Traits\ContextServiceAwareTrait;
......@@ -43,7 +42,6 @@ class FormuleController extends AbstractController
/* @var $formuleTestIntervenant 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();
$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();
......@@ -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');
}
......@@ -94,7 +97,7 @@ class FormuleController extends AbstractController
$formuleTestIntervenant = new FormuleTestIntervenant();
}
$result = ['errors' => '', 'data' => []];
$result = ['errors' => [], 'data' => []];
$data = json_decode($this->params()->fromPost('data'), true);
$formuleTestIntervenant->fromArray($data);
......@@ -116,7 +119,7 @@ class FormuleController extends AbstractController
$passed = false;
}
if ($formuleTestIntervenant->getTypeIntervenant()->getCode() == TypeIntervenant::CODE_PERMANENT
&& !$formuleTestIntervenant->getStructureTest()
&& !$formuleTestIntervenant->getStructureCode()
) {
$result['errors'][] = 'La structure doit être renseignée';
$passed = false;
......
......@@ -15,7 +15,6 @@ class FormuleTestIntervenant
use FormuleAwareTrait;
use AnneeAwareTrait;
use TypeIntervenantAwareTrait;
use FormuleTestStructureAwareTrait;
use TypeVolumeHoraireAwareTrait;
use EtatVolumeHoraireAwareTrait;
......@@ -30,9 +29,9 @@ class FormuleTestIntervenant
private $libelle;
/**
* @var float
* @var string|null
*/
private $heuresDecharge = 0;
private $structureCode;
/**
* @var float
......@@ -67,7 +66,7 @@ class FormuleTestIntervenant
/**
* @var float
*/
private $tauxTpServiceCompl = 2/3;
private $tauxTpServiceCompl = 2 / 3;
/**
* @var float
......@@ -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 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
*/
......@@ -937,34 +959,34 @@ class FormuleTestIntervenant
*/
public function getDebugInfo()
{
$data = ['lines' => [], 'cols' => [], 'cells' => [], 'inds' => []];
$data = ['lines' => [], 'cols' => [], 'cells' => [], 'inds' => []];
$calcs = [];
$a = explode('[',$this->debugInfo);
foreach( $a as $d ){
$d = explode( '|', $d);
switch($d[0]){
$a = explode('[', $this->debugInfo);
foreach ($a as $d) {
$d = explode('|', $d);
switch ($d[0]) {
case 'cell':
$c = $d[1];
$l = (int)$d[2];
$c = $d[1];
$l = (int)$d[2];
$val = (float)$d[3];
if ($l > 0){
if ($l > 0) {
$data['cells'][$c][$l] = $val;
$data['lines'][$l] = $l;
$data['cols'][$c] = $c;
}else{
$data['lines'][$l] = $l;
$data['cols'][$c] = $c;
} else {
$data['inds'][$c] = $val;
}
break;
case 'calc':
$fnc = $d[1];
$c = $d[2];
$res = $d[3];
$fnc = $d[1];
$c = $d[2];
$res = $d[3];
$data['cells'][$c][$fnc] = $res;
$calcs[$fnc] = $fnc;
$data['cols'][$c] = $c;
$calcs[$fnc] = $fnc;
$data['cols'][$c] = $c;
break;
}
}
......@@ -972,9 +994,10 @@ class FormuleTestIntervenant
sort($data['lines']);
sort($calcs);
$data['lines'] = array_merge($data['lines'], $calcs);
usort($data['cols'], function($a, $b){
$diffLen = strlen($a ) - strlen($b);
usort($data['cols'], function ($a, $b) {
$diffLen = strlen($a) - strlen($b);
if ($diffLen) return $diffLen;
return $a > $b;
});
......
......@@ -3,12 +3,10 @@
namespace Application\Entity\Db;
use Application\Entity\Db\Traits\FormuleTestIntervenantAwareTrait;
use Application\Entity\Db\Traits\FormuleTestStructureAwareTrait;
class FormuleTestVolumeHoraire
{
use FormuleTestIntervenantAwareTrait;
use FormuleTestStructureAwareTrait;
/**
* @var integer
......@@ -30,6 +28,11 @@ class FormuleTestVolumeHoraire
*/
private $typeInterventionCode;
/**
* @var string|null
*/
private $structureCode;
/**
* @var float
*/
......@@ -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
*/
......
......@@ -18,9 +18,6 @@
<many-to-one field="typeIntervenant" target-entity="Application\Entity\Db\TypeIntervenant">
<join-column name="TYPE_INTERVENANT_ID" referenced-column-name="ID"/>
</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">
<join-column name="TYPE_VOLUME_HORAIRE_ID" referenced-column-name="ID"/>