Subversion Repositories Applications.gtt

Rev

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 'HTML/QuickForm.php';
//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; 
    
}
?>