";
diff --git a/html/gestion_structure.php b/html/gestion_structure.php
index d6e2d97..7f74bfc 100644
--- a/html/gestion_structure.php
+++ b/html/gestion_structure.php
@@ -395,7 +395,7 @@
// echo "Avant l'affichage du nom... ";
echo "" . $struct->nomcourt() . " (" . $struct->id() . ") - " . $struct->nomlong() . " - Responsable G2T : " . $struct->responsablesiham()->identitecomplete() . " ";
echo "id() . "\",\"". $struct->isdeployed() . "\");}'";
}
@@ -651,7 +651,7 @@ function resp_mode_change_id(); ?>()
echo " ";
}
- if ($mode == 'gestrh')
+ if ($mode == MODE_RH)
{
?>
";
- if ($teletravail->statut() == teletravail::TELETRAVAIL_VALIDE and $mode=='gestrh')
+ if ($teletravail->statut() == teletravail::TELETRAVAIL_VALIDE and $mode==MODE_RH)
{
// On peut modifier la date de début de la convention dans une période de 6 mois avant la date saisie
$datedebutminconv_tab = date("d/m/Y", strtotime("-" . $nbmonthsprevious . " month", strtotime($fonctions->formatdatedb($datedebutteletravail))));
@@ -1300,7 +1300,7 @@
}
echo " ";
echo " ";
- if ($teletravail->statut() == teletravail::TELETRAVAIL_VALIDE and $mode=='gestrh')
+ if ($teletravail->statut() == teletravail::TELETRAVAIL_VALIDE and $mode==MODE_RH)
{
// $datefinminconv_tab = date("d/m/Y", strtotime("-6 month", strtotime($fonctions->formatdatedb($datefinteletravail))));
$datefinminconv_tab = $datedebutminconv_tab;
@@ -1360,15 +1360,15 @@
echo "" . $teletravail->esignatureid() . " ";
echo "".(($teletravail->statut() == teletravail::TELETRAVAIL_ANNULE) ? '':$teletravail->esignatureurl())." ";
}
- if ($mode=='gestrh' or $esignatureactive)
+ if ($mode==MODE_RH or $esignatureactive)
{
// echo "statut(), array(teletravail::TELETRAVAIL_ANNULE,teletravail::TELETRAVAIL_REFUSE))) // and $teletravail->statut()==teletravail::TELETRAVAIL_ANNULE)
+ if ($mode==MODE_RH and in_array($teletravail->statut(), array(teletravail::TELETRAVAIL_ANNULE,teletravail::TELETRAVAIL_REFUSE))) // and $teletravail->statut()==teletravail::TELETRAVAIL_ANNULE)
{
echo " disabled='disabled' ";
}
- elseif ($mode!='gestrh' and in_array($teletravail->statut(), array(teletravail::TELETRAVAIL_ANNULE,teletravail::TELETRAVAIL_REFUSE, teletravail::TELETRAVAIL_VALIDE)))
+ elseif ($mode!=MODE_RH and in_array($teletravail->statut(), array(teletravail::TELETRAVAIL_ANNULE,teletravail::TELETRAVAIL_REFUSE, teletravail::TELETRAVAIL_VALIDE)))
{
echo " disabled='disabled' ";
}
@@ -1551,7 +1551,7 @@ function hide_inactive()
$formdisabled = " disabled='disabled' ";
}
- if (!$esignatureactive and $mode!='gestrh')
+ if (!$esignatureactive and $mode!=MODE_RH)
{
$formhidden = " hidden='hidden' ";
$formdisabled = " disabled='disabled' ";
@@ -1877,19 +1877,19 @@ function getnbjrsteletravail(id)
}
// A ce niveau $declaration est soit NULL soit il vaut la declaration de TP active
- if (is_null($declaration) or $mode=='gestrh')
+ if (is_null($declaration) or $mode==MODE_RH)
{
- if (is_null($declaration) and $mode!='gestrh')
+ if (is_null($declaration) and $mode!=MODE_RH)
{
echo $fonctions->showmessage(fonctions::MSGERROR, "Vous n'avez pas de déclaration de temps partiel active. Impossible de saisir une convention de télétravail");
$nbjoursmaxteletravailcalcule = 0;
$disablesubmit = true;
}
- elseif (is_null($declaration) and $mode=='gestrh')
+ elseif (is_null($declaration) and $mode==MODE_RH)
{
echo $fonctions->showmessage(fonctions::MSGWARNING, "L'agent " . $agent->identitecomplete() . " pas de déclaration de temps partiel active.");
}
- if ($mode=='gestrh')
+ if ($mode==MODE_RH)
{
$hidden = '';
if ($inputtypeconv != teletravail::CODE_CONVENTION_MEDICAL)
@@ -2185,12 +2185,12 @@ function verif_nbre_checkbox()
echo " ";
$hiddentext = '';
- if ($disablesubmit and $mode!='gestrh' and $inputtypeconv != teletravail::CODE_CONVENTION_MEDICAL )
+ if ($disablesubmit and $mode!=MODE_RH and $inputtypeconv != teletravail::CODE_CONVENTION_MEDICAL )
{
$hiddentext = " hidden='hidden' ";
}
echo " ";
- if ($disablesubmit and $mode!='gestrh')
+ if ($disablesubmit and $mode!=MODE_RH)
{
echo "
On est en mode responsable ==> On va modifier les demandes de télétravail de la structure dont on est responsable. ";
$structliste = $user->structrespliste(true);
@@ -2336,7 +2336,7 @@ function showsubdiv(statutselected)
foreach ($structliste as $structure)
{
$teletravailtrouvestruct = false;
- if ($mode=='resp')
+ if ($mode==MODE_RESPONSABLE)
{
////////////////////////////////
// ATTENTION : On force l'affichage des demandes des sous-structure à 'N' pour n'afficher que les agents en responsabilité de la structure (et pas les sous-structures)
@@ -2357,7 +2357,7 @@ function showsubdiv(statutselected)
// }
// }
}
- else if ($mode=='gestion')
+ else if ($mode==MODE_GESTION)
{
$agentliste = $user->listeagentengestion(date("d/m/Y"), date("d/m/Y"),$structure);
@@ -2394,7 +2394,7 @@ function showsubdiv(statutselected)
foreach ((array)$agentliste as $agent)
{
- if ($agent->agentid()!=$user->agentid() or $mode!='resp')
+ if ($agent->agentid()!=$user->agentid() or $mode!=MODE_RESPONSABLE)
{
$tabdemandeteletravail = $agent->listedemandeteletravailenattente();
foreach($tabdemandeteletravail as $teletravail)
diff --git a/html/includes/all_g2t_classes.php b/html/includes/all_g2t_classes.php
index 10d5f32..61520ea 100644
--- a/html/includes/all_g2t_classes.php
+++ b/html/includes/all_g2t_classes.php
@@ -12,6 +12,7 @@
require_once (dirname(__FILE__,2) . "/class/cet.php");
require_once (dirname(__FILE__,2) . "/class/affectation.php");
require_once (dirname(__FILE__,2) . "/class/complement.php");
+ require_once (dirname(__FILE__,2) . "/class/demandecomplement.php");
require_once (dirname(__FILE__,2) . "/class/periodeobligatoire.php");
require_once (dirname(__FILE__,2) . "/class/alimentationCET.php");
require_once (dirname(__FILE__,2) . "/class/optionCET.php");
@@ -28,6 +29,27 @@
define('TABCOULEURPLANNINGELEMENT', $tabcouleurelement);
//var_dump(TABCOULEURPLANNINGELEMENT);
}
+
+ if (!defined('MODE_CONSULTANT'))
+ {
+ define('MODE_CONSULTANT', 'consult');
+ }
+ if (!defined('MODE_RH'))
+ {
+ define('MODE_RH', 'rh');
+ }
+ if (!defined('MODE_GESTION'))
+ {
+ define('MODE_GESTION', 'gest');
+ }
+ if (!defined('MODE_RESPONSALBE'))
+ {
+ define('MODE_RESPONSABLE', 'resp');
+ }
+ if (!defined('MODE_AGENT'))
+ {
+ define('MODE_AGENT', 'agent');
+ }
/*
$sql="SELECT COUNT(*) FROM TELETRAVAIL WHERE STATUT IN ('" . teletravail::OLD_STATUT_ACTIVE . "','" . teletravail::OLD_STATUT_INACTIVE . "')";
diff --git a/html/includes/menu.php b/html/includes/menu.php
index c6c2a42..dc90f82 100644
--- a/html/includes/menu.php
+++ b/html/includes/menu.php
@@ -815,7 +815,7 @@ function affichestructureliste($structure, $niveau = 0)
Gestion des temps partiels
@@ -834,7 +834,7 @@ function affichestructureliste($structure, $niveau = 0)
>
Planning de la structure
@@ -931,10 +931,19 @@ function affichestructureliste($structure, $niveau = 0)
MENU CONSULTANT
Paramétrage des dossiers et des structures
@@ -982,7 +991,7 @@ function affichestructureliste($structure, $niveau = 0)
Gestion des conventions de télétravail
@@ -995,14 +1004,15 @@ function affichestructureliste($structure, $niveau = 0)
Planning de la structure
Validation des demandes en attente
@@ -1039,7 +1049,7 @@ function affichestructureliste($structure, $niveau = 0)
Gestion des jours supplémentaires pour un agent
@@ -1068,14 +1078,14 @@ function affichestructureliste($structure, $niveau = 0)
Validation des temps partiels
Saisir le temps partiel pour un agent
Affichage du solde des agents de la structure
@@ -1104,7 +1114,7 @@ function affichestructureliste($structure, $niveau = 0)
Planning de la structure
@@ -1112,7 +1122,7 @@ function affichestructureliste($structure, $niveau = 0)
Validation des demandes en attente
@@ -1149,7 +1159,7 @@ function affichestructureliste($structure, $niveau = 0)
Affichage du solde des agents de la structure
@@ -1180,14 +1190,14 @@ function affichestructureliste($structure, $niveau = 0)
Paramétrage des dossiers et des structures
Gestion des conventions de télétravail
@@ -1196,7 +1206,7 @@ function affichestructureliste($structure, $niveau = 0)
Planning de la structure
@@ -1243,7 +1253,7 @@ function affichestructureliste($structure, $niveau = 0)
Validation des demandes en attente
@@ -1258,14 +1268,14 @@ function affichestructureliste($structure, $niveau = 0)
Validation des temps partiels
Affichage du solde des agents de la structure
@@ -1276,7 +1286,7 @@ function affichestructureliste($structure, $niveau = 0)
Planning de la structure
@@ -1323,7 +1333,7 @@ function affichestructureliste($structure, $niveau = 0)
Validation des demandes en attente
@@ -1331,7 +1341,7 @@ function affichestructureliste($structure, $niveau = 0)
Affichage du solde des agents de la structure
@@ -1363,7 +1373,7 @@ function affichestructureliste($structure, $niveau = 0)
Paramétrage des structures
@@ -1376,7 +1386,7 @@ function affichestructureliste($structure, $niveau = 0)
Gestion des conventions de télétravail (hors eSignature)
@@ -1384,7 +1394,7 @@ function affichestructureliste($structure, $niveau = 0)
Gestion des conventions de télétravail (avec eSignature)
@@ -1418,42 +1428,42 @@ function affichestructureliste($structure, $niveau = 0)
Validation des congés sur CET
Gestion d'un CET
Gestion d'un CET (hors eSignature)
Reprise d'un CET existant
Alimentation du CET
Droit d'option sur CET
@@ -1491,7 +1501,7 @@ function affichestructureliste($structure, $niveau = 0)
Annulation de congés imputés sur le CET
@@ -1511,14 +1521,14 @@ function affichestructureliste($structure, $niveau = 0)
Gestion des jours supplémentaires pour un agent
Affichage du solde des agents d'une structure
diff --git a/html/saisir_tpspartiel.php b/html/saisir_tpspartiel.php
index 7f8e9c8..7fd23e6 100644
--- a/html/saisir_tpspartiel.php
+++ b/html/saisir_tpspartiel.php
@@ -448,7 +448,7 @@
echo "";
echo " ";
- if (strcasecmp($mode, "resp") == 0) {
+ if (strcasecmp($mode, MODE_RESPONSABLE) == 0) {
echo " ";
echo " Ne pas vérifier la répartition des jours de temps partiel. ";
echo "Cette fonction permet, par exemple, de saisir 3 jours de TP une semaine et 2 jours la semaine suivante pour une personne à 50% ";
diff --git a/html/structure_planning.php b/html/structure_planning.php
index 1c07918..d5c6c20 100644
--- a/html/structure_planning.php
+++ b/html/structure_planning.php
@@ -73,7 +73,7 @@
}
// echo "annee (apres) = $annee ";
- $mode = "resp";
+ $mode = MODE_RESPONSABLE;
if (isset($_POST["mode"]))
{
$mode = $_POST["mode"]; // Mode = resp ou agent ou consult
@@ -607,8 +607,10 @@
$anneemois = $fonctions->anneeref() - $previous;
// echo "index = $index ";
for ($indexcpt = 1; $indexcpt <= 12; $indexcpt ++) {
- // Si on est en mode consultant et que la date calculée (annee + mois) est inférieure à la date du jour => on n'affiche pas
- if (strcasecmp($mode,"consult")==0 and ($anneemois . str_pad($index, 2, "0", STR_PAD_LEFT) on n'affiche pas
+
+ //if (strcasecmp($mode,MODE_CONSULTANT)==0 and ($anneemois . str_pad($index, 2, "0", STR_PAD_LEFT) < date("Ym")))
+ if (in_array($mode,array(MODE_CONSULTANT,MODE_AGENT)) and ($anneemois . str_pad($index, 2, "0", STR_PAD_LEFT) < date("Ym")))
{
// On ne fait rien
}
@@ -646,7 +648,7 @@
echo " ";
echo "";
- if (strcasecmp($mode, "resp") == 0)
+ if (strcasecmp($mode, MODE_RESPONSABLE) == 0)
{
$structureliste = $user->structrespliste();
$structureliste = $fonctions->enleverstructuresinclues_planning($structureliste);
@@ -730,16 +732,7 @@
}
}
}
-
-
-
-/*
- $structincluelist = $fonctions->listestructurenoninclue();
- echo "Liste des id de structures non inclue :" ;
- var_dump($structincluelist);
- echo " ";
-*/
- } elseif (strcasecmp($mode, "gestion") == 0) {
+ } elseif (strcasecmp($mode, MODE_GESTION) == 0) {
$structureliste = $user->structgestliste();
$structureliste = $fonctions->enleverstructuresinclues_planning($structureliste);
if (is_array($structureliste))
@@ -787,7 +780,7 @@
}
}
}
- elseif (strcasecmp($mode, "consult") == 0)
+ elseif (strcasecmp($mode, MODE_CONSULTANT) == 0)
{
//var_dump("Je suis en mode consultant");
$structure = new structure($dbcon);
diff --git a/html/utilisation_cet.php b/html/utilisation_cet.php
index b50fb9a..c2fe441 100644
--- a/html/utilisation_cet.php
+++ b/html/utilisation_cet.php
@@ -133,7 +133,7 @@
}
}
- if (strcasecmp($mode, "gestrh") == 0) {
+ if (strcasecmp($mode, MODE_RH) == 0) {
echo "Personne à rechercher : ";
echo "";
- } elseif (! $user->estresponsable() and (strcasecmp($mode, "resp") == 0)) {
+ } elseif (! $user->estresponsable() and (strcasecmp($mode, MODE_RESPONSABLE) == 0)) {
echo "Vous n'êtes pas responsable, vous ne pouvez pas valider les demandes de congés/d'absence ";
}
- if ($user->estgestionnaire() and (strcasecmp($mode, "gestion") == 0)) {
+ if ($user->estgestionnaire() and (strcasecmp($mode, MODE_GESTION) == 0)) {
echo "";
- } elseif (! $user->estgestionnaire() and (strcasecmp($mode, "gestion") == 0)) {
+ } elseif (! $user->estgestionnaire() and (strcasecmp($mode, MODE_GESTION) == 0)) {
echo "Vous n'êtes pas gestionnaire, vous ne pouvez pas valdier les demandes de congés/d'absence ";
}
+
+ //var_dump ("mode = $mode");
+ if (strcasecmp($mode, MODE_CONSULTANT) == 0) {
+ echo "";
+
+
+ }
?>
diff --git a/html/valider_tpspartiel.php b/html/valider_tpspartiel.php
index 722c962..bebdab5 100644
--- a/html/valider_tpspartiel.php
+++ b/html/valider_tpspartiel.php
@@ -84,12 +84,12 @@
}
$structlist = null;
- if (strcasecmp($mode, "resp") == 0) {
+ if (strcasecmp($mode, MODE_RESPONSABLE) == 0) {
$structlist = $user->structrespliste();
$structlist = $fonctions->enleverstructuresinclues_demandes($structlist);
}
- if (strcasecmp($mode, "gestion") == 0) {
+ if (strcasecmp($mode, MODE_GESTION) == 0) {
$structlist = $user->structgestliste();
// On récupère la liste des structures où l'agent (donc le gestionnaire) gère les congés (des agents et/ou du responsable)
$listegeststruct = $user->structgestcongeliste();
@@ -106,7 +106,7 @@
echo "Remarque : Les personnes affectées à temps plein ne sont pas affichées dans cet écran. ";
foreach ($structlist as $keystruct => $structure)
{
- if (strcasecmp($mode, "resp") == 0) // Si on est en mode responsable, on charge les agents en responsabilité
+ if (strcasecmp($mode, MODE_RESPONSABLE) == 0) // Si on est en mode responsable, on charge les agents en responsabilité
{
if (strcasecmp($structure->respaffdemandesousstruct(),'o')==0) // Si on doit gérer les demandes de congés/afficher le solde des agents des structures inclues
{
@@ -123,7 +123,7 @@
$agentlist = $user->listeagentenresponsabilite(date("d/m/Y"), date("d/m/Y"),$structure);
}
}
- elseif (strcasecmp($mode, "gestion") == 0)
+ elseif (strcasecmp($mode, MODE_GESTION) == 0)
{
// Si le gestionnaire ne doit pas gérer les agents et qu'il n'est pas destinataire des notifications des demandes de congés
if (strcasecmp($structure->gestvalidagent(),'n')==0