Subversion Repositories Applications.gtt

Rev

Rev 126 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 126 Rev 138
Line 54... Line 54...
54
    	if (false == $utilisateurs) {
54
    	if (false == $utilisateurs) {
55
    		$aso_stat['messages'][] = "Aucun utilisateur affichable de disponible...";
55
    		$aso_stat['messages'][] = "Aucun utilisateur affichable de disponible...";
56
    	} else {
56
    	} else {
57
			// Initialisation de variables communes à la gestion des projets et des absences
57
			// Initialisation de variables communes à la gestion des projets et des absences
58
			$aso_stat['total_absences_projets'] = 0;
58
			$aso_stat['total_absences_projets'] = 0;
-
 
59
			// Initialisation de variables propre aux absences
-
 
60
			$aso_stat['total_absences'] = 0;
-
 
61
			// Initialisation de variables propre aux absences
-
 
62
			$aso_stat['total_projets'] = 0;
Line 59... Line 63...
59
 
63
 
60
		    // Récupération des motifs d'absence
64
		    // Récupération des motifs d'absence
61
			$AbsenceMotif = new AbsenceMotif();
65
			$AbsenceMotif = new AbsenceMotif();
62
			$cmd = AbsenceMotif::GAM_TOUS;
66
			$cmd = AbsenceMotif::GAM_TOUS;
Line 74... Line 78...
74
		 								'total' => 0);
78
		 								'total' => 0);
Line 75... Line 79...
75
	
79
	
76
				//+-------------------------------------------------------------------------------------------------+
80
				//+-------------------------------------------------------------------------------------------------+
77
				// GESTION DES PROJETS
81
				// GESTION DES PROJETS
78
				//+-------------------------------------------------------------------------------------------------+
-
 
79
				// Initialisation de variables propre aux absences
-
 
80
				$aso_stat['total_projets'] = 0;
-
 
81
	   	
82
				//+-------------------------------------------------------------------------------------------------+
82
		    	// Récupération du temps de travail pour un utilisateur à une date donnée
83
		    	// Récupération du temps de travail pour un utilisateur à une date donnée
83
		    	$TravailProjet = new TravailProjet();
84
		    	$TravailProjet = new TravailProjet();
84
				$cmd = TravailProjet::GTP_ID_UTILISATEUR_DATE_DEB_FIN;
85
				$cmd = TravailProjet::GTP_ID_UTILISATEUR_DATE_DEB_FIN;
85
				$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
86
				$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
Line 109... Line 110...
109
						if (!isset($aso_stat['categories'][$Categorie->getIdCategorie()])) {
110
						if (!isset($aso_stat['categories'][$Categorie->getIdCategorie()])) {
110
							$aso_stat['categories'][$Categorie->getIdCategorie()] = array(	'projets' => array(), 
111
							$aso_stat['categories'][$Categorie->getIdCategorie()] = array(	'projets' => array(), 
111
																							'nom' => $Categorie->getLibelle(), 
112
																							'nom' => $Categorie->getLibelle(), 
112
																							'total' => 0);
113
																							'total' => 0);
113
						}
114
						}
114
						$aso_stat['categories'][$Categorie->getIdCategorie()]['projets'][$Projet->getIdProjet()] = 
-
 
115
							array(	'nom' => $Projet->getNom(),
-
 
116
									'desc' => $Projet->getDescription());
-
 
Line 117... Line 115...
117
						
115
						
