Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
Merge branch '1.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
wouldsmina committed Aug 21, 2017
2 parents a2087ec + 0b356dc commit 27539c3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
16 changes: 9 additions & 7 deletions admin/Fonctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2236,6 +2236,7 @@ public static function commit_update_user($u_login_to_update, &$tab_new_user, &$
if ($_SESSION['config']['gestion_heures'] && !\admin\Fonctions::FormAddUserSoldeHeureOk($tab_new_user['solde_heure'])) {
$valid_5=false;
}

// si aucune erreur de saisie n'a ete commise
if(($valid_1) && ($valid_2) && ($valid_3) && ($valid_4) && ($valid_5) && ($valid_reliquat) && $tab_new_user['login']!="") {
// UPDATE de la table conges_users
Expand Down Expand Up @@ -2601,7 +2602,7 @@ public static function modifier_user($u_login, $onglet)
}
else {
$planningName = _('Aucun_planning');
}
}
$return .= '<br><hr/>';
$return .= '<h4>' . _('admin_planning_utilisateur') . '</h4>';
$return .= '<div>' . $planningName . '</div>';
Expand Down Expand Up @@ -2647,9 +2648,9 @@ public static function modifUserModule($session, $onglet)
$tab_new_solde = getpost_variable('tab_new_solde') ;
$tab_new_reliquat = getpost_variable('tab_new_reliquat') ;

