Subversion Repositories Applications.gtt

Rev

Rev 104 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 104 Rev 170
Line 1... Line 1...
1
<?php
1
<?php
2
// +------------------------------------------------------------------------------------------------------+
2
// +------------------------------------------------------------------------------------------------------+
3
// | PHP version 5.1.1                                                                                    |
3
// | PHP version 5.1.1                                                                                    |
4
// +------------------------------------------------------------------------------------------------------+
4
// +------------------------------------------------------------------------------------------------------+
5
// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org)                                         |
5
// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// +------------------------------------------------------------------------------------------------------+
6
// +------------------------------------------------------------------------------------------------------+
7
// | This file is part of eFlore.                                                                         |
7
// | This file is part of eFlore.                                                                         |
8
// |                                                                                                      |
8
// |                                                                                                      |
9
// | Foobar is free software; you can redistribute it and/or modify                                       |
9
// | Foobar is free software; you can redistribute it and/or modify                                       |
10
// | it under the terms of the GNU General Public License as published by                                 |
10
// | it under the terms of the GNU General Public License as published by                                 |
11
// | the Free Software Foundation; either version 2 of the License, or                                    |
11
// | the Free Software Foundation; either version 2 of the License, or                                    |
12
// | (at your option) any later version.                                                                  |
12
// | (at your option) any later version.                                                                  |
13
// |                                                                                                      |
13
// |                                                                                                      |
14
// | Foobar is distributed in the hope that it will be useful,                                            |
14
// | Foobar is distributed in the hope that it will be useful,                                            |
15
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
16
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
16
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
17
// | GNU General Public License for more details.                                                         |
17
// | GNU General Public License for more details.                                                         |
18
// |                                                                                                      |
18
// |                                                                                                      |
19
// | You should have received a copy of the GNU General Public License                                    |
19
// | You should have received a copy of the GNU General Public License                                    |
20
// | along with Foobar; if not, write to the Free Software                                                |
20
// | along with Foobar; if not, write to the Free Software                                                |
21
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// +------------------------------------------------------------------------------------------------------+
22
// +------------------------------------------------------------------------------------------------------+
23
// CVS : $Id$
23
// CVS : $Id$
24
/**
24
/**
25
* Classe UtilisateurStatut
25
* Classe UtilisateurStatut
26
*
26
*
27
* Description
27
* Description
28
*
28
*
29
*@package eFlore
29
*@package eFlore
30
*@subpackage modele
30
*@subpackage modele
31
//Auteur original :
31
//Auteur original :
32
*@version 3
32
*@version 3
33
*@author        Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
33
*@author        Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
34
//Autres auteurs :
34
//Autres auteurs :
35
*@version 4
35
*@version 4
36
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
36
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
37
*@author        aucun
37
*@author        aucun
38
*@copyright     Tela-Botanica 2000-2006
38
*@copyright     Tela-Botanica 2000-2006
39
*@version       $Revision$ $Date$
39
*@version       $Revision$ $Date$
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
*/
41
*/
42
 
42
 
