9,7 → 9,10 |
|
public function executer() |
{ |
$aso_stat = array(); |
//+-------------------------------------------------------------------------------------------------+ |
// GESTION D'INFO GLOBALES |
//+-------------------------------------------------------------------------------------------------+ |
$aso_stat = array('total_w' => 0,'total_a' => 0, 'total' => 0); |
$this->getRegistre()->setTitre('Plan de charge'); |
|
//+-------------------------------------------------------------------------------------------------+ |
69,7 → 72,7 |
foreach ($tab_semaine_jours as $num => $Day) { |
// Nous prenons en compte uniquement les jours du mois courant |
if ($Day->thisMonth() == $_GET['mois']) { |
$element = array(); |
$element = array('travail' => 0, 'absence' => 0, 'w_et_a' => 0); |
$element['jour'] = $Day->thisDay(); |
$element['jour_nom'] = $Calendrier->getNomJours($num); |
$element['class'] = 'jour'; |
144,18 → 147,38 |
$j = date('Y-m-d', strtotime($TP->getIdDateTravail())); |
if ($TP->getIdProjet() == $Projet->getIdProjet()) { |
// Récupération des infos sur les catégories |
if (!isset($aso_stat['categorie_totaux'][$Categorie->getLibelle()][$j])) { |
$aso_stat['categorie_totaux'][$Categorie->getLibelle()][$j] = 0; |
if (!isset($aso_stat['categories'][$Categorie->getLibelle()][$j])) { |
$aso_stat['categories'][$Categorie->getLibelle()][$j] = 0; |
} |
$aso_stat['categorie_totaux'][$Categorie->getLibelle()][$j] += $TP->getDuree(); |
$aso_stat['categories'][$Categorie->getLibelle()][$j] += $TP->getDuree(); |
if (!isset($aso_stat['categories'][$Categorie->getLibelle()]['total'])) { |
$aso_stat['categories'][$Categorie->getLibelle()]['total'] = 0; |
} |
$aso_stat['categories'][$Categorie->getLibelle()]['total'] += $TP->getDuree(); |
|
// Récupération du total de travail |
$aso_stat['total_w'] += $TP->getDuree(); |
|
// Récupération du total de temps global (travail+absence) |
$aso_stat['total'] += $TP->getDuree(); |
|
// Récupération d'info sur le temps travaillé |
$aso_stat['elements'][$j]['travail'] += $TP->getDuree(); |
|
// Récupération du total travail + absence par jour |
$aso_stat['elements'][$j]['w_et_a'] += $TP->getDuree(); |
|
// Récupération des infos sur les projets |
if (!isset($aso_stat['projets'][$Categorie->getLibelle()][$Projet->getIdProjet()])) { |
$aso_stat['projets'][$Categorie->getLibelle()][$Projet->getIdProjet()] = array( |
'id' => $Projet->getIdProjet(), |
'nom' => $Projet->getNom(), |
'duree' => array()); |
'desc' => $Projet->getDescription(), |
'duree' => array(), |
'total' => 0); |
} |
$aso_stat['projets'][$Categorie->getLibelle()][$Projet->getIdProjet()]['duree'][$j] = $TP->getDuree(); |
$aso_stat['projets'][$Categorie->getLibelle()][$Projet->getIdProjet()]['total'] += $TP->getDuree(); |
} |
} |
} |
181,19 → 204,34 |
$aso_stat['ab_total'] = ''; |
if ($tab_am) { |
foreach ($tab_am as $AM) { |
$aso_stat['absences'][$AM->getIdAbsenceMotif()] = $AM->getLibelle(); |
//$aso_gestion['ab'][$AM->getIdAbsenceMotif()] = 0; |
// Initialisation du tableau des types d'absences |
$aso_stat['absences'][$AM->getIdAbsenceMotif()]['nom'] = $AM->getLibelle(); |
if (!isset($aso_stat['absences'][$AM->getIdAbsenceMotif()]['total'])) { |
$aso_stat['absences'][$AM->getIdAbsenceMotif()]['total'] = 0; |
} |
|
if ($tab_a) { |
foreach ($tab_a as $A) { |
if ($A->getIdAbsenceMotif() == $AM->getIdAbsenceMotif() && $A->getDuree() != 0) { |
$j = date('Y-m-d', strtotime($A->getIdDateAbsence())); |
|
// Récupération des infos sur les absences |
$aso_stat['ab'][$AM->getIdAbsenceMotif()][$j] = $A->getDuree(); |
|
// Récupération du total des absences par jour |
$aso_stat['elements'][$j]['absence'] += $A->getDuree(); |
|
// Récupération du total travail + absence par jour |
$aso_stat['elements'][$j]['w_et_a'] += $A->getDuree(); |
|
// Récupération du total pour chaque type d'absence |
$aso_stat['absences'][$AM->getIdAbsenceMotif()]['total'] += $A->getDuree(); |
|
// Récupération du total des absences |
if (!isset($aso_stat['ab_total'][$j])) { |
$aso_stat['ab_total'][$j] = 0; |
} |
$aso_stat['ab_total'][$j] += $A->getDuree(); |
$aso_stat['total_a'] += $A->getDuree(); |
|
// Récupération du total de temps global (travail+absence) |
$aso_stat['total'] += $A->getDuree(); |
} |
} |
} |
203,8 → 241,7 |
$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); |
//trigger_error('<pre>'.print_r($aso_stat, true).'</pre>', E_USER_NOTICE); |
$this->getRegistre()->ajouterDonnee('stat_tableau_charge', $aso_stat); |
} |
} |