118
						foreach ($tab_tp as $TP) {
116
						foreach ($tab_tp as $TP) {
119
							if ($TP->getIdProjet() == $Projet->getIdProjet()) {
117
							if ($TP->getIdProjet() == $Projet->getIdProjet()) {
120
								// Info trans utilisateur sur les catégories
118
								// Info trans utilisateur sur les catégories
121
								if (!isset($aso_stat['categories'][$Categorie->getIdCategorie()]['projets'][$Projet->getIdProjet()]['total'])) {
119
								if (!isset($aso_stat['categories'][$Categorie->getIdCategorie()]['projets'][$Projet->getIdProjet()])) {
122
									$aso_stat['categories'][$Categorie->getIdCategorie()]['projets'][$Projet->getIdProjet()]['total'] = 0;
120
									$aso_stat['categories'][$Categorie->getIdCategorie()]['projets'][$Projet->getIdProjet()] = 
123
								} else {
121
										array(	'nom' => $Projet->getNom(),
-
 
122
												'desc' => $Projet->getDescription(),
124
									$aso_stat['categories'][$Categorie->getIdCategorie()]['projets'][$Projet->getIdProjet()]['total'] += $TP->getDuree();
123
												'total' => 0);
-
 
124
								}
125
								}
125
								$aso_stat['categories'][$Categorie->getIdCategorie()]['projets'][$Projet->getIdProjet()]['total'] += $TP->getDuree();
126
								$aso_stat['categories'][$Categorie->getIdCategorie()]['total'] += $TP->getDuree();
126
								$aso_stat['categories'][$Categorie->getIdCategorie()]['total'] += $TP->getDuree();
127
								// Stockage des infos nécessaire pour l'affichage d'un utilisateur
127
								// Stockage des infos nécessaire pour l'affichage d'un utilisateur
128
								if (!isset($aso_gestion['projets'][$Categorie->getIdCategorie()][$Projet->getIdProjet()])) {
128
								if (!isset($aso_gestion['projets'][$Categorie->getIdCategorie()][$Projet->getIdProjet()])) {
129
									$aso_gestion['projets'][$Categorie->getIdCategorie()][$Projet->getIdProjet()] = array(
129
									$aso_gestion['projets'][$Categorie->getIdCategorie()][$Projet->getIdProjet()] = array(
130
										'id' => $Projet->getIdProjet(),
130
										'id' => $Projet->getIdProjet(),
131
										'nom' => $Projet->getNom(),
131
										'nom' => $Projet->getNom(),
132
										'duree' => 0);
132
										'duree' => 0);
133
								}
133
								}
-
 
134
								$aso_gestion['projets'][$Categorie->getIdCategorie()][$Projet->getIdProjet()]['duree'] += $TP->getDuree();
-
 
135
								if (!isset($aso_gestion['projets'][$Categorie->getIdCategorie()]['total'])) {
-
 
136
									$aso_gestion['projets'][$Categorie->getIdCategorie()]['total'] = 0;
-
 
137
								}
134
								$aso_gestion['projets'][$Categorie->getIdCategorie()][$Projet->getIdProjet()]['duree'] += $TP->getDuree();
138
								$aso_gestion['projets'][$Categorie->getIdCategorie()]['total'] += $TP->getDuree();
135
								$aso_gestion['total_w'] += $TP->getDuree();
139
								$aso_gestion['total_w'] += $TP->getDuree();
136
							}
140
							}
137
						}
141
						}
138
					}
142
					}
Line 141... Line 145...
141
				$aso_stat['total_projets'] += $aso_gestion['total_w'];
145
				$aso_stat['total_projets'] += $aso_gestion['total_w'];
Line 142... Line 146...
142
				
146
				
143
				//+-------------------------------------------------------------------------------------------------+
147
				//+-------------------------------------------------------------------------------------------------+
144
				// GESTION DES ABSENCES
148
				// GESTION DES ABSENCES
145
				//+-------------------------------------------------------------------------------------------------+
-
 
146
				// Initialisation de variables propre aux absences
-
 
147
				$aso_stat['total_absences'] = 0;
-
 
148
				
149
				//+-------------------------------------------------------------------------------------------------+
149
				// Récupération des absences pour un utilisateur à une date donnée
150
				// Récupération des absences pour un utilisateur à une date donnée
150
		    	$Absence = new Absence();
151
		    	$Absence = new Absence();
151
				$cmd = Absence::GA_ID_UTILISATEUR_DATE_DEB_FIN;
152
				$cmd = Absence::GA_ID_UTILISATEUR_DATE_DEB_FIN;
152
				$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
153
				$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
-
 
154
				$tab_a = $Absence->consulter($cmd, $param);