43
/**
43
/**
44
* class UtilisateurStatut : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
44
* class UtilisateurStatut : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
45
* classe métier
45
* classe métier
46
*/
46
*/
47
class UtilisateurStatut extends aGttSql {
47
class UtilisateurStatut extends aGttSql {
48
	/*** Constantes : */
48
	/*** Constantes : */
49
	const GUS_TOUS = 'UTILISATEURSTATUT_TOUS';
49
	const GUS_TOUS = 'UTILISATEURSTATUT_TOUS';
50
	const GUS_ID = 'UTILISATEURSTATUT_ID';
50
	const GUS_ID = 'UTILISATEURSTATUT_ID';
51
	const GUS_ID_MAX = 'UTILISATEURSTATUT_ID_MAX';
51
	const GUS_ID_MAX = 'UTILISATEURSTATUT_ID_MAX';
52
	const GUS_LIBELLE = 'UTILISATEURSTATUT_LIBELLE';
52
	const GUS_LIBELLE = 'UTILISATEURSTATUT_LIBELLE';
53
 
53
 
54
	/*** Attributs : */
54
	/*** Attributs : */
55
	private $id_utilisateur_statut;
55
	private $id_utilisateur_statut;
56
	private $libelle;
56
	private $libelle;
57
	private $mark_recapitulatif;
57
	private $mark_recapitulatif;
58
 
58
 
59
	/*** Aggregations : */
59
	/*** Aggregations : */
60
 
60
 
61
	/*** Constructeur : */
61
	/*** Constructeur : */
62
	public function __construct($cmd = null, $parametres = null)
62
	public function __construct($cmd = null, $parametres = null)
63
	{
63
	{
64
		$this->dao_table_nom = 'gestion_utilisateur_statut';
64
		$this->dao_table_nom = GTT_BDD_PREFIXE . 'gestion_utilisateur_statut';
65
		$this->dao_correspondance = array(
65
		$this->dao_correspondance = array(
66
			'gus_id_utilisateur_statut'	=> 'id_utilisateur_statut',
66
			'gus_id_utilisateur_statut'	=> 'id_utilisateur_statut',
67
			'gus_libelle'	=> 'libelle',
67
			'gus_libelle'	=> 'libelle',
68
			'gus_mark_recapitulatif'	=> 'mark_recapitulatif');
68
			'gus_mark_recapitulatif'	=> 'mark_recapitulatif');
69
 
69
 
70
		// Si l'on veut remplir l'objet à la création on lance la requete correspondante
70
		// Si l'on veut remplir l'objet à la création on lance la requete correspondante
71
		if (!is_null($cmd)) {
71
		if (!is_null($cmd)) {
72
			$this->consulter($cmd, $parametres, true);
72
			$this->consulter($cmd, $parametres, true);
73
		}
73
		}
74
	}
74
	}
75
 
75
 
76
	/*** Accesseurs : */
76
	/*** Accesseurs : */
77
	// Id Utilisateur Statut
77
	// Id Utilisateur Statut
78
	public function getIdUtilisateurStatut()
78
	public function getIdUtilisateurStatut()
79
	{
79
	{
80
		return $this->id_utilisateur_statut;
80
		return $this->id_utilisateur_statut;
81
	}
81
	}
82
	public function setIdUtilisateurStatut( $ius )
82
	public function setIdUtilisateurStatut( $ius )
83
	{
83
	{
84
		$this->id_utilisateur_statut = $ius;
84
		$this->id_utilisateur_statut = $ius;
85
	}
85
	}
86
 
86
 
87
	// Libelle
87
	// Libelle
88
	public function getLibelle()
88
	public function getLibelle()
89
	{
89
	{
90
		return $this->libelle;
90
		return $this->libelle;
91
	}
91
	}
92
	public function setLibelle( $l )
92
	public function setLibelle( $l )
93
	{
93
	{
94
		$this->libelle = $l;
94
		$this->libelle = $l;
95
	}
95
	}
Line 96... Line 96...
96
 
96
 
97
	// Mark Recapitulatif
97
	// Mark Recapitulatif
98
	public function getMarkRecapitulatif()
98
	public function getMarkRecapitulatif()
99
	{
99
	{
100
		return $this->mark_recapitulatif;
100
		return $this->mark_recapitulatif;
101
	}
101
	}
102
	public function setMarkRecapitulatif( $mr )
102
	public function setMarkRecapitulatif( $mr )
103
	{
103
	{
104
		$this->mark_recapitulatif = $mr;
104
		$this->mark_recapitulatif = $mr;
105
	}
105
	}
106
 
106
 
107
	/*** Méthodes : */
107
	/*** Méthodes : */
108
 
108
 
109
	/**
109
	/**
110
	* Consulter la table gestion_utilisateur_statut.
110
	* Consulter la table gestion_utilisateur_statut.
111
	* @return mixed un tableau d'objets UtilisateurStatut s'il y en a plusieurs, l'objet UtilisateurStatut s'il y en a 1 seul sinon false.
111
	* @return mixed un tableau d'objets UtilisateurStatut s'il y en a plusieurs, l'objet UtilisateurStatut s'il y en a 1 seul sinon false.
112
	*/
112
	*/
113
	public function consulter($cmd = '', $parametres = array(), $instancier = false)
113
	public function consulter($cmd = '', $parametres = array(), $instancier = false)
114
	{
114
	{
115
		switch ($cmd) {
115
		switch ($cmd) {
116
			case UtilisateurStatut::GUS_TOUS:
116
			case UtilisateurStatut::GUS_TOUS:
-
 
117
				$requete = 	'SELECT * '.
-
 
118
							'FROM ' . GTT_BDD_PREFIXE . 'gestion_utilisateur_statut ';
-
 
119
				break;
-
 
120
			case UtilisateurStatut::GUS_ID:
-
 
121
				$requete = 	'SELECT * '.
117
				$requete = 	'SELECT * '.
122
							'FROM ' . GTT_BDD_PREFIXE . 'gestion_utilisateur_statut '.
118
							'FROM gestion_utilisateur_statut ';
123
							'WHERE gus_id_utilisateur_statut = #0 ';
119
				break;
-
 
120
			case UtilisateurStatut::GUS_ID:
-
 
121
				$requete = 	'SELECT * '.
-
 
122
							'FROM gestion_utilisateur_statut '.
-
 
123
							'WHERE gus_id_utilisateur_statut = #0 ';
-
 
124
				break;
124
				break;
125
			case UtilisateurStatut::GUS_ID_MAX:
125
			case UtilisateurStatut::GUS_ID_MAX:
126
				$requete =	'SELECT MAX(gus_id_utilisateur_statut) AS gus_id_utilisateur_statut '.
126
				$requete =	'SELECT MAX(gus_id_utilisateur_statut) AS gus_id_utilisateur_statut '.
127
							'FROM gestion_utilisateur_statut ';
127
							'FROM ' . GTT_BDD_PREFIXE . 'gestion_utilisateur_statut ';
128
				break;
128
				break;
129
			case UtilisateurStatut::GUS_LIBELLE:
129
			case UtilisateurStatut::GUS_LIBELLE:
130
				$requete =	'SELECT * '.
130
				$requete =	'SELECT * '.
131
							'FROM gestion_utilisateur_statut '.
131
							'FROM ' . GTT_BDD_PREFIXE . 'gestion_utilisateur_statut '.
132
							'WHERE gus_libelle = "#0" ';
132
							'WHERE gus_libelle = "#0" ';
133
				break;
133
				break;
134
			default :
134
			default :
135
				$message = 'Commande '.$cmd.'inconnue!';
135
				$message = 'Commande '.$cmd.'inconnue!';
136
				$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
136
				$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
137
    			trigger_error($e, E_USER_ERROR);
137
    			trigger_error($e, E_USER_ERROR);
138
		}
138
		}
139
		return parent::consulter($requete, $parametres, $instancier);
139
		return parent::consulter($requete, $parametres, $instancier);
140
	}
140
	}
141
}
141
}
142
 
142
 
143
/* +--Fin du code ----------------------------------------------------------------------------------------+
143
/* +--Fin du code ----------------------------------------------------------------------------------------+
144
*
144
*
145
* $Log$
145
* $Log$
146
*
146
*
147
* +-- Fin du code ----------------------------------------------------------------------------------------+
147
* +-- Fin du code ----------------------------------------------------------------------------------------+
148
*/
148
*/
149
?>
149
?>