Subversion Repositories Applications.bazar

Rev

Rev 39 | Rev 51 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 39 Rev 45
Line 18... Line 18...
18
// |                                                                                                      |
18
// |                                                                                                      |
19
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | You should have received a copy of the GNU Lesser General Public                                     |
20
// | License along with this library; if not, write to the Free Software                                  |
20
// | License along with this library; 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: bazar.php,v 1.11 2005-10-21 16:15:04 florian Exp $
23
// CVS : $Id: bazar.php,v 1.12 2005-11-07 17:05:46 florian Exp $
24
/**
24
/**
25
* 
25
* 
26
*@package bazar
26
*@package bazar
27
//Auteur original :
27
//Auteur original :
28
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
28
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
29
*@author        Florian Schmitt <florian@ecole-et-nature.org>
29
*@author        Florian Schmitt <florian@ecole-et-nature.org>
30
//Autres auteurs :
30
//Autres auteurs :
31
*@copyright     Tela-Botanica 2000-2004
31
*@copyright     Tela-Botanica 2000-2004
32
*@version       $Revision: 1.11 $ $Date: 2005-10-21 16:15:04 $
32
*@version       $Revision: 1.12 $ $Date: 2005-11-07 17:05:46 $
33
// +------------------------------------------------------------------------------------------------------+
33
// +------------------------------------------------------------------------------------------------------+
34
*/
34
*/
Line 35... Line 35...
35
 
35
 
36
// +------------------------------------------------------------------------------------------------------+
36
// +------------------------------------------------------------------------------------------------------+
Line 92... Line 92...
92
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
92
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
93
	$GLOBALS['_BAZAR_']['url']->addQueryString('nature', 'toutes');
93
	$GLOBALS['_BAZAR_']['url']->addQueryString('nature', 'toutes');
94
	//partie consultation d'annonces
94
	//partie consultation d'annonces
95
	$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_CONSULTER.'</a>'."\n".'</li>'."\n";
95
	$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_CONSULTER.'</a>'."\n".'</li>'."\n";
96
	$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
96
	$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
97
	
97
 
98
	/*$requete = 'SELECT bn_id_nature, bn_label_nature FROM bazar_nature WHERE bn_ce_id_menu='.$GLOBALS['_GEN_commun']['info_menu']->gm_id_menu.' or  bn_ce_id_menu=0';
-
 
99
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
-
 
100
	if (DB::isError($resultat)) {
98
	//partie abonnement aux annonces
101
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
-
 
102
	}
-
 
103
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
-
 
104
		$GLOBALS['_BAZAR_']['url']->addQueryString('nature', $ligne['bn_label_nature']);
-
 
105
		$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.$ligne['bn_label_nature'].'</a></li>'."\n";
-
 
106
		$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
-
 
107
	}
-
 
108
	
-
 
109
	$GLOBALS['_BAZAR_']['url']->addQueryString('nature', 'toutes');
99
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_S_INSCRIRE);
110
	$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_TOUTES_LES_ANNONCES.'</a></li></ul></li>'."\n";
100
	$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_S_ABONNER.'</a></li>'."\n" ;
111
	$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
-
 
112
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
101
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
113
	
102
		
114
	//partie recherche d'annonces
103
	//partie saisie d'annonces
115
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_RECHERCHER_ANNONCE);
104
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_DEPOSER_ANNONCE);
116
	$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHER.'</a></li>'."\n";
105
	$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_SAISIR.'</a>'."\n".'<ul>'."\n";
-
 
106
	$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_DEPOSE_UNE_NOUVELLE_ANNONCE.'</a></li>'."\n" ;
117
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
107
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
118
	
108
 
119
	//pour les identifiés seulement
-
 
120
	if ($GLOBALS['AUTH']->getAuth()) {*/
-
 
121
		//partie abonnement aux annonces
109
	//annonces propres
122
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_S_INSCRIRE);
110
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_VOS_ANNONCES);
123
		$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_S_ABONNER.'</a></li>'."\n" ;
111
	$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_VOS_ANNONCES.'</a></li>'."\n";
124
		$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
112
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
-
 
113
	$res .='</ul></li>'."\n";
Line 125... Line 114...
125
		
114
		
-
 
