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

Update: tableaux plus lisible pour les différents tableaux de l'application #204

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions admin/Fonctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1346,6 +1346,7 @@ public static function userModule($session)


// AFFICHAGE TABLEAU
$tmp = 0;
$table = new \App\Libraries\Structure\Table();
$table->addClasses([
'table',
Expand All @@ -1357,14 +1358,16 @@ public static function userModule($session)
$childTable = '<thead>';
$childTable .= '<tr>';
$childTable .= '<th>' . _('user') . '</th>';
$childTable .= '<th>' . _('divers_quotite_maj_1') . '</th>';
$childTable .= '<th style="border-right: 2px solid #e6e6e6;">' . _('divers_quotite_maj_1') . '</th>';
foreach ($tab_type_conges as $id_type_cong => $libelle) {
$childTable .= '<th>' . $libelle . ' / ' . _('divers_an') . '</th>';
$childTable .= '<th>' . _('divers_solde') . ' ' . $libelle . '</th>';
$childTable .= '<th colspan="2" style="border-right: 2px solid #e6e6e6;">' . _('divers_solde') . ' ' . $libelle . '</th>';
$tmp ++;
}

foreach ($tab_type_conges_exceptionnels as $id_type_cong => $libelle) {
$childTable .= '<th>' . _('divers_solde') . ' ' . $libelle . '</th>';
$childTable .= '<th style="border-right: 2px solid #e6e6e6;">' . _('divers_solde') . ' ' . $libelle . '</th>';
$tmp ++;
}
$childTable .= '<th></th>';
$childTable .= '<th></th>';
Expand All @@ -1373,6 +1376,12 @@ public static function userModule($session)
}
$childTable .= '</tr>';
$childTable .= '</thead>';
$childTable .= '<thead><tr><th></th><th style="text-align: center; border-right: 2px solid #e6e6e6;"></th>';
for($i=0;$i<$tmp;$i++) {
$childTable .= '<th style="text-align: center; border-right: 1px solid #e6e6e6;">' . _('divers_an_maj') .
'</th><th style="text-align: center; border-right: 2px solid #e6e6e6;">' . _('divers_solde_maj') . '</th>';
}
$childTable .= '</tr></thead>';
$childTable .= '<tbody>';

// Récuperation des informations des users:
Expand Down Expand Up @@ -1418,15 +1427,15 @@ public static function userModule($session)

$childTable .= '<span class="responsable"> responsable : <strong>' . $tab_current_infos['resp_login'] . '</strong></span>';

$childTable .= '</td><td>' . $tab_current_infos['quotite'] . ' %</td>';
$childTable .= '</td><td style="text-align: center; border-right: 2px solid #e6e6e6;">' . $tab_current_infos['quotite'] . ' %</td>';

//tableau de tableaux les nb et soldes de conges d'un user (indicé par id de conges)
$tab_conges=$tab_current_infos['conges'];

foreach($tab_type_conges as $id_conges => $libelle) {
if (isset($tab_conges[$libelle])) {
$childTable .= '<td>' . $tab_conges[$libelle]['nb_an'] . '</td>';
$childTable .= '<td>' . $tab_conges[$libelle]['solde'] . '</td>';
$childTable .= '<td style="text-align: center; border-right: 2px solid #e6e6e6;">' . $tab_conges[$libelle]['nb_an'] . '</td>';
$childTable .= '<td style="text-align: center; border-right: 2px solid #e6e6e6;">' . $tab_conges[$libelle]['solde'] . '</td>';
} else {
$childTable .= '<td>0</td>';
$childTable .= '<td>0</td>';
Expand Down
24 changes: 16 additions & 8 deletions fonctions_conges.php
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ function constuct_and_send_mail($objet, $mail_sender_name, $mail_sender_addr, $m
// affiche : "23 / 01 / 2008 (am)"
$sql_date_deb = "01 / 01 / 2001 (am)";
// affiche : "23 / 01 / 2008 (am)"
$sql_date_deb = "02 / 01 / 2001 (am)";
$sql_date_fin = "02 / 01 / 2001 (am)";
$sql_nb_jours = 2;
$sql_commentaire = "Test comment";
$sql_type_absence = "cp";
Expand Down Expand Up @@ -1911,30 +1911,38 @@ function affiche_tableau_bilan_conges_user($login)
if ($_SESSION['config']['gestion_conges_exceptionnels']) {
$tab_type_conges_exceptionnels=recup_tableau_types_conges_exceptionnels();
}

$tmp = 0;
$return .= '<table class="table table-hover table-responsive table-condensed table-bordered">';
$return .= '<thead>';
$return .= '<tr><td></td><td colspan="' . (count($tab_cong_user) * 2 ) . '">SOLDES</td></tr>';
$return .= '<tr><td></td><td colspan="' . (count($tab_cong_user) * 2 ) . '" style="text-align: center;">SOLDES</td></tr>';
$return .= '<tr>';
$return .= '<th class="titre">'. _('divers_quotite') .'</th>';

foreach($tab_cong_user as $id => $val) {
if ($_SESSION['config']['gestion_conges_exceptionnels'] && in_array($id,$tab_type_conges_exceptionnels)) {
$return .= '<th colspan="2" style="text-align: center; border-right: 2px solid #e6e6e6;">' . $id . '</th>';
$tmp ++;
/*if ($_SESSION['config']['gestion_conges_exceptionnels'] && in_array($id,$tab_type_conges_exceptionnels)) {
$return .= '<th class="solde">' . $id . '</th>';
} else {
$return .= '<th class="annuel">' . $id . ' / ' . _('divers_an_maj') . '</th><th class="solde">' . $id . '</th>';
}
}*/
}
$return .= '</tr>';
$return .= '</thead>';
$return .= '<thead><tr><th style="text-align: center; border-right: 2px solid #e6e6e6;"></th>';
for($i=0;$i<$tmp;$i++) {
$return .= '<th style="text-align: center; border-right: 2px solid #e6e6e6;">' . _('divers_an_maj') .
'</th><th style="text-align: center; border-right: 2px solid #e6e6e6;">' . _('divers_solde_maj') . '</th>';
}
$return .= '</tr></thead>';
$return .= '<tbody>';
$return .= '<tr>';
$return .= '<td class="quotite">' . $sql_quotite . '%</td>';
$return .= '<td class="quotite" style="text-align: center; border-right: 2px solid #e6e6e6;">' . $sql_quotite . '%</td>';
foreach($tab_cong_user as $id => $val) {
if ($_SESSION['config']['gestion_conges_exceptionnels'] && in_array($id,$tab_type_conges_exceptionnels)) {
$return .= '<td class="solde">' . $val['solde'] . ($val['reliquat'] > 0 ? ' (' . _('dont_reliquat') . ' ' . $val['reliquat'] . ')' : '') . '</td>';
$return .= '<td class="solde" style="text-align: center; border-right: 2px solid #e6e6e6;">' . $val['solde'] . ($val['reliquat'] > 0 ? ' (' . _('dont_reliquat') . ' ' . $val['reliquat'] . ')' : '') . '</td>';
} else {
$return .= '<td class="annuel">' . $val['nb_an'] . '</td><td class="solde">' . $val['solde'] . ($val['reliquat'] > 0 ? ' (' . _('dont_reliquat') . ' ' . $val['reliquat'] . ')' : '') . '</td>';
$return .= '<td class="annuel" style="text-align: center; border-right: 2px solid #e6e6e6;">' . $val['nb_an'] . '</td><td class="solde">' . $val['solde'] . ($val['reliquat'] > 0 ? ' (' . _('dont_reliquat') . ' ' . $val['reliquat'] . ')' : '') . '</td>';
}
}
$return .= '</tr>';
Expand Down
25 changes: 16 additions & 9 deletions hr/Fonctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,20 @@ public static function pagePrincipaleModule(array $tab_type_cong, array $tab_typ
$return .= '<tr>';
$return .= '<th>' . _('divers_nom_maj') . '</th>';
$return .= '<th>' . _('divers_prenom_maj') . '</th>';
$return .= '<th>' . _('divers_quotite_maj_1') . '</th>';
$return .= '<th style="border-right: 2px solid #e6e6e6;">'. _('divers_quotite_maj_1') .'</th>' ;
$tmp = 0;
$nb_colonnes = 3;
foreach($tab_type_cong as $id_conges => $libelle) {
// cas d'une absence ou d'un congé
$return .= '<th>' . $libelle . ' / ' . _('divers_an_maj') . '</th>';
$return .= '<th>'. _('divers_solde_maj') . ' ' . $libelle . '</th>';
$return .= '<th colspan="2" style="text-align: center; border-right: 2px solid #e6e6e6;">'.$libelle.'</th>';
$nb_colonnes += 2;
$tmp ++;
}
// conges exceptionnels
if ($_SESSION['config']['gestion_conges_exceptionnels']) {
foreach($tab_type_conges_exceptionnels as $id_type_cong => $libelle) {
$return .= '<th>'. _('divers_solde_maj') . ' ' . $libelle . '</th>';
$return .= '<th style="text-align: center; border-right: 2px solid #e6e6e6;">'. _('divers_solde_maj') . ' ' . $libelle . '</th>';
$nb_colonnes += 1;
$tmp ++;
}
}
$return .= '<th></th>';
Expand All @@ -76,6 +77,12 @@ public static function pagePrincipaleModule(array $tab_type_cong, array $tab_typ
}
$return .= '</tr>';
$return .= '</thead>';
$return .= '<thead><tr><th></th><th></th><th style="text-align: center; border-right: 2px solid #e6e6e6;"></th>';
for($i=0;$i<$tmp;$i++) {
$return .= '<th style="text-align: center; border-right: 2px solid #e6e6e6;">' . _('divers_an_maj') .
'</th><th style="text-align: center; border-right: 2px solid #e6e6e6;">' . _('divers_solde_maj') . '</th>';
}
$return .= '</tr></thead>';
$return .= '<tbody>';

/***********************************/
Expand All @@ -101,16 +108,16 @@ public static function pagePrincipaleModule(array $tab_type_cong, array $tab_typ
} else {
$return .= '<tr class="hidden">';
}
$return .= '<td>' . $tab_current_user['nom'] . '</td><td>' . $tab_current_user['prenom'] . '</td><td>' . $tab_current_user['quotite'] . '%</td>';
$return .= '<td>' . $tab_current_user['nom'] . '</td><td>' . $tab_current_user['prenom'] . '</td><td style="text-align: center; border-right: 2px solid #e6e6e6;">' . $tab_current_user['quotite'] . '%</td>';
foreach($tab_type_cong as $id_conges => $libelle) {
$nbAn = isset($tab_conges[$libelle]['nb_an'])
? $tab_conges[$libelle]['nb_an']
: 0;
$solde = isset($tab_conges[$libelle]['solde'])
? $tab_conges[$libelle]['solde']
: 0;
$return .= '<td>'.$nbAn.'</td>';
$return .= '<td>'. $solde .'</td>';
$return .= '<td style="text-align: center; border-right: 2px solid #e6e6e6;">'.$nbAn.'</td>';
$return .= '<td style="text-align: center; border-right: 2px solid #e6e6e6;">'. $solde .'</td>';
}
if ($_SESSION['config']['gestion_conges_exceptionnels']) {
foreach($tab_type_conges_exceptionnels as $id_type_cong => $libelle)
Expand Down Expand Up @@ -3017,7 +3024,7 @@ public static function saisie_groupe_fermeture()
}
$return .= '</div>';
$return .= '<hr>';
$return .= '<a class="btn" href="/admin/admin_index.php?session=' . $session . '">' . _('form_cancel') . '</a>';
$return .= '<a class="btn" href="'.ROOT_PATH.'/hr/hr_index.php?session=' . $session . '">' . _('form_cancel') . '</a>';
return $return;
}

Expand Down
30 changes: 19 additions & 11 deletions responsable/Fonctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1038,27 +1038,28 @@ public static function pagePrincipaleModule($tab_type_cong, $tab_type_conges_exc
// AFFICHAGE TABLEAU (premiere ligne)
$return .= '<h1>' . _('resp_traite_user_etat_conges') . '</h1>';

$return .= '<table class="table table-hover table-responsive table-condensed table-striped">';
$return .= '<table class="table table-striped table-hover table-responsive table-condensed" >';
$return .= '<thead>';

$nb_colonnes = 0;
$tmp = 0;

$return .= '<tr>';
$return .= '<th>' . _('divers_nom_maj') .'</th>';
$return .= '<th>'. _('divers_prenom_maj') .'</th>';
$return .= '<th>'. _('divers_quotite_maj_1') .'</th>' ;
$return .= '<th style="border-right: 2px solid #e6e6e6;">'. _('divers_quotite_maj_1') .'</th>' ;
$nb_colonnes = 3;
foreach($tab_type_cong as $id_conges => $libelle) {
// cas d'une absence ou d'un congé
$return .= '<th>' . $libelle . ' / ' . _('divers_an_maj') . '</th>';
$return .= '<th>'. _('divers_solde_maj') . ' ' . $libelle . '</th>';
$return .= '<th colspan="2" style="text-align: center; border-right: 2px solid #e6e6e6;">'.$libelle.'</th>';
$nb_colonnes += 2;
$tmp ++;
}

// conges exceptionnels
if ($_SESSION['config']['gestion_conges_exceptionnels']) {
foreach($tab_type_conges_exceptionnels as $id_type_cong => $libelle) {
$return .= '<th>'. _('divers_solde_maj') . ' ' . $libelle . '</th>';
$return .= '<th style="text-align: center;">'. _('divers_solde_maj') . ' ' . $libelle . '</th>';
$nb_colonnes += 1;
$tmp ++;
}
}
$return .= '<th></th>';
Expand All @@ -1069,6 +1070,13 @@ public static function pagePrincipaleModule($tab_type_cong, $tab_type_conges_exc
}
$return .= '</tr>';
$return .= '</thead>';
$return .= '<thead><tr><th></th><th></th><th style="text-align: center; border-right: 2px solid #e6e6e6;"></th>';

for($i=0;$i<=$tmp;$i++) {
$return .= '<th style="text-align: center; border-right: 2px solid #e6e6e6;">' . _('divers_an_maj') . '</th><th style="text-align: center; border-right: 2px solid #e6e6e6;">' . _('divers_solde_maj') . '</th>';
$i++;
}
$return .= '</tr></thead>';
$return .= '<tbody>';

/***********************************/
Expand All @@ -1091,14 +1099,14 @@ public static function pagePrincipaleModule($tab_type_cong, $tab_type_conges_exc
$text_edit_papier="<a class=\"action edit\" href=\"../edition/edit_user.php?session=$session&user_login=$current_login\" target=\"_blank\" title=\""._('resp_etat_users_imprim')."\"><i class=\"fa fa-file-text\"></i></a>";

$return .= '<tr class="' . ($i ? 'i' : 'p') . '">';
$return .= '<td>' . $tab_current_user['nom'] . '</td><td>' . $tab_current_user['prenom'] . '</td><td>' . $tab_current_user['quotite'] . '%</td>';
$return .= '<td>' . $tab_current_user['nom'] . '</td><td>' . $tab_current_user['prenom'] . '</td><td style="text-align: center; border-right: 2px solid #e6e6e6;">' . $tab_current_user['quotite'] . '%</td>';
foreach($tab_type_cong as $id_conges => $libelle) {
$return .= '<td>' . $tab_conges[$libelle]['nb_an'] . '</td>';
$return .= '<td>' . $tab_conges[$libelle]['solde'] . '</td>';
$return .= '<td style="text-align: center; border-right: 2px solid #e6e6e6;">' . $tab_conges[$libelle]['nb_an'] . '</td>';
$return .= '<td style="text-align: center; border-right: 2px solid #e6e6e6;">' . $tab_conges[$libelle]['solde'] . '</td>';
}
if ($_SESSION['config']['gestion_conges_exceptionnels']) {
foreach($tab_type_conges_exceptionnels as $id_type_cong => $libelle) {
$return .= '<td>' . $tab_conges[$libelle]['solde'] . '</td>';
$return .= '<td style="text-align: center; border-right: 2px solid #e6e6e6;">' . $tab_conges[$libelle]['solde'] . '</td>';
}
}
$return .= '<td>' . $text_affich_user . '</td>';
Expand Down