Subversion Repositories Applications.gtt

Rev

Rev 2 | 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                                       |
// +------------------------------------------------------------------------------------------------------+

//include_once 'gtt_config.inc.php';
require_once CHEMIN_CLASSES_METIER.'gtt_utilisateur.class.php';
require_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';



// +------------------------------------------------------------------------------------------------------+
// |                                            CORPS du PROGRAMME                                       |
// +------------------------------------------------------------------------------------------------------+

/**
*permet d'afficher une page 
*/
function afficherPage($page)
{
    print($page);
}


/**
*permet l'affichage du titre
*/

function creerZoneTitre($nom)
{
    $titreHTML.='   <!--Titre-->'."\n";
    $titreHTML.='    <div class="zone titre">'."\n";
    $titreHTML.='     '.$nom."\n";
    $titreHTML.='    </div'."\n";
    $titreHTML.='    <!-- Fin titre -->'."\n\n";
    
    return $titreHTML;
}
    
/*
*fonction creant l'entete de tout page web
*/
function creerEntetePage($nom)
{
    $entete ='<?xml version="1.0" encoding="ISO-8859-15" ?>'."\n";
    $entete .='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />'."\n";
    $entete .='<html xmlns="http://www.w3.org/1999/xhtml/" >'."\n";
    $entete .='   <head>'."\n";
    $entete .='     <meta http-equiv="Content-Style-Type" content="text/css" />'."\n";
    $entete .='         <link rel="stylesheet" type="text/css" href="'.CHEMIN_CSS.'gtt_vert.css" media="screen" title="Vert" />'."\n";
    $entete .='           <title>'.$nom.'</title>'."\n";
    $entete .='   </head>'."\n";
    $entete .='   <body>'."\n\n";
    
    return $entete;
}

/**
*fonction creant la partie au pied de la page
*/
function creerZonePiedPage()
{
    $piedPage.='    <!--Debut pied de page -->'."\n";
    $piedPage.='    <div class="zone_pieds_page">'." \n";
    $piedPage.= '     Copyright Tela Botanica 2004 - <a href="mailto:accueil@tela-botanica.org" > Webmaster </a> '."\n";
    $piedPage.= '    </div>'."\n";
    $piedPage.= '  <!-- Fin pied de page -->'."\n\n";
    
    return $piedPage;
}
    
    
/**
*fonction permettant de fermer les balises html
*/
function fermerBalisesFin()
{
    $ret ='   </body>'."\n";
    $ret.='</html>'."\n";
    
    return $ret;
}

/**
*fonction permettant d'afficher la zone de menu de gauche
*fournit un lien vers le menu a afficher selon le choix de l'utilisateur
*/

