Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OSE
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
OSE
Commits
2b80d950
Commit
2b80d950
authored
Jun 29, 2020
by
Laurent Lecluse
Browse files
Options
Downloads
Patches
Plain Diff
Modif de la description du plafond des HETD
parent
d0e26986
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
module/Application/src/Application/Form/StatutIntervenant/StatutIntervenantSaisieForm.php
+28
-44
28 additions, 44 deletions
...on/Form/StatutIntervenant/StatutIntervenantSaisieForm.php
with
28 additions
and
44 deletions
module/Application/src/Application/Form/StatutIntervenant/StatutIntervenantSaisieForm.php
+
28
−
44
View file @
2b80d950
...
@@ -28,7 +28,6 @@ class StatutIntervenantSaisieForm extends AbstractForm
...
@@ -28,7 +28,6 @@ class StatutIntervenantSaisieForm extends AbstractForm
use
TypeAgrementStatutServiceAwareTrait
;
use
TypeAgrementStatutServiceAwareTrait
;
public
function
init
()
public
function
init
()
{
{
$hydrator
=
new
StatutIntervenantHydrator
();
$hydrator
=
new
StatutIntervenantHydrator
();
...
@@ -135,31 +134,30 @@ class StatutIntervenantSaisieForm extends AbstractForm
...
@@ -135,31 +134,30 @@ class StatutIntervenantSaisieForm extends AbstractForm
$qb
=
$this
->
getServiceTypeAgrement
()
->
finderByHistorique
();
$qb
=
$this
->
getServiceTypeAgrement
()
->
finderByHistorique
();
$typesAgrement
=
$this
->
getServiceTypeAgrement
()
->
getList
(
$qb
);
$typesAgrement
=
$this
->
getServiceTypeAgrement
()
->
getList
(
$qb
);
foreach
(
$typesAgrement
as
$type
)
foreach
(
$typesAgrement
as
$type
)
{
{
$this
->
add
([
$this
->
add
([
'name'
=>
$type
->
getCode
(),
'name'
=>
$type
->
getCode
(),
'options'
=>
[
'options'
=>
[
'label'
=>
$type
->
getLibelle
(),
'label'
=>
$type
->
getLibelle
(),
'value_options'
=>
[
'value_options'
=>
[
0
=>
'Non'
,
0
=>
'Non'
,
1
=>
'Oui'
1
=>
'Oui'
,
]
]
,
],
],
'attributes'
=>
[
'attributes'
=>
[
'value'
=>
0
,
'value'
=>
0
,
],
],
'type'
=>
'Zend\Form\Element\Radio'
'type'
=>
'Zend\Form\Element\Radio'
,
]);
]);
$this
->
add
([
$this
->
add
([
'name'
=>
$type
->
getCode
()
.
'-DUREE_VIE'
,
'name'
=>
$type
->
getCode
()
.
'-DUREE_VIE'
,
'options'
=>
[
'options'
=>
[
'suffix'
=>
'an(s)'
'suffix'
=>
'an(s)'
,
],
],
'attributes'
=>
[
'attributes'
=>
[
'title'
=>
"Nombre d'annnée de validité de l'agrément"
,
'title'
=>
"Nombre d'annnée de validité de l'agrément"
,
'value'
=>
'1'
'value'
=>
'1'
,
],
],
'type'
=>
'Text'
,
'type'
=>
'Text'
,
...
@@ -167,10 +165,6 @@ class StatutIntervenantSaisieForm extends AbstractForm
...
@@ -167,10 +165,6 @@ class StatutIntervenantSaisieForm extends AbstractForm
}
}
$this
->
add
([
$this
->
add
([
'name'
=>
'service-statutaire'
,
'name'
=>
'service-statutaire'
,
'options'
=>
[
'options'
=>
[
...
@@ -190,7 +184,7 @@ class StatutIntervenantSaisieForm extends AbstractForm
...
@@ -190,7 +184,7 @@ class StatutIntervenantSaisieForm extends AbstractForm
'suffix'
=>
'HETD'
,
'suffix'
=>
'HETD'
,
],
],
'attributes'
=>
[
'attributes'
=>
[
'title'
=>
"Nombre maximal d'heures
de service
(en équivalent TD) autorisées pour l'intervenant"
,
'title'
=>
"Nombre maximal d'heures (en équivalent TD) autorisées pour l'intervenant
, service et complémentaire
"
,
],
],
'type'
=>
'Text'
,
'type'
=>
'Text'
,
]);
]);
...
@@ -398,7 +392,6 @@ class StatutIntervenantHydrator implements HydratorInterface
...
@@ -398,7 +392,6 @@ class StatutIntervenantHydrator implements HydratorInterface
use
TypeAgrementStatutServiceAwareTrait
;
use
TypeAgrementStatutServiceAwareTrait
;
/**
/**
* Hydrate $object with the provided $data.
* Hydrate $object with the provided $data.
*
*
...
@@ -435,8 +428,7 @@ class StatutIntervenantHydrator implements HydratorInterface
...
@@ -435,8 +428,7 @@ class StatutIntervenantHydrator implements HydratorInterface
$object
->
setDepassementSDSHC
(
$data
[
'depassement-sdshc'
]);
$object
->
setDepassementSDSHC
(
$data
[
'depassement-sdshc'
]);
$object
->
setChargesPatronales
(
FloatFromString
::
run
(
$data
[
'charges-patronales'
])
/
100
);
$object
->
setChargesPatronales
(
FloatFromString
::
run
(
$data
[
'charges-patronales'
])
/
100
);
//Uniquement si le statut intervenant existe déjà en base.
//Uniquement si le statut intervenant existe déjà en base.
if
(
!
empty
(
$data
[
'id'
]))
if
(
!
empty
(
$data
[
'id'
]))
{
{
//Gestion de la durée de vie des agréments par statut d'intervenant
//Gestion de la durée de vie des agréments par statut d'intervenant
//On récupére les types d'agrement
//On récupére les types d'agrement
$qb
=
$this
->
getServiceTypeAgrement
()
->
finderByHistorique
();
$qb
=
$this
->
getServiceTypeAgrement
()
->
finderByHistorique
();
...
@@ -446,28 +438,22 @@ class StatutIntervenantHydrator implements HydratorInterface
...
@@ -446,28 +438,22 @@ class StatutIntervenantHydrator implements HydratorInterface
$this
->
getServiceTypeAgrementStatut
()
->
finderByHistorique
(
$qb
);
$this
->
getServiceTypeAgrementStatut
()
->
finderByHistorique
(
$qb
);
$typesAgrementsStatuts
=
$this
->
getServiceTypeAgrementStatut
()
->
getList
(
$qb
);
$typesAgrementsStatuts
=
$this
->
getServiceTypeAgrementStatut
()
->
getList
(
$qb
);
$typesAgrementsStatusByCode
=
[];
$typesAgrementsStatusByCode
=
[];
foreach
(
$typesAgrementsStatuts
as
$tas
)
foreach
(
$typesAgrementsStatuts
as
$tas
)
{
{
$typesAgrementsStatusByCode
[
$tas
->
getType
()
->
getCode
()]
=
$tas
;
$typesAgrementsStatusByCode
[
$tas
->
getType
()
->
getCode
()]
=
$tas
;
}
}
//On boucle pour faire ensuite de l'insert, update ou delete
//On boucle pour faire ensuite de l'insert, update ou delete
foreach
(
$typesAgrements
as
$ta
)
foreach
(
$typesAgrements
as
$ta
)
{
{
if
(
array_key_exists
(
$ta
->
getCode
(),
$data
))
{
if
(
array_key_exists
(
$ta
->
getCode
(),
$data
))
if
(
!
$data
[
$ta
->
getCode
()]
&&
array_key_exists
(
$ta
->
getCode
(),
$typesAgrementsStatusByCode
))
{
{
if
(
!
$data
[
$ta
->
getCode
()]
&&
array_key_exists
(
$ta
->
getCode
(),
$typesAgrementsStatusByCode
))
{
$tasToDelete
=
$typesAgrementsStatusByCode
[
$ta
->
getCode
()];
$tasToDelete
=
$typesAgrementsStatusByCode
[
$ta
->
getCode
()];
$object
->
removeTypeAgrementStatut
(
$tasToDelete
);
$object
->
removeTypeAgrementStatut
(
$tasToDelete
);
$this
->
getServiceTypeAgrementStatut
()
->
delete
(
$tasToDelete
);
$this
->
getServiceTypeAgrementStatut
()
->
delete
(
$tasToDelete
);
}
}
elseif
(
$data
[
$ta
->
getCode
()]
&&
array_key_exists
(
$ta
->
getCode
(),
$typesAgrementsStatusByCode
))
{
elseif
(
$data
[
$ta
->
getCode
()]
&&
array_key_exists
(
$ta
->
getCode
(),
$typesAgrementsStatusByCode
)){
$tasToUpdate
=
$typesAgrementsStatusByCode
[
$ta
->
getCode
()];
$tasToUpdate
=
$typesAgrementsStatusByCode
[
$ta
->
getCode
()];
$dureeVie
=
$data
[
$ta
->
getCode
()
.
'-DUREE_VIE'
];
$dureeVie
=
$data
[
$ta
->
getCode
()
.
'-DUREE_VIE'
];
$tasToUpdate
->
setDureeVie
(
$dureeVie
);
$tasToUpdate
->
setDureeVie
(
$dureeVie
);
$this
->
getServiceTypeAgrementStatut
()
->
save
(
$tasToUpdate
);
$this
->
getServiceTypeAgrementStatut
()
->
save
(
$tasToUpdate
);
}
}
elseif
(
$data
[
$ta
->
getCode
()]
&&
!
array_key_exists
(
$ta
->
getCode
(),
$typesAgrementsStatusByCode
))
{
elseif
(
$data
[
$ta
->
getCode
()]
&&
!
array_key_exists
(
$ta
->
getCode
(),
$typesAgrementsStatusByCode
)){
$dureeVie
=
$data
[
$ta
->
getCode
()
.
'-DUREE_VIE'
];
$dureeVie
=
$data
[
$ta
->
getCode
()
.
'-DUREE_VIE'
];
$tasToCreate
=
new
TypeAgrementStatut
();
$tasToCreate
=
new
TypeAgrementStatut
();
$tasToCreate
->
setDureeVie
(
$dureeVie
);
$tasToCreate
->
setDureeVie
(
$dureeVie
);
...
@@ -476,17 +462,17 @@ class StatutIntervenantHydrator implements HydratorInterface
...
@@ -476,17 +462,17 @@ class StatutIntervenantHydrator implements HydratorInterface
$tasToCreate
->
setStatut
(
$object
);
$tasToCreate
->
setStatut
(
$object
);
$this
->
getServiceTypeAgrementStatut
()
->
save
(
$tasToCreate
);
$this
->
getServiceTypeAgrementStatut
()
->
save
(
$tasToCreate
);
$object
->
addTypeAgrementStatut
(
$tasToCreate
);
$object
->
addTypeAgrementStatut
(
$tasToCreate
);
}
}
}
}
}
}
}
}
return
$object
;
return
$object
;
}
}
/**
/**
* Extract values from an object
* Extract values from an object
*
*
...
@@ -525,10 +511,8 @@ class StatutIntervenantHydrator implements HydratorInterface
...
@@ -525,10 +511,8 @@ class StatutIntervenantHydrator implements HydratorInterface
];
];
$typesAgrementsStatuts
=
$object
->
getTypeAgrementStatut
();
$typesAgrementsStatuts
=
$object
->
getTypeAgrementStatut
();
foreach
(
$typesAgrementsStatuts
as
$tas
)
foreach
(
$typesAgrementsStatuts
as
$tas
)
{
{
if
(
!
$tas
->
getHistoDestruction
())
{
if
(
!
$tas
->
getHistoDestruction
())
{
$data
[
$tas
->
getType
()
->
getCode
()]
=
1
;
$data
[
$tas
->
getType
()
->
getCode
()]
=
1
;
$data
[
$tas
->
getType
()
->
getCode
()
.
'-DUREE_VIE'
]
=
$tas
->
getDureeVie
();
$data
[
$tas
->
getType
()
->
getCode
()
.
'-DUREE_VIE'
]
=
$tas
->
getDureeVie
();
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment