Subversion Repositories Applications.gtt

Rev

Rev 65 | Rev 104 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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