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