Subversion Repositories Applications.gtt

Rev

Rev 110 | Rev 122 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 110 Rev 116
Line 41... Line 41...
41
		$mois_courant_j36 = date('Y-m-d H:i:s', mktime(0, 0, 0, $NMonth->thisMonth(), 0, $NMonth->thisYear()));
41
		$mois_courant_j36 = date('Y-m-d H:i:s', mktime(0, 0, 0, $NMonth->thisMonth(), 0, $NMonth->thisYear()));
Line 42... Line 42...
42
 
42
 
43
    	//+-------------------------------------------------------------------------------------------------+
43
    	//+-------------------------------------------------------------------------------------------------+
44
		// GESTION D'INFO GLOBALES
44
		// GESTION D'INFO GLOBALES
45
		//+-------------------------------------------------------------------------------------------------+
45
		//+-------------------------------------------------------------------------------------------------+
46
		// Initialisation de variables communes à la gestion des projets et des absences
46
		// Initialisation de variables
-
 
47
		$aso_stat['absences'] = false;
Line 47... Line 48...
47
		$aso_stat['total_absences_projets'] = 0;
48
	    $aso_stat['categories'] = false;
48
 
49
	    		
49
		// Récupération des infos sur les utilisateurs
50
		// Récupération des infos sur les utilisateurs
Line -... Line 51...
-
 
51
		$DaoUtilsateur = new Utilisateur();
-
 
52
    	$utilisateurs = $DaoUtilsateur->consulter(Utilisateur::GU_TOUS_AFFICHABLE);
-
 
53
		
-
 
54
    	if (false == $utilisateurs) {
-
 
55
    		$aso_stat['messages'][] = "Aucun utilisateur affichable de disponible...";
-
 
56
    	} else {
50
		$DaoUtilsateur = new Utilisateur();
57
			// Initialisation de variables communes à la gestion des projets et des absences
51
    	$utilisateurs = $DaoUtilsateur->consulter(Utilisateur::GU_TOUS_AFFICHABLE);
58
			$aso_stat['total_absences_projets'] = 0;
52
 
59
 
53
		// Récupération des motifs d'absence
60
		    // Récupération des motifs d'absence
54
		$AbsenceMotif = new AbsenceMotif();
61
			$AbsenceMotif = new AbsenceMotif();
55
		$cmd = AbsenceMotif::GAM_TOUS;
-
 
56
		$tab_am = $AbsenceMotif->consulter($cmd);
62
			$cmd = AbsenceMotif::GAM_TOUS;
57
    	if (false == $tab_am) {
-
 
58
    		$aso_stat['absences'] = false;
63
			$tab_am = $AbsenceMotif->consulter($cmd);
Line 59... Line 64...
59
			$aso_stat['messages'][] = "Aucun motif d'absence de renseigné";
64
	    	if (false == $tab_am) {
60
    		
65
				$aso_stat['messages'][] = "Aucun motif d'absence de renseigné";
61
    	}
66
	    	}
Line 78... Line 83...
78
	    	$TravailProjet = new TravailProjet();
83
		    	$TravailProjet = new TravailProjet();
79
			$cmd = TravailProjet::GTP_ID_UTILISATEUR_DATE_DEB_FIN;
84
				$cmd = TravailProjet::GTP_ID_UTILISATEUR_DATE_DEB_FIN;
80
			$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
85
				$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
81
			$tab_tp = $TravailProjet->consulter($cmd, $param);
86
				$tab_tp = $TravailProjet->consulter($cmd, $param);
82
			if (false == $tab_tp) {
87
				if (false == $tab_tp) {
83
    			$aso_stat['categories'] = false;
-
 
84
    			$aso_stat['messages'][] = "Aucune information sur le travail de ${aso_gestion['prenom_nom']}";
88
	    			$aso_stat['messages'][] = "Aucune information sur le travail de ${aso_gestion['prenom_nom']}";
85
    		} else {
89
	    		} else {
86
				// Récupération des identifiants des projets 
90
					// Récupération des identifiants des projets 
87
		    	$tab_projet_id = array('');
91
			    	$tab_projet_id = array('');
88
		    	foreach ($tab_tp as $tp) {
92
			    	foreach ($tab_tp as $tp) {
Line 146... Line 150...
146
	    	$Absence = new Absence();
150
		    	$Absence = new Absence();
147
			$cmd = Absence::GA_ID_UTILISATEUR_DATE_DEB_FIN;
151
				$cmd = Absence::GA_ID_UTILISATEUR_DATE_DEB_FIN;
148
			$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
152
				$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
149
			$tab_a = $Absence->consulter($cmd, $param);
153
				$tab_a = $Absence->consulter($cmd, $param);
150
			if (false == $tab_a) {
154
				if (false == $tab_a) {
151
				$aso_stat['absences'] = false;
-
 
152
				$aso_stat['messages'][] = "Aucune information sur les absences de ${aso_gestion['prenom_nom']}";
155
					$aso_stat['messages'][] = "Aucune information sur les absences de ${aso_gestion['prenom_nom']}";
153
			} else {
156
				} else {
154
				if (false != $tab_am) {
157
					if (false != $tab_am) {
155
					foreach ($tab_am as $AM) {
158
						foreach ($tab_am as $AM) {
156
						$aso_stat['absences'][$AM->getIdAbsenceMotif()]['nom'] = $AM->getLibelle();
159
							$aso_stat['absences'][$AM->getIdAbsenceMotif()]['nom'] = $AM->getLibelle();
Line 173... Line 176...
173
				}
176
					}
174
			}
177
				}
175
			$aso_stat['total_absences_projets'] += $aso_gestion['total'];
178
				$aso_stat['total_absences_projets'] += $aso_gestion['total'];
176
			$aso_stat['utilisateurs'][] = $aso_gestion;
179
				$aso_stat['utilisateurs'][] = $aso_gestion;
177
    	}
180
	    	}
-
 
181
    	}
Line 178... Line 182...
178
		
182
    	
179
		//trigger_error('<pre>'.print_r($aso_stat, true).'</pre>', E_USER_NOTICE);
183
		//trigger_error('<pre>'.print_r($aso_stat, true).'</pre>', E_USER_NOTICE);
180
		$this->getRegistre()->ajouterDonnee('stat_tableau_global', $aso_stat);
184
		$this->getRegistre()->ajouterDonnee('stat_tableau_global', $aso_stat);
181
    }
185
    }