1 |
<?php
|
1 |
<?php
|
2 |
|
2 |
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
4 |
// | PHP version 4.1 |
|
4 |
// | PHP version 4.1 |
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
8 |
// | This library is free software; you can redistribute it and/or |
|
8 |
// | This library is free software; you can redistribute it and/or |
|
9 |
// | modify it under the terms of the GNU Lesser General Public |
|
9 |
// | modify it under the terms of the GNU Lesser General Public |
|
10 |
// | License as published by the Free Software Foundation; either |
|
10 |
// | License as published by the Free Software Foundation; either |
|
11 |
// | version 2.1 of the License, or (at your option) any later version. |
|
11 |
// | version 2.1 of the License, or (at your option) any later version. |
|
12 |
// | |
|
12 |
// | |
|
13 |
// | This library is distributed in the hope that it will be useful, |
|
13 |
// | This library is distributed in the hope that it will be useful, |
|
14 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
15 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
16 |
// | Lesser General Public License for more details. |
|
16 |
// | Lesser General Public License for more details. |
|
17 |
// | |
|
17 |
// | |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
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 |
|
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 |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
22 |
// |@author ABDOOL RAHEEM shaheen shaheenar50@hotmail.com |
|
22 |
// |@author ABDOOL RAHEEM shaheen shaheenar50@hotmail.com |
|
23 |
// |@version 3 |
|
23 |
// |@version 3 |
|
24 |
/*@package gtt_general
|
24 |
/*@package gtt_general
|
25 |
//Auteur original :
|
25 |
//Auteur original :
|
26 |
*@author Dorian Bannier <dbannier@aol.com>
|
26 |
*@author Dorian Bannier <dbannier@aol.com>
|
27 |
//Autres auteurs :
|
27 |
//Autres auteurs :
|
28 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
28 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
29 |
*@copyright Copyright (C) 2003 Tela-Botanica
|
29 |
*@copyright Copyright (C) 2003 Tela-Botanica
|
30 |
@version $Date: 2004/07/06
|
30 |
@version $Date: 2004/07/06
|
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 CHEMIN_FN_GENERIQUE_AFFICHAGE;
|
37 |
include_once CHEMIN_FN_GENERIQUE_AFFICHAGE;
|
38 |
include_once CHEMIN_MENU.'gtt_menu_editer_preferences.php';
|
38 |
include_once CHEMIN_MENU.'gtt_menu_editer_preferences.php';
|
39 |
include_once CHEMIN_CLASSES_METIER.'gtt_preference.class.php';
|
39 |
include_once CHEMIN_CLASSES_METIER.'gtt_preference.class.php';
|
40 |
/**
|
40 |
/**
|
41 |
*fonction traitant les fonctions du menu editer prefernces
|
41 |
*fonction traitant les fonctions du menu editer prefernces
|
42 |
*/
|
42 |
*/
|
43 |
function traiterEditerPreferences($user)
|
43 |
function traiterEditerPreferences($user)
|
44 |
{
|
44 |
{
|
45 |
$text=creerEntetePage(GESTION_EDITER_PREFERENCES_L);
|
45 |
$text = creerEntetePage(GESTION_EDITER_PREFERENCES_L);
|
46 |
$form= afficherMenuEditerPref($user);
|
46 |
$form = afficherMenuEditerPref($user);
|
47 |
if (isset($_POST["btn_valider_editer"])and $_POST["btn_valider_editer"]!='dejaValider'and $form->validate())
|
47 |
if (isset($_POST["btn_valider_editer"]) and $_POST["btn_valider_editer"] != 'dejaValider' and $form->validate()) {
|
48 |
{
|
- |
|
49 |
$form->process(editerPref($user));
|
48 |
$form->process(editerPref($user));
|
50 |
$t=afficherMenuEditerPref($user);
|
49 |
$t = afficherMenuEditerPref($user);
|
51 |
$text.=$t->ToHTml();
|
50 |
$text .= $t->ToHTml();
|
52 |
}else{
|
51 |
} else {
|
53 |
$text.=$form->ToHtml();
|
52 |
$text .= $form->ToHtml();
|
54 |
}
|
53 |
}
|
55 |
//affichage des options disponibles pour l'utilisateur courant
|
54 |
// Affichage des options disponibles pour l'utilisateur courant
|
56 |
$text.=afficherOptionAplication($user);
|
55 |
$text .= afficherOptionAplication($user);
|
57 |
return $text;
|
56 |
return $text;
|
58 |
}
|
57 |
}
|
59 |
|
58 |
|
60 |
/**
|
59 |
/**
|
61 |
*fonction realisant l'ajout et la supression de preferences
|
60 |
*fonction realisant l'ajout et la supression de preferences
|
62 |
*/
|
61 |
*/
|
63 |
function editerPref($user)
|
62 |
function editerPref($user)
|
64 |
{
|
63 |
{
|
65 |
$r=&Preference::supprimerPreferences($user);
|
64 |
$r =& Preference::supprimerPreferences($user);
|
66 |
$nb=$_POST["champ_nb_total_proj"]; //NB TOTAL DE PROJET
|
65 |
$nb = $_POST['champ_nb_total_proj']; //NB TOTAL DE PROJET
|
67 |
for($u=0;$u<$nb;$u++)
|
66 |
for($i = 0; $i < $nb; $i++) {
|
68 |
{
|
- |
|
69 |
if(isset($_POST["champ_check".$u]))
|
67 |
if (isset($_POST['champ_check'.$i])) {
|
70 |
{
|
- |
|
71 |
$preference1=new Preference($user,$_POST["champ_id_pr".$u]);
|
68 |
$Preference = new Preference($user, $_POST['champ_id_pr'.$i]);
|
72 |
$ret= $preference1->enregistrerPreference();
|
69 |
if (!$Preference->ajouter()) {
|
73 |
if($ret!=1)echo "erreur preferences";
|
70 |
echo "Erreur preferences";
|
74 |
}
|
71 |
}
|
75 |
}
|
72 |
}
|
- |
|
73 |
}
|
76 |
}
|
74 |
}
|
77 |
?>
|
75 |
?>
|