function creerZoneMenuOption($utilisateur)
{
  
    
        $zoneOption.= '<!-- Début zone menu -->'."\n";
        $zoneOption.='  <div class="zone_menu">'."\n";
        $zoneOption .= '      <ul>'."\n";
        $zoneOption .= '        <li>'."\n";
        $zoneOption .= '          <a href="index.php?action='.GESTION_TRAVAIL.'&semaine='.$semaine.'&annee='.$annee.'&user='.$utilisateur.'" >'."\n";
        $zoneOption .= '          '.GTT_L_ME_TRAVAIL.' </a>'."\n";
        $zoneOption .= '        </li>'."\n";
        $zoneOption .= '        <li>'."\n";
        $zoneOption .= '          <a href="index.php?menu='.GTT_MENU_ABSCENCES.'&action='.GTT_ACTION_NON_TRAVAIL.'&mois='.$mois.'&annee='.$annee.'" >'."\n";
        $zoneOption .= '          '.GTT_L_ME_NON_TRAVAIL.' </a>'."\n";
        $zoneOption .= '        </li>'."\n";
        $zoneOption .= '        <li>'."\n";
        $zoneOption .= '          <a href="index.php?menu='.GTT_MENU_GRAPHIQUES.'&action='.GTT_ACTION_GRAPHIQUE.'&date='.$date.'&user='.$utilisateur.'" >'."\n";
        $zoneOption .= '          '.GTT_L_ME_GRAPH.' </a>'."\n";
        $zoneOption .= '        </li>'."\n";
        $zoneOption .= '        <li>'."\n";
        $zoneOption .= '          <a href="index.php?menu='.GTT_MENU_INFO_ORGANISME.'&action='.GTT_ACTION_RECAPITULATIF_GENERAL.'&annee='.$annee.'&user='.$utilisateur.'" >'."\n";
        $zoneOption .= '          '.GTT_L_ME_RECAPITULATIF_GENERAL.' </a>'."\n";
        $zoneOption .= '        </li>'."\n";
        $zoneOption .= '        <li>'."\n";
        $zoneOption .= '          <a href="index.php?menu='.GTT_MENU_INFO_PERSO_PROJET.'&action='.GTT_ACTION_RECAPITULATIF.'&date='.$date.'&user='.$utilisateur.'" >'."\n";
        $zoneOption .= '          '.GTT_L_ME_RECAPITULATIF_UTILISATEUR.' </a>'."\n";
        $zoneOption .= '        </li>'."\n";
        $zoneOption .= '        <li>'."\n";
        $zoneOption .= '          <a href="index.php?menu='.GTT_MENU_INFO_PERSO_MENSUEL.'&action='.GTT_ACTION_FEUILLE_MOIS.'&date='.$date.'&user='.$utilisateur.'" >'."\n";
        $zoneOption .= '          '.GTT_L_ME_FEUILLE_MOIS.' </a>'."\n";
        $zoneOption .= '        </li>'."\n";
        $zoneOption .= '        <li>'."\n";
        $zoneOption .= '          <a href="index.php?menu='.GTT_MENU_UTILISATEURS.'&action='.GTT_ACTION_DONNEE_UTILISATEUR.'" >'."\n";
        $zoneOption .= '          '.GTT_L_ME_UTILISATEURS.' </a>'."\n";
        
        if ($utilisateur->isAdmin()==1)
        {
          $zoneOption .= '        <li>'."\n";
            //$zoneOption .= '          <a href="index.php?menu='.GTT_MENU_ADMINISTRATION.'&action='.GTT_ACTION_ADMIN_UTILISATEUR.'" >'."\n";
            $zoneOption .= '          '.GTT_L_ME_ADMINISTRATION.' </a>'."\n";
            $zoneOption .= '        </li>'."\n";

        }
        $zoneOption .= '        <li>'."\n";
        //$zoneOption .= '          <a href="index.php?menu='.GTT_MENU_DECONNECTION.'&date='.$date.'&user='.$utilisateur.'" >'."\n";
        $zoneOption .= '          '.GTT_L_ME_DECONNECTION.' </a>'."\n";
        $zoneOption .= '        </li>'."\n";
        $zoneOption .= '      </ul>'."\n";
        $zoneOption .= '    </div>'."\n";
        $zoneOption .= '    <!-- Fin zone menu -->'."\n\n";
        
        
        return $zoneOption;
    }
    
    /**
        * fonction affichant les options 
        *@param identifiant d'un utilisateur
        *renvoie un formulaire sous forme html
        */
    function afficherOptionAplication($user)
    {
                $id = 'MENU_OPTION';
                $size = 15;
                $assoc1 = array('class'=>$id);
                $form = new HTML_QuickForm('gestion_option', 'post','','', $assoc1);
                //ajout d'element
                //projets de l'utilisateur 
                $ligneEditerPref = &HTML_QuickForm::createElement('link', 'btn_editer_pref','',$GLOBALS['urlBase'].GESTION_EDITER_PREFERENCES,GESTION_MES_PROJETS_L,$assoc1);
            $form->addElement($ligneEditerPref);
            //travail
                $ligneTravail=&HTML_QuickForm::createElement('link', 'btn_editer_travail','',$GLOBALS['urlBase'].GESTION_TRAVAIL,GTT_L_ME_TRAVAIL,$assoc1);
                $form->addElement($ligneTravail);
                //administration
                $user1=&Utilisateur::recupererUtilisateur($user);
                if ($user1->isAdmin() == 1) {
                        $ligneAdmin=&HTML_QuickForm::createElement('link', 'btn_admin','',$GLOBALS['urlBase'].GESTION_ADMIN_UTILISATEUR,GTT_L_ME_ADMINISTRATION,$assoc1);
                        $form->addElement($ligneAdmin);
                }
        
                $ligneDeconnexion =& HTML_QuickForm::createElement('link', 'btn_deconnexion','',$GLOBALS['urlBase'].GESTION_DECONNEXION,GTT_L_ME_DECONNECTION,$assoc1);
                $form->addElement($ligneDeconnexion);
        
                return $form->toHtml();
    }
        
        /**
        *fonctions creant la liste des options disponibles
        *nouveau formulaire avec la liste des optiosn disponibles
        */
        function creerFormulaireOptionAdmin()
        {
        $id = 'LISTE_OPTION_ADMIN';
        $size=7;
        $assoc =array ('class'=>$id, 'size'=>$size);
   
   $form=new HTML_QuickForm('liste_options_admin', 'post','','',$assoc);
   
   //liste des elements : categorie
    $bouton=&HTML_QuickForm::createElement('link', 'champ_categorie','',$GLOBALS['urlBase'].GESTION_ADMIN_CATEGORIE,GESTION_CATEGORIE_L,$assoc);
        $form->addElement($bouton);

   

   //frais
    $bouton1=&HTML_QuickForm::createElement('link', 'champ_frais','',$GLOBALS['urlBase'].GESTION_ADMIN_FRAIS,GESTION_FRAIS_L,$assoc);
        $form->addElement($bouton1);

   //motifs absence
    $bouton2=&HTML_QuickForm::createElement('link', 'champ_motif_absence','',$GLOBALS['urlBase'].GESTION_ADMIN_MOTIF_ABSENCE,GESTION_MOTIF_L,$assoc);
        $form->addElement($bouton2);


   //projets
   $bouton3=&HTML_QuickForm::createElement('link', 'champ_projet','',$GLOBALS['urlBase'].GESTION_ADMIN_PROJET,GESTION_PROJET_L,$assoc);
        $form->addElement($bouton3);

   
    //statut
    $bouton4=&HTML_QuickForm::createElement('link', 'champ_statut','',$GLOBALS['urlBase'].GESTION_ADMIN_STATUT,GESTION_STATUT_L,$assoc);
        $form->addElement($bouton4);


   //taches
   $bouton5=&HTML_QuickForm::createElement('link', 'champs_tache','',$GLOBALS['urlBase'].GESTION_ADMIN_TACHE,GESTION_TACHES_L,$assoc);
        $form->addElement($bouton5);


   //utilisateur
   $bouton6=&HTML_QuickForm::createElement('link', 'champ_utilisateur','',$GLOBALS['urlBase'].GESTION_ADMIN_UTILISATEUR,GESTION_UTILISATEUR_L,$assoc);
        $form->addElement($bouton6);
    return $form;
}

?>