Subversion Repositories Applications.gtt

Rev

Rev 103 | Rev 122 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 103 Rev 110
1
<?php
1
<?php
2
class GttCtrlActionStatTableauCharge extends aControlleurAction {
2
class GttCtrlActionStatTableauCharge extends aControlleurAction {
3
 
3
 
4
	public function __construct(Registre $Registre)
4
	public function __construct(Registre $Registre)
5
    {
5
    {
6
    	$Registre->ajouterEspace('StatTableauCharge', 'stat_tableau_charge');
6
    	$Registre->ajouterEspace('StatTableauCharge', 'stat_tableau_charge');
7
    	$Registre->ajouterSquelette('stat_tableau_charge', 'stat_tableau_charge.tpl.html');
7
    	$Registre->ajouterSquelette('stat_tableau_charge', 'stat_tableau_charge.tpl.html');
8
    }
8
    }
9
 
9
 
10
    public function executer()
10
    public function executer()
11
    {
11
    {
-
 
12
   		//+-------------------------------------------------------------------------------------------------+
-
 
13
		// GESTION D'INFO GLOBALES
-
 
14
		//+-------------------------------------------------------------------------------------------------+
12
   		$aso_stat = array();
15
   		$aso_stat = array('total_w' => 0,'total_a' => 0, 'total' => 0);
13
    	$this->getRegistre()->setTitre('Plan de charge');
16
    	$this->getRegistre()->setTitre('Plan de charge');
14
 
17
 
15
    	//+-------------------------------------------------------------------------------------------------+
18
    	//+-------------------------------------------------------------------------------------------------+
16
		// GESTION DES PARAMÊTRE de l'URL
19
		// GESTION DES PARAMÊTRE de l'URL
17
		//+-------------------------------------------------------------------------------------------------+
20
		//+-------------------------------------------------------------------------------------------------+
18
		// Initialisation des variables
21
		// Initialisation des variables
19
		if (!isset($_GET['annee'])) {
22
		if (!isset($_GET['annee'])) {
20
			$_GET['annee'] = date('Y');
23
			$_GET['annee'] = date('Y');
21
		}
24
		}
22
		if (!isset($_GET['mois'])) {
25
		if (!isset($_GET['mois'])) {
23
			$_GET['mois'] = date('m');
26
			$_GET['mois'] = date('m');
24
		}
27
		}
25
		if (!isset($_GET['uid'])) {// ID de l'utilisateur à afficher
28
		if (!isset($_GET['uid'])) {// ID de l'utilisateur à afficher
26
			$_GET['uid'] = null;
29
			$_GET['uid'] = null;
27
		}
30
		}
28
		//+-------------------------------------------------------------------------------------------------+
31
		//+-------------------------------------------------------------------------------------------------+
29
		// GESTION DES UTILISATEURS
32
		// GESTION DES UTILISATEURS
30
		//+-------------------------------------------------------------------------------------------------+
33
		//+-------------------------------------------------------------------------------------------------+
31
		$DaoUtilsateur = new Utilisateur();
34
		$DaoUtilsateur = new Utilisateur();
32
    	$utilisateurs = $DaoUtilsateur->consulter(Utilisateur::GU_TOUS_AFFICHABLE);
35
    	$utilisateurs = $DaoUtilsateur->consulter(Utilisateur::GU_TOUS_AFFICHABLE);
33
    	if (is_object($utilisateurs)) {
36
    	if (is_object($utilisateurs)) {
34
    		$utilisateurs[0] = $utilisateurs;
37
    		$utilisateurs[0] = $utilisateurs;
35
    	}
38
    	}
36
    	$UtilisateurCourant = null;
39
    	$UtilisateurCourant = null;
37
    	foreach ($utilisateurs as $Utilisateur) {
40
    	foreach ($utilisateurs as $Utilisateur) {
38
	    	// Récupération des infos sur l'utilisateur
41
	    	// Récupération des infos sur l'utilisateur
39
	 		$aso_stat['utilisateurs'][$Utilisateur->getIdUtilisateur()]['courant'] = false;
42
	 		$aso_stat['utilisateurs'][$Utilisateur->getIdUtilisateur()]['courant'] = false;
40
	 		$aso_stat['utilisateurs'][$Utilisateur->getIdUtilisateur()]['nom'] = $Utilisateur->getPrenom().' '.$Utilisateur->getNom();
43
	 		$aso_stat['utilisateurs'][$Utilisateur->getIdUtilisateur()]['nom'] = $Utilisateur->getPrenom().' '.$Utilisateur->getNom();
41
	 		if (	(!is_null($_GET['uid']) && $Utilisateur->getIdUtilisateur() == $_GET['uid'])
44
	 		if (	(!is_null($_GET['uid']) && $Utilisateur->getIdUtilisateur() == $_GET['uid'])
42
	 			||	(is_null($_GET['uid']) && $Utilisateur->getIdUtilisateur() == $GLOBALS['_GTT_']['Utilisateur']->getIdUtilisateur()) ) {
45
	 			||	(is_null($_GET['uid']) && $Utilisateur->getIdUtilisateur() == $GLOBALS['_GTT_']['Utilisateur']->getIdUtilisateur()) ) {
43
	 			$UtilisateurCourant = clone $Utilisateur;
46
	 			$UtilisateurCourant = clone $Utilisateur;
44
	 			$aso_stat['utilisateurs'][$Utilisateur->getIdUtilisateur()]['courant'] = true;
47
	 			$aso_stat['utilisateurs'][$Utilisateur->getIdUtilisateur()]['courant'] = true;
45
	 			$aso_stat['utilisateur_courant'] = $Utilisateur->getPrenom().' '.$Utilisateur->getNom();
48
	 			$aso_stat['utilisateur_courant'] = $Utilisateur->getPrenom().' '.$Utilisateur->getNom();
46
	 			$_GET['uid'] = $Utilisateur->getIdUtilisateur();
49
	 			$_GET['uid'] = $Utilisateur->getIdUtilisateur();
47
	 		}
50
	 		}
48
    	}
51
    	}
49
    	$aso_stat['etre_admin'] = $GLOBALS['_GTT_']['Utilisateur']->getMarkAdmin();
52
    	$aso_stat['etre_admin'] = $GLOBALS['_GTT_']['Utilisateur']->getMarkAdmin();
50
		$Utilisateur = $UtilisateurCourant;
53
		$Utilisateur = $UtilisateurCourant;
51
		
54
		
52
		//+-------------------------------------------------------------------------------------------------+
55
		//+-------------------------------------------------------------------------------------------------+
53
		// GESTION DES CALENDRIERS
56
		// GESTION DES CALENDRIERS
54
		//+-------------------------------------------------------------------------------------------------+
57
		//+-------------------------------------------------------------------------------------------------+
55
		
58
		
56
		// Construction du Calendrier
59
		// Construction du Calendrier
57
		$Calendrier = new Calendrier();
60
		$Calendrier = new Calendrier();
58
		$tab_jours_feries = $Calendrier->getListeFeries();
61
		$tab_jours_feries = $Calendrier->getListeFeries();
59
		
62
		
60
		// Construction de l'objet mois
63
		// Construction de l'objet mois
61
		$Month = new Calendar_Month_Weeks($_GET['annee'], $_GET['mois']);
64
		$Month = new Calendar_Month_Weeks($_GET['annee'], $_GET['mois']);
62
		$Month->build();
65
		$Month->build();
63
		
66
		
64
		// Récupération des jours du mois
67
		// Récupération des jours du mois
65
		while ($Week = $Month->fetch()) {
68
		while ($Week = $Month->fetch()) {
66
			$Week->build();
69
			$Week->build();
67
			//echo '<pre>'.print_r($Month, true).'</pre>';
70
			//echo '<pre>'.print_r($Month, true).'</pre>';
68
			$tab_semaine_jours = $Week->fetchAll();
71
			$tab_semaine_jours = $Week->fetchAll();
69
			foreach ($tab_semaine_jours as $num => $Day) {
72
			foreach ($tab_semaine_jours as $num => $Day) {
70
				// Nous prenons en compte uniquement les jours du mois courant
73
				// Nous prenons en compte uniquement les jours du mois courant
71
				if ($Day->thisMonth() == $_GET['mois']) {
74
				if ($Day->thisMonth() == $_GET['mois']) {
72
					$element = array();
75
					$element = array('travail' => 0, 'absence' => 0, 'w_et_a' => 0);
73
					$element['jour'] = $Day->thisDay();
76
					$element['jour'] = $Day->thisDay();
74
					$element['jour_nom'] = $Calendrier->getNomJours($num);
77
					$element['jour_nom'] = $Calendrier->getNomJours($num);
75
					$element['class'] = 'jour';
78
					$element['class'] = 'jour';
76
					// Nous vérifions le type de jour
79
					// Nous vérifions le type de jour
77
					// Jour courrant
80
					// Jour courrant
78
					if ($Day->isSelected()) {
81
					if ($Day->isSelected()) {
79
						$element['class'] .= ' jour_courrant';
82
						$element['class'] .= ' jour_courrant';
80
					} 
83
					} 
81
					// Jour n'appartenant pas au moins courrant
84
					// Jour n'appartenant pas au moins courrant
82
					if ($Day->isEmpty()) {
85
					if ($Day->isEmpty()) {
83
						$element['class'] .= ' jour_vide';
86
						$element['class'] .= ' jour_vide';
84
					}
87
					}
85
					// Jour férié
88
					// Jour férié
86
					foreach ($tab_jours_feries as $jour_ferie) {
89
					foreach ($tab_jours_feries as $jour_ferie) {
87
						if ($Day->thisDay(true) ==  $jour_ferie) {
90
						if ($Day->thisDay(true) ==  $jour_ferie) {
88
							$element['class'] .= ' jour_ferie';
91
							$element['class'] .= ' jour_ferie';
89
						}
92
						}
90
					}
93
					}
91
					// Jour de week-end
94
					// Jour de week-end
92
					if ($element['jour_nom'] == GESTION_DIM_L || $element['jour_nom'] == GESTION_SAM_L) {
95
					if ($element['jour_nom'] == GESTION_DIM_L || $element['jour_nom'] == GESTION_SAM_L) {
93
						$element['class'] .= ' jour_we';
96
						$element['class'] .= ' jour_we';
94
					}
97
					}
95
					$id = date('Y-m-d', mktime(0, 0, 0, $Day->thisMonth(), $Day->thisDay(), $Day->thisYear()));
98
					$id = date('Y-m-d', mktime(0, 0, 0, $Day->thisMonth(), $Day->thisDay(), $Day->thisYear()));
96
					$aso_stat['elements'][$id] = $element;
99
					$aso_stat['elements'][$id] = $element;
97
				}
100
				}
98
			}
101
			}
99
		}
102
		}
100
		
103
		
101
		// Construction de l'url pour les mois précédent/suivant/courant et paramêtres pour le formulaire utilisateur
104
		// Construction de l'url pour les mois précédent/suivant/courant et paramêtres pour le formulaire utilisateur
102
		$aso_stat['form_url'] = 'index.php';
105
		$aso_stat['form_url'] = 'index.php';
103
		$aso_stat['form_param']['action'] = GTT_ACTION_STAT_TAB_CHARGE;
106
		$aso_stat['form_param']['action'] = GTT_ACTION_STAT_TAB_CHARGE;
104
		$aso_stat['form_param']['annee'] = $Month->thisYear();
107
		$aso_stat['form_param']['annee'] = $Month->thisYear();
105
		$aso_stat['form_param']['mois'] = $Month->thisMonth();
108
		$aso_stat['form_param']['mois'] = $Month->thisMonth();
106
		$PMonth = $Month->prevMonth('object');
109
		$PMonth = $Month->prevMonth('object');
107
		$aso_stat['url_mois_precedent'] = 'index.php?action='.GTT_ACTION_STAT_TAB_CHARGE.'&amp;annee='.$PMonth->thisYear().'&amp;mois='.$PMonth->thisMonth().'&amp;uid='.$_GET['uid'];
110
		$aso_stat['url_mois_precedent'] = 'index.php?action='.GTT_ACTION_STAT_TAB_CHARGE.'&amp;annee='.$PMonth->thisYear().'&amp;mois='.$PMonth->thisMonth().'&amp;uid='.$_GET['uid'];
108
		$NMonth = $Month->nextMonth('object');
111
		$NMonth = $Month->nextMonth('object');
109
		$aso_stat['url_mois_suivant'] = 'index.php?action='.GTT_ACTION_STAT_TAB_CHARGE.'&amp;annee='.$NMonth->thisYear().'&amp;mois='.$NMonth->thisMonth().'&amp;uid='.$_GET['uid'];
112
		$aso_stat['url_mois_suivant'] = 'index.php?action='.GTT_ACTION_STAT_TAB_CHARGE.'&amp;annee='.$NMonth->thisYear().'&amp;mois='.$NMonth->thisMonth().'&amp;uid='.$_GET['uid'];
110
		$aso_stat['mois']['mois'] = $Calendrier->getNomMois($Month->thisMonth());
113
		$aso_stat['mois']['mois'] = $Calendrier->getNomMois($Month->thisMonth());
111
		$aso_stat['mois']['annee'] = $Month->thisYear();
114
		$aso_stat['mois']['annee'] = $Month->thisYear();
112
		$mois_courant_j1 = $Month->thisYear().'-'.sprintf("%02s", $Month->thisMonth()).'-'.sprintf("%02s", $Month->thisDay()).' 00:00:00';
115
		$mois_courant_j1 = $Month->thisYear().'-'.sprintf("%02s", $Month->thisMonth()).'-'.sprintf("%02s", $Month->thisDay()).' 00:00:00';
113
		$mois_courant_j36 = date('Y-m-d H:i:s', mktime(0, 0, 0, $NMonth->thisMonth(), 0, $NMonth->thisYear()));
116
		$mois_courant_j36 = date('Y-m-d H:i:s', mktime(0, 0, 0, $NMonth->thisMonth(), 0, $NMonth->thisYear()));
114
		
117
		
115
		//+-------------------------------------------------------------------------------------------------+
118
		//+-------------------------------------------------------------------------------------------------+
116
		// GESTION DES PROJETS
119
		// GESTION DES PROJETS
117
		//+-------------------------------------------------------------------------------------------------+
120
		//+-------------------------------------------------------------------------------------------------+
118
    	// Récupération du temps de travail pour un utilisateur pour le mois donné
121
    	// Récupération du temps de travail pour un utilisateur pour le mois donné
119
    	$TravailProjet = new TravailProjet();
122
    	$TravailProjet = new TravailProjet();
120
		$cmd = TravailProjet::GTP_ID_UTILISATEUR_DATE_DEB_FIN;
123
		$cmd = TravailProjet::GTP_ID_UTILISATEUR_DATE_DEB_FIN;
121
		$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
124
		$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
122
		$tab_tp = $TravailProjet->consulter($cmd, $param);
125
		$tab_tp = $TravailProjet->consulter($cmd, $param);
123
		
126
		
124
		if ($tab_tp != false) {
127
		if ($tab_tp != false) {
125
			$tab_projet_id = array();
128
			$tab_projet_id = array();
126
			foreach ($tab_tp as $utp) {
129
			foreach ($tab_tp as $utp) {
127
    			$tab_projet_id[] = $utp->getIdProjet();
130
    			$tab_projet_id[] = $utp->getIdProjet();
128
    		}
131
    		}
129
			// Nous vérifions qu'il y a des données pour l'utilisateur courant pour le mois donné
132
			// Nous vérifions qu'il y a des données pour l'utilisateur courant pour le mois donné
130
			// Récupération des infos sur les projets de l'utilisateur
133
			// Récupération des infos sur les projets de l'utilisateur
131
	    	$Projet = new Projet();
134
	    	$Projet = new Projet();
132
	    	$tab_p = $Projet->consulter(Projet::GP_ID_LIST, array(implode(',', $tab_projet_id)));
135
	    	$tab_p = $Projet->consulter(Projet::GP_ID_LIST, array(implode(',', $tab_projet_id)));
133
			foreach ($tab_p as $Projet) {
136
			foreach ($tab_p as $Projet) {
134
				// Récupération de la catégorie du projet
137
				// Récupération de la catégorie du projet
135
				$ProjetCategorie = new ProjetCategorie();
138
				$ProjetCategorie = new ProjetCategorie();
136
				$cmd = ProjetCategorie::GPC_ID;
139
				$cmd = ProjetCategorie::GPC_ID;
137
				$param = $Projet->getCeCategorie();
140
				$param = $Projet->getCeCategorie();
138
				$Categorie = current($ProjetCategorie->consulter($cmd, $param));
141
				$Categorie = current($ProjetCategorie->consulter($cmd, $param));
139
				
142
				
140
				// Nous vérifions le temps de travail pour ce projet
143
				// Nous vérifions le temps de travail pour ce projet
141
				$aso_tps_w = 0;
144
				$aso_tps_w = 0;
142
				if ($tab_tp) {
145
				if ($tab_tp) {
143
					foreach ($tab_tp as $TP) {
146
					foreach ($tab_tp as $TP) {
144
						$j = date('Y-m-d', strtotime($TP->getIdDateTravail()));
147
						$j = date('Y-m-d', strtotime($TP->getIdDateTravail()));
145
						if ($TP->getIdProjet() == $Projet->getIdProjet()) {
148
						if ($TP->getIdProjet() == $Projet->getIdProjet()) {
146
							// Récupération des infos sur les catégories
149
							// Récupération des infos sur les catégories
147
							if (!isset($aso_stat['categorie_totaux'][$Categorie->getLibelle()][$j])) {
150
							if (!isset($aso_stat['categories'][$Categorie->getLibelle()][$j])) {
148
								$aso_stat['categorie_totaux'][$Categorie->getLibelle()][$j] = 0;
151
								$aso_stat['categories'][$Categorie->getLibelle()][$j] = 0;
-
 
152
							}
-
 
153
							$aso_stat['categories'][$Categorie->getLibelle()][$j] += $TP->getDuree();
-
 
154
							if (!isset($aso_stat['categories'][$Categorie->getLibelle()]['total'])) {
-
 
155
								$aso_stat['categories'][$Categorie->getLibelle()]['total'] = 0;
149
							}
156
							}
150
							$aso_stat['categorie_totaux'][$Categorie->getLibelle()][$j] += $TP->getDuree();
157
							$aso_stat['categories'][$Categorie->getLibelle()]['total'] += $TP->getDuree();
-
 
158
							
-
 
159
							// Récupération du total de travail
-
 
160
							$aso_stat['total_w'] += $TP->getDuree();
-
 
161
							
-
 
162
							// Récupération du total de temps global (travail+absence)
-
 
163
							$aso_stat['total'] += $TP->getDuree();
-
 
164
							
-
 
165
							// Récupération d'info sur le temps travaillé
-
 
166
							$aso_stat['elements'][$j]['travail'] += $TP->getDuree();
-
 
167
 
-
 
168
							// Récupération du total travail + absence par jour
-
 
169
							$aso_stat['elements'][$j]['w_et_a'] += $TP->getDuree();
-
 
170
							
151
							// Récupération des infos sur les projets
171
							// Récupération des infos sur les projets
152
							if (!isset($aso_stat['projets'][$Categorie->getLibelle()][$Projet->getIdProjet()])) {
172
							if (!isset($aso_stat['projets'][$Categorie->getLibelle()][$Projet->getIdProjet()])) {
153
								$aso_stat['projets'][$Categorie->getLibelle()][$Projet->getIdProjet()] = array(
173
								$aso_stat['projets'][$Categorie->getLibelle()][$Projet->getIdProjet()] = array(
154
									'id' => $Projet->getIdProjet(),
174
									'id' => $Projet->getIdProjet(),
155
									'nom' => $Projet->getNom(),
175
									'nom' => $Projet->getNom(),
-
 
176
									'desc' => $Projet->getDescription(),
156
									'duree' => array());
177
									'duree' => array(),
-
 
178
									'total' => 0);
157
							}
179
							}
158
							$aso_stat['projets'][$Categorie->getLibelle()][$Projet->getIdProjet()]['duree'][$j] = $TP->getDuree();
180
							$aso_stat['projets'][$Categorie->getLibelle()][$Projet->getIdProjet()]['duree'][$j] = $TP->getDuree();
-
 
181
							$aso_stat['projets'][$Categorie->getLibelle()][$Projet->getIdProjet()]['total'] += $TP->getDuree();
159
						}
182
						}
160
					}
183
					}
161
				}
184
				}
162
			}
185
			}
163
		} else {
186
		} else {
164
			$aso_stat['messages'][] = 'Aucune information sur le travail en '.$aso_stat['mois']['mois'].' '.$aso_stat['mois']['annee'];
187
			$aso_stat['messages'][] = 'Aucune information sur le travail en '.$aso_stat['mois']['mois'].' '.$aso_stat['mois']['annee'];
165
		}
188
		}
166
		
189
		
167
		//+-------------------------------------------------------------------------------------------------+
190
		//+-------------------------------------------------------------------------------------------------+
168
		// GESTION DES ABSENCES
191
		// GESTION DES ABSENCES
169
		//+-------------------------------------------------------------------------------------------------+
192
		//+-------------------------------------------------------------------------------------------------+
170
		// Récupération des motifs d'absence
193
		// Récupération des motifs d'absence
171
		$AbsenceMotif = new AbsenceMotif();
194
		$AbsenceMotif = new AbsenceMotif();
172
		$cmd = AbsenceMotif::GAM_TOUS;
195
		$cmd = AbsenceMotif::GAM_TOUS;
173
		$tab_am = $AbsenceMotif->consulter($cmd);
196
		$tab_am = $AbsenceMotif->consulter($cmd);
174
 
197
 
175
		// Récupération des absences pour un utilisateur à une date donnée
198
		// Récupération des absences pour un utilisateur à une date donnée
176
    	$Absence = new Absence();
199
    	$Absence = new Absence();
177
		$cmd = Absence::GA_ID_UTILISATEUR_DATE_DEB_FIN;
200
		$cmd = Absence::GA_ID_UTILISATEUR_DATE_DEB_FIN;
178
		$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
201
		$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
179
		$tab_a = $Absence->consulter($cmd, $param);
202
		$tab_a = $Absence->consulter($cmd, $param);
180
		if ($tab_a != false) {
203
		if ($tab_a != false) {
181
			$aso_stat['ab_total'] = '';
204
			$aso_stat['ab_total'] = '';
182
			if ($tab_am) {
205
			if ($tab_am) {
183
				foreach ($tab_am as $AM) {
206
				foreach ($tab_am as $AM) {
-
 
207
					// Initialisation du tableau des types d'absences
184
					$aso_stat['absences'][$AM->getIdAbsenceMotif()] = $AM->getLibelle();
208
					$aso_stat['absences'][$AM->getIdAbsenceMotif()]['nom'] = $AM->getLibelle();
-
 
209
					if (!isset($aso_stat['absences'][$AM->getIdAbsenceMotif()]['total'])) {
185
					//$aso_gestion['ab'][$AM->getIdAbsenceMotif()] = 0;
210
						$aso_stat['absences'][$AM->getIdAbsenceMotif()]['total'] = 0;
-
 
211
					}
-
 
212
 
186
					if ($tab_a) {
213
					if ($tab_a) {
187
						foreach ($tab_a as $A) {
214
						foreach ($tab_a as $A) {
188
							if ($A->getIdAbsenceMotif() == $AM->getIdAbsenceMotif() && $A->getDuree() != 0) {
215
							if ($A->getIdAbsenceMotif() == $AM->getIdAbsenceMotif() && $A->getDuree() != 0) {
189
								$j = date('Y-m-d', strtotime($A->getIdDateAbsence()));
216
								$j = date('Y-m-d', strtotime($A->getIdDateAbsence()));
-
 
217
 
190
								// Récupération des infos sur les absences
218
								// Récupération des infos sur les absences
191
								$aso_stat['ab'][$AM->getIdAbsenceMotif()][$j] = $A->getDuree();
219
								$aso_stat['ab'][$AM->getIdAbsenceMotif()][$j] = $A->getDuree();
-
 
220
								
-
 
221
								// Récupération du total des absences par jour
-
 
222
								$aso_stat['elements'][$j]['absence'] += $A->getDuree();
-
 
223
								
-
 
224
								// Récupération du total travail + absence par jour
-
 
225
								$aso_stat['elements'][$j]['w_et_a'] += $A->getDuree();
-
 
226
 
-
 
227
								// Récupération du total pour chaque type d'absence
-
 
228
								$aso_stat['absences'][$AM->getIdAbsenceMotif()]['total'] += $A->getDuree();
-
 
229
 
192
								// Récupération du total des absences
230
								// Récupération du total des absences
193
								if (!isset($aso_stat['ab_total'][$j])) {
231
								$aso_stat['total_a'] += $A->getDuree();
-
 
232
								
194
									$aso_stat['ab_total'][$j] = 0;
233
								// Récupération du total de temps global (travail+absence)
195
								}
-
 
196
								$aso_stat['ab_total'][$j] += $A->getDuree();
234
								$aso_stat['total'] += $A->getDuree();
197
							}
235
							}
198
						}
236
						}
199
					}
237
					}
200
				}
238
				}
201
			}
239
			}
202
		} else {
240
		} else {
203
			$aso_stat['messages'][] = 'Aucune absence de mentionnée en '.$aso_stat['mois']['mois'].' '.$aso_stat['mois']['annee'];
241
			$aso_stat['messages'][] = 'Aucune absence de mentionnée en '.$aso_stat['mois']['mois'].' '.$aso_stat['mois']['annee'];
204
		}
242
		}
205
		
-
 
206
		
243
		
207
		trigger_error('<pre>'.print_r($aso_stat, true).'</pre>', E_USER_NOTICE);
244
		//trigger_error('<pre>'.print_r($aso_stat, true).'</pre>', E_USER_NOTICE);
208
		$this->getRegistre()->ajouterDonnee('stat_tableau_charge', $aso_stat);
245
		$this->getRegistre()->ajouterDonnee('stat_tableau_charge', $aso_stat);
209
    }
246
    }
210
}
247
}
211
?>
248
?>