Skip to content

Commit

Permalink
Evolutions multiples
Browse files Browse the repository at this point in the history
* Il est possible de forcer le solde de congés d'un agent directement depuis G2T, sans que celui-ci soit écrasé par le calcul quotidien du solde
* Le gestionnaire d'une structure peut gèrer les demandes de congés du responsable des structures filles si le paramétrage est activé.
ATTENTION : L'option est masquée car non encore validée par DRH. Valeur par défaut : Non
* Si on essaie de synchroniser une convention de télétravail avec un identifiant eSignature non valide, la synchronisation n'a pas lieu et retourne Ok.
* Début du remplacement des comparaisons de chaine "O"/"N" avec une conversion booléenne de la valeur (fonctions::convertvaluetobool) dans la gestion des dossiers.
* Utilisation des variables des formulaires 'Alimentation CET' + 'Option CET' pour initier les données à la création du document eSignature
  • Loading branch information
pacomte-Paris1 committed May 29, 2024
1 parent aa126d7 commit ef05cec
Show file tree
Hide file tree
Showing 10 changed files with 306 additions and 85 deletions.
2 changes: 1 addition & 1 deletion CRON/php/import_absence_xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

//echo "datefinformate = $datefinformate Date J - 2 ans = " . (date('Y')-2) . date("md") . " typeabsence = $typeabsence \n";
// Si l'arret s'est terminé il y a moins de 2 ans et que c'est un type d'absence M (<=> maladie)
if ($datefinformate > (date('Y')-2) . date("md") and strcasecmp($typeabsence,'M')==0 and true==false)
if ($datefinformate > (date('Y')-2) . date("md") and strcasecmp($typeabsence,'M')==0 and false)
{
echo "L'arret date de moins de 2 ans et c'est une maladie (typeabsence = $typeabsence) \n";
$agent = new agent($dbcon);
Expand Down
76 changes: 76 additions & 0 deletions html/class/agent.php
Original file line number Diff line number Diff line change
Expand Up @@ -4108,6 +4108,29 @@ function calculsoldeannuel($anneeref = null, $maj_solde = true, $loginfo = false
{
$anneeref = $this->fonctions->anneeref();
}

$agentcomplement = new complement($this->dbconnect);
$agentcomplement->load($this->agentid(),complement::FORCE_SOLDE_LABEL . $anneeref);
// Si le complément existe et qu'on a réussi à le chager
if ($agentcomplement->agentid()==$this->agentid())
{
if ($loginfo == true)
{
error_log(basename(__FILE__) . $this->fonctions->stripAccents(" Le solde $anneeref de l'agent " . $this->identitecomplete() . " est forcé => On ne fait pas de calcul."));
}
$solde = new solde($this->dbconnect);
$msg_erreur = $solde->load($this->agentid(),"ann" . substr($anneeref,-2,2));
if ($msg_erreur <> "")
{
echo $msg_erreur;
}
if ($loginfo == true)
{
error_log(basename(__FILE__) . $this->fonctions->stripAccents(" Le solde acquis est conservé à " . $solde->droitaquis() . " jours"));
}
return $solde->droitaquis();
}

// Construction des date de début et de fin de période (typiquement : 01/09/YYYY et 31/08/YYYY+1)
$date_deb_period = $anneeref . $this->fonctions->debutperiode();
$date_fin_period = ($anneeref + 1) . $this->fonctions->finperiode();
Expand Down Expand Up @@ -4913,6 +4936,25 @@ function newcalculsoldeannuel($anneeref = null, $maj_solde = true, $loginfo = fa
{
$anneeref = $this->fonctions->anneeref();
}

$agentcomplement = new complement($this->dbconnect);
$agentcomplement->load($this->agentid(),complement::FORCE_SOLDE_LABEL . $anneeref);
// Si le complément existe et qu'on a réussi à le chager
if ($agentcomplement->agentid()==$this->agentid())
{
$this->fonctions->log_traces($loginfo,$displayinfo,"Le solde $anneeref de l'agent " . $this->identitecomplete() . " est forcé => On ne fait pas de calcul.");
$solde = new solde($this->dbconnect);
$msg_erreur = $solde->load($this->agentid(),"ann" . substr($anneeref,-2,2));
if ($msg_erreur <> "")
{
echo $msg_erreur;
}
$this->fonctions->log_traces($loginfo,$displayinfo,"Le solde acquis est conservé à " . $solde->droitaquis() . " jours");
$this->fonctions->log_traces($loginfo,$displayinfo,"###########################################");
return $solde->droitaquis();
}


// Construction des date de début et de fin de période (typiquement : 01/09/YYYY et 31/08/YYYY+1)
$date_deb_period = $anneeref . $this->fonctions->debutperiode();
$date_fin_period = ($anneeref + 1) . $this->fonctions->finperiode();
Expand Down Expand Up @@ -5609,6 +5651,40 @@ function listeagentengestion($datedebut,$datefin, $structure = null)
unset($agentliste[$resp->nom() . " " . $resp->prenom() . " " . $resp->agentid()]);
$agentlistefull = array_merge((array) $agentlistefull, (array) $agentliste);
}

//////////////////////////////////////////////////
// On va ajouter les responsables des structures filles si le gestionnaire peut valider les demandes ds responsables filles
// Attention : On doit vérifier que le responsable de la structure fille est bien affecté dans la structure
// Sinon, ce n'est pas à lui de gérer les congés.
if ($this->fonctions->convertvaluetobool($structure->gestvalidrespstructfille()))
{
$structfilleliste = $structure->structurefille();
foreach ((array)$structfilleliste as $fille)
{
$codeinterne = null;
$destinataire = $fille->resp_envoyer_a($codeinterne);
if ($codeinterne==structure::MAIL_RESP_ENVOI_RESP_PARENT)
{
$resp = $fille->responsable();
if (trim($resp->civilite())!='' and !$resp->estutilisateurspecial())
{
if ($resp->structureid()==$fille->id())
{
$agentlistefull[$resp->nom() . " " . $resp->prenom() . " " . $resp->agentid()] = $resp;
}
}
$resp = $fille->responsablesiham();
if (trim($resp->civilite())!='' and !$resp->estutilisateurspecial())
{
if ($resp->structureid()==$fille->id())
{
$agentlistefull[$resp->nom() . " " . $resp->prenom() . " " . $resp->agentid()] = $resp;
}
}
}
}
}

$codeinterne = null;
$destinataire = $structure->resp_envoyer_a($codeinterne);
if (is_null($destinataire))
Expand Down
1 change: 1 addition & 0 deletions html/class/complement.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
class complement
{
public const TT_EXCLU_LABEL = 'TT_EXCLU_';
public const FORCE_SOLDE_LABEL = 'FORCE_SOLDE_';

private $agentid = null;

Expand Down
9 changes: 9 additions & 0 deletions html/class/fonctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3530,6 +3530,15 @@ public function synchroniseconventionteletravail($esignatureid)

error_log(basename(__FILE__) . $this->stripAccents(" On va modifier le statut de la convention télétravail => " . $esignatureid));

if (trim($esignatureid . "")=="")
{
$error = "Pas de synchronisation sur la convention " . $esignatureid . " => Pas dans eSignature";
error_log(basename(__FILE__) . $this->stripAccents(" " . $error));
$result_json = array('status' => 'Ok', 'description' => '');
error_log(basename(__FILE__) . $this->stripAccents(" result_json = " . print_r($result_json,true)));
return $result_json;
}

$curl = curl_init();
$params_string = "";
$opts = [
Expand Down
39 changes: 35 additions & 4 deletions html/class/structure.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class structure
// private $respvalidsousstruct = null; // permet au responsable de la structure de valider les demandes des agents d'une structure fille -- OBSOLETE --

private $gestvalidagent = null; // autorise le gestionnaire à valider les demandes des congés des agents

private $gestvalidrespstructfille = null; // autorise le gestionnaire à valider les demandes de congés des responsables des structures filles

private $respaffsoldesousstruct = null; // le responsable de la structure courante visualise le solde des agents des structures inclues

Expand Down Expand Up @@ -108,7 +110,8 @@ function load($structureid)
RESPAFFDEMANDESOUSSTRUCT,
EXTERNALID,
ISDEPLOYED,
AGENTAFFPLANNINGDIRECTION
AGENTAFFPLANNINGDIRECTION,
GESTVALIDRESPSTRUCTFILLE
FROM STRUCTURE
WHERE STRUCTUREID=?";
$params = array($structureid);
Expand Down Expand Up @@ -153,6 +156,7 @@ function load($structureid)
$this->externalid = "$result[17]";
$this->isdeployed = "$result[18]";
$this->agentaffplanningdirection = "$result[19]";
$this->gestvalidrespstructfille = "$result[20]";

$this->profondeurrelative = 0;

Expand Down Expand Up @@ -483,12 +487,37 @@ function gestvalidagent($valide = null)
$errlog = "Structure->gestvalidagent : Le paramètre gestvalidagent de la structure n'est pas défini !!!";
echo $errlog . "<br/>";
error_log(basename(__FILE__) . " " . $this->fonctions->stripAccents($errlog));
} else
}
else
{
return $this->gestvalidagent;
} else
}
}
else
{
$this->gestvalidagent = $valide;
}
}

