diff --git a/app/Controllers/AgentController.php b/app/Controllers/AgentController.php
index 26e725f..b57e1dc 100644
--- a/app/Controllers/AgentController.php
+++ b/app/Controllers/AgentController.php
@@ -361,7 +361,6 @@ final class AgentController
$contractEndDate = $contractEnd !== '' ? DateTimeImmutable::createFromFormat('!Y-m-d', $contractEnd) : null;
$postId = filter_var($payload['id_poste'] ?? null, FILTER_VALIDATE_INT);
$contractType = strtoupper(trim((string) ($payload['type_contrat'] ?? 'PERMANENT')));
- $trainingPlanned = filter_var($payload['formation_repartition_annuelle'] ?? false, FILTER_VALIDATE_BOOLEAN);
// Le droit à l'enveloppe de formation est acquis par défaut : un
// formulaire ancien ou une intégration tierce ne doit pas le retirer.
$trainingRight = filter_var($payload['droit_enveloppe_formation'] ?? true, FILTER_VALIDATE_BOOLEAN);
@@ -408,7 +407,6 @@ final class AgentController
'date_fin_contrat' => $contractEnd !== '' ? $contractEnd : null,
'id_poste' => (int) $postId,
'type_contrat' => $contractType,
- 'formation_repartition_annuelle' => $trainingPlanned,
'droit_enveloppe_formation' => $trainingRight,
'commentaire_pta' => $ptaComment !== '' ? $ptaComment : null,
]);
@@ -440,7 +438,6 @@ final class AgentController
'id_poste' => (int) $postId,
'poste_libelle' => (string) (array_values(array_filter($this->agentModel->allPosts(), static fn(array $post): bool => (int) $post['id_poste'] === (int) $postId))[0]['libelle'] ?? ''),
'type_contrat' => $contractType,
- 'formation_repartition_annuelle' => $trainingPlanned ? 1 : 0,
'droit_enveloppe_formation' => $trainingRight ? 1 : 0,
'commentaire_pta' => $ptaComment !== '' ? $ptaComment : null,
]),
@@ -466,7 +463,6 @@ final class AgentController
$contractEndDate = $contractEnd !== '' ? DateTimeImmutable::createFromFormat('!Y-m-d', $contractEnd) : null;
$postId = filter_var($payload['id_poste'] ?? null, FILTER_VALIDATE_INT);
$contractType = strtoupper(trim((string) ($payload['type_contrat'] ?? 'PERMANENT')));
- $trainingPlanned = filter_var($payload['formation_repartition_annuelle'] ?? false, FILTER_VALIDATE_BOOLEAN);
// Le droit à l'enveloppe de formation est acquis par défaut : un
// formulaire ancien ou une intégration tierce ne doit pas le retirer.
$trainingRight = filter_var($payload['droit_enveloppe_formation'] ?? true, FILTER_VALIDATE_BOOLEAN);
@@ -510,7 +506,6 @@ final class AgentController
'date_fin_contrat' => $contractEnd !== '' ? $contractEnd : null,
'id_poste' => (int) $postId,
'type_contrat' => $contractType,
- 'formation_repartition_annuelle' => $trainingPlanned,
'droit_enveloppe_formation' => $trainingRight,
'commentaire_pta' => $ptaComment !== '' ? $ptaComment : null,
'structure_id' => $structureId !== null ? (int) $structureId : null,
diff --git a/app/Models/AgentModel.php b/app/Models/AgentModel.php
index bad3b33..20bf91f 100644
--- a/app/Models/AgentModel.php
+++ b/app/Models/AgentModel.php
@@ -25,25 +25,19 @@ final class AgentModel extends BaseModel
}
/**
- * Minutes de formation ouvertes à l'agent sur l'année : rien s'il n'y a pas
- * droit, rien non plus si sa formation est déjà comptée dans la répartition
- * annuelle, l'enveloppe complémentaire sinon.
+ * Minutes de formation ouvertes à l'agent sur l'année : l'enveloppe de 14 h
+ * s'il y a droit, rien sinon.
*/
public static function trainingEnvelopeMinutes(array $agent): int
{
- if (!self::hasTrainingRight($agent) || !empty($agent['formation_repartition_annuelle'])) {
- return 0;
- }
-
- return self::ENVELOPPE_FORMATION_MINUTES;
+ return self::hasTrainingRight($agent) ? self::ENVELOPPE_FORMATION_MINUTES : 0;
}
private const AGENT_SELECT = <<<'SQL'
SELECT a.id_agent, a.matricule, a.nom, a.prenom, a.email,
a.telephone, a.adresse, a.est_diplome, a.diplome_libelle,
a.date_debut_contrat, a.date_fin_contrat, a.type_contrat,
- a.formation_repartition_annuelle, a.droit_enveloppe_formation,
- a.commentaire_pta,
+ a.droit_enveloppe_formation, a.commentaire_pta,
a.id_poste, po.code AS poste_code, po.libelle AS poste_libelle,
po.famille AS poste_famille, po.heures_mercredi_minutes,
po.heures_extrascolaire_minutes, po.autorise_preparation,
@@ -160,7 +154,6 @@ final class AgentModel extends BaseModel
$quotaTarget = (int) round($quotaReference * ((float) $data['quotite_travail'] / 100));
$trainingEnvelope = self::trainingEnvelopeMinutes([
'droit_enveloppe_formation' => !empty($data['droit_enveloppe_formation']) ? 1 : 0,
- 'formation_repartition_annuelle' => $data['formation_repartition_annuelle'],
]);
try {
@@ -171,14 +164,14 @@ final class AgentModel extends BaseModel
matricule, nom, prenom, email, telephone, adresse,
est_diplome, diplome_libelle, date_debut_contrat,
id_poste, type_contrat, date_fin_contrat,
- formation_repartition_annuelle, droit_enveloppe_formation,
- commentaire_pta, id_structure, actif
+ droit_enveloppe_formation, commentaire_pta,
+ id_structure, actif
) VALUES (
:matricule, :nom, :prenom, :email, :telephone, :adresse,
:est_diplome, :diplome_libelle, :date_debut_contrat,
:id_poste, :type_contrat, :date_fin_contrat,
- :formation_repartition_annuelle, :droit_enveloppe_formation,
- :commentaire_pta, :structure_id, TRUE
+ :droit_enveloppe_formation, :commentaire_pta,
+ :structure_id, TRUE
)'
);
$insertAgent->execute([
@@ -194,7 +187,6 @@ final class AgentModel extends BaseModel
'id_poste' => $data['id_poste'],
'type_contrat' => $data['type_contrat'],
'date_fin_contrat' => $contractEnd?->format('Y-m-d'),
- 'formation_repartition_annuelle' => $data['formation_repartition_annuelle'] ? 1 : 0,
'droit_enveloppe_formation' => !empty($data['droit_enveloppe_formation']) ? 1 : 0,
'commentaire_pta' => $data['commentaire_pta'],
'structure_id' => $data['structure_id'],
@@ -293,7 +285,6 @@ final class AgentModel extends BaseModel
id_poste = :id_poste,
type_contrat = :type_contrat,
date_fin_contrat = :date_fin_contrat,
- formation_repartition_annuelle = :formation_repartition_annuelle,
droit_enveloppe_formation = :droit_enveloppe_formation,
commentaire_pta = :commentaire_pta,
id_structure = :structure_id
@@ -309,7 +300,6 @@ final class AgentModel extends BaseModel
$update->bindValue(':id_poste', $data['id_poste'], PDO::PARAM_INT);
$update->bindValue(':type_contrat', $data['type_contrat']);
$update->bindValue(':date_fin_contrat', $data['date_fin_contrat']);
- $update->bindValue(':formation_repartition_annuelle', $data['formation_repartition_annuelle'] ? 1 : 0, PDO::PARAM_INT);
$update->bindValue(':droit_enveloppe_formation', !empty($data['droit_enveloppe_formation']) ? 1 : 0, PDO::PARAM_INT);
$update->bindValue(':commentaire_pta', $data['commentaire_pta']);
if ($newStructureId === null) {
diff --git a/app/Models/SchemaModel.php b/app/Models/SchemaModel.php
index ebb640f..fbbf2ab 100644
--- a/app/Models/SchemaModel.php
+++ b/app/Models/SchemaModel.php
@@ -52,7 +52,7 @@ final class SchemaModel extends BaseModel
$requiredColumns = [
'creneau_horaire' => ['id_motif'],
'planning' => ['date_validation'],
- 'agent' => ['email', 'telephone', 'adresse', 'est_diplome', 'diplome_libelle', 'id_structure', 'id_poste', 'type_contrat', 'date_debut_contrat', 'date_fin_contrat', 'formation_repartition_annuelle', 'droit_enveloppe_formation', 'commentaire_pta'],
+ 'agent' => ['email', 'telephone', 'adresse', 'est_diplome', 'diplome_libelle', 'id_structure', 'id_poste', 'type_contrat', 'date_debut_contrat', 'date_fin_contrat', 'droit_enveloppe_formation', 'commentaire_pta'],
'structure' => ['type_affectation'],
];
diff --git a/app/Views/layouts/footer.php b/app/Views/layouts/footer.php
index 797d563..d5fdc2f 100644
--- a/app/Views/layouts/footer.php
+++ b/app/Views/layouts/footer.php
@@ -28,10 +28,10 @@ window.PTA_PAGE_CONFIG = = json_encode([
'params' => $pageConfig,
], JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE) ?>;
-
+
-
+
-
+