Subversion Repositories Applications.bazar

Rev

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

Rev 109 Rev 111
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.fonct.php,v 1.45 2006-03-24 09:28:02 alexandre_tb Exp $
22
// CVS : $Id: bazar.fonct.php,v 1.46 2006-03-29 13:04:35 alexandre_tb Exp $
23
/**
23
/**
24
*
24
*
25
* Fonctions du module bazar
25
* Fonctions du module bazar
26
* 
26
* 
27
*
27
*
Line 29... Line 29...
29
//Auteur original :
29
//Auteur original :
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
31
*@author        Florian Schmitt <florian@ecole-et-nature.org>
31
*@author        Florian Schmitt <florian@ecole-et-nature.org>
32
//Autres auteurs :
32
//Autres auteurs :
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.45 $ $Date: 2006-03-24 09:28:02 $
34
*@version       $Revision: 1.46 $ $Date: 2006-03-29 13:04:35 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
Line 37... Line 37...
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
Line 320... Line 320...
320
	$formtemplate->setDefaults($defauts);
320
	$formtemplate->setDefaults($defauts);
321
	$res.= $formtemplate->toHTML().'<br />'."\n" ;
321
	$res.= $formtemplate->toHTML().'<br />'."\n" ;
Line 322... Line 322...
322
	
322
	
323
	if ($personne!=0) {
323
	if ($personne!=0) {
-
 
324
		//cas du super utilisateur
324
		//cas du super utilisateur
325
		$utilisateur = new Utilisateur_bazar($personne) ;
325
		if (niveau_droit(0,$personne)=='superadministrateur') {
326
		if ($utilisateur->isSuperAdmin()) {
326
			$res.= '<br />'.BAZ_EST_SUPERADMINISTRATEUR.'<br /><br />'."\n";
327
			$res.= '<br />'.BAZ_EST_SUPERADMINISTRATEUR.'<br /><br />'."\n";
327
			$lien_enlever_superadmin=$GLOBALS['_BAZAR_']['url'];
328
			$lien_enlever_superadmin=$GLOBALS['_BAZAR_']['url'];
328
			$lien_enlever_superadmin->addQueryString('action', BAZ_GERER_DROITS);
329
			$lien_enlever_superadmin->addQueryString('action', BAZ_GERER_DROITS);
329
			$lien_enlever_superadmin->addQueryString('pers', $personne);
330
			$lien_enlever_superadmin->addQueryString('pers', $personne);
Line 371... Line 372...
371
				$lien_passer_admin=$GLOBALS['_BAZAR_']['url'];
372
				$lien_passer_admin=$GLOBALS['_BAZAR_']['url'];
372
				$lien_passer_admin->addQueryString('action', BAZ_GERER_DROITS);
373
				$lien_passer_admin->addQueryString('action', BAZ_GERER_DROITS);
373
				$lien_passer_admin->addQueryString('pers', $personne);
374
				$lien_passer_admin->addQueryString('pers', $personne);
374
				$lien_passer_admin->addQueryString('droits', 'admin');
375
				$lien_passer_admin->addQueryString('droits', 'admin');
375
				$lien_passer_admin->addQueryString('idtypeannonce', $ligne["bn_id_nature"]);
376
				$lien_passer_admin->addQueryString('idtypeannonce', $ligne["bn_id_nature"]);
-
 
377
				if (isset($ligne['bn_image_titre'])) {
376
				if (isset($ligne['bn_image_titre'])) {$titre='&nbsp;<img src="client/bazar/images/'.$ligne['bn_image_titre'].'" alt="'.constant($ligne['bn_label_nature']).'" />'."\n";}
378
					$titre='&nbsp;<img src="client/bazar/images/'.$ligne['bn_image_titre'].'" alt="'.$ligne['bn_label_nature'].'" />'."\n";
-
 
379
				} else {
377
				else {$titre='<strong>&nbsp;'.constant($ligne['bn_label_nature']).'</strong>'."\n";}
380
					$titre='<strong>&nbsp;'.$ligne['bn_label_nature'].'</strong>'."\n";
-
 
381
				}
378
				if ($droits=='aucun') {
382
				if ($utilisateur->isAdmin($ligne['bn_id_nature'])) {
379
					$table->addRow(array($titre,
383
					$table->addRow(array($titre,
380
					                     BAZ_AUCUN_DROIT,
384
							     BAZ_DROIT_ADMIN,
381
					                     '<a href='.$lien_passer_redacteur->getURL().'>'.BAZ_DROIT_REDACTEUR.'</a>',
385
							     '<a href='.$lien_aucun_droit->getURL().'>'.BAZ_AUCUN_DROIT.'</a>',
382
							     '<a href='.$lien_passer_admin->getURL().'>'.BAZ_DROIT_ADMIN.'</a>'));
386
							     '<a href='.$lien_passer_redacteur->getURL().'>'.BAZ_DROIT_REDACTEUR.'</a>'));
383
				}
387
				}
384
				elseif ($droits=='redacteur') {
388
				elseif ($utilisateur->isRedacteur($ligne['bn_id_nature'])) {
385
					$table->addRow(array($titre,
389
					$table->addRow(array($titre,
386
					                     BAZ_DROIT_REDACTEUR,
390
					                     BAZ_DROIT_REDACTEUR,
387
					                     '<a href='.$lien_aucun_droit->getURL().'>'.BAZ_AUCUN_DROIT.'</a>',
391
					                     '<a href='.$lien_aucun_droit->getURL().'>'.BAZ_AUCUN_DROIT.'</a>',
388
							     '<a href='.$lien_passer_admin->getURL().'>'.BAZ_DROIT_ADMIN.'</a>'));
392
							     '<a href='.$lien_passer_admin->getURL().'>'.BAZ_DROIT_ADMIN.'</a>'));
389
				}
393
				}
390
				else {
394
				else {
391
					$table->addRow(array($titre,
395
					$table->addRow(array($titre,
392
							     BAZ_DROIT_ADMIN,
396
					                     BAZ_AUCUN_DROIT,
393
							     '<a href='.$lien_aucun_droit->getURL().'>'.BAZ_AUCUN_DROIT.'</a>',
397
					                     '<a href='.$lien_passer_redacteur->getURL().'>'.BAZ_DROIT_REDACTEUR.'</a>',
394
							     '<a href='.$lien_passer_redacteur->getURL().'>'.BAZ_DROIT_REDACTEUR.'</a>'));
398
							     '<a href='.$lien_passer_admin->getURL().'>'.BAZ_DROIT_ADMIN.'</a>'));
-
 
399
					
395
				}
400
				}
396
			}
401
			}
397
			$table->altRowAttributes(1, array('class' => 'ligne_impaire'), array('class' => 'ligne_paire'));
402
			$table->altRowAttributes(1, array('class' => 'ligne_impaire'), array('class' => 'ligne_paire'));
398
			$table->updateColAttributes(0, array('align' => 'left'));
403
			$table->updateColAttributes(0, array('align' => 'left'));
399
			$table->updateColAttributes(1, array('align' => 'left'));
404
			$table->updateColAttributes(1, array('align' => 'left'));
Line 1306... Line 1311...
1306
}
1311
}
Line 1307... Line 1312...
1307
 
1312
 
1308
/* +--Fin du code ----------------------------------------------------------------------------------------+
1313
/* +--Fin du code ----------------------------------------------------------------------------------------+
1309
*
1314
*
-
 
1315
* $Log: not supported by cvs2svn $
-
 
1316
* Revision 1.45  2006/03/24 09:28:02  alexandre_tb
-
 
1317
* utilisation de la variable globale $GLOBALS['_BAZAR_']['filtre']
1310
* $Log: not supported by cvs2svn $
1318
*
1311
* Revision 1.44  2006/03/14 17:10:21  florian
1319
* Revision 1.44  2006/03/14 17:10:21  florian
1312
* ajout des fonctions de syndication, changement du moteur de recherche
1320
* ajout des fonctions de syndication, changement du moteur de recherche
1313
*
1321
*
1314
* Revision 1.43  2006/03/02 20:36:52  florian
1322
* Revision 1.43  2006/03/02 20:36:52  florian