39,13 → 39,25 |
$aso_stat['mois']['annee'] = $Month->thisYear(); |
$mois_courant_j1 = $Month->thisYear().'-'.sprintf("%02s", $Month->thisMonth()).'-'.sprintf("%02s", $Month->thisDay()).' 00:00:00'; |
$mois_courant_j36 = date('Y-m-d H:i:s', mktime(0, 0, 0, $NMonth->thisMonth(), 0, $NMonth->thisYear())); |
|
|
//+-------------------------------------------------------------------------------------------------+ |
// GESTION D'INFO GLOBALES |
//+-------------------------------------------------------------------------------------------------+ |
// Récupération des infos sur les utilisateurs |
$DaoUtilsateur = new Utilisateur(); |
$utilisateurs = $DaoUtilsateur->consulter(Utilisateur::GU_TOUS_AFFICHABLE); |
if (is_object($utilisateurs)) { |
$utilisateurs[0] = $utilisateurs; |
|
// Récupération des motifs d'absence |
$AbsenceMotif = new AbsenceMotif(); |
$cmd = AbsenceMotif::GAM_TOUS; |
$tab_am = $AbsenceMotif->consulter($cmd); |
if (false == $tab_am) { |
$aso_stat['absences'] = false; |
$aso_stat['messages'][] = "Aucun motif d'absence de renseigné"; |
|
} |
|
// Pour chaque utilisateur nous récupérons les infos |
foreach ($utilisateurs as $Utilisateur) { |
$aso_gestion = array(); |
//+-------------------------------------------------------------------------------------------------+ |
61,7 → 73,10 |
$UtilsateurAProjet = new UtilisateurAProjet(); |
$tab_uap = $UtilsateurAProjet->consulter(UtilisateurAProjet::GUAP_UTILISATEUR, $Utilisateur->getIdUtilisateur()); |
|
if (is_array($tab_uap) && count($tab_uap) > 0) { |
if (false == $tab_uap) { |
$aso_stat['projets'] = false; |
$aso_stat['messages'][] = "Aucune information sur le travail de ${aso_gestion['prenom_nom']}"; |
} else { |
//echo '<pre>la'.print_r($tab_uap, true).'</pre>'; |
$tab_projet_id = array(); |
foreach ($tab_uap as $uap) { |
73,9 → 88,6 |
$cmd = TravailProjet::GTP_ID_UTILISATEUR_DATE_DEB_FIN; |
$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36); |
$tab_tp = $TravailProjet->consulter($cmd, $param); |
if ($tab_tp && count($tab_tp) == 1) { |
$tab_tp = array($tab_tp); |
} |
|
// Récupération des infos sur les projets de l'utilisateur |
$aso_gestion['totaux'] = 0; |
114,32 → 126,24 |
$aso_stat['projets'][$Categorie->getLibelle()][$Projet->getIdProjet()] = $Projet->getNom(); |
} |
} |
|
//+-------------------------------------------------------------------------------------------------+ |
// GESTION DES ABSENCES |
//+-------------------------------------------------------------------------------------------------+ |
// Récupération des motifs d'absence |
$AbsenceMotif = new AbsenceMotif(); |
$cmd = AbsenceMotif::GAM_TOUS; |
$tab_am = $AbsenceMotif->consulter($cmd); |
if ($tab_am && count($tab_am) == 1) { |
$tab_am = array($tab_am); |
} |
|
// Récupération des absences pour un utilisateur à une date donnée |
$Absence = new Absence(); |
$cmd = Absence::GA_ID_UTILISATEUR_DATE_DEB_FIN; |
$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36); |
$tab_a = $Absence->consulter($cmd, $param); |
if ($tab_a && count($tab_a) == 1) { |
$tab_a = array($tab_a); |
} |
|
$aso_gestion['ab_total'] = ''; |
if ($tab_am) { |
foreach ($tab_am as $AM) { |
$aso_stat['absences'][$AM->getIdAbsenceMotif()] = $AM->getLibelle(); |
//$aso_gestion['ab'][$AM->getIdAbsenceMotif()] = 0; |
if ($tab_a) { |
if (false == $tab_a) { |
$aso_stat['absences'] = false; |
$aso_stat['messages'][] = "Aucune information sur les absences de ${aso_gestion['prenom_nom']}"; |
} else { |
if (false != $tab_am) { |
foreach ($tab_am as $AM) { |
$aso_stat['absences'][$AM->getIdAbsenceMotif()] = $AM->getLibelle(); |
//$aso_gestion['ab'][$AM->getIdAbsenceMotif()] = 0; |
foreach ($tab_a as $A) { |
if ($A->getIdAbsenceMotif() == $AM->getIdAbsenceMotif() && $A->getDuree() != 0) { |
$aso_gestion['ab'][$AM->getIdAbsenceMotif()] = $A->getDuree(); |
152,7 → 156,7 |
} |
$aso_stat['utilisateurs'][] = $aso_gestion; |
} |
|
|
//trigger_error('<pre>'.print_r($aso_stat, true).'</pre>', E_USER_NOTICE); |
$this->getRegistre()->ajouterDonnee('stat_tableau_global', $aso_stat); |
} |