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