$tab_new_user['login'] = htmlentities(getpost_variable('new_login'), ENT_QUOTES | ENT_HTML401);
$tab_new_user['nom'] = htmlentities(getpost_variable('new_nom'), ENT_QUOTES | ENT_HTML401);
$tab_new_user['prenom'] = htmlentities(getpost_variable('new_prenom'), ENT_QUOTES | ENT_HTML401);
$tab_new_user['login'] = htmlspecialchars(getpost_variable('new_login'), ENT_QUOTES | ENT_HTML401);
$tab_new_user['nom'] = htmlspecialchars(getpost_variable('new_nom'), ENT_QUOTES | ENT_HTML401);
$tab_new_user['prenom'] = htmlspecialchars(getpost_variable('new_prenom'), ENT_QUOTES | ENT_HTML401);
$tab_new_user['quotite'] = htmlentities(getpost_variable('new_quotite'), ENT_QUOTES | ENT_HTML401);
if ($_SESSION['config']['gestion_heures'] ) {
$tab_new_user['solde_heure'] = htmlentities(getpost_variable('new_solde_heure'), ENT_QUOTES | ENT_HTML401);
Expand Down Expand Up @@ -3552,6 +3553,7 @@ public static function ajoutUtilisateurModule($onglet)
// si on recupere les users dans ldap et qu'on vient d'en créer un depuis la liste déroulante
if ($_SESSION['config']['export_users_from_ldap'] && isset($_POST['new_ldap_user'])) {
$index = 0;

// On lance une boucle pour selectionner tous les items
// traitements : $login contient les valeurs successives
foreach($_POST['new_ldap_user'] as $login) {
Expand Down Expand Up @@ -3604,9 +3606,9 @@ public static function ajoutUtilisateurModule($onglet)
$tab_new_user[$login]['new_year'] = getpost_variable('new_year');
}
} else {
$tab_new_user[0]['login'] = htmlentities(getpost_variable('new_login'), ENT_QUOTES | ENT_HTML401);
$tab_new_user[0]['nom'] = htmlentities(getpost_variable('new_nom'), ENT_QUOTES | ENT_HTML401);
$tab_new_user[0]['prenom'] = htmlentities(getpost_variable('new_prenom'), ENT_QUOTES | ENT_HTML401);
$tab_new_user[0]['login'] = htmlspecialchars(getpost_variable('new_login'), ENT_QUOTES | ENT_HTML401);
$tab_new_user[0]['nom'] = htmlspecialchars(getpost_variable('new_nom'), ENT_QUOTES | ENT_HTML401);
$tab_new_user[0]['prenom'] = htmlspecialchars(getpost_variable('new_prenom'), ENT_QUOTES | ENT_HTML401);
$tab_new_user[0]['quotite'] = getpost_variable('new_quotite');
$tab_new_user[0]['is_resp'] = htmlentities(getpost_variable('new_is_resp'), ENT_QUOTES | ENT_HTML401);
$tab_new_user[0]['solde_heure']= htmlentities(getpost_variable('new_solde_heure'), ENT_QUOTES | ENT_HTML401);
Expand Down
10 changes: 5 additions & 5 deletions fonctions_conges.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ function affiche_decimal($str)

// verif validité des valeurs saisies lors d'une demande de conges par un user ou d'une saisie de conges par le responsable
// (attention : le $new_nb_jours est passé par référence car on le modifie si besoin)
function verif_saisie_new_demande($new_debut, $new_demi_jour_deb, $new_fin, $new_demi_jour_fin, &$new_nb_jours, $new_comment)
function verif_saisie_new_demande($new_debut, $new_demi_jour_deb, $new_fin, $new_demi_jour_fin, &$new_nb_jours, $new_comment, $login)
{
$verif = true;

Expand Down Expand Up @@ -351,17 +351,17 @@ function verif_saisie_new_demande($new_debut, $new_demi_jour_deb, $new_fin, $new
}

$conge = new \App\ProtoControllers\Employe\Conge();
if ($conge->isChevauchement($_SESSION['userlogin'], $new_debut, $periodeDebut, $new_fin, $periodeFin)) {
if ($conge->isChevauchement($login, $new_debut, $periodeDebut, $new_fin, $periodeFin)) {
echo '<br>'. _('demande_heure_chevauche_demande') .'<br>';
$verif = false;
}

$tab_periode_calcul = make_tab_demi_jours_periode($new_debut, $new_fin, $new_demi_jour_deb, $new_demi_jour_fin);
if(verif_periode_chevauche_periode_user($new_debut, $new_fin, $_SESSION['userlogin'], "", $tab_periode_calcul, $new_comment)){
if(verif_periode_chevauche_periode_user($new_debut, $new_fin, $login, "", $tab_periode_calcul, $new_comment)){
echo '<br>'._('calcul_nb_jours_commentaire') .'<br>';
$verif = false;
}

$new_comment = htmlentities($new_comment, ENT_QUOTES | ENT_HTML401);

return $verif;
Expand Down
4 changes: 2 additions & 2 deletions hr/Fonctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ public static function new_conges($user_login, $numero_int, $new_debut, $new_dem
$new_fin = convert_date($new_fin);

// verif validité des valeurs saisies
$valid=verif_saisie_new_demande($new_debut, $new_demi_jour_deb, $new_fin, $new_demi_jour_fin, $new_nb_jours, $new_comment);
$valid = verif_saisie_new_demande($new_debut, $new_demi_jour_deb, $new_fin, $new_demi_jour_fin, $new_nb_jours, $new_comment, $user_login);

if($valid) {
$return .= $user_login . '---' . $new_debut . '_' . $new_demi_jour_deb . '---' . $new_fin . '_' . $new_demi_jour_fin . '---' . $new_nb_jours . '---' . $new_comment . '---' . $new_type_id . '<br>';
Expand Down Expand Up @@ -1025,7 +1025,7 @@ public static function affichage($user_login, $year_affichage, $year_calendrier
'startDate' => $startDate,
];
$return .= '<script>generateDatePicker(' . json_encode($datePickerOpts) . ');</script>';

// si les mois et année ne sont pas renseignés, on prend ceux du jour
if($year_calendrier_saisie_debut==0) {
$year_calendrier_saisie_debut=date("Y");
Expand Down
2 changes: 1 addition & 1 deletion responsable/Fonctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ public static function new_conges($user_login, $new_debut, $new_demi_jour_deb, $
$new_fin = convert_date($new_fin);

// verif validité des valeurs saisies
$valid=verif_saisie_new_demande($new_debut, $new_demi_jour_deb, $new_fin, $new_demi_jour_fin, $new_nb_jours, $new_comment);
$valid = verif_saisie_new_demande($new_debut, $new_demi_jour_deb, $new_fin, $new_demi_jour_fin, $new_nb_jours, $new_comment, $user_login);

if ($valid) {
$return .= $user_login . '---' . $new_debut . '_' . $new_demi_jour_deb . '---' . $new_fin . '_' . $new_demi_jour_fin . '---' . $new_nb_jours . '---' . $new_comment . '---' . $new_type_id . '<br>';
Expand Down
4 changes: 2 additions & 2 deletions utilisateur/Fonctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static function new_demande($new_debut, $new_demi_jour_deb, $new_fin, $ne
$session=session_id();

// verif validité des valeurs saisies
$valid = verif_saisie_new_demande($new_debut, $new_demi_jour_deb, $new_fin, $new_demi_jour_fin, $new_nb_jours, $new_comment);
$valid = verif_saisie_new_demande($new_debut, $new_demi_jour_deb, $new_fin, $new_demi_jour_fin, $new_nb_jours, $new_comment, $_SESSION['userlogin']);

// verifie que le solde de conges sera encore positif après validation
if( $_SESSION['config']['solde_toujours_positif'] ) {
Expand Down Expand Up @@ -549,7 +549,7 @@ public static function confirmerSuppression($p_num, $onglet)
$sql_nb_jours=affiche_decimal($resultat1["p_nb_jours"]);
//$sql_type=$resultat1["p_type"];
$sql_type= \utilisateur\Fonctions::get_libelle_abs($resultat1["p_type"]);
$sql_comment=htmlentities($resultat1["p_commentaire"], ENT_QUOTES | ENT_HTML401);
$sql_comment = $resultat1["p_commentaire"];

$return .= '<td>' . $sql_date_deb . '_' . $demi_j_deb . '</td>';
$return .= '<td>' . $sql_date_fin . '_' . $demi_j_fin . '</td>';
Expand Down

0 comments on commit 27539c3

Please sign in to comment.