示例#1
0
 /**
  * Encapsule le comportement du module d'ajout de congés
  *
  * @param array  $tab_type_cong
  * @param string $session
  *
  * @return void
  * @access public
  * @static
  */
 public static function pageAjoutCongesModule($tab_type_cong, $session)
 {
     //var pour resp_ajout_conges_all.php
     $ajout_conges = getpost_variable('ajout_conges');
     $ajout_global = getpost_variable('ajout_global');
     $ajout_groupe = getpost_variable('ajout_groupe');
     $choix_groupe = getpost_variable('choix_groupe');
     $return = '';
     // titre
     $return .= '<h1>' . _('resp_ajout_conges_titre') . '</h1>';
     if ($ajout_conges == "TRUE") {
         $tab_champ_saisie = getpost_variable('tab_champ_saisie');
         $tab_commentaire_saisie = getpost_variable('tab_commentaire_saisie');
         $return .= \hr\Fonctions::ajout_conges($tab_champ_saisie, $tab_commentaire_saisie);
         redirect(ROOT_PATH . 'hr/hr_index.php?session=' . $session, false);
         exit;
     } elseif ($ajout_global == "TRUE") {
         $tab_new_nb_conges_all = getpost_variable('tab_new_nb_conges_all');
         $tab_calcul_proportionnel = getpost_variable('tab_calcul_proportionnel');
         $tab_new_comment_all = getpost_variable('tab_new_comment_all');
         $return .= \hr\Fonctions::ajout_global($tab_new_nb_conges_all, $tab_calcul_proportionnel, $tab_new_comment_all);
         redirect(ROOT_PATH . 'hr/hr_index.php?session=' . $session, false);
         exit;
     } elseif ($ajout_groupe == "TRUE") {
         $tab_new_nb_conges_all = getpost_variable('tab_new_nb_conges_all');
         $tab_calcul_proportionnel = getpost_variable('tab_calcul_proportionnel');
         $tab_new_comment_all = getpost_variable('tab_new_comment_all');
         $choix_groupe = getpost_variable('choix_groupe');
         \hr\Fonctions::ajout_global_groupe($choix_groupe, $tab_new_nb_conges_all, $tab_calcul_proportionnel, $tab_new_comment_all);
         redirect(ROOT_PATH . 'hr/hr_index.php?session=' . $session, false);
         exit;
     } else {
         $return .= \hr\Fonctions::saisie_ajout($tab_type_cong);
     }
     return $return;
 }