Subversion Repositories Applications.gtt

Rev

Rev 8 | Go to most recent revision | Blame | Last modification | View Log | RSS feed

<?php
 
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1                                                                                      |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or                                        |
// | modify it under the terms of the GNU Lesser General Public                                           |
// | License as published by the Free Software Foundation; either                                         |
// | version 2.1 of the License, or (at your option) any later version.                                   |
// |                                                                                                      |
// | This library is distributed in the hope that it will be useful,                                      |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
// | Lesser General Public License for more details.                                                      |
// |                                                                                                      |
// | You should have received a copy of the GNU Lesser General Public                                     |
// | License along with this library; if not, write to the Free Software                                  |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
// +------------------------------------------------------------------------------------------------------+
// |@author ABDOOL RAHEEM shaheen   shaheenar50@hotmail.com                                                 |
// |@version 3                                                                                            |
/*@package gtt_general
//Auteur original :
*@author        Dorian Bannier <dbannier@aol.com>
//Autres auteurs :
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@copyright     Copyright (C) 2003 Tela-Botanica
@version        $Date: 2004/07/06
*/
// +------------------------------------------------------------------------------------------------------+
// +------------------------------------------------------------------------------------------------------+
// |                                            INCLUSION DE FICHIERS                                       |
// +------------------------------------------------------------------------------------------------------+
//inclusion des paquets de la librairie pear
include_once CHEMIN_MENU.'gtt_menu_editer_preferences.php';
include_once CHEMIN_CLASSES_METIER.'gtt_preference.class.php';
/**
*fonction traitant les fonctions du menu editer prefernces 
*/
function traiterEditerPreferences($user)
{
        $text = creerEntetePage(GESTION_EDITER_PREFERENCES_L);
        $form = afficherMenuEditerPref($user);
        if (isset($_POST["btn_valider_editer"]) and $_POST["btn_valider_editer"] != 'dejaValider' and $form->validate()) {
                $form->process(editerPref($user));
                $t = afficherMenuEditerPref($user);
                $text .= $t->ToHTml();
        } else {
                $text .= $form->ToHtml();
        }
        // Affichage des options disponibles pour l'utilisateur courant
        $text .= afficherOptionAplication($user); 
        return $text;
}

/**
*fonction realisant l'ajout et la supression de preferences 
*/
function editerPref($user)
{
        $r =& Preference::supprimer($user);
        $nb = $_POST['champ_nb_total_proj']; //NB TOTAL DE PROJET
        for($i = 0; $i < $nb; $i++) {
                if (isset($_POST['champ_check'.$i])) {
                        $Preference = new Preference($user, $_POST['champ_id_pr'.$i]); 
                        if (!$Preference->ajouter()) {
                                echo "Erreur preferences";
                        }
                }
        }
}
?>