Subversion Repositories Applications.gtt

Rev

Rev 58 | Rev 94 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 jpm 1
<?php
2
// +------------------------------------------------------------------------------------------------------+
3
// | PHP version 4.1                                                                                      |
4
// +------------------------------------------------------------------------------------------------------+
5
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// +------------------------------------------------------------------------------------------------------+
7
// | This library is free software; you can redistribute it and/or                                        |
8
// | modify it under the terms of the GNU Lesser General Public                                           |
9
// | License as published by the Free Software Foundation; either                                         |
10
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// |                                                                                                      |
12
// | This library is distributed in the hope that it will be useful,                                      |
13
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | Lesser General Public License for more details.                                                      |
16
// |                                                                                                      |
17
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | License along with this library; if not, write to the Free Software                                  |
19
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// +------------------------------------------------------------------------------------------------------+
21
// |@author ABDOOL RAHEEM shaheen   shaheenar50@hotmail.com                                                 |
22
// |@version 3                                                                                            |
23
 
24
// +------------------------------------------------------------------------------------------------------+
25
/*
28 jpm 26
*fichier contenant le menu principal de l'application de gestion du temps de travail
2 jpm 27
*@package gtt_general
28
//Auteur original :
29
*@author        Dorian Bannier <dbannier@aol.com>
30
//Autres auteurs :
31
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
32
*@copyright     Copyright (C) 2003 Tela-Botanica
33
*/
34
// +------------------------------------------------------------------------------------------------------+
35
// |                                            INCLUSION DE FICHIERS                                       |
36
// +------------------------------------------------------------------------------------------------------+
5 jpm 37
 
38
// Fichiers de la bibliotheque PEAR
27 jpm 39
include 'Auth/Auth.php';
40
include 'DB.php';
41
include 'gtt_config.inc.php';
58 jpm 42
if (!file_exists('config.inc.php')) {
43
	die('Veuillez configurer la base de données de la Gestion du Temps de travail en complétant puis en renommant en config.inc.php le fichier config.inc.defaut.php.');
44
}
45
include 'config.inc.php';
56 jpm 46
include GTT_CHEMIN_LANGUE.'gtt_langue_fr.inc.php';
2 jpm 47
 
10 jpm 48
// Test des choix de menu a afficher
56 jpm 49
$action = 'identification';
10 jpm 50
if (!empty($_GET['action'])) {
51
	$action = $_GET['action'];
2 jpm 52
}
48 jpm 53
 
56 jpm 54
// Initialisation du gestionnaire d'erreur
65 jpm 55
$GLOBALS['_GTT_']['erreur'] = new GestionnaireErreur(GTT_DEBOGAGE_CONTEXTE);
56
$GLOBALS['_GTT_']['erreur']->setNiveauErreurCourrant(GTT_DEBOGAGE_NIVEAU);
44 jpm 57
 
56 jpm 58
// Connexion a la base de donnees
59
$GLOBALS['db'] = DB::connect(GTT_BDD_DSN);
60
if (PEAR::isError($GLOBALS['db'])) {
61
	trigger_error("Echec connexion a la base de donnees : ".$GLOBALS['db']->getMessage(), E_USER_ERROR);
62
}
48 jpm 63
 
56 jpm 64
// Utilisation du mécanisme MVC avec Squelette PHP et objet
65 jpm 65
$Controlleur = new ControlleurFrontal();
56 jpm 66
echo $Controlleur->executer($action);
44 jpm 67
 
56 jpm 68
/**
69
* La fonction __autoload() charge dynamiquement les classes trouvées dans le code.
70
*
71
* Cette fonction est appelée par php5 quand il trouve une instanciation de classe dans le code.
72
*
73
*@param string le nom de la classe appelée.
74
*@return void le fichier contenant la classe doit être inclu par la fonction.
75
*/
76
function __autoload($classe)
77
{
78
	$fichier_classe_pear = GTT_CHEMIN_PEAR.str_replace('_', '/', $classe).'.php';
79
	if (file_exists($fichier_classe_pear)) {
80
		require_once $fichier_classe_pear;
81
	} else {
82
		$nom_classe_gtt = $classe.'.class.php';
83
		foreach ($GLOBALS['_GTT_']['tab_chemin_autoload'] as $chemin) {
84
			$fichier = $chemin.$nom_classe_gtt;
85
			if (file_exists($fichier)) {
86
				require_once $fichier;
87
			}
9 jpm 88
		}
89
	}
2 jpm 90
}
56 jpm 91
 
5 jpm 92
?>