示例#1
0
 /**
  * Encapsule le comportement du module de gestion des congés des utilisateurs
  *
  * @return void
  * @access public
  * @static
  */
 public static function traiteUserModule()
 {
     //var pour resp_traite_user.php
     $user_login = getpost_variable('user_login');
     $year_calendrier_saisie_debut = getpost_variable('year_calendrier_saisie_debut', 0);
     $mois_calendrier_saisie_debut = getpost_variable('mois_calendrier_saisie_debut', 0);
     $year_calendrier_saisie_fin = getpost_variable('year_calendrier_saisie_fin', 0);
     $mois_calendrier_saisie_fin = getpost_variable('mois_calendrier_saisie_fin', 0);
     $tri_date = getpost_variable('tri_date', "ascendant");
     $tab_checkbox_annule = getpost_variable('tab_checkbox_annule');
     $tab_radio_traite_demande = getpost_variable('tab_radio_traite_demande');
     $tab_text_refus = getpost_variable('tab_text_refus');
     $tab_text_annul = getpost_variable('tab_text_annul');
     $new_demande_conges = getpost_variable('new_demande_conges', 0);
     $new_debut = getpost_variable('new_debut');
     $new_demi_jour_deb = getpost_variable('new_demi_jour_deb');
     $new_fin = getpost_variable('new_fin');
     $new_demi_jour_fin = getpost_variable('new_demi_jour_fin');
     $return = '';
     if ($_SESSION['config']['disable_saise_champ_nb_jours_pris']) {
         // zone de texte en readonly et grisée
         $new_nb_jours = compter($user_login, '', $new_debut, $new_fin, $new_demi_jour_deb, $new_demi_jour_fin, $comment);
     } else {
         $new_nb_jours = getpost_variable('new_nb_jours');
     }
     $new_comment = getpost_variable('new_comment');
     $new_type = getpost_variable('new_type');
     $year_affichage = getpost_variable('year_affichage', date("Y"));
     /*************************************/
     if (!is_resp_of_user($_SESSION['userlogin'], $user_login)) {
         redirect(ROOT_PATH . 'deconnexion.php');
         exit;
     }
     /************************************/
     // si une annulation de conges a été selectionée :
     if ($tab_checkbox_annule != "") {
         $return .= \responsable\Fonctions::annule_conges($user_login, $tab_checkbox_annule, $tab_text_annul);
     } elseif ($tab_radio_traite_demande != "") {
         $return .= \responsable\Fonctions::traite_demandes($user_login, $tab_radio_traite_demande, $tab_text_refus);
     } elseif ($new_demande_conges == 1) {
         $return .= \responsable\Fonctions::new_conges($user_login, $new_debut, $new_demi_jour_deb, $new_fin, $new_demi_jour_fin, $new_nb_jours, $new_comment, $new_type);
     } else {
         $return .= \responsable\Fonctions::affichage($user_login, $year_affichage, $year_calendrier_saisie_debut, $mois_calendrier_saisie_debut, $year_calendrier_saisie_fin, $mois_calendrier_saisie_fin, $tri_date);
     }
     return $return;
 }