Subversion Repositories Applications.gtt

Rev

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

Rev 11 Rev 46
Line 1... Line 1...
1
<?php
1
<?php
2
 
-
 
3
require_once GTT_CHEMIN_METIER.'Utilisateur.class.php';
-
 
4
 
-
 
5
class GttCtrlActionUtilisateur extends aAction {
2
class GttCtrlActionUtilisateur extends aAction {
Line 6... Line 3...
6
 
3
 
7
    public function __construct()
4
    public function __construct()
8
    {
5
    {
9
    	print_r($this->getResultat());
6
    	print_r($this->getResultat());
10
    	$Resultats = $this->getResultat();
7
    	$Resultats = $this->getResultat();
11
    	$Resultats->ajouterEspace('Utilisateur', 'utilisateur');
8
    	$Resultats->ajouterEspace('Utilisateur', 'utilisateur');
12
    	$Resultats->ajouterSquelette('utilisateur', 'utilisateur.tpl.html');
9
    	$Resultats->ajouterSquelette('utilisateur', 'utilisateur.tpl.html');
13
    }
10
    }
14
    
11
 
15
    public function executer(Resultat $Resultat)
12
    public function executer(Resultat $Resultat)
16
    {
13
    {
17
    	$Resultat->setTitre('Ajouter un utilisateur');
14
    	$Resultat->setTitre('Ajouter un utilisateur');
18
    	$tab_preferences =& Projet::recupererTableauProjet();
15
    	$tab_preferences =& Projet::recupererTableauProjet();
19
    	$aso_preferences = array();
16
    	$aso_preferences = array();
20
    	$Preference = new Preferences($GLOBALS['_GTT_']['Utilisateur']->getIdUtilisateur(), 5000);
17
    	$Preference = new Preferences($GLOBALS['_GTT_']['Utilisateur']->getIdUtilisateur(), 5000);
21
    	$aso_preferences['nbre_projets'] = count($tab_preferences); 
18
    	$aso_preferences['nbre_projets'] = count($tab_preferences);
22
		// Parcourt du tableau de projets
19
		// Parcourt du tableau de projets
23
		for($i = 0; $i < $aso_preferences['nbre_projets']; $i++) {
20
		for($i = 0; $i < $aso_preferences['nbre_projets']; $i++) {
24
			$ligne = $tab_preferences[$i];
21
			$ligne = $tab_preferences[$i];
25
			$coche = false;
22
			$coche = false;
26
			if ($Preference->isInPreferences($ligne[GEST_CHAMPS_ID_PROJET])) {
23
			if ($Preference->isInPreferences($ligne[GEST_CHAMPS_ID_PROJET])) {
27
				$coche = true;
24
				$coche = true;
28
			}
25
			}
29
			$aso_preferences['preferences'][$ligne[GEST_CHAMPS_LIBELLE_CATEGORIE]][] = array(
26
			$aso_preferences['preferences'][$ligne[GEST_CHAMPS_LIBELLE_CATEGORIE]][] = array(
30
				'id' => 'pr['.$ligne[GEST_CHAMPS_ID_PROJET].']', 
27
				'id' => 'pr['.$ligne[GEST_CHAMPS_ID_PROJET].']',
31
				'valeur' => $ligne[GEST_CHAMPS_ID_PROJET], 
28
				'valeur' => $ligne[GEST_CHAMPS_ID_PROJET],
32
				'nom' => $ligne[GEST_CHAMPS_NOM_PROJET],
29
				'nom' => $ligne[GEST_CHAMPS_NOM_PROJET],
33
				'coche' => $coche);
30
				'coche' => $coche);
34
		}
31
		}
35
		$Resultat->ajouterDonnee('preferences', $aso_preferences);
32
		$Resultat->ajouterDonnee('preferences', $aso_preferences);
36
    }
33
    }
37
} 
34
}
38
?>
35
?>