153
				$tab_a = $Absence->consulter($cmd, $param);
155
 
154
				if (false == $tab_a) {
156
				if (false == $tab_a) {
155
					$aso_stat['messages'][] = "Aucune information sur les absences de ${aso_gestion['prenom_nom']}";
157
					$aso_stat['messages'][] = "Aucune information sur les absences de ${aso_gestion['prenom_nom']}";
156
				} else {
158
				} else {
157
					if (false != $tab_am) {
159
					if (false != $tab_am) {
-
 
160
						foreach ($tab_am as $AM) {
158
						foreach ($tab_am as $AM) {
161
							if (!isset($aso_stat['absences'][$AM->getIdAbsenceMotif()])) {
-
 
162
								$aso_stat['absences'][$AM->getIdAbsenceMotif()] = 
-
 
163
									array( 	'nom' => $AM->getLibelle(),
-
 
164
											'total' => 0);
Line 159... Line -...
159
							$aso_stat['absences'][$AM->getIdAbsenceMotif()]['nom'] = $AM->getLibelle();
-
 
160
							
165
							}
161
							//$aso_gestion['ab'][$AM->getIdAbsenceMotif()] = 0;
166
							
162
							foreach ($tab_a as $A) {
-
 
163
								if ($A->getIdAbsenceMotif() == $AM->getIdAbsenceMotif() && $A->getDuree() != 0) {
-
 
164
									if (!isset($aso_stat['absences'][$AM->getIdAbsenceMotif()]['total'])) {
-
 
165
										$aso_stat['absences'][$AM->getIdAbsenceMotif()]['total'] = 0;
167
							foreach ($tab_a as $A) {
166
									} else {
-
 
167
										$aso_stat['absences'][$AM->getIdAbsenceMotif()]['total'] += $A->getDuree();
168
								if ($A->getIdAbsenceMotif() == $AM->getIdAbsenceMotif() && $A->getDuree() != 0) {
-
 
169
									$aso_stat['absences'][$AM->getIdAbsenceMotif()]['total'] += $A->getDuree();
-
 
170
									$aso_stat['total_absences'] += $A->getDuree();
-
 
171
									if (!isset($aso_gestion['ab'][$AM->getIdAbsenceMotif()])) {
168
									}
172
										$aso_gestion['ab'][$AM->getIdAbsenceMotif()] = 0;
169
									$aso_stat['total_absences'] += $A->getDuree();
173
									}
170
									$aso_gestion['ab'][$AM->getIdAbsenceMotif()] = $A->getDuree();
174
									$aso_gestion['ab'][$AM->getIdAbsenceMotif()] += $A->getDuree();
171
									$aso_gestion['total_a'] += $A->getDuree();
175
									$aso_gestion['total_a'] += $A->getDuree();
172
									$aso_gestion['total'] += $A->getDuree();
176
									$aso_gestion['total'] += $A->getDuree();
173
								}
177
								}
Line 178... Line 182...
178
				$aso_stat['total_absences_projets'] += $aso_gestion['total'];
182
				$aso_stat['total_absences_projets'] += $aso_gestion['total'];
179
				$aso_stat['utilisateurs'][] = $aso_gestion;
183
				$aso_stat['utilisateurs'][] = $aso_gestion;
180
	    	}
184
	    	}
181
    	}
185
    	}
Line -... Line 186...
-
 
186
    	
-
 
187
    	// Post-traitement des nombre pour l'affichage
-
 
188
    	$aso_stat = Nombre::formaterNbre($aso_stat, GTT_LANGUE);
-
 
189
		
182
    	
190
		// Sortie
183
		//trigger_error('<pre>'.print_r($aso_stat, true).'</pre>', E_USER_NOTICE);
191
		//trigger_error(print_r($aso_stat, true), E_USER_NOTICE);
184
		$this->getRegistre()->ajouterDonnee('stat_tableau_global', $aso_stat);
192
		$this->getRegistre()->ajouterDonnee('stat_tableau_global', $aso_stat);
185
    }
193
    }
186
}
194
}
187
?>
195
?>