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 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
34 |
// | INCLUSION DE FICHIERS |
|
|
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
36 |
//inclusion des paquets de la librairie pear
|
|
|
37 |
include_once 'HTML/QuickForm.php';
|
|
|
38 |
//fichier langues
|
|
|
39 |
include_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';
|
|
|
40 |
//classes metier
|
|
|
41 |
include_once CHEMIN_CLASSES_METIER.'gtt_projet.class.php';
|
|
|
42 |
include_once CHEMIN_CLASSES_METIER.'gtt_preference.class.php';
|
|
|
43 |
include_once CHEMIN_CLASSES_METIER.'gtt_utilisateur.class.php';
|
|
|
44 |
|
|
|
45 |
|
|
|
46 |
/**
|
|
|
47 |
*fonction affichant le menu editer preferences
|
|
|
48 |
*/
|
|
|
49 |
|
|
|
50 |
function afficherMenuEditerPref($user)
|
|
|
51 |
{
|
|
|
52 |
$id="MANIPULER_PREFERENCES";
|
|
|
53 |
$size=100;
|
|
|
54 |
$assoc1 =array('class'=>$id);
|
|
|
55 |
|
|
|
56 |
$form=new HTML_QuickForm('gestion_admin_pref', 'post',$GLOBALS['urlBase'].GESTION_EDITER_PREFERENCES,'', $assoc1);
|
|
|
57 |
|
|
|
58 |
//entete du formulaire
|
|
|
59 |
|
|
|
60 |
$form->addElement('header', 'entete', GESTION_EDITER_PREFERENCES_L);
|
|
|
61 |
|
|
|
62 |
//creation des Messages d'erreur
|
|
|
63 |
|
|
|
64 |
$form->setRequiredNote('='.GTT_CHAMPS_OBLIGATOIRE);
|
|
|
65 |
$form->setJsWarnings(GTT_DONNEES_INCORRECTES, GTT_DONNEES_A_CORRIGER);
|
|
|
66 |
$TabProjet=&Projet::recupererTableauProjet();
|
|
|
67 |
$pref=new Preference($user,5000);
|
|
|
68 |
$tabPref=$pref->recupererTableauPreferences();
|
|
|
69 |
|
|
|
70 |
//conseils
|
|
|
71 |
$z=& $form->addElement('html','<tr><td>'.GESTION_CONSEILS_PREFERENCES.'</tr></td>');
|
|
|
72 |
|
|
|
73 |
//nombre de projets
|
|
|
74 |
$z=&$form->addElement('hidden','champ_nb_total_proj',count($TabProjet));
|
|
|
75 |
$cat='';
|
|
|
76 |
//parcourt du tableau de projets
|
|
|
77 |
for($y=0;$y<count($TabProjet);$y++)
|
|
|
78 |
{
|
|
|
79 |
$tab=$TabProjet[$y];
|
|
|
80 |
//ligne categorie
|
|
|
81 |
if ($cat!=$tab[GEST_CHAMPS_LIBELLE_CATEGORIE])
|
|
|
82 |
{
|
|
|
83 |
$size1=25;
|
|
|
84 |
$id1="nom_categorie";
|
|
|
85 |
$assoc1=array('class' =>$id1, 'size'=>$size1);
|
|
|
86 |
$ligneNomCateg=&HTML_QuickForm::createElement('html', '<tr><td>'.$tab[GEST_CHAMPS_LIBELLE_CATEGORIE].' : '.'</td></tr>');
|
|
|
87 |
$form->addElement($ligneNomCateg);
|
|
|
88 |
$cat =$tab[GEST_CHAMPS_LIBELLE_CATEGORIE];
|
|
|
89 |
}
|
|
|
90 |
|
|
|
91 |
//champ cache
|
|
|
92 |
$z=&$form->addElement('hidden','champ_id_pr'.$y,$tab[GEST_CHAMPS_ID_PROJET]);
|
|
|
93 |
$ligne[0]=&HTML_QuickForm::createElement('checkbox','champ_check'.$y);
|
|
|
94 |
$estDansPref=$pref->isInPreferences($tab[GEST_CHAMPS_ID_PROJET]);
|
|
|
95 |
|
|
|
96 |
$ligne[0]->setChecked($estDansPref);
|
|
|
97 |
$form->addGroup($ligne,'groupe',$tab[GEST_CHAMPS_NOM_PROJET].'   ','   ',false);
|
|
|
98 |
}
|
|
|
99 |
|
|
|
100 |
//champ_valider
|
|
|
101 |
|
|
|
102 |
$size4=5;
|
|
|
103 |
$id4='btn_editer_pref';
|
|
|
104 |
$assoc4=array('class' =>$id4, 'size'=>$size4);
|
|
|
105 |
$btnValiderEditer= &HTML_QuickForm::createElement('submit', 'btn_valider_editer',GTT_L_G_VALIDER,$assoc4);
|
|
|
106 |
$form->addElement($btnValiderEditer);
|
|
|
107 |
|
|
|
108 |
return $form;
|
|
|
109 |
|
|
|
110 |
}
|
|
|
111 |
?>
|