Subversion Repositories Applications.gtt

Rev

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

Rev 8 Rev 9
1
<?php
1
<?php
2
 
2
 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// |@author ABDOOL RAHEEM shaheen   shaheenar50@hotmail.com                                                 |
22
// |@author ABDOOL RAHEEM shaheen   shaheenar50@hotmail.com                                                 |
23
// |@version 3                                                                                            |
23
// |@version 3                                                                                            |
24
/*@package gtt_general
24
/*@package gtt_general
25
//Auteur original :
25
//Auteur original :
26
*@author        Dorian Bannier <dbannier@aol.com>
26
*@author        Dorian Bannier <dbannier@aol.com>
27
//Autres auteurs :
27
//Autres auteurs :
28
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
28
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
29
*@copyright     Copyright (C) 2003 Tela-Botanica
29
*@copyright     Copyright (C) 2003 Tela-Botanica
30
@version        $Date: 2004/07/06
30
@version        $Date: 2004/07/06
31
*/
31
*/
32
// +------------------------------------------------------------------------------------------------------+
32
// +------------------------------------------------------------------------------------------------------+
33
// +------------------------------------------------------------------------------------------------------+
33
// +------------------------------------------------------------------------------------------------------+
34
// |                                            INCLUSION DE FICHIERS                                       |
34
// |                                            INCLUSION DE FICHIERS                                     |
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
// Fichier langues
36
// Fichier langues
37
include_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';
37
include_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';
38
// Classes metier
38
// Classes metier
39
include_once CHEMIN_CLASSES_METIER.'gtt_projet.class.php';
39
include_once CHEMIN_CLASSES_METIER.'gtt_projet.class.php';
40
include_once CHEMIN_CLASSES_METIER.'gtt_preference.class.php';
40
include_once CHEMIN_CLASSES_METIER.'gtt_preference.class.php';
41
include_once CHEMIN_CLASSES_METIER.'gtt_utilisateur.class.php';
41
include_once CHEMIN_CLASSES_METIER.'gtt_utilisateur.class.php';
42
 
42
 