function gestvalidrespstructfille($valide = null)
{
if (is_null($valide)) {
if (is_null($this->gestvalidrespstructfille)) {
$errlog = "Structure->gestvalidrespstructfille : Le paramètre gestvalidrespstructfille de la structure n'est pas défini !!!";
echo $errlog . "<br/>";
error_log(basename(__FILE__) . " " . $this->fonctions->stripAccents($errlog));
}
else
{
return $this->gestvalidrespstructfille;
}
}
else
{
$this->gestvalidrespstructfille = $valide;
}
}

function sousstructure($sousstruct = null)
{
if (is_null($sousstruct)) {
Expand Down Expand Up @@ -1525,7 +1554,8 @@ function store()
RESPAFFSOLDESOUSSTRUCT=?,
RESPAFFDEMANDESOUSSTRUCT=?,
ISDEPLOYED=?,
AGENTAFFPLANNINGDIRECTION=?
AGENTAFFPLANNINGDIRECTION=?,
GESTVALIDRESPSTRUCTFILLE=?
WHERE STRUCTUREID=?";
// echo "SQL = " . $sql . "<br>";
$params = array($this->sousstructure(),
Expand All @@ -1535,6 +1565,7 @@ function store()
$this->respaffdemandesousstruct(),
$this->isdeployed(),
$this->agentaffplanningdirection(),
$this->gestvalidrespstructfille(),
$this->id());
$query = $this->fonctions->prepared_query($sql, $params);
$erreur = mysqli_error($this->dbconnect);
Expand Down
48 changes: 34 additions & 14 deletions html/gerer_alimentationCET.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,20 +332,40 @@
//var_dump($tabinfos);

$formsdata = array();
$formsdata["nom_agent"] = $tabinfos["agent"]["name"];
$formsdata["prenom_agent"] = $tabinfos["agent"]["firstname"];
$formsdata["corps_agent"] = $tabinfos["agent"]["corps"];
$formsdata["quotite_agent"] = $tabinfos["agent"]["activity"];
$formsdata["structure_libelle"] = $tabinfos["agent"]["service"]["name"];
$formsdata["adresse_agent"] = $tabinfos["agent"]["service"]["addr"];
$formsdata["annee_ref"] = $tabinfos["agent"]["ref_year"];
$formsdata["cellule_a"] = $tabinfos["informations"]["0"]["value"];
$formsdata["cellule_b"] = $tabinfos["informations"]["1"]["value"];
$formsdata["cellule_c"] = $tabinfos["informations"]["2"]["value"];
$formsdata["cellule_d"] = $tabinfos["informations"]["3"]["value"];
$formsdata["cellule_e"] = $tabinfos["informations"]["4"]["value"];
$formsdata["cellule_f"] = $tabinfos["informations"]["5"]["value"];
$formsdata["cellule_g"] = $tabinfos["informations"]["6"]["value"];

// $formsdata["nom_agent"] = $tabinfos["agent"]["name"];
// $formsdata["prenom_agent"] = $tabinfos["agent"]["firstname"];
// $formsdata["corps_agent"] = $tabinfos["agent"]["corps"];
// $formsdata["quotite_agent"] = $tabinfos["agent"]["activity"];
// $formsdata["structure_libelle"] = $tabinfos["agent"]["service"]["name"];
// $formsdata["adresse_agent"] = $tabinfos["agent"]["service"]["addr"];
// $formsdata["annee_ref"] = $tabinfos["agent"]["ref_year"];
// $formsdata["cellule_a"] = $tabinfos["informations"]["0"]["value"];
// $formsdata["cellule_b"] = $tabinfos["informations"]["1"]["value"];
// $formsdata["cellule_c"] = $tabinfos["informations"]["2"]["value"];
// $formsdata["cellule_d"] = $tabinfos["informations"]["3"]["value"];
// $formsdata["cellule_e"] = $tabinfos["informations"]["4"]["value"];
// $formsdata["cellule_f"] = $tabinfos["informations"]["5"]["value"];
// $formsdata["cellule_g"] = $tabinfos["informations"]["6"]["value"];

$formsdata["Nom"] = $tabinfos["agent"]["name"];
$formsdata["Prenom"] = $tabinfos["agent"]["firstname"];
$formsdata["Corps"] = $tabinfos["agent"]["corps"];
$formsdata["Quotite"] = $tabinfos["agent"]["activity"];
$formsdata["Affectation"] = $tabinfos["agent"]["service"]["name"];
$formsdata["Adresse"] = $tabinfos["agent"]["service"]["addr"];
$formsdata["AnneeRef"] = $tabinfos["agent"]["ref_year"];
$formsdata["CETA"] = $tabinfos["informations"]["0"]["value"];
$formsdata["CETB"] = $tabinfos["informations"]["1"]["value"];
$formsdata["CETC"] = $tabinfos["informations"]["2"]["value"];
$formsdata["CETD"] = $tabinfos["informations"]["3"]["value"];
$formsdata["CETE"] = $tabinfos["informations"]["4"]["value"];
$formsdata["CETF"] = $tabinfos["informations"]["5"]["value"];
$formsdata["CETG"] = $tabinfos["informations"]["6"]["value"];
for ($index=0 ; $index<6 ; $index++)
{
$formsdata["PiedPage" . ($index+1)] = date("d/m/Y") . "-" . strtoupper($tabinfos["agent"]["name"] . " " . $tabinfos["agent"]["firstname"]);
}

//echo "formsdata = <br>"; var_dump($formsdata);

Expand Down
50 changes: 35 additions & 15 deletions html/gerer_optionCET.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,21 +241,41 @@
//var_dump($tabinfos);

$formsdata = array();
$formsdata["nom_agent"] = $tabinfos["agent"]["name"];
$formsdata["prenom_agent"] = $tabinfos["agent"]["firstname"];
$formsdata["corps_agent"] = $tabinfos["agent"]["corps"];
$formsdata["quotite_agent"] = $tabinfos["agent"]["activity"];
$formsdata["structure_libelle"] = $tabinfos["agent"]["service"]["name"];
$formsdata["adresse_agent"] = $tabinfos["agent"]["service"]["addr"];
$formsdata["annee_ref"] = $tabinfos["agent"]["ref_year"];
$formsdata["cellule_a"] = $tabinfos["informations"]["0"]["value"];
$formsdata["cellule_g"] = $tabinfos["informations"]["1"]["value"];
$formsdata["cellule_h"] = $tabinfos["informations"]["2"]["value"];
$formsdata["cellule_i"] = $tabinfos["informations"]["3"]["value"];
$formsdata["cellule_j"] = $tabinfos["informations"]["4"]["value"];
$formsdata["cellule_k"] = $tabinfos["informations"]["5"]["value"];
$formsdata["cellule_l"] = $tabinfos["informations"]["6"]["value"];


// $formsdata["nom_agent"] = $tabinfos["agent"]["name"];
// $formsdata["prenom_agent"] = $tabinfos["agent"]["firstname"];
// $formsdata["corps_agent"] = $tabinfos["agent"]["corps"];
// $formsdata["quotite_agent"] = $tabinfos["agent"]["activity"];
// $formsdata["structure_libelle"] = $tabinfos["agent"]["service"]["name"];
// $formsdata["adresse_agent"] = $tabinfos["agent"]["service"]["addr"];
// $formsdata["annee_ref"] = $tabinfos["agent"]["ref_year"];
// $formsdata["cellule_a"] = $tabinfos["informations"]["0"]["value"];
// $formsdata["cellule_g"] = $tabinfos["informations"]["1"]["value"];
// $formsdata["cellule_h"] = $tabinfos["informations"]["2"]["value"];
// $formsdata["cellule_i"] = $tabinfos["informations"]["3"]["value"];
// $formsdata["cellule_j"] = $tabinfos["informations"]["4"]["value"];
// $formsdata["cellule_k"] = $tabinfos["informations"]["5"]["value"];
// $formsdata["cellule_l"] = $tabinfos["informations"]["6"]["value"];

$formsdata["Nom"] = $tabinfos["agent"]["name"];
$formsdata["Prenom"] = $tabinfos["agent"]["firstname"];
$formsdata["Corps"] = $tabinfos["agent"]["corps"];
$formsdata["Quotite"] = $tabinfos["agent"]["activity"];
$formsdata["Affectation"] = $tabinfos["agent"]["service"]["name"];
$formsdata["Adresse"] = $tabinfos["agent"]["service"]["addr"];
$formsdata["AnneeRef"] = $tabinfos["agent"]["ref_year"];
$formsdata["CETA"] = $tabinfos["informations"]["0"]["value"];
$formsdata["CETG"] = $tabinfos["informations"]["1"]["value"];
$formsdata["CETH"] = $tabinfos["informations"]["2"]["value"];
$formsdata["CETI"] = $tabinfos["informations"]["3"]["value"];
$formsdata["CETJ"] = $tabinfos["informations"]["4"]["value"];
$formsdata["CETK"] = $tabinfos["informations"]["5"]["value"];
$formsdata["CETL"] = $tabinfos["informations"]["6"]["value"];
for ($index=0 ; $index<6 ; $index++)
{
$formsdata["PiedPage" . ($index+1)] = date("d/m/Y") . "-" . strtoupper($tabinfos["agent"]["name"] . " " . $tabinfos["agent"]["firstname"]);
}

//echo "formsdata = <br>"; var_dump($formsdata);

$params = array
Expand Down
Loading

0 comments on commit ef05cec

Please sign in to comment.