115
	//choix des administrateurs	
-
 
116
	$est_admin=0;
126
		//partie saisie d'annonces
117
	if ($GLOBALS['AUTH']->getAuth()) {
127
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_DEPOSER_ANNONCE);
118
		$requete='SELECT bn_id_nature FROM bazar_nature';
-
 
119
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
128
		$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_SAISIR.'</a>'."\n".'<ul>'."\n";
120
		if (DB::isError($resultat)) {
-
 
121
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
129
		$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_DEPOSE_UNE_NOUVELLE_ANNONCE.'</a></li>'."\n" ;
122
		}
-
 
123
		while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
-
 
124
			if ((niveau_droit($ligne['bn_id_nature'],$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)))=='administrateur') {
-
 
125
				$est_admin=1;
130
		$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
126
		    }
-
 
127
		}
131
	
128
		if (($est_admin)or(niveau_droit($id_nature_offre='0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')) {
132
		//annonces propres
129
		//partie administrer
133
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_VOS_ANNONCES);
130
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ANNONCES_A_VALIDER);
-
 
131
		$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMINISTRER.'</a><ul>'."\n";
134
		$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_VOS_ANNONCES.'</a></li>'."\n";
132
		$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ANNONCES_A_ADMINISTRER.'</a></li>'."\n" ;
135
		$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
-
 
Line 136... Line -...
136
		$res .='</ul></li>'."\n";
-
 
137
		
-
 
138
		
-
 
139
		//choix des administrateurs	
-
 
140
		$est_admin=0;
-
 
141
		if ($GLOBALS['AUTH']->getAuth()) {
-
 
142
			$requete='SELECT bn_id_nature FROM bazar_nature';
-
 
143
			$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
-
 
144
			if (DB::isError($resultat)) {
-
 
145
				die ($resultat->getMessage().$resultat->getDebugInfo()) ;
-
 
146
			}
-
 
147
			while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
-
 
148
				if ((niveau_droit($ligne['bn_id_nature'],$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)))=='administrateur') {
-
 
149
					$est_admin=1;
-
 
150
			    }
133
		$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
151
			}
-
 
152
			if (($est_admin)or(niveau_droit($id_nature_offre='0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')) {
134
		
153
			//partie administrer
-
 
154
			$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ANNONCES_A_VALIDER);
135
		if (niveau_droit($id_nature_offre='0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur') {
155
			$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMINISTRER.'</a><ul>'."\n";
136
			$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_GERER_DROITS);
Line 156... Line -...
156
			$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ANNONCES_A_ADMINISTRER.'</a></li>'."\n" ;
-
 
157
			$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
-
 
158
			
-
 
159
			if (niveau_droit($id_nature_offre='0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur') {
-
 
160
				$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_GERER_DROITS);
-
 
161
				$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_GESTION_DES_DROITS.'</a></li>'."\n" ;
137
			$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_GESTION_DES_DROITS.'</a></li>'."\n" ;
162
				$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
138
			$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
163
				
139
			
164
				$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ADMINISTRER_ANNONCES);
140
			$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ADMINISTRER_ANNONCES);
165
				$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMIN_ANNONCES.'</a></li>'."\n" ;
141
			$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMIN_ANNONCES.'</a></li>'."\n" ;
166
				$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
142
			$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
167
			}
143
		}
168
			$res .= '</ul></li>'."\n";
144
		$res .= '</ul></li>'."\n";
169
			}
145
		}
Line 170... Line 146...
170
	}	
146
	}	
Line 206... Line 182...
206
 
182
 
207
 
183
 
208
/* +--Fin du code ----------------------------------------------------------------------------------------+
184
/* +--Fin du code ----------------------------------------------------------------------------------------+
-
 
185
*
-
 
186
* $Log: not supported by cvs2svn $
-
 
187
* Revision 1.11  2005/10/21 16:15:04  florian
209
*
188
* mise a jour appropriation
210
* $Log: not supported by cvs2svn $
189
*
211
* Revision 1.10  2005/10/12 17:20:33  ddelon
190
* Revision 1.10  2005/10/12 17:20:33  ddelon
212
* Reorganisation calendrier + applette
191
* Reorganisation calendrier + applette
213
*
192
*