43
/**
43
/**
44
*fonction affichant le menu editer preferences
44
*fonction affichant le menu editer preferences
45
*/
45
*/
46
function afficherMenuEditerPref($user) {
46
function afficherMenuEditerPref($user) {
47
	$id = 'MANIPULER_PREFERENCES';
47
	$id = 'MANIPULER_PREFERENCES';
48
	$size = 100;
48
	$size = 100;
49
	$assoc1 = array('class' => $id);
49
	$assoc1 = array('class' => $id);
50
	
50
	
51
	$form = new HTML_QuickForm('gestion_admin_pref', 'post', $GLOBALS['urlBase'].GESTION_EDITER_PREFERENCES, '', $assoc1);
51
	$form = new HTML_QuickForm('gestion_admin_pref', 'post', $GLOBALS['urlBase'].GESTION_EDITER_PREFERENCES, '', $assoc1);
52
	
52
	
53
	// Entete du formulaire
53
	// Entete du formulaire
54
	$form->addElement('header', 'entete', GESTION_EDITER_PREFERENCES_L);
54
	$form->addElement('header', 'entete', GESTION_EDITER_PREFERENCES_L);
55
	
55
	
56
	//Creation des Messages d'erreur
56
	//Creation des Messages d'erreur
57
	$form->setRequiredNote('='.GTT_CHAMPS_OBLIGATOIRE);
57
	$form->setRequiredNote('='.GTT_CHAMPS_OBLIGATOIRE);
58
	$form->setJsWarnings(GTT_DONNEES_INCORRECTES, GTT_DONNEES_A_CORRIGER);
58
	$form->setJsWarnings(GTT_DONNEES_INCORRECTES, GTT_DONNEES_A_CORRIGER);
59
	$TabProjet =& Projet::recupererTableauProjet();
59
	$TabProjet =& Projet::recupererTableauProjet();
60
	$pref = new Preference($user, 5000);
60
	$pref = new Preference($user, 5000);
61
	$tabPref = $pref->recupererTableauPreferences();
61
	$tabPref = $pref->recupererTableauPreferences();
62
	
62
	
63
	// Conseils
63
	// Conseils
64
	$z =& $form->addElement('html','<tr><td>'.GESTION_CONSEILS_PREFERENCES.'</tr></td>');
64
	$z =& $form->addElement('html','<tr><td>'.GESTION_CONSEILS_PREFERENCES.'</tr></td>');
65
	
65
	
66
	// Nombre de projets
66
	// Nombre de projets
67
	$z =& $form->addElement('hidden', 'champ_nb_total_proj', count($TabProjet));
67
	$z =& $form->addElement('hidden', 'champ_nb_total_proj', count($TabProjet));
68
	$cat = '';
68
	$cat = '';
69
 
69
 
70
	// Parcourt du tableau de projets
70
	// Parcourt du tableau de projets
71
	for($y = 0; $y < count($TabProjet); $y++) {
71
	for($y = 0; $y < count($TabProjet); $y++) {
72
		$tab = $TabProjet[$y];
72
		$tab = $TabProjet[$y];
73
		// Ligne categorie
73
		// Ligne categorie
74
		if ($cat != $tab[GEST_CHAMPS_LIBELLE_CATEGORIE]) {
74
		if ($cat != $tab[GEST_CHAMPS_LIBELLE_CATEGORIE]) {
75
			$size1 = 25;
75
			$size1 = 25;
76
			$id1 = 'nom_categorie';
76
			$id1 = 'nom_categorie';
77
			$assoc1 = array('class' =>$id1, 'size'=>$size1); 
77
			$assoc1 = array('class' =>$id1, 'size'=>$size1); 
78
			$ligneNomCateg =& HTML_QuickForm::createElement('html', '<tr><td>'.$tab[GEST_CHAMPS_LIBELLE_CATEGORIE].' : '.'</td></tr>');
78
			$ligneNomCateg =& HTML_QuickForm::createElement('html', '<tr><td>'.$tab[GEST_CHAMPS_LIBELLE_CATEGORIE].' : '.'</td></tr>');
79
			$form->addElement($ligneNomCateg);
79
			$form->addElement($ligneNomCateg);
80
			$cat = $tab[GEST_CHAMPS_LIBELLE_CATEGORIE];
80
			$cat = $tab[GEST_CHAMPS_LIBELLE_CATEGORIE];
81
		}
81
		}
82
		
82
		
83
		// Champ cache
83
		// Champ cache
84
		$z =& $form->addElement('hidden','champ_id_pr'.$y,$tab[GEST_CHAMPS_ID_PROJET]);
84
		$z =& $form->addElement('hidden','champ_id_pr'.$y,$tab[GEST_CHAMPS_ID_PROJET]);
85
		$ligne[0] =& HTML_QuickForm::createElement('checkbox','champ_check'.$y);
85
		$ligne[0] =& HTML_QuickForm::createElement('checkbox','champ_check'.$y);
86
	    $estDansPref = $pref->isInPreferences($tab[GEST_CHAMPS_ID_PROJET]);
86
	    $estDansPref = $pref->isInPreferences($tab[GEST_CHAMPS_ID_PROJET]);
87
	   
87
	   
88
	    $ligne[0]->setChecked($estDansPref);
88
	    $ligne[0]->setChecked($estDansPref);
89
	    $form->addGroup($ligne,'groupe', $tab[GEST_CHAMPS_NOM_PROJET].'&nbsp&nbsp&nbsp','&nbsp&nbsp&nbsp', false);
89
	    $form->addGroup($ligne,'groupe', $tab[GEST_CHAMPS_NOM_PROJET].'&nbsp&nbsp&nbsp','&nbsp&nbsp&nbsp', false);
90
	}
90
	}
91
	
91
	
92
	// Champ_valider
92
	// Champ_valider
93
	$size4 = 5;
93
	$size4 = 5;
94
	$id4 = 'btn_editer_pref';
94
	$id4 = 'btn_editer_pref';
95
	$assoc4 = array('class' => $id4, 'size'=> $size4); 
95
	$assoc4 = array('class' => $id4, 'size'=> $size4); 
96
	$btnValiderEditer =& HTML_QuickForm::createElement('submit', 'btn_valider_editer', GTT_L_G_VALIDER, $assoc4);
96
	$btnValiderEditer =& HTML_QuickForm::createElement('submit', 'btn_valider_editer', GTT_L_G_VALIDER, $assoc4);
97
	$form->addElement($btnValiderEditer);
97
	$form->addElement($btnValiderEditer);
98
	
98
	
99
	return $form;     
99
	return $form;     
100
}
100
}
101
?>
101
?>