Subversion Repositories Applications.papyrus

Rev

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

Rev 723 Rev 725
Line 17... Line 17...
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
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                                  |
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                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: bazar.php,v 1.26 2006-02-06 09:33:53 alexandre_tb Exp $
22
// CVS : $Id: bazar.php,v 1.27 2006-02-07 11:08:36 alexandre_tb Exp $
23
/**
23
/**
24
* 
24
* 
25
*@package bazar
25
*@package bazar
26
//Auteur original :
26
//Auteur original :
27
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
27
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
28
*@author        Florian Schmitt <florian@ecole-et-nature.org>
28
*@author        Florian Schmitt <florian@ecole-et-nature.org>
29
//Autres auteurs :
29
//Autres auteurs :
30
*@copyright     Tela-Botanica 2000-2004
30
*@copyright     Tela-Botanica 2000-2004
31
*@version       $Revision: 1.26 $ $Date: 2006-02-06 09:33:53 $
31
*@version       $Revision: 1.27 $ $Date: 2006-02-07 11:08:36 $
32
// +------------------------------------------------------------------------------------------------------+
32
// +------------------------------------------------------------------------------------------------------+
33
*/
33
*/
Line 34... Line 34...
34
 
34
 
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
Line 61... Line 61...
61
 
61
 
62
error_reporting(E_ALL);
62
error_reporting(E_ALL);
63
require_once 'DB.php' ;
63
require_once 'DB.php' ;
64
require_once 'Auth.php' ;
64
require_once 'Auth.php' ;
-
 
65
require_once 'configuration/baz_config.inc.php'; //fichier de configuration de Bazar
65
require_once 'configuration/baz_config.inc.php'; //fichier de configuration de Bazar
66
require_once 'bibliotheque/bazar.class.php';
Line 66... Line 67...
66
require_once 'bibliotheque/bazar.fonct.php'; //fichier des fonctions de Bazar
67
require_once 'bibliotheque/bazar.fonct.php'; //fichier des fonctions de Bazar
67
 
68
 
68
if (defined('PAP_VERSION')) { //si on est dans Papyrus
69
if (defined('PAP_VERSION')) { //si on est dans Papyrus
Line 139... Line 140...
139
	function afficherContenuNavigation () {
140
	function afficherContenuNavigation () {
140
		$res ='<ul id="BAZ_menu">'."\n";
141
		$res ='<ul id="BAZ_menu">'."\n";
141
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
142
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
142
		$GLOBALS['_BAZAR_']['url']->addQueryString('nature', 'toutes');
143
		$GLOBALS['_BAZAR_']['url']->addQueryString('nature', 'toutes');
143
		//partie consultation d'annonces
144
		//partie consultation d'annonces
144
		$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_CONSULTER.'</a>'."\n".'</li>'."\n";
145
		$res .= '<li id="consulter"><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_CONSULTER.'</a>'."\n".'</li>'."\n";
145
		$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
146
		$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
Line 146... Line 147...
146
	
147
	
147
		//partie abonnement aux annonces
148
		//partie abonnement aux annonces
148
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_S_INSCRIRE);
149
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_S_INSCRIRE);
149
		$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_S_ABONNER.'</a></li>'."\n" ;
150
		$res .= '<li id="inscrire"><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_S_ABONNER.'</a></li>'."\n" ;
Line 150... Line 151...
150
		$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
151
		$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
151
			
152
			
152
		//partie saisie d'annonces
153
		//partie saisie d'annonces
153
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_DEPOSER_ANNONCE);
154
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_DEPOSER_ANNONCE);
Line 154... Line 155...
154
		$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_SAISIR.'</a>'."\n".'</li>'."\n";
155
		$res .= '<li id="deposer"><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_SAISIR.'</a>'."\n".'</li>'."\n";
-
 
156
		$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
155
		$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
157
			
156
			
158
		//choix des administrateurs	
157
		//choix des administrateurs	
159
		$utilisateur = new Utilisateur_bazar($GLOBALS['AUTH']) ;
158
		$est_admin=0;
160
		$est_admin=0;
159
		if ($GLOBALS['AUTH']->getAuth()) {
161
		if ($GLOBALS['AUTH']->getAuth()) {
160
			$requete='SELECT bn_id_nature FROM bazar_nature';
162
			$requete='SELECT bn_id_nature FROM bazar_nature';
161
			$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
163
			$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
162
			if (DB::isError($resultat)) {
164
			if (DB::isError($resultat)) {
163
				die ($resultat->getMessage().$resultat->getDebugInfo()) ;
165
				die ($resultat->getMessage().$resultat->getDebugInfo()) ;
164
			}
166
			}
165
			while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
167
			while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
166
				if ((niveau_droit($ligne['bn_id_nature'],$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)))=='administrateur') {
168
				if ($utilisateur->isAdmin ($ligne['bn_id_nature'])) {
167
					$est_admin=1;
169
					$est_admin=1;
168
			    }
170
			    }
169
			}
171
			}
170
			if (($est_admin)or(niveau_droit($id_nature_offre='0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')) {
172
			if ($est_admin || $utilisateur->isSuperAdmin()) {
171
				//partie administrer
173
				//partie administrer
Line 172... Line 174...
172
				$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ANNONCES_A_VALIDER);
174
				$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ANNONCES_A_VALIDER);
173
				$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMINISTRER.'</a></li>'."\n";
175
				$res .= '<li id="administrer"><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMINISTRER.'</a></li>'."\n";
174
				$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
176
				$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
175
				
177
				
176
				if (niveau_droit($id_nature_offre='0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur') {
178
				if ($utilisateur->isSuperAdmin()) {
177
					$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_GERER_DROITS);
179
					$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_GERER_DROITS);
178
					$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_GESTION_DES_DROITS.'</a></li>'."\n" ;
180
					$res .= '<li id="gerer"><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_GESTION_DES_DROITS.'</a></li>'."\n" ;
179
					$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
181
					$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
Line 221... Line 223...
221
 
223
 
222
 
224
 
223
/* +--Fin du code ----------------------------------------------------------------------------------------+
225
/* +--Fin du code ----------------------------------------------------------------------------------------+
-
 
226
*
-
 
227
* $Log: not supported by cvs2svn $
-
 
228
* Revision 1.26  2006/02/06 09:33:53  alexandre_tb
224
*
229
* modification de l'affichage lors de la saisie de fiche
225
* $Log: not supported by cvs2svn $
230
*
226
* Revision 1.25  2006/01/30 17:25:38  alexandre_tb
231
* Revision 1.25  2006/01/30 17:25:38  alexandre_tb
227
* correction de bugs
232
* correction de bugs
228
*
233
*