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                                     |
// +------------------------------------------------------------------------------------------------------+
// Fichier langues
include_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';
// Classes metier
include_once CHEMIN_CLASSES_METIER.'gtt_projet.class.php';
include_once CHEMIN_CLASSES_METIER.'gtt_preference.class.php';
include_once CHEMIN_CLASSES_METIER.'gtt_utilisateur.class.php';

/**
*fonction affichant le menu editer preferences
*/
function afficherMenuEditerPref($user) {
        $id = 'MANIPULER_PREFERENCES';
        $size = 100;
        $assoc1 = array('class' => $id);
        
        $form = new HTML_QuickForm('gestion_admin_pref', 'post', $GLOBALS['urlBase'].GESTION_EDITER_PREFERENCES, '', $assoc1);
        
        // Entete du formulaire
        $form->addElement('header', 'entete', GESTION_EDITER_PREFERENCES_L);
        
        //Creation des Messages d'erreur
        $form->setRequiredNote('='.GTT_CHAMPS_OBLIGATOIRE);
        $form->setJsWarnings(GTT_DONNEES_INCORRECTES, GTT_DONNEES_A_CORRIGER);
        $TabProjet =& Projet::recupererTableauProjet();
        $pref = new Preference($user, 5000);
        $tabPref = $pref->recupererTableauPreferences();
        
        // Conseils
        $z =& $form->addElement('html','<tr><td>'.GESTION_CONSEILS_PREFERENCES.'</tr></td>');
        
        // Nombre de projets
        $z =& $form->addElement('hidden', 'champ_nb_total_proj', count($TabProjet));
        $cat = '';

        // Parcourt du tableau de projets
        for($y = 0; $y < count($TabProjet); $y++) {
                $tab = $TabProjet[$y];
                // Ligne categorie
                if ($cat != $tab[GEST_CHAMPS_LIBELLE_CATEGORIE]) {
                        $size1 = 25;
                        $id1 = 'nom_categorie';
                        $assoc1 = array('class' =>$id1, 'size'=>$size1); 
                        $ligneNomCateg =& HTML_QuickForm::createElement('html', '<tr><td>'.$tab[GEST_CHAMPS_LIBELLE_CATEGORIE].' : '.'</td></tr>');
                        $form->addElement($ligneNomCateg);
                        $cat = $tab[GEST_CHAMPS_LIBELLE_CATEGORIE];
                }
                
                // Champ cache
                $z =& $form->addElement('hidden','champ_id_pr'.$y,$tab[GEST_CHAMPS_ID_PROJET]);
                $ligne[0] =& HTML_QuickForm::createElement('checkbox','champ_check'.$y);
            $estDansPref = $pref->isInPreferences($tab[GEST_CHAMPS_ID_PROJET]);
           
            $ligne[0]->setChecked($estDansPref);
            $form->addGroup($ligne,'groupe', $tab[GEST_CHAMPS_NOM_PROJET].'&nbsp&nbsp&nbsp','&nbsp&nbsp&nbsp', false);
        }
        
        // Champ_valider
        $size4 = 5;
        $id4 = 'btn_editer_pref';
        $assoc4 = array('class' => $id4, 'size'=> $size4); 
        $btnValiderEditer =& HTML_QuickForm::createElement('submit', 'btn_valider_editer', GTT_L_G_VALIDER, $assoc4);
        $form->addElement($btnValiderEditer);
        
        return $form;     
}
?>