Subversion Repositories Applications.gtt

Rev

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

Rev 101 Rev 103
Line 8... Line 8...
8
    }
8
    }
Line 9... Line 9...
9
 
9
 
10
    public function executer()
10
    public function executer()
11
    {
11
    {
12
   		$aso_stat = array();
12
   		$aso_stat = array();
Line 13... Line 13...
13
    	$this->getRegistre()->setTitre('Tableau récapitulatif');
13
    	$this->getRegistre()->setTitre('Tableau récapitulatif');
14
 
14
 
15
    	//+-------------------------------------------------------------------------------------------------+
15
    	//+-------------------------------------------------------------------------------------------------+
16
		// GESTION DES CALENDRIERS
16
		// GESTION DES CALENDRIERS
Line 28... Line 28...
28
		$Month->build();
28
		$Month->build();
Line 29... Line 29...
29
 
29
 
30
		// Construction du Calendrier
30
		// Construction du Calendrier
Line 31... Line 31...
31
		$Calendrier = new Calendrier();
31
		$Calendrier = new Calendrier();
32
		
32
		
33
		// Construction de l'url pour les mois précédent/suivant
33
		// Construction de l'url pour les mois précédent/suivant
34
		$PMonth = $Month->prevMonth('object');
34
		$PMonth = $Month->prevMonth('object');
35
		$aso_stat['url_mois_precedent'] = 'index.php?action='.GTT_ACTION_STAT_TAB_GLOB.'&annee='.$PMonth->thisYear().'&mois='.$PMonth->thisMonth();
35
		$aso_stat['url_mois_precedent'] = 'index.php?action='.GTT_ACTION_STAT_TAB_GLOB.'&annee='.$PMonth->thisYear().'&mois='.$PMonth->thisMonth();
36
		$NMonth = $Month->nextMonth('object');
36
		$NMonth = $Month->nextMonth('object');
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
		// Récupération des infos sur les utilisateurs
46
		// Récupération des infos sur les utilisateurs
47
		$DaoUtilsateur = new Utilisateur();
47
		$DaoUtilsateur = new Utilisateur();
Line 48... Line 48...
48
    	$utilisateurs = $DaoUtilsateur->consulter(Utilisateur::GU_TOUS_AFFICHABLE);
48
    	$utilisateurs = $DaoUtilsateur->consulter(Utilisateur::GU_TOUS_AFFICHABLE);
49
    	
49
    	
50
		// Récupération des motifs d'absence
50
		// Récupération des motifs d'absence
51
		$AbsenceMotif = new AbsenceMotif();
51
		$AbsenceMotif = new AbsenceMotif();
52
		$cmd = AbsenceMotif::GAM_TOUS;
52
		$cmd = AbsenceMotif::GAM_TOUS;
53
		$tab_am = $AbsenceMotif->consulter($cmd);
53
		$tab_am = $AbsenceMotif->consulter($cmd);
54
    	if (false == $tab_am) {
54
    	if (false == $tab_am) {
Line 55... Line 55...
55
    		$aso_stat['absences'] = false;
55
    		$aso_stat['absences'] = false;
Line 56... Line 56...
56
			$aso_stat['messages'][] = "Aucun motif d'absence de renseigné";
56
			$aso_stat['messages'][] = "Aucun motif d'absence de renseigné";
57
    		
57
    		
58
    	}
58
    	}
59
    	
59
    	
60
    	// Pour chaque utilisateur nous récupérons les infos
60
    	// Pour chaque utilisateur nous récupérons les infos
61
		foreach ($utilisateurs as $Utilisateur) {
61
		foreach ($utilisateurs as $Utilisateur) {
62
			$aso_gestion = array();
62
			$aso_gestion = array();
63
			//+-------------------------------------------------------------------------------------------------+
63
			//+-------------------------------------------------------------------------------------------------+
64
			// GESTION DES PROJETS
64
			// GESTION DES PROJETS
65
			//+-------------------------------------------------------------------------------------------------+
65
			//+-------------------------------------------------------------------------------------------------+
66
	    	// Récupération des infos sur l'utilisateur
66
	    	// Récupération des infos sur l'utilisateur
Line 67... Line 67...
67
	 		$aso_gestion['prenom_nom'] = $Utilisateur->getPrenom().' '.$Utilisateur->getNom();
67
	 		$aso_gestion['prenom_nom'] = $Utilisateur->getPrenom().' '.$Utilisateur->getNom();
68
	 		$aso_gestion['conges_payes'] = $Utilisateur->getCongesPayes();
68
	 		$aso_gestion['conges_payes'] = $Utilisateur->getCongesPayes();
69
	 		$aso_gestion['rtt'] = $Utilisateur->getQuotaHeuresSupp();
69
	 		$aso_gestion['rtt'] = $Utilisateur->getQuotaHeuresSupp();
Line 70... Line 70...
70
	 		$aso_gestion['tps_w'] = $Utilisateur->getTempsDeTravailJour();
70
	 		$aso_gestion['tps_w'] = $Utilisateur->getTempsDeTravailJour();
71
	
71
	
Line 81... Line 81...
81
		    	$tab_projet_id = array();
81
		    	$tab_projet_id = array();
82
		    	foreach ($tab_uap as $uap) {
82
		    	foreach ($tab_uap as $uap) {
83
		    		$tab_projet_id[] = $uap->getIdProjet();
83
		    		$tab_projet_id[] = $uap->getIdProjet();
84
		    	}
84
		    	}
Line 85... Line 85...
85
				
85
				
86
		    	// Récupération du temps de travail pour un utilisateur à une date donnée
86
		    	// Récupération du temps de travail pour un utilisateur à une date donnée
87
		    	$TravailProjet = new TravailProjet();
87
		    	$TravailProjet = new TravailProjet();
88
				$cmd = TravailProjet::GTP_ID_UTILISATEUR_DATE_DEB_FIN;
88
				$cmd = TravailProjet::GTP_ID_UTILISATEUR_DATE_DEB_FIN;
89
				$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
89
				$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
Line 90... Line 90...
90
				$tab_tp = $TravailProjet->consulter($cmd, $param);
90
				$tab_tp = $TravailProjet->consulter($cmd, $param);
91
		
91
		
92
				// Récupération des infos sur les projets de l'utilisateur
92
				// Récupération des infos sur les projets de l'utilisateur
93
		    	$aso_gestion['totaux'] = 0;
93
		    	$aso_gestion['totaux'] = 0;
Line 94... Line 94...
94
		    	$Projet = new Projet();
94
		    	$Projet = new Projet();
Line 95... Line 95...
95
		    	$tab_p = $Projet->consulter(Projet::GP_ID_LIST, array(implode(',', $tab_projet_id)));
95
		    	$tab_p = $Projet->consulter(Projet::GP_ID_LIST, array(implode(',', $tab_projet_id)));
96
		    	
96
		    	
97
				foreach ($tab_p as $Projet) {
97
				foreach ($tab_p as $Projet) {
98
		
98
		
99
					// Récupération de la catégorie du projet
99
					// Récupération de la catégorie du projet
Line 100... Line 100...
100
					$ProjetCategorie = new ProjetCategorie();
100
					$ProjetCategorie = new ProjetCategorie();
101
					$cmd = ProjetCategorie::GPC_ID;
101
					$cmd = ProjetCategorie::GPC_ID;
102
					$param = $Projet->getCeCategorie();
102
					$param = $Projet->getCeCategorie();
103
					$Categorie = current($ProjetCategorie->consulter($cmd, $param));
103
					$Categorie = current($ProjetCategorie->consulter($cmd, $param));
104
		
104
		
105
					// Nous vérifions le temps de travail pour ce projet pour la semaine courrante
105
					// Nous vérifions le temps de travail pour ce projet pour la semaine courrante
106
					$aso_tps_w = 0;
106
					$aso_tps_w = 0;
107
					if (!isset($aso_gestion['categorie_totaux'][$Categorie->getLibelle()])) {
107
					if (!isset($aso_gestion['categorie_totaux'][$Categorie->getLibelle()])) {
108
						$aso_gestion['categorie_totaux'][$Categorie->getLibelle()] = 0;
108
						$aso_gestion['categorie_totaux'][$Categorie->getLibelle()] = 0;
109
					}
109
					}
110
					if ($tab_tp) {
110
					if ($tab_tp) {
111
						foreach ($tab_tp as $TP) {
111
						foreach ($tab_tp as $TP) {
112
							if ($TP->getIdProjet() == $Projet->getIdProjet()) {
112
							if ($TP->getIdProjet() == $Projet->getIdProjet()) {
113
								$aso_gestion['categorie_totaux'][$Categorie->getLibelle()] += $TP->getDuree();
113
								$aso_gestion['categorie_totaux'][$Categorie->getLibelle()] += $TP->getDuree();
114
								$aso_gestion['totaux'] += $TP->getDuree();
114
								$aso_gestion['totaux'] += $TP->getDuree();
115
								// Stockage des infos nécessaire pour l'affichage
115
								// Stockage des infos nécessaire pour l'affichage
Line 128... Line 128...
128
	    	}
128
	    	}
Line 129... Line 129...
129
 
129
 
130
			//+-------------------------------------------------------------------------------------------------+
130
			//+-------------------------------------------------------------------------------------------------+
131
			// GESTION DES ABSENCES
131
			// GESTION DES ABSENCES
132
			//+-------------------------------------------------------------------------------------------------+
132
			//+-------------------------------------------------------------------------------------------------+
133
			// Récupération des absences pour un utilisateur à une date donnée
133
			// Récupération des absences pour un utilisateur à une date donnée
134
	    	$Absence = new Absence();
134
	    	$Absence = new Absence();
135
			$cmd = Absence::GA_ID_UTILISATEUR_DATE_DEB_FIN;
135
			$cmd = Absence::GA_ID_UTILISATEUR_DATE_DEB_FIN;
136
			$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
136
			$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
137
			$tab_a = $Absence->consulter($cmd, $param);
137
			$tab_a = $Absence->consulter($cmd, $param);