2 |
jpm |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
4 |
// | PHP version 4.1 |
|
|
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
|
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
8 |
// | This library is free software; you can redistribute it and/or |
|
|
|
9 |
// | modify it under the terms of the GNU Lesser General Public |
|
|
|
10 |
// | License as published by the Free Software Foundation; either |
|
|
|
11 |
// | version 2.1 of the License, or (at your option) any later version. |
|
|
|
12 |
// | |
|
|
|
13 |
// | This library is distributed in the hope that it will be useful, |
|
|
|
14 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
15 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
|
|
16 |
// | Lesser General Public License for more details. |
|
|
|
17 |
// | |
|
|
|
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 |
|
|
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
|
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
22 |
// |@author ABDOOL RAHEEM shaheen shaheenar50@hotmail.com |
|
|
|
23 |
// |@version 3 |
|
|
|
24 |
/*@package gtt_general
|
|
|
25 |
//Auteur original :
|
|
|
26 |
*@author Dorian Bannier <dbannier@aol.com>
|
|
|
27 |
//Autres auteurs :
|
|
|
28 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
|
|
29 |
*@copyright Copyright (C) 2003 Tela-Botanica
|
|
|
30 |
@version $Date: 2004/07/06
|
|
|
31 |
*/
|
|
|
32 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
33 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
34 |
// | INCLUSION DE FICHIERS |
|
|
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
36 |
|
|
|
37 |
//include_once 'gtt_config.inc.php';
|
5 |
jpm |
38 |
require_once CHEMIN_CLASSES_METIER.'gtt_utilisateur.class.php';
|
|
|
39 |
require_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';
|
2 |
jpm |
40 |
|
|
|
41 |
|
|
|
42 |
|
|
|
43 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
44 |
// | CORPS du PROGRAMME |
|
|
|
45 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
46 |
|
|
|
47 |
/**
|
|
|
48 |
*permet d'afficher une page
|
|
|
49 |
*/
|
|
|
50 |
function afficherPage($page)
|
|
|
51 |
{
|
|
|
52 |
print($page);
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
|
|
|
56 |
/**
|
|
|
57 |
*permet l'affichage du titre
|
|
|
58 |
*/
|
|
|
59 |
|
|
|
60 |
function creerZoneTitre($nom)
|
|
|
61 |
{
|
|
|
62 |
$titreHTML.=' <!--Titre-->'."\n";
|
|
|
63 |
$titreHTML.=' <div class="zone titre">'."\n";
|
|
|
64 |
$titreHTML.=' '.$nom."\n";
|
|
|
65 |
$titreHTML.=' </div'."\n";
|
|
|
66 |
$titreHTML.=' <!-- Fin titre -->'."\n\n";
|
|
|
67 |
|
|
|
68 |
return $titreHTML;
|
|
|
69 |
}
|
|
|
70 |
|
|
|
71 |
/*
|
|
|
72 |
*fonction creant l'entete de tout page web
|
|
|
73 |
*/
|
|
|
74 |
function creerEntetePage($nom)
|
|
|
75 |
{
|
5 |
jpm |
76 |
$entete ='<?xml version="1.0" encoding="ISO-8859-15" ?>'."\n";
|
2 |
jpm |
77 |
$entete .='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />'."\n";
|
|
|
78 |
$entete .='<html xmlns="http://www.w3.org/1999/xhtml/" >'."\n";
|
|
|
79 |
$entete .=' <head>'."\n";
|
|
|
80 |
$entete .=' <meta http-equiv="Content-Style-Type" content="text/css" />'."\n";
|
|
|
81 |
$entete .=' <link rel="stylesheet" type="text/css" href="'.CHEMIN_CSS.'gtt_vert.css" media="screen" title="Vert" />'."\n";
|
|
|
82 |
$entete .=' <title>'.$nom.'</title>'."\n";
|
|
|
83 |
$entete .=' </head>'."\n";
|
|
|
84 |
$entete .=' <body>'."\n\n";
|
|
|
85 |
|
|
|
86 |
return $entete;
|
|
|
87 |
}
|
|
|
88 |
|
|
|
89 |
/**
|
|
|
90 |
*fonction creant la partie au pied de la page
|
|
|
91 |
*/
|
|
|
92 |
function creerZonePiedPage()
|
|
|
93 |
{
|
|
|
94 |
$piedPage.=' <!--Debut pied de page -->'."\n";
|
|
|
95 |
$piedPage.=' <div class="zone_pieds_page">'." \n";
|
|
|
96 |
$piedPage.= ' Copyright Tela Botanica 2004 - <a href="mailto:accueil@tela-botanica.org" > Webmaster </a> '."\n";
|
|
|
97 |
$piedPage.= ' </div>'."\n";
|
|
|
98 |
$piedPage.= ' <!-- Fin pied de page -->'."\n\n";
|
|
|
99 |
|
|
|
100 |
return $piedPage;
|
|
|
101 |
}
|
|
|
102 |
|
|
|
103 |
|
|
|
104 |
/**
|
|
|
105 |
*fonction permettant de fermer les balises html
|
|
|
106 |
*/
|
|
|
107 |
function fermerBalisesFin()
|
|
|
108 |
{
|
|
|
109 |
$ret =' </body>'."\n";
|
|
|
110 |
$ret.='</html>'."\n";
|
|
|
111 |
|
|
|
112 |
return $ret;
|
|
|
113 |
}
|
|
|
114 |
|
|
|
115 |
/**
|
|
|
116 |
*fonction permettant d'afficher la zone de menu de gauche
|
|
|
117 |
*fournit un lien vers le menu a afficher selon le choix de l'utilisateur
|
|
|
118 |
*/
|
|
|
119 |
|
|
|
120 |
function creerZoneMenuOption($utilisateur)
|
|
|
121 |
{
|
|
|
122 |
|
|
|
123 |
|
|
|
124 |
$zoneOption.= '<!-- Début zone menu -->'."\n";
|
|
|
125 |
$zoneOption.=' <div class="zone_menu">'."\n";
|
|
|
126 |
$zoneOption .= ' <ul>'."\n";
|
|
|
127 |
$zoneOption .= ' <li>'."\n";
|
|
|
128 |
$zoneOption .= ' <a href="index.php?action='.GESTION_TRAVAIL.'&semaine='.$semaine.'&annee='.$annee.'&user='.$utilisateur.'" >'."\n";
|
|
|
129 |
$zoneOption .= ' '.GTT_L_ME_TRAVAIL.' </a>'."\n";
|
|
|
130 |
$zoneOption .= ' </li>'."\n";
|
|
|
131 |
$zoneOption .= ' <li>'."\n";
|
|
|
132 |
$zoneOption .= ' <a href="index.php?menu='.GTT_MENU_ABSCENCES.'&action='.GTT_ACTION_NON_TRAVAIL.'&mois='.$mois.'&annee='.$annee.'" >'."\n";
|
|
|
133 |
$zoneOption .= ' '.GTT_L_ME_NON_TRAVAIL.' </a>'."\n";
|
|
|
134 |
$zoneOption .= ' </li>'."\n";
|
|
|
135 |
$zoneOption .= ' <li>'."\n";
|
|
|
136 |
$zoneOption .= ' <a href="index.php?menu='.GTT_MENU_GRAPHIQUES.'&action='.GTT_ACTION_GRAPHIQUE.'&date='.$date.'&user='.$utilisateur.'" >'."\n";
|
|
|
137 |
$zoneOption .= ' '.GTT_L_ME_GRAPH.' </a>'."\n";
|
|
|
138 |
$zoneOption .= ' </li>'."\n";
|
|
|
139 |
$zoneOption .= ' <li>'."\n";
|
|
|
140 |
$zoneOption .= ' <a href="index.php?menu='.GTT_MENU_INFO_ORGANISME.'&action='.GTT_ACTION_RECAPITULATIF_GENERAL.'&annee='.$annee.'&user='.$utilisateur.'" >'."\n";
|
|
|
141 |
$zoneOption .= ' '.GTT_L_ME_RECAPITULATIF_GENERAL.' </a>'."\n";
|
|
|
142 |
$zoneOption .= ' </li>'."\n";
|
|
|
143 |
$zoneOption .= ' <li>'."\n";
|
|
|
144 |
$zoneOption .= ' <a href="index.php?menu='.GTT_MENU_INFO_PERSO_PROJET.'&action='.GTT_ACTION_RECAPITULATIF.'&date='.$date.'&user='.$utilisateur.'" >'."\n";
|
|
|
145 |
$zoneOption .= ' '.GTT_L_ME_RECAPITULATIF_UTILISATEUR.' </a>'."\n";
|
|
|
146 |
$zoneOption .= ' </li>'."\n";
|
|
|
147 |
$zoneOption .= ' <li>'."\n";
|
|
|
148 |
$zoneOption .= ' <a href="index.php?menu='.GTT_MENU_INFO_PERSO_MENSUEL.'&action='.GTT_ACTION_FEUILLE_MOIS.'&date='.$date.'&user='.$utilisateur.'" >'."\n";
|
|
|
149 |
$zoneOption .= ' '.GTT_L_ME_FEUILLE_MOIS.' </a>'."\n";
|
|
|
150 |
$zoneOption .= ' </li>'."\n";
|
|
|
151 |
$zoneOption .= ' <li>'."\n";
|
|
|
152 |
$zoneOption .= ' <a href="index.php?menu='.GTT_MENU_UTILISATEURS.'&action='.GTT_ACTION_DONNEE_UTILISATEUR.'" >'."\n";
|
|
|
153 |
$zoneOption .= ' '.GTT_L_ME_UTILISATEURS.' </a>'."\n";
|
|
|
154 |
|
|
|
155 |
if ($utilisateur->isAdmin()==1)
|
|
|
156 |
{
|
|
|
157 |
$zoneOption .= ' <li>'."\n";
|
|
|
158 |
//$zoneOption .= ' <a href="index.php?menu='.GTT_MENU_ADMINISTRATION.'&action='.GTT_ACTION_ADMIN_UTILISATEUR.'" >'."\n";
|
|
|
159 |
$zoneOption .= ' '.GTT_L_ME_ADMINISTRATION.' </a>'."\n";
|
|
|
160 |
$zoneOption .= ' </li>'."\n";
|
|
|
161 |
|
|
|
162 |
}
|
|
|
163 |
$zoneOption .= ' <li>'."\n";
|
|
|
164 |
//$zoneOption .= ' <a href="index.php?menu='.GTT_MENU_DECONNECTION.'&date='.$date.'&user='.$utilisateur.'" >'."\n";
|
|
|
165 |
$zoneOption .= ' '.GTT_L_ME_DECONNECTION.' </a>'."\n";
|
|
|
166 |
$zoneOption .= ' </li>'."\n";
|
|
|
167 |
$zoneOption .= ' </ul>'."\n";
|
|
|
168 |
$zoneOption .= ' </div>'."\n";
|
|
|
169 |
$zoneOption .= ' <!-- Fin zone menu -->'."\n\n";
|
|
|
170 |
|
|
|
171 |
|
|
|
172 |
return $zoneOption;
|
|
|
173 |
}
|
5 |
jpm |
174 |
|
2 |
jpm |
175 |
/**
|
5 |
jpm |
176 |
* fonction affichant les options
|
|
|
177 |
*@param identifiant d'un utilisateur
|
|
|
178 |
*renvoie un formulaire sous forme html
|
|
|
179 |
*/
|
2 |
jpm |
180 |
function afficherOptionAplication($user)
|
|
|
181 |
{
|
5 |
jpm |
182 |
$id = 'MENU_OPTION';
|
|
|
183 |
$size = 15;
|
|
|
184 |
$assoc1 = array('class'=>$id);
|
|
|
185 |
$form = new HTML_QuickForm('gestion_option', 'post','','', $assoc1);
|
|
|
186 |
//ajout d'element
|
|
|
187 |
//projets de l'utilisateur
|
|
|
188 |
$ligneEditerPref = &HTML_QuickForm::createElement('link', 'btn_editer_pref','',$GLOBALS['urlBase'].GESTION_EDITER_PREFERENCES,GESTION_MES_PROJETS_L,$assoc1);
|
|
|
189 |
$form->addElement($ligneEditerPref);
|
|
|
190 |
//travail
|
|
|
191 |
$ligneTravail=&HTML_QuickForm::createElement('link', 'btn_editer_travail','',$GLOBALS['urlBase'].GESTION_TRAVAIL,GTT_L_ME_TRAVAIL,$assoc1);
|
|
|
192 |
$form->addElement($ligneTravail);
|
|
|
193 |
//administration
|
|
|
194 |
$user1=&Utilisateur::recupererUtilisateur($user);
|
|
|
195 |
if ($user1->isAdmin() == 1) {
|
|
|
196 |
$ligneAdmin=&HTML_QuickForm::createElement('link', 'btn_admin','',$GLOBALS['urlBase'].GESTION_ADMIN_UTILISATEUR,GTT_L_ME_ADMINISTRATION,$assoc1);
|
|
|
197 |
$form->addElement($ligneAdmin);
|
|
|
198 |
}
|
2 |
jpm |
199 |
|
5 |
jpm |
200 |
$ligneDeconnexion =& HTML_QuickForm::createElement('link', 'btn_deconnexion','',$GLOBALS['urlBase'].GESTION_DECONNEXION,GTT_L_ME_DECONNECTION,$assoc1);
|
|
|
201 |
$form->addElement($ligneDeconnexion);
|
|
|
202 |
|
|
|
203 |
return $form->toHtml();
|
2 |
jpm |
204 |
}
|
5 |
jpm |
205 |
|
|
|
206 |
/**
|
|
|
207 |
*fonctions creant la liste des options disponibles
|
|
|
208 |
*nouveau formulaire avec la liste des optiosn disponibles
|
|
|
209 |
*/
|
|
|
210 |
function creerFormulaireOptionAdmin()
|
|
|
211 |
{
|
|
|
212 |
$id = 'LISTE_OPTION_ADMIN';
|
|
|
213 |
$size=7;
|
|
|
214 |
$assoc =array ('class'=>$id, 'size'=>$size);
|
2 |
jpm |
215 |
|
|
|
216 |
$form=new HTML_QuickForm('liste_options_admin', 'post','','',$assoc);
|
|
|
217 |
|
|
|
218 |
//liste des elements : categorie
|
|
|
219 |
$bouton=&HTML_QuickForm::createElement('link', 'champ_categorie','',$GLOBALS['urlBase'].GESTION_ADMIN_CATEGORIE,GESTION_CATEGORIE_L,$assoc);
|
|
|
220 |
$form->addElement($bouton);
|
|
|
221 |
|
|
|
222 |
|
|
|
223 |
|
|
|
224 |
//frais
|
|
|
225 |
$bouton1=&HTML_QuickForm::createElement('link', 'champ_frais','',$GLOBALS['urlBase'].GESTION_ADMIN_FRAIS,GESTION_FRAIS_L,$assoc);
|
|
|
226 |
$form->addElement($bouton1);
|
|
|
227 |
|
|
|
228 |
//motifs absence
|
|
|
229 |
$bouton2=&HTML_QuickForm::createElement('link', 'champ_motif_absence','',$GLOBALS['urlBase'].GESTION_ADMIN_MOTIF_ABSENCE,GESTION_MOTIF_L,$assoc);
|
|
|
230 |
$form->addElement($bouton2);
|
|
|
231 |
|
|
|
232 |
|
|
|
233 |
//projets
|
|
|
234 |
$bouton3=&HTML_QuickForm::createElement('link', 'champ_projet','',$GLOBALS['urlBase'].GESTION_ADMIN_PROJET,GESTION_PROJET_L,$assoc);
|
|
|
235 |
$form->addElement($bouton3);
|
|
|
236 |
|
|
|
237 |
|
|
|
238 |
//statut
|
|
|
239 |
$bouton4=&HTML_QuickForm::createElement('link', 'champ_statut','',$GLOBALS['urlBase'].GESTION_ADMIN_STATUT,GESTION_STATUT_L,$assoc);
|
|
|
240 |
$form->addElement($bouton4);
|
|
|
241 |
|
|
|
242 |
|
|
|
243 |
//taches
|
|
|
244 |
$bouton5=&HTML_QuickForm::createElement('link', 'champs_tache','',$GLOBALS['urlBase'].GESTION_ADMIN_TACHE,GESTION_TACHES_L,$assoc);
|
|
|
245 |
$form->addElement($bouton5);
|
|
|
246 |
|
|
|
247 |
|
|
|
248 |
//utilisateur
|
|
|
249 |
$bouton6=&HTML_QuickForm::createElement('link', 'champ_utilisateur','',$GLOBALS['urlBase'].GESTION_ADMIN_UTILISATEUR,GESTION_UTILISATEUR_L,$assoc);
|
|
|
250 |
$form->addElement($bouton6);
|
|
|
251 |
return $form;
|
|
|
252 |
}
|
|
|
253 |
|
|
|
254 |
?>
|