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

Commit

Permalink
Diverses corrections mineures (#972)
Browse files Browse the repository at this point in the history
* Correction affichage liste des demande RH

* Correction libellé pour ajout de congés

* Corrige l'historique des congé dans l'interface responsable

* Corrige l'historique des congé dans l'interface HR

* Correction style tableau HR

* Ajout de congés sans calcul proportionnel

* Correction ajout utilisateur si pas de type de congés exceptionnel
  • Loading branch information
SaiyanRiku authored Sep 6, 2021
1 parent ae0e25f commit 266134b
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 38 deletions.
3 changes: 3 additions & 0 deletions App/Models/Conge.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ public static function statusText($status)
case static::STATUT_ANNUL:
$text = _('statut_annul');
break;
case static::STATUT_AJOUT:
$text = _('statut_ajout');
break;

default:
$text = _('statut_inconnu');
Expand Down
3 changes: 3 additions & 0 deletions App/Tools/locale/fr_FR/LC_MESSAGES/php-conges.po
Original file line number Diff line number Diff line change
Expand Up @@ -1925,6 +1925,9 @@ msgstr "Refusé"
msgid "statut_annul"
msgstr "Annulé"

msgid "statut_ajout"
msgstr "Ajout"

msgid "statut_inconnu"
msgstr "Inconnu"

Expand Down
24 changes: 8 additions & 16 deletions hr/Fonctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ private static function affiche_etat_conges_user_for_resp($user_login, $year_aff

// AFFICHAGE TABLEAU
$return .= '<form action="' . $PHP_SELF . '?onglet=traite_user" method="POST">';
$return .= '<table cellpadding="2" class="tablo">';
$return .= '<table cellpadding="2" class="table table-hover table-responsive table-condensed table-striped">';
$return .= '<thead>';
$return .= '<tr>';
$return .= '<th>';
Expand All @@ -507,8 +507,8 @@ private static function affiche_etat_conges_user_for_resp($user_login, $year_aff
$i = true;
$tab_checkbox=array();
while ($resultat3 = $ReqLog3->fetch_array() ) {
$sql_date_deb = eng_date_to_fr($resultat3["p_date_deb"]) ;
$sql_date_fin = eng_date_to_fr($resultat3["p_date_fin"]) ;
$sql_date_deb = $resultat3["p_date_deb"];
$sql_date_fin = $resultat3["p_date_fin"];
$sql_demi_jour_deb = $resultat3["p_demi_jour_deb"] ;
$sql_demi_jour_fin = $resultat3["p_demi_jour_fin"] ;

Expand All @@ -522,17 +522,9 @@ private static function affiche_etat_conges_user_for_resp($user_login, $year_aff
$sql_p_date_traitement = $resultat3["p_date_traitement"];
$sql_num = $resultat3["p_num"] ;

if ($sql_demi_jour_deb=="am") {
$demi_j_deb = _('divers_am_short') ;
} else {
$demi_j_deb = _('divers_pm_short') ;
}

if ($sql_demi_jour_fin=="am") {
$demi_j_fin = _('divers_am_short') ;
} else {
$demi_j_fin = _('divers_pm_short') ;
}

$demi_j_deb = ($sql_demi_jour_deb == "am") ? 'matin' : 'après-midi';
$demi_j_fin = ($sql_demi_jour_fin == "am") ? 'matin' : 'après-midi';

if (($sql_etat=="annul") || ($sql_etat=="refus") || ($sql_etat=="ajout")) {
$casecocher1="";
Expand All @@ -553,8 +545,8 @@ private static function affiche_etat_conges_user_for_resp($user_login, $year_aff
}

$return .= '<tr class="' . ($i ? 'i' : 'p') . '">';
$return .= '<td>' . $sql_date_deb . '_' . $demi_j_deb . '</td>';
$return .= '<td>' . $sql_date_fin . '_' . $demi_j_fin . '</td>';
$return .= '<td>' . \App\Helpers\Formatter::dateIso2Fr($sql_date_deb) . ' <span class="demi">' . schars($demi_j_deb) . '</span></td>';
$return .= '<td>' . \App\Helpers\Formatter::dateIso2Fr($sql_date_fin) . ' <span class="demi">' . schars($demi_j_fin) . '</span></td>';
$return .= '<td>' . $sql_nb_jours . '</td>';
$return .= '<td>' . $sql_commentaire . '</td>';
$return .= '<td>' . $tab_types_abs[$sql_type]['libelle'] . '</td>';
Expand Down
4 changes: 2 additions & 2 deletions hr/hr_ajout_conges.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function get_list_groupes_pour_rh() : string

if ('true' === $ajout_global) {
$tab_new_nb_conges_all = getpost_variable('tab_new_nb_conges_all');
$tab_calcul_proportionnel = getpost_variable('tab_calcul_proportionnel');
$tab_calcul_proportionnel = getpost_variable('tab_calcul_proportionnel', array());
$tab_new_comment_all = getpost_variable('tab_new_comment_all');

ajout_global($tab_new_nb_conges_all, $tab_calcul_proportionnel, $tab_new_comment_all, $_SESSION['userlogin']);
Expand All @@ -196,7 +196,7 @@ function get_list_groupes_pour_rh() : string

if ('true' === $ajout_groupe) {
$tab_new_nb_conges_all = getpost_variable('tab_new_nb_conges_all');
$tab_calcul_proportionnel = getpost_variable('tab_calcul_proportionnel');
$tab_calcul_proportionnel = getpost_variable('tab_calcul_proportionnel', array());
$tab_new_comment_all = getpost_variable('tab_new_comment_all');
$choix_groupe = getpost_variable('choix_groupe');

Expand Down
14 changes: 8 additions & 6 deletions hr/hr_ajout_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,16 @@ function insertSoldeUtilisateur(array $data, \includes\SQL $sql) : bool
$returnStd = $sql->query($req);
$returnExc = 1;
$typeAbsencesExceptionnels = \App\ProtoControllers\Conge::getTypesAbsences($sql, 'conges_exceptionnels');
foreach ($typeAbsencesExceptionnels as $typeId => $info) {
$valuesExc[] = "(DEFAULT, '" . $data['login'] . "' ,"
. $typeId . ", 0, "
. $data['soldes'][$typeId] . ", 0)" ;
if(count($typeAbsencesExceptionnels) > 0){
foreach ($typeAbsencesExceptionnels as $typeId => $info) {
$valuesExc[] = "(DEFAULT, '" . $data['login'] . "' ,"
. $typeId . ", 0, "
. $data['soldes'][$typeId] . ", 0)" ;

}
$req = "INSERT INTO conges_solde_user (su_id, su_login, su_abs_id, su_nb_an, su_solde, su_reliquat) VALUES " . implode(",", $valuesExc);
$returnExc = $sql->query($req);
}
$req = "INSERT INTO conges_solde_user (su_id, su_login, su_abs_id, su_nb_an, su_solde, su_reliquat) VALUES " . implode(",", $valuesExc);
$returnExc = $sql->query($req);

return $returnStd && $returnExc;
}
Expand Down
20 changes: 6 additions & 14 deletions responsable/Fonctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,20 +424,12 @@ private static function affiche_etat_conges_user_for_resp($user_login, $year_aff
$i = true;
while ($resultat3 = $ReqLog3->fetch_array()) {
$sql_login=$resultat3["p_login"] ;
$sql_date_deb=eng_date_to_fr($resultat3["p_date_deb"]);
$sql_date_deb=$resultat3["p_date_deb"];
$sql_demi_jour_deb=$resultat3["p_demi_jour_deb"] ;
if ($sql_demi_jour_deb=="am") {
$demi_j_deb = _('divers_am_short');
} else {
$demi_j_deb = _('divers_pm_short');
}
$sql_date_fin=eng_date_to_fr($resultat3["p_date_fin"]);
$demi_j_deb = ($sql_demi_jour_deb == "am") ? 'matin' : 'après-midi';
$sql_date_fin=$resultat3["p_date_fin"];
$sql_demi_jour_fin=$resultat3["p_demi_jour_fin"] ;
if ($sql_demi_jour_fin=="am") {
$demi_j_fin = _('divers_am_short');
} else {
$demi_j_fin = _('divers_pm_short');
}
$demi_j_fin = ($sql_demi_jour_fin == "am") ? 'matin' : 'après-midi';
$sql_nb_jours=affiche_decimal($resultat3["p_nb_jours"]);
$sql_commentaire=$resultat3["p_commentaire"] ;
$sql_type=$resultat3["p_type"] ;
Expand Down Expand Up @@ -469,8 +461,8 @@ private static function affiche_etat_conges_user_for_resp($user_login, $year_aff
}

$return .= '<tr class="' . ($i ? 'i' : 'p') . '">';
$return .= '<td>' . $sql_date_deb . '_' . $demi_j_deb . '</td>';
$return .= '<td>' . $sql_date_fin . '_' . $demi_j_fin . '</td>';
$return .= '<td>' . \App\Helpers\Formatter::dateIso2Fr($sql_date_deb) .' <span class="demi">' . schars($demi_j_deb) . '</span></td>';
$return .= '<td>' . \App\Helpers\Formatter::dateIso2Fr($sql_date_fin) .' <span class="demi">' . schars($demi_j_deb) . '</span></td>';
$return .= '<td>' . $sql_nb_jours . '</td>';
$return .= '<td>' . $sql_commentaire . '</td>';
$return .= '<td>' . $tab_types_abs[$sql_type]['libelle'] . '</td>';
Expand Down

0 comments on commit 266134b

Please sign in to comment.