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 CHEMIN_FN_GENERIQUE_AFFICHAGE;
|
|
|
38 |
include_once CHEMIN_MENU.'gtt_menu_editer_preferences.php';
|
|
|
39 |
include_once CHEMIN_CLASSES_METIER.'gtt_preference.class.php';
|
|
|
40 |
/**
|
|
|
41 |
*fonction traitant les fonctions du menu editer prefernces
|
|
|
42 |
*/
|
|
|
43 |
function traiterEditerPreferences($user)
|
|
|
44 |
{
|
|
|
45 |
$text=creerEntetePage(GESTION_EDITER_PREFERENCES_L);
|
|
|
46 |
$form= afficherMenuEditerPref($user);
|
|
|
47 |
if (isset($_POST["btn_valider_editer"])and $_POST["btn_valider_editer"]!='dejaValider'and $form->validate())
|
|
|
48 |
{
|
|
|
49 |
$form->process(editerPref($user));
|
|
|
50 |
$t=afficherMenuEditerPref($user);
|
|
|
51 |
$text.=$t->ToHTml();
|
|
|
52 |
}else{
|
|
|
53 |
$text.=$form->ToHtml();
|
|
|
54 |
}
|
|
|
55 |
//affichage des options disponibles pour l'utilisateur courant
|
|
|
56 |
$text.=afficherOptionAplication($user);
|
|
|
57 |
return $text;
|
|
|
58 |
}
|
|
|
59 |
|
|
|
60 |
/**
|
|
|
61 |
*fonction realisant l'ajout et la supression de preferences
|
|
|
62 |
*/
|
|
|
63 |
function editerPref($user)
|
|
|
64 |
{
|
|
|
65 |
$r=&Preference::supprimerPreferences($user);
|
|
|
66 |
$nb=$_POST["champ_nb_total_proj"]; //NB TOTAL DE PROJET
|
|
|
67 |
for($u=0;$u<$nb;$u++)
|
|
|
68 |
{
|
|
|
69 |
if(isset($_POST["champ_check".$u]))
|
|
|
70 |
{
|
|
|
71 |
$preference1=new Preference($user,$_POST["champ_id_pr".$u]);
|
|
|
72 |
$ret= $preference1->enregistrerPreference();
|
|
|
73 |
if($ret!=1)echo "erreur preferences";
|
|
|
74 |
}
|
|
|
75 |
}
|
|
|
76 |
}
|
|
|
77 |
?>
|