Subversion Repositories Applications.gtt

Rev

Rev 8 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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