Subversion Repositories Applications.gtt

Compare Revisions

Ignore whitespace Rev 137 → Rev 138

/trunk/actions/GttCtrlActionStatTableauCharge.class.php
238,7 → 238,11
$aso_stat['messages'][] = 'Aucune absence de mentionnée en '.$aso_stat['mois']['mois'].' '.$aso_stat['mois']['annee'];
}
//trigger_error('<pre>'.print_r($aso_stat, true).'</pre>', E_USER_NOTICE);
// Post-traitement des nombre pour l'affichage
$aso_stat = Nombre::formaterNbre($aso_stat, GTT_LANGUE);
// Sortie
//trigger_error(print_r($aso_stat, true), E_USER_NOTICE);
$this->getRegistre()->ajouterDonnee('stat_tableau_charge', $aso_stat);
}
}
/trunk/actions/GttCtrlActionStatTableauGlobal.class.php
56,6 → 56,10
} else {
// Initialisation de variables communes à la gestion des projets et des absences
$aso_stat['total_absences_projets'] = 0;
// Initialisation de variables propre aux absences
$aso_stat['total_absences'] = 0;
// Initialisation de variables propre aux absences
$aso_stat['total_projets'] = 0;
 
// Récupération des motifs d'absence
$AbsenceMotif = new AbsenceMotif();
76,9 → 80,6
//+-------------------------------------------------------------------------------------------------+
// GESTION DES PROJETS
//+-------------------------------------------------------------------------------------------------+
// Initialisation de variables propre aux absences
$aso_stat['total_projets'] = 0;
// Récupération du temps de travail pour un utilisateur à une date donnée
$TravailProjet = new TravailProjet();
$cmd = TravailProjet::GTP_ID_UTILISATEUR_DATE_DEB_FIN;
111,18 → 112,17
'nom' => $Categorie->getLibelle(),
'total' => 0);
}
$aso_stat['categories'][$Categorie->getIdCategorie()]['projets'][$Projet->getIdProjet()] =
array( 'nom' => $Projet->getNom(),
'desc' => $Projet->getDescription());
foreach ($tab_tp as $TP) {
if ($TP->getIdProjet() == $Projet->getIdProjet()) {
// Info trans utilisateur sur les catégories
if (!isset($aso_stat['categories'][$Categorie->getIdCategorie()]['projets'][$Projet->getIdProjet()]['total'])) {
$aso_stat['categories'][$Categorie->getIdCategorie()]['projets'][$Projet->getIdProjet()]['total'] = 0;
} else {
$aso_stat['categories'][$Categorie->getIdCategorie()]['projets'][$Projet->getIdProjet()]['total'] += $TP->getDuree();
if (!isset($aso_stat['categories'][$Categorie->getIdCategorie()]['projets'][$Projet->getIdProjet()])) {
$aso_stat['categories'][$Categorie->getIdCategorie()]['projets'][$Projet->getIdProjet()] =
array( 'nom' => $Projet->getNom(),
'desc' => $Projet->getDescription(),
'total' => 0);
}
$aso_stat['categories'][$Categorie->getIdCategorie()]['projets'][$Projet->getIdProjet()]['total'] += $TP->getDuree();
$aso_stat['categories'][$Categorie->getIdCategorie()]['total'] += $TP->getDuree();
// Stockage des infos nécessaire pour l'affichage d'un utilisateur
if (!isset($aso_gestion['projets'][$Categorie->getIdCategorie()][$Projet->getIdProjet()])) {
132,6 → 132,10
'duree' => 0);
}
$aso_gestion['projets'][$Categorie->getIdCategorie()][$Projet->getIdProjet()]['duree'] += $TP->getDuree();
if (!isset($aso_gestion['projets'][$Categorie->getIdCategorie()]['total'])) {
$aso_gestion['projets'][$Categorie->getIdCategorie()]['total'] = 0;
}
$aso_gestion['projets'][$Categorie->getIdCategorie()]['total'] += $TP->getDuree();
$aso_gestion['total_w'] += $TP->getDuree();
}
}
143,31 → 147,31
//+-------------------------------------------------------------------------------------------------+
// GESTION DES ABSENCES
//+-------------------------------------------------------------------------------------------------+
// Initialisation de variables propre aux absences
$aso_stat['total_absences'] = 0;
// 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 (false == $tab_a) {
$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()]['nom'] = $AM->getLibelle();
if (!isset($aso_stat['absences'][$AM->getIdAbsenceMotif()])) {
$aso_stat['absences'][$AM->getIdAbsenceMotif()] =
array( 'nom' => $AM->getLibelle(),
'total' => 0);
}
//$aso_gestion['ab'][$AM->getIdAbsenceMotif()] = 0;
foreach ($tab_a as $A) {
if ($A->getIdAbsenceMotif() == $AM->getIdAbsenceMotif() && $A->getDuree() != 0) {
if (!isset($aso_stat['absences'][$AM->getIdAbsenceMotif()]['total'])) {
$aso_stat['absences'][$AM->getIdAbsenceMotif()]['total'] = 0;
} else {
$aso_stat['absences'][$AM->getIdAbsenceMotif()]['total'] += $A->getDuree();
$aso_stat['absences'][$AM->getIdAbsenceMotif()]['total'] += $A->getDuree();
$aso_stat['total_absences'] += $A->getDuree();
if (!isset($aso_gestion['ab'][$AM->getIdAbsenceMotif()])) {
$aso_gestion['ab'][$AM->getIdAbsenceMotif()] = 0;
}
$aso_stat['total_absences'] += $A->getDuree();
$aso_gestion['ab'][$AM->getIdAbsenceMotif()] = $A->getDuree();
$aso_gestion['ab'][$AM->getIdAbsenceMotif()] += $A->getDuree();
$aso_gestion['total_a'] += $A->getDuree();
$aso_gestion['total'] += $A->getDuree();
}
180,7 → 184,11
}
}
//trigger_error('<pre>'.print_r($aso_stat, true).'</pre>', E_USER_NOTICE);
// Post-traitement des nombre pour l'affichage
$aso_stat = Nombre::formaterNbre($aso_stat, GTT_LANGUE);
// Sortie
//trigger_error(print_r($aso_stat, true), E_USER_NOTICE);
$this->getRegistre()->ajouterDonnee('stat_tableau_global', $aso_stat);
}
}