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