/tags/Racine_livraison_menes/bazar.calendrier.applette.php |
---|
New file |
0,0 → 1,70 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// Copyright (C) 1999-2004 Tela Botanica (accueil@tela-botanica.org) |
// |
// Ce logiciel est un programme informatique servant à gérer du contenu et des |
// applications web. |
// Ce logiciel est régi par la licence CeCILL soumise au droit français et |
// respectant les principes de diffusion des logiciels libres. Vous pouvez |
// utiliser, modifier et/ou redistribuer ce programme sous les conditions |
// de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA |
// sur le site "http://www.cecill.info". |
// En contrepartie de l'accessibilité au code source et des droits de copie, |
// de modification et de redistribution accordés par cette licence, il n'est |
// offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, |
// seule une responsabilité restreinte pèse sur l'auteur du programme, le |
// titulaire des droits patrimoniaux et les concédants successifs. |
// A cet égard l'attention de l'utilisateur est attirée sur les risques |
// associés au chargement, à l'utilisation, à la modification et/ou au |
// développement et à la reproduction du logiciel par l'utilisateur étant |
// donné sa spécificité de logiciel libre, qui peut le rendre complexe à |
// manipuler et qui le réserve donc à des développeurs et des professionnels |
// avertis possédant des connaissances informatiques approfondies. Les |
// utilisateurs sont donc invités à charger et tester l'adéquation du |
// logiciel à leurs besoins dans des conditions permettant d'assurer la |
// sécurité de leurs systèmes et ou de leurs données et, plus généralement, |
// à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. |
// Le fait que vous puissiez accéder à cet en-tête signifie que vous avez |
// pris connaissance de la licence CeCILL, et que vous en avez accepté les |
// termes. |
// ---- |
// CVS : $Id: bazar.calendrier.applette.php,v 1.6 2005-10-31 17:10:56 ddelon Exp $ |
/** |
* bazar_calendrier : programme affichant les evenements du bazar sous forme de Calendrier |
* |
* |
*@package Bazar |
//Auteur original : |
*@author David DELON <david.delon@clapas.net> |
*@version $Revision: 1.6 $ $Date: 2005-10-31 17:10:56 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
if (!defined('BAZ_VOIR_FICHE')) { |
define ('BAZ_VOIR_FICHE', 8); |
} |
include_once 'configuration/baz_config.inc.php'; //fichier de configuration de Bazar |
include_once 'bibliotheque/bazar.fonct.php'; //fichier des fonctions de Bazar |
include_once 'bibliotheque/bazar.fonct.cal.php'; //fichier des fonctions de Bazar |
$GLOBALS['_CAL_']['nom_fonction'] = 'afficherCalendrier'; |
$_GEN_commun['info_applette_nom_fonction'] = $GLOBALS['_CAL_']['nom_fonction']; |
// Balise : CLIENT_BAZAR_CALENDRIER |
$_GEN_commun['info_applette_balise'] = 'BAZAR_CALENDRIER'; |
function afficherCalendrier() { |
return GestionAffichageCalendrier('calendrier_applette'); |
} |
?> |
/tags/Racine_livraison_menes/bazar.desinscription.inc.php |
---|
New file |
0,0 → 1,62 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU Lesser General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | Lesser General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU Lesser General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: bazar.desinscription.inc.php,v 1.1 2005-09-29 16:14:17 alexandre_tb Exp $ |
/** |
* |
*@package bazar |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@author Florian Schmitt <florian@ecole-et-nature.org> |
//Autres auteurs : |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision: 1.1 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
/* Ce programme est appelé depuis inscription.php et |
* se situe dans la fonction afficherContenuCorps() |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | LES CONSTANTES DES ACTIONS DE BAZAR | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// Suppression des entrée dans bazar_droits |
$requete = 'delete from bazar_droits where bd_id_utilisateur='.$id_utilisateur ; |
$resultat = $GLOBALS['ins_db']->query($requete) ; |
if (DB::isError($resultat)) { |
echo 'Erreur dans la requete sur bazar_droits<br />'.$requete.'<br />'.$resultat->getMessage() ; |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/tags/Racine_livraison_menes/bazar.interne.css |
---|
New file |
0,0 → 1,37 |
/* |
+----------------------------------------------------------------------------+ |
| bazar.css | |
+----------------------------------------------------------------------------+ |
| Copyright (c) 2005 Ecole et Nature | |
+----------------------------------------------------------------------------+ |
| Feuille de style interne spécifique a l'application Bazar | |
+----------------------------------------------------------------------------+ |
| Auteur : Florian SCHMITT <florian@ecole-et-nature.org> | |
+----------------------------------------------------------------------------+ |
*/ |
#BAZ_corps {width:100%;} |
#formulaire input, #formulaire textarea, #formulaire select {border:1px solid #000;} |
.enligne {padding:0;margin:0;display:inline;list-style: none;list-style-type:none;background:#FFF;} |
/*-------------Les fiches Bazar-------------------------------------------------*/ |
.BAZ_cadre_fiche {margin:0 auto;width:100%;padding:10px; |
border: 1px solid #3082AA;-moz-border-radius:10px; |
text-indent:0; font: 13px arial, sans-serif; color:#000; text-align:justify; line-height:17px;} |
.BAZ_cadre_fiche a {font: 14px arial, sans-serif;color:#3082AA;text-decoration:underline;} |
.BAZ_cadre_fiche a:hover {color:#515966;text-decoration:underline;} |
#fiche_image {float:left;height:150px; width:150px;} |
#fiche_titre {text-align:left;width:100%;padding-left:10px; background:transparent; border:0; color:#B1BB7E; font: 19px arial, sans-serif;} |
#BAZ_description {min-height:120px;font: 15px arial, sans-serif;text-align:justify;} |
#BAZ_bas_page {margin: 0;padding:0;} |
.bulle_haut {margin: 0;padding:0;} |
.bulle_corps {margin: 0;padding:10px 5px;border: 1px solid #3082AA;-moz-border-radius:10px;background:#DBE8C8;} |
.bulle_bas {margin: 0;padding:0;} |
#formation_qualifiante {float:right;margin:0 -15px 0 5px;height:190px;width:30px;background:url(images/BAZ_formation_qualifiante.gif) bottom right no-repeat;} |
#formation_diplomante {float:right;margin:0 -15px 0 5px;height:190px;width:30px;background:url(images/BAZ_formation_diplomante.gif) bottom right no-repeat;} |
#formation_continue {float:right;margin:0 -15px 0 5px;height:190px;width:30px;background:url(images/BAZ_formation_continue.gif) bottom right no-repeat;} |
.centrer {clear:both;margin:0 auto;} |
.rubrique {width:150px; text-align:left;font: bold 15px arial, sans-serif; color: #515966;} |
.rubrique_bulle {width:90px;text-align:left;font: bold 15px arial, sans-serif; color: #000;} |
.infos {width:70%;float:left;min-height:120px;font: bold 15px arial, sans-serif; color: #B1BB7E;line-height: 25px;} |
.bazar_checkbox {float:left;width:170px;font:10px arial, sans-serif;border:0;} |
.lien_wikini {margin: 0;padding:10px 5px;border: 2px solid #DBE8C8;-moz-border-radius:10px;background:#3082AA;} |
div.lien_wikini a {padding-left:100px;color:#FFFFFF;} |
/tags/Racine_livraison_menes/documentation/balises.txt |
---|
New file |
0,0 → 1,2 |
Affichage calendrier : |
CLIENT_BAZAR_CALENDRIER |
/tags/Racine_livraison_menes/documentation/bazar_v0.24.sql |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/documentation/bazar_v0.24.sql |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/bazar.calendrier.php |
---|
New file |
0,0 → 1,62 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// Copyright (C) 1999-2004 Tela Botanica (accueil@tela-botanica.org) |
// |
// Ce logiciel est un programme informatique servant à gérer du contenu et des |
// applications web. |
// Ce logiciel est régi par la licence CeCILL soumise au droit français et |
// respectant les principes de diffusion des logiciels libres. Vous pouvez |
// utiliser, modifier et/ou redistribuer ce programme sous les conditions |
// de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA |
// sur le site "http://www.cecill.info". |
// En contrepartie de l'accessibilité au code source et des droits de copie, |
// de modification et de redistribution accordés par cette licence, il n'est |
// offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, |
// seule une responsabilité restreinte pèse sur l'auteur du programme, le |
// titulaire des droits patrimoniaux et les concédants successifs. |
// A cet égard l'attention de l'utilisateur est attirée sur les risques |
// associés au chargement, à l'utilisation, à la modification et/ou au |
// développement et à la reproduction du logiciel par l'utilisateur étant |
// donné sa spécificité de logiciel libre, qui peut le rendre complexe à |
// manipuler et qui le réserve donc à des développeurs et des professionnels |
// avertis possédant des connaissances informatiques approfondies. Les |
// utilisateurs sont donc invités à charger et tester l'adéquation du |
// logiciel à leurs besoins dans des conditions permettant d'assurer la |
// sécurité de leurs systèmes et ou de leurs données et, plus généralement, |
// à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. |
// Le fait que vous puissiez accéder à cet en-tête signifie que vous avez |
// pris connaissance de la licence CeCILL, et que vous en avez accepté les |
// termes. |
// ---- |
// CVS : $Id: bazar.calendrier.php,v 1.8 2005-10-31 17:10:56 ddelon Exp $ |
/** |
* bazar_calendrier : programme affichant les evenements du bazar sous forme de Calendrier |
* |
* |
*@package Bazar |
//Auteur original : |
*@author David DELON <david.delon@clapas.net> |
*@version $Revision: 1.8 $ $Date: 2005-10-31 17:10:56 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
if (!defined('BAZ_VOIR_FICHE')) { |
define ('BAZ_VOIR_FICHE', 8); |
} |
include_once 'configuration/baz_config.inc.php'; //fichier de configuration de Bazar |
include_once 'bibliotheque/bazar.fonct.php'; //fichier des fonctions de Bazar |
include_once 'bibliotheque/bazar.fonct.cal.php'; //fichier des fonctions de Bazar |
function afficherContenuCorps() { |
return GestionAffichageCalendrier('calendrier'); |
} |
?> |
/tags/Racine_livraison_menes/bibliotheque/bazar.fonct.cal.php |
---|
New file |
0,0 → 1,310 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU Lesser General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | Lesser General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU Lesser General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: bazar.fonct.cal.php,v 1.10 2006-09-14 14:15:35 alexandre_tb Exp $ |
/** |
* |
* Fonctions calendrier du module bazar |
* |
*@package bazar |
//Auteur original : |
*@author David Delon <david.delon@clapas.net> |
//Autres auteurs : |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.10 $ $Date: 2006-09-14 14:15:35 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Month/Weekdays.php'; |
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Day.php'; |
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Decorator.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
// Classe Utilitaire pour Calendrier |
class DiaryEvent extends Calendar_Decorator { |
var $entry=array(); |
function DiaryEvent($calendar) { |
Calendar_Decorator::Calendar_Decorator($calendar); |
} |
function setEntry($entry) { |
$this->entry[]=$entry; |
} |
function getEntry() { |
return $this->entry; |
} |
} |
// $type : calendrier |
// $type : calendrier_appplette |
function GestionAffichageCalendrier($type='calendrier') { |
$retour=''; |
$url = $GLOBALS['_GEN_commun']['url'] ; |
$db = &$GLOBALS['_GEN_commun']['pear_db'] ; |
$auth = &$GLOBALS['_GEN_commun']['pear_auth'] ; |
if (!isset($_GET['y'])) { |
$_GET['y'] = date('Y'); |
} |
if (!isset($_GET['m'])) { |
$_GET['m'] = date('m'); |
} |
// Construction Mois en Cours |
$month = new Calendar_Month_Weekdays($_GET['y'],$_GET['m']); |
$curStamp=$month->getTimeStamp(); |
$url->addQueryString ('y', date('Y',$curStamp)); |
$url->addQueryString ('m', date('n',$curStamp)); |
$url->addQueryString ('d', date('j',$curStamp)); |
$cur = $url->getUrl(); |
// Navigation |
$prevStamp = $month->prevMonth(true); |
$url->addQueryString ('y', date('Y',$prevStamp)); |
$url->addQueryString ('m', date('n',$prevStamp)); |
$url->addQueryString ('d', date('j',$prevStamp)); |
$prev = $url->getUrl(); |
$nextStamp = $month->nextMonth(true); |
$url->addQueryString ('y', date('Y',$nextStamp)); |
$url->addQueryString ('m', date('n',$nextStamp)); |
$url->addQueryString ('d', date('j',$nextStamp)); |
$next = $url->getUrl(); |
$fr_month=array("1"=>BAZ_JANVIER,"2"=>BAZ_FEVRIER,"3"=>BAZ_MARS,"4"=>BAZ_AVRIL,"5"=>BAZ_MAI,"6"=>BAZ_JUIN,"7"=>BAZ_JUILLET,"8"=>BAZ_AOUT,"9"=>BAZ_SEPTEMBRE,"10"=>BAZ_OCTOBRE,"11"=>BAZ_NOVEMBRE,"12"=>BAZ_DECEMBRE); |
$retour.= "<div class=\"navi\">"; |
$retour.= "<a href=\"".$prev."\"> << </a>"; |
$retour.= " "; |
$retour.= "<a href=\"".$cur; |
$retour.= "\"> "; |
$retour.= $fr_month[(date('n',$curStamp))]; |
$retour.= " "; |
$retour.= (date('Y',$curStamp)); |
$retour.= "</a>"; |
$retour.= " "; |
$retour.= "<a href=\"".$next."\"> >> </a>"; |
$retour.= "</div>"; |
$retour.="<br></br>"; |
// Vue Mois calendrier ou vue applette |
if ((!isset($_GET['id_fiche']) && ($type=='calendrier')) || ($type=='calendrier_applette')){ |
// Recherche evenement de la periode selectionnée |
// TODO : Selectionner element du mois en cours |
$requete_evenements = "SELECT DISTINCT bf_id_fiche, bf_titre, bf_lieu_evenement, day(bf_date_debut_evenement) as bf_jour_debut_evenement , bf_date_fin_evenement, bf_description FROM bazar_fiche, bazar_nature where year(bf_date_debut_evenement) =". |
date('Y',$curStamp)." and month(bf_date_debut_evenement)=". |
date('m',$curStamp)." and bf_ce_nature=bn_id_nature and bn_id_nature='".BAZ_NUM_ANNONCE_CALENDRIER."'"; |
$resultat_evenement = $db->query($requete_evenements); |
(DB::isError($resultat_evenement)) |
? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_evenement->getMessage(), $requete_evenements)) |
: ''; |
$calcom=""; |
$selection=array(); |
$evenements=array(); |
$prev_curday_ymd=0; |
while ($ligne_evenements = $resultat_evenement->fetchRow(DB_FETCHMODE_OBJECT)) { |
$curday_ymd=date('Ym',$curStamp).$ligne_evenements->bf_jour_debut_evenement; |
if ($curday_ymd!=$prev_curday_ymd) { |
$Day = new Calendar_Day(date('Y',$curStamp),date('m',$curStamp), $ligne_evenements->bf_jour_debut_evenement); |
$DiaryEvent = new DiaryEvent($Day); |
$prev_curday_ymd=$curday_ymd; |
} |
$DiaryEvent->setEntry($ligne_evenements); |
// Add the decorator to the selection |
$selection[] = $DiaryEvent; |
} |
// Affichage Calendrier |
$month->build($selection); |
if ($type=='calendrier') { |
$retour.= "<table class=\"calendar\"> |
<tr> |
<th> ". BAZ_LUNDI ."</th> |
<th> ". BAZ_MARDI ."</th> |
<th> ". BAZ_MERCREDI ."</th> |
<th> ". BAZ_JEUDI ."</th> |
<th> ". BAZ_VENDREDI ."</th> |
<th> ". BAZ_SAMEDI ."</th> |
<th> ". BAZ_DIMANCHE ."</th> |
</tr> |
"; |
} |
else { |
$retour.= "<table class=\"calendar\"> |
<tr> |
<th> ". BAZ_LUNDI_COURT ."</th> |
<th> ". BAZ_MARDI_COURT ."</th> |
<th> ". BAZ_MERCREDI_COURT ."</th> |
<th> ". BAZ_JEUDI_COURT ."</th> |
<th> ". BAZ_VENDREDI_COURT ."</th> |
<th> ". BAZ_SAMEDI_COURT ."</th> |
<th> ". BAZ_DIMANCHE_COURT ."</th> |
</tr> |
"; |
} |
$todayStamp=time(); |
$today_ymd=date('Ymd',$todayStamp); |
// Other month : mois |
// |
while ($day = $month->fetch() ) { |
$dayStamp = $day->thisDay(true); |
$day_ymd=date('Ymd',$dayStamp); |
if ( $day->isEmpty() ) { |
$class = "other_month"; |
} |
else { |
if (($day_ymd < $today_ymd)) { |
$class= "previous_month"; |
} |
else { |
if ($day_ymd == $today_ymd) { |
$class= "current_day"; |
} |
else { |
$class="current_month"; |
} |
} |
} |
$url->addQueryString ('y', date('Y',$dayStamp)); |
$url->addQueryString ('m', date('n',$dayStamp)); |
$url->addQueryString ('d', date('j',$dayStamp)); |
$link = $url->getUrl(); |
// isFirst() to find start of week |
if ($day->isFirst()) |
$retour.= ( "<tr>\n" ); |
//$retour.= ( "<td class=\"".$class."\"><a href=\"".$link."\">".$day->thisDay()."</a>\n" ); |
if ($type=='calendrier') { |
$retour.= "<td class=\"".$class."\">".$day->thisDay()."\n"; |
if ($day->isSelected() ) { |
$evenements=$day->getEntry(); |
while ($ligne_evenement=array_pop($evenements)) { |
$id_fiches=array(); |
$id_fiches[]=$ligne_evenement->bf_id_fiche; |
$url->addQueryString ('id_fiches',$id_fiches); |
$link = $url->getUrl(); |
$retour.= "<a href=\"".$link."\">".$ligne_evenement->bf_titre."</a>\n"; |
$url->removeQueryString ('id_fiches'); |
} |
} |
} |
else { |
$lien_date= "<td class=\"".$class."\">".$day->thisDay()."\n"; |
if ($day->isSelected() ) { |
$evenements=$day->getEntry(); |
$id_fiches=array(); |
while ($ligne_evenement=array_pop($evenements)) { |
$id_fiches[]=$ligne_evenement->bf_id_fiche; |
} |
$url->addQueryString ('id_fiches',$id_fiches); |
$link = $url->getUrl(); |
$lien_date= "<td class=\"".$class."\"><a href=\"".$link."\">".$day->thisDay()."</a>\n"; |
$url->removeQueryString ('id_fiches'); |
} |
$retour.=$lien_date; |
} |
$retour.= ( "</td>\n" ); |
// isLast() to find end of week |
if ( $day->isLast() ) |
$retour.= ( "</tr>\n" ); |
} |
$retour.= "</table>"; |
} |
// Vue detail |
if ((isset($_GET['id_fiches']))) { |
// Ajout des styles du bazar |
if (defined('PAP_VERSION')) { //si on est dans Papyrus |
GEN_stockerStyleExterne( 'bazar_interne', 'client/bazar/bazar.interne.css'); |
} |
// Ajout d'un titre pour la page avec la date |
$jours = array ('lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche') ; |
$mois = array ('janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', |
'octobre', 'novembre', 'décembre') ; |
$timestamp = strtotime ($_GET['y'].'/'.$_GET['m'].'/'.$_GET['d']) ; |
$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] = '<h1>'.$jours[date('w', $timestamp)]. |
' '.$_GET['d'].' '.$mois[$_GET['m']-1].' '.$_GET['y'].'</h1>' ; |
$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] .= baz_voir_fiches(0,$_GET['id_fiches'] ); |
} |
return $retour; |
} |
?> |
/tags/Racine_livraison_menes/bibliotheque/bazar.fonct.php |
---|
New file |
0,0 → 1,1458 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU Lesser General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | Lesser General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU Lesser General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: bazar.fonct.php,v 1.57 2006-10-05 08:53:50 florian Exp $ |
/** |
* |
* Fonctions du module bazar |
* |
* |
*@package bazar |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
*@author Florian Schmitt <florian@ecole-et-nature.org> |
//Autres auteurs : |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.57 $ $Date: 2006-10-05 08:53:50 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm.php' ; |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/checkbox.php' ; |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/textarea.php' ; |
require_once PAP_CHEMIN_API_PEAR.'HTML/Table.php' ; |
require_once 'bazar.fonct.formulaire.php'; |
require_once 'bazar.fonct.rss.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
/** niveau_droit() - Retourne le niveau de droit de l'utilisateur |
* |
* @param integer Id de la nature d'offre pour connaitre les droits sur une rubrique |
* @param integer Id de la personne (par défaut la personne loguée) |
* |
* @return string Retourne 'redacteur', 'administrateur', 'superadministrateur', ou 'aucun' |
*/ |
function niveau_droit($id_nature_offre='0', $personne) { |
$requete = 'select bd_niveau_droit FROM bazar_droits WHERE bd_id_utilisateur='.$personne. |
' AND (bd_id_nature_offre="'.$id_nature_offre.'" OR bd_id_nature_offre=0)'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query ($requete) ; |
if (DB::isError($resultat)) { |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows() != 0) { |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
if ($ligne['bd_niveau_droit']==0) return 'superadministrateur'; |
if ($ligne['bd_niveau_droit']==1) return 'redacteur'; |
if ($ligne['bd_niveau_droit']==2) return 'administrateur'; |
} |
} |
else return 'aucun'; |
} |
/** fiches_a_valider () - Renvoie les annonces restant à valider par un administrateur |
* |
* @return string HTML |
*/ |
function fiches_a_valider() { |
// Pour les administrateurs d'une rubrique, on affiche les fiches a valider de cette rubrique |
// On effectue une requete sur le bazar pour voir les fiches a administrer |
$res= '<h2>'.BAZ_ANNONCES_A_ADMINISTRER.'</h2><br />'."\n"; |
$requete = 'SELECT * FROM bazar_fiche, bazar_nature WHERE bf_statut_fiche=0 AND bn_id_nature=bf_ce_nature AND bn_ce_id_menu='.$GLOBALS['_BAZAR_']['categorie_nature'].' ORDER BY bf_date_maj_fiche DESC' ; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ('Echec de la requete<br />'.$resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows() != 0) { |
$tableAttr = array('id' => 'table_bazar') ; |
$table = new HTML_Table($tableAttr) ; |
$entete = array (BAZ_TITREANNONCE ,BAZ_ANNONCEUR, BAZ_TYPEANNONCE, BAZ_PUBLIER, BAZ_SUPPRIMER) ; |
$table->addRow($entete) ; |
$table->setRowType (0, 'th') ; |
// On affiche une ligne par proposition |
while ($ligne = $resultat->fetchRow (DB_FETCHMODE_ASSOC)) { |
//Requete pour trouver le nom et prénom de l'annonceur |
$requetenomprenom = 'SELECT '.BAZ_CHAMPS_PRENOM.', '.BAZ_CHAMPS_NOM.' FROM '.BAZ_ANNUAIRE. |
' WHERE '.BAZ_CHAMPS_ID.'='.$ligne['bf_ce_utilisateur'] ; |
$resultatnomprenom = $GLOBALS['_BAZAR_']['db']->query ($requetenomprenom) ; |
if (DB::isError($resultatnomprenom)) { |
echo ("Echec de la requete<br />".$resultatnomprenom->getMessage()."<br />".$resultatnomprenom->getDebugInfo()) ; |
} |
while ($lignenomprenom = $resultatnomprenom->fetchRow (DB_FETCHMODE_ASSOC)) { |
$annonceur=$lignenomprenom[BAZ_CHAMPS_PRENOM]." ".$lignenomprenom[BAZ_CHAMPS_NOM]; |
} |
$lien_voir=$GLOBALS['_BAZAR_']['url']; |
$lien_voir->addQueryString('action', BAZ_VOIR_FICHE); |
$lien_voir->addQueryString('id_fiche', $ligne['bf_id_fiche']); |
$lien_voir->addQueryString('typeannonce', $ligne['bn_id_nature']); |
$lien_publie_oui=$GLOBALS['_BAZAR_']['url']; |
$lien_publie_oui->addQueryString('action', BAZ_ACTION_PUBLIER); |
$lien_publie_oui->addQueryString('id_fiche', $ligne['bf_id_fiche']); |
$lien_publie_oui->addQueryString('typeannonce', $ligne['bn_id_nature']); |
$lien_publie_non=$GLOBALS['_BAZAR_']['url']; |
$lien_publie_non->addQueryString('action', BAZ_ACTION_PAS_PUBLIER); |
$lien_publie_non->addQueryString('id_fiche', $ligne['bf_id_fiche']); |
$lien_publie_non->addQueryString('typeannonce', $ligne['bn_id_nature']); |
$lien_supprimer=$GLOBALS['_BAZAR_']['url']; |
$lien_supprimer->addQueryString('action', BAZ_ACTION_SUPPRESSION); |
$lien_supprimer->addQueryString('id_fiche', $ligne['bf_id_fiche']); |
$lien_supprimer->addQueryString('typeannonce', $ligne['bn_id_nature']); |
$table->addRow (array( |
'<a href="'.$lien_voir->getURL().'">'.$ligne['bf_titre'].'</a>'."\n", // col 1 : le nom |
$annonceur."\n", // col 2 : annonceur |
constant($ligne['bn_label_nature'])."\n", // col 3 : type annonce |
"<a href=\"".$lien_publie_oui->getURL()."\">".BAZ_OUI."</a> / \n". |
"<a href=\"".$lien_publie_non->getURL()."\">".BAZ_NON."</a>", // col 4 : publier ou pas |
"<a href=\"".$lien_supprimer->getURL()."\"". |
" onclick=\"javascript:return confirm('".BAZ_CONFIRMATION_SUPPRESSION."');\">".BAZ_SUPPRIMER."</a>\n")) ; // col 5 : supprimer |
} |
$table->altRowAttributes(1, array("class" => "ligne_impaire"), array("class" => "ligne_paire")); |
$table->updateColAttributes(1, array("align" => "center")); |
$table->updateColAttributes(2, array("align" => "center")); |
$table->updateColAttributes(3, array("align" => "center")); |
$table->updateColAttributes(4, array("align" => "center")); |
$res .= $table->toHTML() ; |
} |
else { |
$res .= '<p class="zone_info">'.BAZ_PAS_DE_FICHE_A_VALIDER.'</p>'."\n" ; |
} |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES); |
$res .= '<br /><ul style="clear:both;"><li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'" title="'.BAZ_CONSULTER_FICHES_VALIDEES.'">'.BAZ_CONSULTER_FICHES_VALIDEES.'</a></li></ul>'; |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action'); |
return $res; |
} |
/** mes_fiches () - Renvoie les fiches bazar d'un utilisateur |
* |
* @return string HTML |
*/ |
function mes_fiches() { |
$res= '<h2>'.BAZ_VOS_ANNONCES.'</h2><br />'."\n"; |
if ($GLOBALS['AUTH']->getAuth()) { |
// requete pour voir si l'utilisateur a des fiches a son nom, classees par date de MAJ et nature d'annonce |
$requete = 'SELECT * FROM bazar_fiche, bazar_nature WHERE bf_ce_utilisateur='. $GLOBALS['id_user']. |
' AND bn_id_nature=bf_ce_nature AND bn_ce_id_menu='.$GLOBALS['_BAZAR_']['categorie_nature'].' ORDER BY bf_date_maj_fiche DESC,bf_ce_nature ASC'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ('Echec de la requete<br />'.$resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows() != 0) { |
$tableAttr = array('id' => 'table_bazar') ; |
$table = new HTML_Table($tableAttr) ; |
$entete = array (BAZ_TITREANNONCE , BAZ_TYPEANNONCE, BAZ_ETATPUBLICATION, BAZ_MODIFIER, BAZ_SUPPRIMER) ; |
$table->addRow($entete) ; |
$table->setRowType (0, "th") ; |
// On affiche une ligne par proposition |
while ($ligne = $resultat->fetchRow (DB_FETCHMODE_ASSOC)) { |
if ($ligne['bf_statut_fiche']==1) $publiee=BAZ_PUBLIEE; |
elseif ($ligne['bf_statut_fiche']==0) $publiee=BAZ_ENCOURSDEVALIDATION; |
else $publiee=BAZ_REJETEE; |
$lien_voir=$GLOBALS['_BAZAR_']['url']; |
$lien_voir->addQueryString('action', BAZ_VOIR_FICHE); |
$lien_voir->addQueryString('id_fiche', $ligne['bf_id_fiche']); |
$lien_voir->addQueryString('typeannonce', $ligne['bn_id_nature']); |
$lien_voir_url=$lien_voir->getURL(); |
$lien_modifier=$GLOBALS['_BAZAR_']['url']; |
$lien_modifier->addQueryString('action', BAZ_ACTION_MODIFIER); |
$lien_modifier->addQueryString('id_fiche', $ligne['bf_id_fiche']); |
$lien_modifier->addQueryString('typeannonce', $ligne['bn_id_nature']); |
$lien_modifier_url=$lien_modifier->getURL(); |
$lien_supprimer=$GLOBALS['_BAZAR_']['url']; |
$lien_supprimer->addQueryString('action', BAZ_ACTION_SUPPRESSION); |
$lien_supprimer->addQueryString('id_fiche', $ligne['bf_id_fiche']); |
$lien_supprimer->addQueryString('typeannonce', $ligne['bn_id_nature']); |
$lien_supprimer_url=$lien_supprimer->getURL(); |
$table->addRow (array( |
'<a href="'.$lien_voir_url.'">'.$ligne['bf_titre'].'</a>'."\n", // col 1 : le nom |
$ligne['bn_label_nature']."\n", // col 2: type annonce |
$publiee."\n", // col 3 : publiee ou non |
'<a href="'.$lien_modifier_url.'">'.BAZ_MODIFIER.'</a>'."\n", // col 4 : modifier |
'<a href="'.$lien_supprimer_url.'" onclick="javascript:return '. |
'confirm(\''.BAZ_CONFIRMATION_SUPPRESSION.'\');" >'.BAZ_SUPPRIMER.'</a>'."\n")) ; // col 5 : supprimer |
} |
$table->altRowAttributes(1, array("class" => "ligne_impaire"), array("class" => "ligne_paire")); |
$table->updateColAttributes(1, array("align" => "left")); |
$table->updateColAttributes(2, array("align" => "center")); |
$table->updateColAttributes(3, array("align" => "center")); |
$table->updateColAttributes(4, array("align" => "center")); |
$res .= $table->toHTML() ; |
} |
else { |
$res .= '<p class="zone_info">'.BAZ_PAS_DE_FICHE.'</p>'."\n" ; |
} |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_DEPOSER_ANNONCE); |
$res .= '<br /><ul><li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'" title="'.BAZ_SAISIR_UNE_NOUVELLE_FICHE.'">'.BAZ_SAISIR_UNE_NOUVELLE_FICHE.'</a></li></ul>'; |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action'); |
} |
else { |
$res .= '<p class="zone_info">'.BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR.'</p>'."\n" ; |
$res .= '<form id="form_connexion" style="clear:both;" class="form_identification" action="' ; |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_VOIR_VOS_ANNONCES); |
$res .= $GLOBALS['_BAZAR_']['url']->getURL(); |
$res .= '" method="post"> |
<fieldset> |
<legend>Identifiez vous</legend> |
<label for="username">Courriel : </label> |
<input type="text" id="username" name="username" maxlength="80" tabindex="1" value="courriel" /> |
<label for="password">Mot de passe : </label> |
<input type="password" id="password" name="password" maxlength="80" tabindex="2" value="mot de passe" /> |
<input type="submit" id="connexion" name="connexion" tabindex="3" value="ok" /> |
</fieldset> |
</form>'; |
} |
return $res; |
} |
/** baz_gestion_droits() interface de gestion des droits |
* |
* return string le code HTML |
*/ |
function baz_gestion_droits() { |
$lien_formulaire=$GLOBALS['_BAZAR_']['url']; |
$lien_formulaire->addQueryString('action', BAZ_GERER_DROITS); |
//contruction du squelette du formulaire |
$formtemplate = new HTML_QuickForm('formulaire', 'post', preg_replace ('/&/', '&', $lien_formulaire->getURL()) ); |
$squelette =& $formtemplate->defaultRenderer(); |
$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'<table style="border:0;">'."\n".'{content}'."\n".'</table>'."\n".'</form>'."\n"); |
$squelette->setElementTemplate( '<tr>'."\n".'<td style="font-size:12px;width:150px;text-align:right;">'."\n".'{label} :</td>'."\n".'<td style="text-align:left;padding:5px;"> '."\n".'{element}'."\n". |
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n". |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n". |
'</td>'."\n".'</tr>'."\n"); |
$squelette->setElementTemplate( '<tr>'."\n".'<td colspan="2" class="liste_a_cocher"><strong>{label} {element}</strong>'."\n". |
'<!-- BEGIN required --><span class="symbole_obligatoire"> *</span><!-- END required -->'."\n".'</td>'."\n".'</tr>'."\n", 'accept_condition'); |
$squelette->setElementTemplate( '<tr><td colspan="2" class="bouton">{label}{element}</td></tr>'."\n", 'valider'); |
$squelette->setRequiredNoteTemplate("\n".'<tr>'."\n".'<td colspan="2" class="symbole_obligatoire">* {requiredNote}</td></tr>'."\n"); |
//Traduction de champs requis |
$formtemplate->setRequiredNote(BAZ_CHAMPS_REQUIS) ; |
$formtemplate->setJsWarnings(BAZ_ERREUR_SAISIE,BAZ_VEUILLEZ_CORRIGER); |
//Initialisation de la variable personne |
if ( isset($_POST['personnes']) ) { |
$personne=$_POST['personnes']; |
} |
else $personne=0; |
//Cas ou les droits ont etes changes |
if (isset($_GET['pers'])) { |
$personne=$_GET['pers']; |
//CAS DES DROITS POUR UN TYPE D'ANNONCE: On efface tous les droits de la personne pour ce type d'annonce |
if (isset($_GET['idtypeannonce'])) { |
$requete = 'DELETE FROM bazar_droits WHERE bd_id_utilisateur='.$_GET['pers']. |
' AND bd_id_nature_offre='.$_GET['idtypeannonce']; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
} |
//CAS DU SUPER ADMIN: On efface tous les droits de la personne en general |
else { |
$requete = 'DELETE FROM bazar_droits WHERE bd_id_utilisateur='.$_GET['pers']; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
} |
if ($_GET['droits']=='superadmin') { |
$requete = 'INSERT INTO bazar_droits VALUES ('.$_GET['pers'].',0,0)'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
} |
elseif ($_GET['droits']=='redacteur') { |
$requete = 'INSERT INTO bazar_droits VALUES ('.$_GET['pers'].','.$_GET['idtypeannonce'].',1)'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
} |
elseif ($_GET['droits']=='admin') { |
$requete = 'INSERT INTO bazar_droits VALUES ('.$_GET['pers'].','.$_GET['idtypeannonce'].',2)'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
} |
} |
//requete pour obtenir l'id, le nom et prenom des personnes inscrites a l'annuaire sauf soi meme |
$requete = 'SELECT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '.BAZ_ANNUAIRE. |
' WHERE '.BAZ_CHAMPS_ID."!=".$GLOBALS['id_user'].' ORDER BY '.BAZ_CHAMPS_NOM.' ASC'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
echo ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
$res='<h2>'.BAZ_GESTION_DES_DROITS.'</h2><br />'."\n"; |
$res.=BAZ_DESCRIPTION_GESTION_DES_DROITS.'<br /><br />'."\n"; |
$personnes_select[0]=BAZ_SELECTION; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$personnes_select[$ligne[BAZ_CHAMPS_ID]] = $ligne[BAZ_CHAMPS_NOM]." ".$ligne[BAZ_CHAMPS_PRENOM] ; |
} |
$java=array ('style'=>'width:250px;','onchange'=>'this.form.submit();'); |
$formtemplate->addElement ('select', 'personnes', BAZ_LABEL_CHOIX_PERSONNE, $personnes_select, $java) ; |
$defauts=array ('personnes'=>$personne); |
$formtemplate->setDefaults($defauts); |
$res.= $formtemplate->toHTML().'<br />'."\n" ; |
if ($personne!=0) { |
//cas du super utilisateur |
$utilisateur = new Utilisateur_bazar($personne) ; |
if ($utilisateur->isSuperAdmin()) { |
$res.= '<br />'.BAZ_EST_SUPERADMINISTRATEUR.'<br /><br />'."\n"; |
$lien_enlever_superadmin=$GLOBALS['_BAZAR_']['url']; |
$lien_enlever_superadmin->addQueryString('action', BAZ_GERER_DROITS); |
$lien_enlever_superadmin->addQueryString('pers', $personne); |
$lien_enlever_superadmin->addQueryString('droits', 'aucun'); |
$res.= '<a href='.$lien_enlever_superadmin->getURL().'>'.BAZ_CHANGER_SUPERADMINISTRATEUR.'</a><br />'."\n"; |
} |
else { |
$lien_passer_superadmin=$GLOBALS['_BAZAR_']['url']; |
$lien_passer_superadmin->addQueryString('action', BAZ_GERER_DROITS); |
$lien_passer_superadmin->addQueryString('pers', $personne); |
$lien_passer_superadmin->addQueryString('droits', 'superadmin'); |
$res.= '<a href='.$lien_passer_superadmin->getURL().'>'.BAZ_PASSER_SUPERADMINISTRATEUR.'</a><br />'."\n"; |
//on cherche les differentes rubriques d'annonces |
$requete = 'SELECT bn_id_nature, bn_label_nature, bn_image_titre FROM bazar_nature'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
$res.='<br /><b>'.BAZ_DROITS_PAR_TYPE.'</b><br /><br />'; |
$table = new HTML_Table(array ('width' => '100%', 'class' => 'table_bazar')) ; |
$table->addRow(array ('<strong>'.BAZ_TYPE_ANNONCES.'</strong>', |
'<strong>'.BAZ_DROITS_ACTUELS.'</strong>', |
'<strong>'.BAZ_PASSER_EN.'</strong>', |
'<strong>'.BAZ_OU_PASSER_EN.'</strong>')) ; |
$table->setRowType (0, 'th') ; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$droits=niveau_droit($ligne['bn_id_nature'],$personne); |
$lien_aucun_droit=$GLOBALS['_BAZAR_']['url']; |
$lien_aucun_droit->addQueryString('action', BAZ_GERER_DROITS); |
$lien_aucun_droit->addQueryString('pers', $personne); |
$lien_aucun_droit->addQueryString('droits', 'aucun'); |
$lien_aucun_droit->addQueryString('idtypeannonce', $ligne["bn_id_nature"]); |
$lien_passer_redacteur=$GLOBALS['_BAZAR_']['url']; |
$lien_passer_redacteur->addQueryString('action', BAZ_GERER_DROITS); |
$lien_passer_redacteur->addQueryString('pers', $personne); |
$lien_passer_redacteur->addQueryString('droits', 'redacteur'); |
$lien_passer_redacteur->addQueryString('idtypeannonce', $ligne["bn_id_nature"]); |
$lien_passer_admin=$GLOBALS['_BAZAR_']['url']; |
$lien_passer_admin->addQueryString('action', BAZ_GERER_DROITS); |
$lien_passer_admin->addQueryString('pers', $personne); |
$lien_passer_admin->addQueryString('droits', 'admin'); |
$lien_passer_admin->addQueryString('idtypeannonce', $ligne["bn_id_nature"]); |
if (isset($ligne['bn_image_titre'])) { |
$titre=' <img src="client/bazar/images/'.$ligne['bn_image_titre'].'" alt="'.$ligne['bn_label_nature'].'" />'."\n"; |
} else { |
$titre='<strong> '.$ligne['bn_label_nature'].'</strong>'."\n"; |
} |
if ($utilisateur->isAdmin($ligne['bn_id_nature'])) { |
$table->addRow(array($titre, |
BAZ_DROIT_ADMIN, |
'<a href='.$lien_aucun_droit->getURL().'>'.BAZ_AUCUN_DROIT.'</a>', |
'<a href='.$lien_passer_redacteur->getURL().'>'.BAZ_DROIT_REDACTEUR.'</a>')); |
} |
elseif ($utilisateur->isRedacteur($ligne['bn_id_nature'])) { |
$table->addRow(array($titre, |
BAZ_DROIT_REDACTEUR, |
'<a href='.$lien_aucun_droit->getURL().'>'.BAZ_AUCUN_DROIT.'</a>', |
'<a href='.$lien_passer_admin->getURL().'>'.BAZ_DROIT_ADMIN.'</a>')); |
} |
else { |
$table->addRow(array($titre, |
BAZ_AUCUN_DROIT, |
'<a href='.$lien_passer_redacteur->getURL().'>'.BAZ_DROIT_REDACTEUR.'</a>', |
'<a href='.$lien_passer_admin->getURL().'>'.BAZ_DROIT_ADMIN.'</a>')); |
} |
} |
$table->altRowAttributes(1, array('class' => 'ligne_impaire'), array('class' => 'ligne_paire')); |
$table->updateColAttributes(0, array('align' => 'left')); |
$table->updateColAttributes(1, array('align' => 'left')); |
$table->updateColAttributes(2, array('align' => 'left')); |
$table->updateColAttributes(3, array('align' => 'left')); |
$res.=$table->toHTML() ; |
} |
} |
return $res; |
} |
/** baz_formulaire() - Renvoie le menu pour les saisies et modification des annonces |
* |
* @param string choix du formulaire a afficher (soit formulaire personnalise de |
* l'annonce, soit choix du type d'annonce) |
* |
* @return string HTML |
*/ |
function baz_formulaire($mode) { |
$res = ''; |
if ($GLOBALS['AUTH']->getAuth()) { |
$lien_formulaire=$GLOBALS['_BAZAR_']['url']; |
//Definir le lien du formulaire en fonction du mode de formulaire choisi |
if ($mode == BAZ_DEPOSER_ANNONCE) { |
$lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU); |
if (isset($GLOBALS['_BAZAR_']['id_typeannonce']) && $GLOBALS['_BAZAR_']['id_typeannonce'] != 'toutes') { |
$mode = BAZ_ACTION_NOUVEAU ; |
} |
} |
if ($mode == BAZ_ACTION_NOUVEAU) { |
if ((!isset($_POST['accept_condition']))and($GLOBALS['_BAZAR_']['condition']!=NULL)) { |
$lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU); |
} else { |
$lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU_V); |
} |
} |
if ($mode == BAZ_ACTION_MODIFIER) { |
if (!isset($_POST['accept_condition'])and($GLOBALS['_BAZAR_']['condition']!=NULL)) { |
$lien_formulaire->addQueryString('action', BAZ_ACTION_MODIFIER); |
} else { |
$lien_formulaire->addQueryString('action', BAZ_ACTION_MODIFIER_V); |
} |
$lien_formulaire->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
} |
if ($mode == BAZ_ACTION_MODIFIER_V) { |
$lien_formulaire->addQueryString('action', BAZ_ACTION_MODIFIER_V); |
$lien_formulaire->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
} |
//contruction du squelette du formulaire |
$formtemplate = new HTML_QuickForm('formulaire', 'post', preg_replace ('/&/', '&', $lien_formulaire->getURL()) ); |
$squelette =& $formtemplate->defaultRenderer(); |
$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'<table style="border:0;width:100%;">'."\n".'{content}'."\n".'</table>'."\n".'</form>'."\n"); |
$squelette->setElementTemplate( '<tr>'."\n".'<td style="font-size:12px;width:120px;text-align:right;">'."\n".'{label}'. |
'<!-- BEGIN required --><span class="symbole_obligatoire"> *</span><!-- END required -->'."\n". |
' :</td>'."\n".'<td style="text-align:left;padding:5px;"> '."\n".'{element}'."\n". |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n". |
'</td>'."\n".'</tr>'."\n"); |
$squelette->setElementTemplate( '<tr>'."\n".'<td colspan="2" class="liste_a_cocher"><strong>{label} {element}</strong>'."\n". |
'<!-- BEGIN required --><span class="symbole_obligatoire"> *</span><!-- END required -->'."\n".'</td>'."\n".'</tr>'."\n", 'accept_condition'); |
$squelette->setElementTemplate( '<tr><td colspan="2" class="bouton">{label}{element}</td></tr>'."\n", 'valider'); |
$squelette->setRequiredNoteTemplate("\n".'<tr>'."\n".'<td colspan="2" class="symbole_obligatoire">* {requiredNote}</td></tr>'."\n"); |
//Traduction de champs requis |
$formtemplate->setRequiredNote(BAZ_CHAMPS_REQUIS) ; |
$formtemplate->setJsWarnings(BAZ_ERREUR_SAISIE,BAZ_VEUILLEZ_CORRIGER); |
//------------------------------------------------------------------------------------------------ |
//AFFICHAGE DU FORMULAIRE GENERAL DE CHOIX DU TYPE D'ANNONCE |
//------------------------------------------------------------------------------------------------ |
if ($mode == BAZ_DEPOSER_ANNONCE) { |
$res = ''; |
//requete pour obtenir le nom et la description des types d'annonce |
$requete = 'SELECT * FROM bazar_nature WHERE bn_ce_id_menu='.$GLOBALS['_BAZAR_']['categorie_nature'].' ORDER BY bn_label_nature ASC'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
$res.='<h2>'.BAZ_DEPOSE_UNE_NOUVELLE_ANNONCE.'</h2>'."\n"; |
if ($resultat->numRows()==1) { |
$ligne = $resultat->fetchRow (DB_FETCHMODE_ASSOC); |
$GLOBALS['_BAZAR_']['id_typeannonce']=$ligne['bn_id_nature']; |
$GLOBALS['_BAZAR_']['typeannonce']=$ligne['bn_label_nature']; |
$GLOBALS['_BAZAR_']['condition']=$ligne['bn_condition']; |
$GLOBALS['_BAZAR_']['template']=$ligne['bn_template']; |
$GLOBALS['_BAZAR_']['commentaire']=$ligne['bn_commentaire']; |
$GLOBALS['_BAZAR_']['appropriation']=$ligne['bn_appropriation']; |
$GLOBALS['_BAZAR_']['image_titre']=$ligne['bn_image_titre']; |
$GLOBALS['_BAZAR_']['image_logo']=$ligne['bn_image_logo']; |
$mode = BAZ_ACTION_NOUVEAU; |
$lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU_V); |
} else { |
$res.='<br />'.BAZ_CHOIX_TYPEANNONCE.'<br /><br />'."\n"; |
while ($ligne = $resultat->fetchRow (DB_FETCHMODE_ASSOC)) { |
$droitspers=niveau_droit($ligne["bn_id_nature"],$GLOBALS["id_user"]); |
if (($droitspers=='redacteur') or ($droitspers=='administrateur') |
or ($droitspers=='superadministrateur' or !BAZ_RESTREINDRE_DEPOT)) { |
if ($ligne['bn_image_titre']!='') { |
$titre=' <img src="client/bazar/images/'.$ligne['bn_image_titre'].'" alt="'. |
$ligne['bn_label_nature'].'" />'.'<br />'."\n"; |
} else { |
$titre='<h3>'.$ligne['bn_label_nature'].' : </h3>'."\n"; |
} |
$formtemplate->addElement('radio', 'typeannonce', '', |
$titre.$ligne['bn_description'].'<br /><br />'."\n", |
$ligne['bn_id_nature'], array("id" => 'select'.$ligne['bn_id_nature'], |
"style" => 'float:left;')); |
} |
} |
$squelette->setElementTemplate( '<div class="listechoix">'."\n".'{element}'."\n".'</div>'."\n"); |
//Mettre les annonces en choix par defaut |
$formtemplate->setdefaults(array('typeannonce'=>'1')); |
//Bouton de validation du formulaire |
$formtemplate->addElement('submit', 'valider', BAZ_VALIDER); |
//Affichage a l'ecran |
$res.= $formtemplate->toHTML()."\n".'<br />'."\n".mes_fiches(); ; |
} |
} |
//------------------------------------------------------------------------------------------------ |
//AFFICHAGE DU FORMULAIRE CORRESPONDANT AU TYPE DE L'ANNONCE CHOISI PAR L'UTILISATEUR |
//------------------------------------------------------------------------------------------------ |
if ($mode == BAZ_ACTION_NOUVEAU) { |
unset ($_SESSION['formulaire_annonce_valide']) ; |
$lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU_V); |
$formtemplate->updateAttributes(array('action' => str_replace('&', '&', $lien_formulaire->getURL()))); |
$res = baz_afficher_formulaire_annonce('insertion',$formtemplate); |
} |
//------------------------------------------------------------------------------------------------ |
//CAS DE LA MODIFICATION D'UNE ANNONCE (FORMULAIRE DE MODIFICATION) |
//------------------------------------------------------------------------------------------------ |
if ($mode == BAZ_ACTION_MODIFIER) { |
$res=baz_afficher_formulaire_annonce('modification',$formtemplate); |
} |
//------------------------------------------------------------------------------------------------ |
//CAS DE L'INSCRIPTION D'UNE ANNONCE |
//------------------------------------------------------------------------------------------------ |
if ($mode == BAZ_ACTION_NOUVEAU_V) { |
if ($formtemplate->validate() && !isset($_SESSION['formulaire_annonce_valide'])) { |
$formtemplate->process('baz_insertion', false) ; |
$_SESSION['formulaire_annonce_valide'] = 1; |
return; |
} |
} |
//------------------------------------------------------------------------------------------------ |
//CAS DE LA MODIFICATION D'UNE ANNONCE (VALIDATION ET MAJ) |
//------------------------------------------------------------------------------------------------ |
if ($mode == BAZ_ACTION_MODIFIER_V) { |
if ($formtemplate->validate()) { |
$formtemplate->process('baz_mise_a_jour', false) ; |
return ; |
} |
} |
} |
else { |
$res .= '<h2>'.BAZ_DEPOSE_UNE_NOUVELLE_ANNONCE.'</h2><br />'."\n"; |
$res .= '<p class="zone_info">'.BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR.'</p>'."\n" ; |
$res .= '<form id="form_connexion" style="clear:both;" class="form_identification" action="' ; |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_DEPOSER_ANNONCE); |
$res .= $GLOBALS['_BAZAR_']['url']->getURL(); |
$res .= '" method="post"> |
<fieldset> |
<legend>Identifiez vous</legend> |
<label for="username">Courriel : </label> |
<input type="text" id="username" name="username" maxlength="80" tabindex="1" value="courriel" /> |
<label for="password">Mot de passe : </label> |
<input type="password" id="password" name="password" maxlength="80" tabindex="2" value="mot de passe" /> |
<input type="submit" id="connexion" name="connexion" tabindex="3" value="ok" /> |
</fieldset> |
</form>'; |
} |
return $res; |
} |
/** baz_afficher_formulaire_annonce() - Genere le formulaire de saisie d'une annonce |
* |
* @param string type de formulaire: insertion ou modification |
* @param mixed objet quickform du formulaire |
* |
* @return string code HTML avec formulaire |
*/ |
function baz_afficher_formulaire_annonce($mode='insertion',$formtemplate) { |
if ($mode=='modification') { |
//initialisation de la variable globale id_fiche |
$GLOBALS['_BAZAR_']['id_fiche'] = $_REQUEST['id_fiche']; |
//suppression eventuelle d'une url, d'un fichier ou d'une image |
if (isset($_GET['id_url'])) { |
baz_suppression_url($_GET['id_url']); |
} |
if (isset($_GET['id_fichier'])) { |
baz_suppression_fichier($_GET['id_fichier']); |
} |
if (isset($_GET['image'])) { |
baz_suppression_image($GLOBALS['_BAZAR_']['id_fiche']); |
} |
} |
//titre de la rubrique |
$res= '<h2>'.BAZ_TITRE_SAISIE_ANNONCE.' '.$GLOBALS['_BAZAR_']['typeannonce'].'</h2><br />'."\n"; |
if (($GLOBALS['_BAZAR_']['condition']!='')AND(!isset($_POST['accept_condition']))AND(!isset($_GET['url'])OR(!isset($_GET['fichier']))OR(!isset($_GET['image'])))) { |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/html.php'; |
$conditions= new HTML_QuickForm_html('<tr><td colspan="2" style="padding:5px; margin:5px; width: 90%; background: #C1CBA7;">'.$GLOBALS['_BAZAR_']['condition'].'</td>'."\n".'</tr>'."\n"); |
$formtemplate->addElement($conditions); |
$formtemplate->addElement('checkbox', 'accept_condition',BAZ_ACCEPTE_CONDITIONS) ; |
$formtemplate->addElement('hidden', 'typeannonce', $GLOBALS['_BAZAR_']['id_typeannonce']); |
$formtemplate->addRule('accept_condition', BAZ_ACCEPTE_CONDITIONS_REQUIS, 'required', '', 'client') ; |
$formtemplate->addElement('submit', 'valider', BAZ_VALIDER); |
} |
//affichage du formulaire si conditions acceptees |
else { |
//Parcours du fichier de templates, pour mettre les valeurs des champs |
$tableau=baz_valeurs_template($GLOBALS['_BAZAR_']['template']); |
if ($mode=='modification') { |
//Ajout des valeurs par defaut |
$valeurs_par_defaut = baz_valeurs_fiche($GLOBALS['_BAZAR_']['id_fiche']) ; |
for ($i=0; $i<count($tableau); $i++) { |
if ( $tableau[$i]['type']=='liste' || $tableau[$i]['type']=='checkbox' ) { |
$def=$tableau[$i]['type'].$tableau[$i]['nom_bdd']; |
} |
elseif ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' || $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ) { |
$def=$tableau[$i]['nom_bdd']; |
} |
$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'], |
$tableau[$i]['limite2'], $valeurs_par_defaut[$def], $tableau[$i]['table_source'], $tableau[$i]['obligatoire']) ; |
} |
} |
else { |
for ($i=0; $i<count($tableau); $i++) { |
$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'], |
$tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire']) ; |
} |
} |
$formtemplate->addElement('hidden', 'typeannonce', $GLOBALS['_BAZAR_']['id_typeannonce']); |
$formtemplate->addElement('submit', 'valider', BAZ_VALIDER); |
} |
//Affichage a l'ecran |
$res .= $formtemplate->toHTML()."\n"; |
return $res; |
} |
/** requete_bazar_fiche() - preparer la requete d'insertion ou de MAJ de la table bazar_fiche à partir du fichier de template |
* |
* @global mixed L'objet contenant les valeurs issues de la saisie du formulaire |
* @return void |
*/ |
function requete_bazar_fiche($valeur) { |
$requete=NULL; |
//l'annonce est directement publiée pour les admins |
if ((niveau_droit($GLOBALS['_BAZAR_']['id_typeannonce'],$GLOBALS['id_user'])=='administrateur') or |
(niveau_droit($GLOBALS['_BAZAR_']['id_typeannonce'],$GLOBALS['id_user'])=='superadministrateur')) { |
$requete.='bf_statut_fiche=1, '; |
} |
else { |
$requete.='bf_statut_fiche="'.BAZ_ETAT_VALIDATION.'", '; |
} |
$tableau=baz_valeurs_template($GLOBALS['_BAZAR_']['template']); |
for ($i=0; $i<count($tableau); $i++) { |
//cas des checkbox et des listes |
if ($tableau[$i]['type']=='checkbox' || $tableau[$i]['type']=='liste') { |
//on supprime les anciennes valeurs de la table bazar_fiche_valeur_liste |
$requetesuppression='DELETE FROM bazar_fiche_valeur_liste WHERE bfvl_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' AND bfvl_ce_liste='.$tableau[$i]['nom_bdd']; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requetesuppression) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
if (isset($valeur[$tableau[$i]['type'].$tableau[$i]['nom_bdd']]) && ($valeur[$tableau[$i]['type'].$tableau[$i]['nom_bdd']]!=0)) { |
//on insere les nouvelles valeurs |
$requeteinsertion='INSERT INTO bazar_fiche_valeur_liste (bfvl_ce_fiche, bfvl_ce_liste, bfvl_valeur) VALUES '; |
//pour les checkbox, les différentes valeurs sont dans un tableau |
if (is_array($valeur[$tableau[$i]['type'].$tableau[$i]['nom_bdd']])) { |
$nb=0; |
while (list($cle, $val) = each($valeur[$tableau[$i]['type'].$tableau[$i]['nom_bdd']])) { |
if ($nb>0) $requeteinsertion .= ', '; |
$requeteinsertion .= '('.$GLOBALS['_BAZAR_']['id_fiche'].', '.$tableau[$i]['nom_bdd'].', '.$cle.') '; |
$nb++; |
} |
} |
//pour les listes, une insertion de la valeur suffit |
else { |
$requeteinsertion .= '('.$GLOBALS['_BAZAR_']['id_fiche'].', '.$tableau[$i]['nom_bdd'].', '.$valeur[$tableau[$i]['type'].$tableau[$i]['nom_bdd']].')'; |
} |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requeteinsertion) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
} |
} |
//cas des fichiers |
elseif ($tableau[$i]['type']=='fichier') { |
if (isset($valeur['texte_fichier'.$tableau[$i]['nom_bdd']]) && $valeur['texte_fichier'.$tableau[$i]['nom_bdd']]!='') { |
baz_insertion_fichier($valeur['texte_fichier'.$tableau[$i]['nom_bdd']], $GLOBALS['_BAZAR_']['id_fiche'], 'fichier'.$tableau[$i]['nom_bdd']); |
} |
} |
//cas des urls |
elseif ($tableau[$i]['type']=='url') { |
if (isset($valeur['url_lien'.$tableau[$i]['nom_bdd']]) && $valeur['url_lien'.$tableau[$i]['nom_bdd']]!='' ) { |
baz_insertion_url($valeur['url_lien'.$tableau[$i]['nom_bdd']], $valeur['url_texte'.$tableau[$i]['nom_bdd']], $GLOBALS['_BAZAR_']['id_fiche']); |
} |
} |
//cas des images |
elseif ($tableau[$i]['type']=='image') { |
if (isset($_FILES['image']['name']) && $_FILES['image']['name']!='') { |
$requete .= baz_insertion_image($GLOBALS['_BAZAR_']['id_fiche']); |
} |
} |
//cas des dates |
elseif ( $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ) { |
$val=$valeur[$tableau[$i]['nom_bdd']]['Y'].'-'.$valeur[$tableau[$i]['nom_bdd']]['m'].'-'.$valeur[$tableau[$i]['nom_bdd']]['d'] ; |
$requete .= $tableau[$i]['nom_bdd'].'="'.$val.'", ' ; |
} |
//cas des champs texte |
elseif ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' ) { |
//on mets les slashes pour les saisies dans les champs texte et textearea |
$val=addslashes($valeur[$tableau[$i]['nom_bdd']]) ; |
$requete .= $tableau[$i]['nom_bdd'].'="'.$val.'", ' ; |
} |
//cas des wikinis |
elseif ( $tableau[$i]['type']=='wikini' && $_REQUEST['action']==BAZ_ACTION_NOUVEAU_V ) { |
//on appelle les pages des apis et de l'integrateur wikini |
include_once PAP_CHEMIN_RACINE.'api/sql/SQL_manipulation.fonct.php'; |
include_once PAP_CHEMIN_RACINE.'client/integrateur_wikini/configuration/adwi_configuration.inc.php' ; |
include_once PAP_CHEMIN_RACINE.'client/integrateur_wikini/bibliotheque/adwi_wikini.fonct.php' ; |
//génération du titre du wiki, sous la forme id-titre du projet |
$titre=baz_titre_wiki($valeur["bf_titre"]); |
//création du wiki |
$valeur=array ("action"=> "nouveau_v", "code_alpha_wikini"=>$titre, "page"=>"AccueiL", "bdd_hote"=> "", |
"bdd_nom"=> "", "bdd_utilisateur"=> "", "bdd_mdp" => "", "table_prefix"=> "", "chemin" => "wikini/".$titre, "valider"=> "Valider"); |
$val = insertion($valeur, $GLOBALS['_BAZAR_']['db']); |
} |
} |
$requete.=' bf_date_maj_fiche=NOW()'; |
return $requete; |
} |
/** baz_insertion() - inserer une nouvelle fiche |
* |
* @array Le tableau des valeurs a inserer |
* @integer Valeur de l'identifiant de la fiche |
* @return void |
*/ |
function baz_insertion($valeur) { |
// =========== Insertion d'une nouvelle fiche =================== |
//requete d'insertion dans bazar_fiche |
$GLOBALS['_BAZAR_']['id_fiche'] = baz_nextid('bazar_fiche', 'bf_id_fiche', $GLOBALS['_BAZAR_']['db']) ; |
$requete = 'INSERT INTO bazar_fiche SET bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].','. |
'bf_ce_utilisateur='.$GLOBALS['id_user'].', bf_ce_nature='.$GLOBALS['_BAZAR_']['id_typeannonce'].','. |
'bf_date_creation_fiche=NOW(),'; |
if ($GLOBALS['_BAZAR_']['appropriation']== 1) { |
$requete .= 'bf_date_debut_validite_fiche=now(), ' ; |
} |
$requete .=requete_bazar_fiche(&$valeur) ; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
return; |
} |
/** baz_insertion_url() - inserer un lien URL a une fiche |
* |
* @global string L'url du lien |
* @global string Le texte du lien |
* @global integer L'identifiant de la fiche |
* @return void |
*/ |
function baz_insertion_url($url_lien, $url_texte, $idfiche) { |
//requete d'insertion dans bazar_url |
$id_url = baz_nextId('bazar_url', 'bu_id_url', $GLOBALS['_BAZAR_']['db']) ; |
$requete = 'INSERT INTO bazar_url SET bu_id_url='.$id_url.', bu_ce_fiche='.$idfiche.', '. |
'bu_url="'.$url_lien.'", bu_descriptif_url="'.addslashes($url_texte).'"'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
return; |
} |
/** baz_insertion_fichier() - inserer un fichier a une fiche |
* |
* @global string Le label du fichier |
* @global string La description du fichier |
* @global integer L'identifiant de la fiche |
* @return void |
*/ |
function baz_insertion_fichier($fichier_description, $idfiche, $nom_fichier='fichier_joint') { |
//verification de la presence de ce fichier |
$requete = 'SELECT bfj_id_fichier FROM bazar_fichier_joint WHERE bfj_fichier="'.$_FILES[$nom_fichier]['name'].'"'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows()==0) { |
$chemin_destination=BAZ_CHEMIN_APPLI.'upload/'.$_FILES[$nom_fichier]['name']; |
move_uploaded_file($_FILES[$nom_fichier]['tmp_name'], $chemin_destination); |
} |
$id_fichier_joint = baz_nextId('bazar_fichier_joint', 'bfj_id_fichier', $GLOBALS['_BAZAR_']['db']) ; |
$requete = 'INSERT INTO bazar_fichier_joint SET bfj_id_fichier='.$id_fichier_joint.', bfj_ce_fiche='.$idfiche. |
', bfj_description="'.addslashes($fichier_description).'", bfj_fichier="'.$_FILES[$nom_fichier]['name'].'"'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
return; |
} |
/** baz_insertion_image() - inserer une image a une fiche |
* |
* @global integer L'identifiant de la fiche |
* @return string requete SQL |
*/ |
function baz_insertion_image($idfiche) { |
//verification de la presence de ce fichier |
$requete = 'SELECT bf_id_fiche FROM bazar_fiche WHERE bf_url_image="'.$_FILES['image']['name'].'" AND bf_id_fiche!='.$idfiche; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows()==0) { |
$chemin_destination=BAZ_CHEMIN_APPLI.'upload/'.$_FILES['image']['name']; |
move_uploaded_file($_FILES['image']['tmp_name'], $chemin_destination); |
} |
return 'bf_url_image="'.$_FILES['image']['name'].'", ' ; |
} |
/** baz_mise_a_jour() - Mettre a jour une fiche |
* |
* @global Le contenu du formulaire de saisie de l'annonce |
* @return void |
*/ |
function baz_mise_a_jour($valeur) { |
//MAJ de bazar_fiche |
$requete = 'UPDATE bazar_fiche SET '.requete_bazar_fiche(&$valeur,$GLOBALS['_BAZAR_']['id_typeannonce']); |
$requete.= ' WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche']; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
return; |
} |
/** baz_suppression() - Supprime une fiche |
* |
* @global L'identifiant de la fiche a supprimer |
* @return void |
*/ |
function baz_suppression() { |
$valeurs=baz_valeurs_fiche($_GET['id_fiche']); |
//suppression des wikinis associes |
//génération du titre du wiki, sous la forme id-titre du projet |
$titre=baz_titre_wiki($valeurs["bf_titre"]); |
$requete = 'SELECT gewi_id_wikini FROM gen_wikini WHERE gewi_code_alpha_wikini = "'.$titre.'"'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if ($resultat->numRows()>0) { |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$id_wikini=$ligne['gewi_id_wikini']; |
} |
include_once PAP_CHEMIN_RACINE.'api/sql/SQL_manipulation.fonct.php'; |
include_once PAP_CHEMIN_RACINE.'client/integrateur_wikini/configuration/adwi_configuration.inc.php' ; |
include_once PAP_CHEMIN_RACINE.'client/integrateur_wikini/bibliotheque/adwi_wikini.fonct.php' ; |
adwi_supprimer_wikini($id_wikini, $GLOBALS['_BAZAR_']['db']); |
} |
// suppression des valeurs des listes et des cases à cocher |
$requete = 'DELETE FROM bazar_fiche_valeur_liste WHERE bfvl_ce_fiche='.$_GET['id_fiche']; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
//suppression des urls associes |
$requete = 'SELECT bu_id_url FROM bazar_url WHERE bu_ce_fiche = '.$_GET['id_fiche']; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ('Echec de la requete<br />'.$resultat->getMessage().'<br />'.$resultat->getDebugInfo().'<br />'."\n") ; |
} |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
baz_suppression_url($ligne['bu_id_url']); |
} |
//suppression des fichiers associes |
$requete = 'SELECT bfj_id_fichier FROM bazar_fichier_joint WHERE bfj_ce_fiche = '.$_GET['id_fiche']; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ('Echec de la requete<br />'.$resultat->getMessage().'<br />'.$resultat->getDebugInfo().'<br />'."\n") ; |
} |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
baz_suppression_fichier($ligne['bfj_id_fichier']); |
} |
//suppression dans bazar_fiche |
$requete = 'DELETE FROM bazar_fiche WHERE bf_id_fiche = '.$_GET['id_fiche']; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ('Echec de la requete<br />'.$resultat->getMessage().'<br />'.$resultat->getDebugInfo().'<br />'."\n") ; |
} |
return ; |
} |
/** baz_suppression_url() - Supprimer un lien d'une fiche |
* |
* @global integer L'identifiant du lien |
* @return void |
*/ |
function baz_suppression_url($id_url) { |
//suppression dans bazar_url |
$requete = 'DELETE FROM bazar_url WHERE bu_id_url = '.$id_url; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ('Echec de la requete<br />'.$resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
return; |
} |
/** baz_suppression_fichier() - Supprimer un fichier d'une fiche |
* |
* @global integer L'identifiant du fichier |
* @return void |
*/ |
function baz_suppression_fichier($id_fichier) { |
//verification de l'utilisation du fichier joint pour une autre annonce |
$requete = 'SELECT bfj_fichier FROM bazar_fichier_joint WHERE bfj_id_fichier='.$id_fichier; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC); |
$requete = 'SELECT bfj_fichier FROM bazar_fichier_joint WHERE bfj_fichier="'.$ligne['bfj_fichier'].'"'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
//si le fichier n'est que utilise dans cette fiche, on le supprime, on le laisse sinon |
if ($resultat->numRows()==1) { |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC); |
unlink(BAZ_CHEMIN_APPLI.'upload/'.$ligne['bfj_fichier']); |
} |
//suppression dans la table bazar_fichier |
$requete = 'DELETE FROM bazar_fichier_joint WHERE bfj_id_fichier = '.$id_fichier; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ('Echec de la requete<br />'.$resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
return; |
} |
/** baz_suppression_image() - Supprimer une image d'une fiche |
* |
* @global integer L'identifiant de la fiche |
* @return void |
*/ |
function baz_suppression_image($id_fiche) { |
//verification de l'utilisation de l'image pour une autre annonce |
$requete = 'SELECT bf_url_image FROM bazar_fiche WHERE bf_id_fiche='.$id_fiche; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC); |
$requete = 'SELECT bf_url_image FROM bazar_fiche WHERE bf_url_image="'.$ligne['bf_url_image'].'"'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
//si le fichier n'est que utilise dans cette fiche, on le supprime, on le laisse sinon |
if ($resultat->numRows()==1) { |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC); |
unlink(BAZ_CHEMIN_APPLI.'upload/'.$ligne['bf_url_image']); |
} |
//suppression dans la table bazar_fiche |
$requete = 'UPDATE bazar_fiche SET bf_url_image=NULL WHERE bf_id_fiche = '.$id_fiche; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ('Echec de la requete<br />'.$resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
return; |
} |
/** publier_fiche () - Publie ou non dans les fichiers XML la fiche bazar d'un utilisateur |
* |
* @global boolean Valide: oui ou non |
* @return void |
*/ |
function publier_fiche($valid) { |
if (isset($_GET['id_fiche'])) $GLOBALS['_BAZAR_']['id_fiche']=$_GET['id_fiche']; |
if (isset($_GET['typeannonce'])) $typeannonce=$_GET['typeannonce']; |
if ($valid==0) { |
$requete = 'UPDATE bazar_fiche SET bf_statut_fiche=2 WHERE bf_id_fiche="'.$GLOBALS['_BAZAR_']['id_fiche'].'"' ; |
} |
else { |
$requete = 'UPDATE bazar_fiche SET bf_statut_fiche=1 WHERE bf_id_fiche="'.$GLOBALS['_BAZAR_']['id_fiche'].'"' ; |
} |
// ====================Mise a jour de la table bazar_fiche==================== |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
unset ($resultat) ; |
//TODO envoie mail annonceur |
return; |
} |
/** baz_s_inscrire() affiche le formulaire qui permet de s'inscrire pour recevoir des annonces d'un type |
* |
* @return string le code HTML |
*/ |
function baz_s_inscrire() { |
$res= '<h2>'.BAZ_S_INSCRIRE_AUX_ANNONCES.'</h2><br />'."\n"; |
if (isset($_GET['inscrip'])) { |
//cas d'une desinscription |
if ($_GET['inscrip']==0) { |
$requete='DELETE FROM bazar_abonnement WHERE ba_id_utilisateur='.$GLOBALS['id_user'].' AND ba_id_rubrique='.$_GET['idtypeannonce']; |
} |
//cas d'une inscription |
else { |
$requete='INSERT INTO bazar_abonnement VALUES ('.$GLOBALS['id_user'].', '.$_GET['idtypeannonce'].')'; |
} |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
} |
if ($GLOBALS['AUTH']->getAuth()) { |
$res .= BAZ_LAIUS_S_ABONNER.'<br /><br />'."\n"; |
//requete pour obtenir l'id et le label des types d'annonces |
$requete = 'SELECT bn_id_nature, bn_label_nature, bn_image_titre '. |
'FROM bazar_nature WHERE 1'; /*bn_ce_id_menu='.$GLOBALS['_BAZAR_']['categorie_nature'];*/ |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
$table = new HTML_Table(array ('width' => '100%', 'class' => 'table_bazar')) ; |
$table->addRow(array ('<b>'.BAZ_TYPE_ANNONCES.'</b>', |
'<b>'.BAZ_STATUT.'</b>', |
'<b>'.BAZ_PASSER_EN.'</b>', |
'<b>'.BAZ_RSS.'</b>',)) ; |
$table->setRowType (0, 'th') ; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$tab_parametres_GET = explode ("&", $_SERVER["argv"][0]) ; |
foreach ($tab_parametres_GET as $cle_param => $valeur_param) { |
$tab_valeur = explode ('=', $valeur_param) ; |
$GLOBALS['_BAZAR_']['url']->addQueryString($tab_valeur[0], $tab_valeur[1]); |
} |
$lien_s_abonner=$GLOBALS['_BAZAR_']['url']; |
$lien_s_abonner->addQueryString('action', BAZ_S_INSCRIRE); |
$lien_s_abonner->addQueryString('idtypeannonce', $ligne['bn_id_nature']); |
$lien_s_abonner->addQueryString('inscrip', 1); |
$lien_se_desabonner=$GLOBALS['_BAZAR_']['url']; |
$lien_se_desabonner->addQueryString('action', BAZ_S_INSCRIRE); |
$lien_se_desabonner->addQueryString('idtypeannonce', $ligne['bn_id_nature']); |
$lien_se_desabonner->addQueryString('inscrip', 0); |
$lien_RSS=$GLOBALS['_BAZAR_']['url']; |
$lien_RSS->addQueryString('action', BAZ_VOIR_FLUX_RSS); |
//requete pour savoir si la personne est inscrite a ce type d'annonce |
$requete = 'SELECT ba_id_utilisateur '. |
'FROM bazar_abonnement '. |
'WHERE ba_id_utilisateur='.$GLOBALS['id_user'].' AND ba_id_rubrique='.$ligne['bn_id_nature']; |
$resultat2 = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat2)) { |
die ($resultat2->getMessage().$resultat2->getDebugInfo()) ; |
} |
if (isset($ligne['bn_image_titre'])) {$titre=' <img src="client/bazar/images/'.$ligne['bn_image_titre'].'" alt="'.$ligne['bn_label_nature'].'" />'."\n";} |
else {$titre='<strong> '.$ligne['bn_label_nature'].'</strong>'."\n";} |
if ($resultat2->numRows()>0) { |
$lien_RSS->addQueryString('annonce', $ligne['bn_id_nature']); |
$table->addRow(array($titre, |
BAZ_ABONNE, |
'<a href='.$lien_se_desabonner->getURL().'>'.BAZ_SE_DESABONNER.'</a>', |
'<a href='.$lien_RSS->getURL().'><img src="client/bazar/images/BAZ_rss.png" alt="'.BAZ_RSS.'"></a>')); |
$lien_RSS->removeQueryString('annonce'); |
} |
else { |
$lien_RSS->addQueryString('annonce', $ligne['bn_id_nature']); |
$table->addRow(array($titre, |
BAZ_PAS_ABONNE, |
'<a href='.$lien_s_abonner->getURL().'>'.BAZ_S_ABONNER.'</a>', |
'<a href='.$lien_RSS->getURL().'><img src="client/bazar/images/BAZ_rss.png" alt="'.BAZ_RSS.'" /></a>')); |
$lien_RSS->removeQueryString('annonce'); |
} |
} |
$table->altRowAttributes(1, array('class' => 'ligne_impaire'), array('class' => 'ligne_paire')); |
$table->updateColAttributes(0, array('align' => 'center')); |
$table->updateColAttributes(1, array('align' => 'center')); |
$table->updateColAttributes(2, array('align' => 'center')); |
$table->updateColAttributes(3, array('style' => 'text-align:center;')); |
$res.=$table->toHTML() ; |
} |
else { |
$res .= '<p class="zone_info">'.BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR.'</p>'."\n" ; |
$res .= '<form id="form_connexion" style="clear:both;" class="form_identification" action="' ; |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_S_INSCRIRE); |
$res .= $GLOBALS['_BAZAR_']['url']->getURL(); |
$res .= '" method="post"> |
<fieldset> |
<legend>Identifiez vous</legend> |
<label for="username">Courriel : </label> |
<input type="text" id="username" name="username" maxlength="80" tabindex="1" value="courriel" /> |
<label for="password">Mot de passe : </label> |
<input type="password" id="password" name="password" maxlength="80" tabindex="2" value="mot de passe" /> |
<input type="submit" id="connexion" name="connexion" tabindex="3" value="ok" /> |
</fieldset> |
</form>'; |
} |
return $res; |
} |
/** baz_valeurs_fiche() - Renvoie un tableau avec les valeurs par defaut du formulaire d'inscription |
* |
* @param integer Identifiant de la fiche |
* |
* @return array Valeurs enregistrees pour cette fiche |
*/ |
function baz_valeurs_fiche($idfiche) { |
$requete = 'SELECT * FROM bazar_fiche WHERE bf_id_fiche='.$idfiche; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ; |
$valeurs_fiche = array() ; |
$tableau = baz_valeurs_template($GLOBALS['_BAZAR_']['template']); |
for ($i=0; $i<count($tableau); $i++) { |
if ($tableau[$i]['type']=='liste' || $tableau[$i]['type']=='checkbox') { |
$requete = 'SELECT bfvl_valeur FROM bazar_fiche_valeur_liste WHERE bfvl_ce_fiche='.$idfiche. |
' AND bfvl_ce_liste='.$tableau[$i]['nom_bdd']; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError ($resultat)) { |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
$nb=0;$val=''; |
while ($result = $resultat->fetchRow()) { |
if ($nb>0) $val .= ', '; |
$val .= $result[0]; |
$nb++; |
} |
$valeurs_fiche[$tableau[$i]['type'].$tableau[$i]['nom_bdd']] = $val; |
} |
elseif ($tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' || $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin') { |
$valeurs_fiche[$tableau[$i]['nom_bdd']] = stripslashes($ligne[$tableau[$i]['nom_bdd']]); |
} |
} |
return $valeurs_fiche; |
} |
function baz_envoie_mail() { |
$headers['From'] = $_SERVER['SERVER_ADMIN'] ; |
$headers['To'] = "<".INS_MAIL_ADMIN_APRES_INSCRIPTION.">" ; |
$headers['Subject'] = INS_MAIL_ADMIN_APRES_INSCRIPTION_SUJET; |
$q = "select * from ".INS_ANNUAIRE." where ".INS_CHAMPS_MAIL."=\"".$_POST['mail']."\"" ; |
$r = $GLOBALS['_BAZAR_']['db']->query($q) ; |
if (DB::isError ($r)) { |
die ("echec de la requete") ; |
} |
$row = $r->fetchRow(DB_FETCHMODE_ASSOC) ; |
$body_entete = "Un nouvel inscrit à tela : \n" ; |
$body = "mail : ".$row[INS_CHAMPS_MAIL]."\n" ; |
$body .= "------------------------------------------\n"; |
$body .= "nom: ".unhtmlentities($row[INS_CHAMPS_NOM])." \n" ; |
$body .= "prénom : ".unhtmlentities($row[INS_CHAMPS_PRENOM])." \n" ; |
$body .= "-------------------------------------------\n" ; |
// création du mail |
$mail_object =& Mail::factory('mail'); |
if (!mail ($headers['To'], $headers['Subject'], $body)) { |
return "Une erreur s'est produite:<br />\n" ; |
} |
$body .= INS_MAIL_INSCRIPTION_2; |
$headers['To'] = $_POST['mail'] ; |
// création du mail |
if (mail($headers['To'], $headers['Subject'], INS_MAIL_INSCRIPTION_1.$body)) { |
return "Une erreur s'est produite<br />\n" ; |
} |
return; |
} |
/** function baz_nextId () Renvoie le prochain identifiant numerique libre d'une table |
* |
* @param string Nom de la table |
* @param string Nom du champs identifiant |
* @param mixed Objet DB de PEAR pour la connexion a la base de donnees |
* |
* return integer Le prochain numero d'identifiant disponible |
*/ |
function baz_nextId($table, $colonne_identifiant, $bdd) { |
$requete = 'SELECT MAX('.$colonne_identifiant.') AS maxi FROM '.$table; |
$resultat = $bdd->query($requete) ; |
if (DB::isError($resultat)) { |
die (__FILE__ . __LINE__ . $resultat->getMessage() . $requete); |
return $bdd->raiseError($resultat) ; |
} |
if ($resultat->numRows() > 1) { |
return $bdd->raiseError('<br />La table '.$table.' a un identifiant non unique<br />') ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ; |
return $ligne->maxi + 1 ; |
} |
/** function baz_titre_wiki () Renvoie la chaine de caractere sous une forme compatible avec wikini |
* |
* @param string mot à transformer (enlever accents, espaces) |
* |
* return string mot transformé |
*/ |
function baz_titre_wiki($nom) { |
$titre=trim($nom); |
for ($j = 0; $j < strlen ($titre); $j++) { |
if (!preg_match ('/[a-zA-Z0-9]/', $titre[$j])) { |
$titre[$j] = '_' ; |
} |
} |
return $titre; |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.56 2006/09/28 15:41:36 alexandre_tb |
* Le formulaire pour se logguer dans l'action saisir reste sur l'action saisir après |
* |
* Revision 1.55 2006/09/21 14:19:39 florian |
* amélioration des fonctions liés au wikini |
* |
* Revision 1.54 2006/09/14 15:11:23 alexandre_tb |
* suppression temporaire de la gestion des wikinis |
* |
* Revision 1.53 2006/07/25 13:24:44 florian |
* correction bug image |
* |
* Revision 1.52 2006/07/25 13:05:00 alexandre_tb |
* Remplacement d un die par un echo |
* |
* Revision 1.51 2006/07/18 14:17:32 alexandre_tb |
* Ajout d'un formulaire d identification |
* |
* Revision 1.50 2006/06/21 08:37:59 alexandre_tb |
* Correction de bug, d'un appel constant (....) qui ne fonctionnais plus. |
* |
* Revision 1.49 2006/06/02 09:29:07 florian |
* debut d'integration de wikini |
* |
* Revision 1.48 2006/05/19 13:54:11 florian |
* stabilisation du moteur de recherche, corrections bugs, lien recherche avancee |
* |
* Revision 1.47 2006/04/28 12:46:14 florian |
* integration des liens vers annuaire |
* |
* Revision 1.46 2006/03/29 13:04:35 alexandre_tb |
* utilisation de la classe Administrateur_bazar |
* |
* Revision 1.45 2006/03/24 09:28:02 alexandre_tb |
* utilisation de la variable globale $GLOBALS['_BAZAR_']['categorie_nature'] |
* |
* Revision 1.44 2006/03/14 17:10:21 florian |
* ajout des fonctions de syndication, changement du moteur de recherche |
* |
* Revision 1.43 2006/03/02 20:36:52 florian |
* les entrees du formulaire de saisir ne sont plus dans les constantes mias dans des tables qui gerent le multilinguisme. |
* |
* Revision 1.42 2006/03/01 16:23:22 florian |
* modifs textes fr et correction bug "undefined index" |
* |
* Revision 1.41 2006/03/01 16:05:51 florian |
* ajout des fichiers joints |
* |
* Revision 1.40 2006/02/06 09:33:00 alexandre_tb |
* correction de bug |
* |
* Revision 1.39 2006/01/30 17:25:38 alexandre_tb |
* correction de bugs |
* |
* Revision 1.38 2006/01/30 10:27:04 florian |
* - ajout des entrées de formulaire fichier, url, et image |
* - correction bug d'affichage du mode de saisie |
* |
* Revision 1.37 2006/01/24 14:11:11 alexandre_tb |
* correction de bug sur l'ajout d'une image et d'un fichier |
* |
* Revision 1.36 2006/01/19 17:42:11 florian |
* ajout des cases à cocher pré-cochées pour les maj |
* |
* Revision 1.35 2006/01/18 11:06:51 florian |
* correction erreur saisie date |
* |
* Revision 1.34 2006/01/18 10:53:28 florian |
* corrections bugs affichage fiche |
* |
* Revision 1.33 2006/01/18 10:07:34 florian |
* recodage de l'insertion et de la maj des données relatives aux listes et checkbox dans des formulaires |
* |
* Revision 1.32 2006/01/18 10:03:36 florian |
* recodage de l'insertion et de la maj des données relatives aux listes et checkbox dans des formulaires |
* |
* Revision 1.31 2006/01/17 10:07:08 alexandre_tb |
* en cours |
* |
* Revision 1.30 2006/01/16 09:42:57 alexandre_tb |
* en cours |
* |
* Revision 1.29 2006/01/13 14:12:51 florian |
* utilisation des temlates dans la table bazar_nature |
* |
* Revision 1.28 2006/01/05 16:28:24 alexandre_tb |
* prise en chage des checkbox, reste la mise à jour à gérer |
* |
* Revision 1.27 2006/01/04 15:30:56 alexandre_tb |
* mise en forme du code |
* |
* Revision 1.26 2006/01/03 10:19:31 florian |
* Mise à jour pour accepter des parametres dans papyrus: faire apparaitre ou non le menu, afficher qu'un type de fiches, définir l'action par défaut... |
* |
* Revision 1.25 2005/12/20 14:49:35 ddelon |
* Fusion Head vers Livraison |
* |
* Revision 1.24 2005/12/16 15:44:40 alexandre_tb |
* ajout de l'option restreindre dépôt |
* |
* Revision 1.23 2005/12/01 17:03:34 florian |
* changement des chemins pour appli Pear |
* |
* Revision 1.22 2005/12/01 16:05:41 florian |
* changement des chemins pour appli Pear |
* |
* Revision 1.21 2005/12/01 15:31:30 florian |
* correction bug modifs et saisies |
* |
* Revision 1.20 2005/11/30 13:58:45 florian |
* ajouts graphisme (logos, boutons), changement structure SQL bazar_fiche |
* |
* Revision 1.19 2005/11/24 16:17:13 florian |
* corrections bugs, ajout des cases à cocher |
* |
* Revision 1.18 2005/11/18 16:03:23 florian |
* correction bug html entites |
* |
* Revision 1.17 2005/11/17 18:48:02 florian |
* corrections bugs + amélioration de l'application d'inscription |
* |
* Revision 1.16 2005/11/07 17:30:36 florian |
* ajout controle sur les listes pour la saisie |
* |
* Revision 1.15 2005/11/07 17:05:45 florian |
* amélioration validation conditions de saisie, ajout des règles spécifiques de saisie des formulaires |
* |
* Revision 1.14 2005/11/07 08:48:02 florian |
* correction pb guillemets pour saisie et modif de fiche |
* |
* Revision 1.13 2005/10/21 16:15:04 florian |
* mise a jour appropriation |
* |
* Revision 1.11 2005/10/12 17:20:33 ddelon |
* Reorganisation calendrier + applette |
* |
* Revision 1.10 2005/10/12 15:14:06 florian |
* amélioration de l'interface de bazar, de manière a simplifier les consultations, et à harmoniser par rapport aux Ressources |
* |
* Revision 1.9 2005/10/10 16:22:52 alexandre_tb |
* Correction de bug. Lorsqu'on revient en arrière après avoir validé un formulaire. |
* |
* Revision 1.8 2005/09/30 13:50:07 alexandre_tb |
* correction bug date parution ressource |
* |
* Revision 1.7 2005/09/30 13:15:58 ddelon |
* compatibilité php5 |
* |
* Revision 1.6 2005/09/30 13:00:05 ddelon |
* Fiche bazar generique |
* |
* Revision 1.5 2005/09/30 12:22:54 florian |
* Ajouts commentaires pour fiche, modifications graphiques, maj SQL |
* |
* Revision 1.3 2005/07/21 19:03:12 florian |
* nouveautés bazar: templates fiches, correction de bugs, ... |
* |
* Revision 1.1.1.1 2005/02/17 18:05:11 florian |
* Import initial de Bazar |
* |
* Revision 1.1.1.1 2005/02/17 11:09:50 florian |
* Import initial |
* |
* Revision 1.1.1.1 2005/02/16 18:06:35 florian |
* import de la nouvelle version |
* |
* Revision 1.10 2004/07/08 17:25:25 florian |
* ajout commentaires + petits debuggages |
* |
* Revision 1.8 2004/07/07 14:30:19 florian |
* débogage RSS |
* |
* Revision 1.7 2004/07/06 16:22:01 florian |
* débogage modification + MAJ flux RSS |
* |
* Revision 1.6 2004/07/06 09:28:26 florian |
* changement interface de modification |
* |
* Revision 1.5 2004/07/05 15:10:23 florian |
* changement interface de saisie |
* |
* Revision 1.4 2004/07/02 14:51:14 florian |
* ajouts divers pour faire fonctionner l'insertion de fiches |
* |
* Revision 1.3 2004/07/01 16:37:42 florian |
* ajout de fonctions pour les templates |
* |
* Revision 1.2 2004/07/01 13:00:13 florian |
* modif Florian |
* |
* Revision 1.1 2004/06/23 09:58:32 alex |
* version initiale |
* |
* Revision 1.1 2004/06/18 09:00:37 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/tags/Racine_livraison_menes/bibliotheque/bazar.fonct.formulaire.php |
---|
New file |
0,0 → 1,506 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU Lesser General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | Lesser General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU Lesser General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: bazar.fonct.formulaire.php,v 1.22 2006-06-02 09:29:07 florian Exp $ |
/** |
* Formulaire |
* |
* Les fonctions de mise en page des formulaire |
* |
*@package bazar |
//Auteur original : |
*@author Florian SCHMITT <florian@ecole-et-nature.org> |
//Autres auteurs : |
*@author Aleandre GRANIER <alexandre@tela-botanica.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.22 $ $Date: 2006-06-02 09:29:07 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
require_once 'bazar.fonct.formulaire.controles.php'; |
//-------------------FONCTIONS DE MISE EN PAGE DES FORMULAIRES |
/** liste() - Ajoute un élément de type liste au formulaire |
* |
* @param mixed L'objet QuickForm du formulaire |
* @param int identifiant de la liste sur bazar_liste |
* @param string label à afficher dans le formulaire |
* @param string première restriction de la taille des champs du formulaire |
* @param string deuxième restriction de la taille des champs du formulaire |
* @param string valeur par défaut du formulaire |
* @param string table source pour les valeurs de la liste |
* @param string ce champs est il obligatoire? (required) |
* @param boolean sommes nous dans le moteur de recherche? |
* @return void |
*/ |
function liste(&$formtemplate, $id_liste , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) { |
$requete = 'SELECT * FROM bazar_liste_valeurs WHERE blv_ce_liste='.$id_liste.' AND blv_ce_i18n="'.$GLOBALS['_BAZAR_']['langue'].'"'; |
$resultat = & $GLOBALS['_BAZAR_']['db'] -> query($requete) ; |
if (DB::isError ($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
if ($dans_moteur_de_recherche==0) { |
$select[0]=BAZ_CHOISIR; |
} |
else { |
$select[0]=BAZ_INDIFFERENT; |
} |
while ($ligne = $resultat->fetchRow()) { |
$select[$ligne[1]] = $ligne[2] ; |
} |
$option=array('style'=>'width: '.$limite1.'px;'); |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/select.php'; |
$select= new HTML_QuickForm_select('liste'.$id_liste, $label, $select, $option); |
$select->setSize($limite2); |
$select->setMultiple(0); |
$select->setSelected($defaut); |
$formtemplate->addElement($select) ; |
if (($dans_moteur_de_recherche==0) && isset($obligatoire) && ($obligatoire==1)) { |
$formtemplate->addRule('liste'.$id_liste, BAZ_CHOISIR_OBLIGATOIRE.' '.$label , 'nonzero', '', 'client') ; |
$formtemplate->addRule('liste'.$id_liste, $label.' obligatoire', 'required', '', 'client') ;} |
} |
/** checkbox() - Ajoute un élément de type checkbox au formulaire |
* |
* @param mixed L'objet QuickForm du formulaire |
* @param int identifiant de la liste sur bazar_liste |
* @param string label à afficher dans le formulaire |
* @param string première restriction de la taille des champs du formulaire |
* @param string deuxième restriction de la taille des champs du formulaire |
* @param string valeur par défaut du formulaire |
* @param string table source pour les valeurs de la liste |
* @param string ce champs est il obligatoire? (required) |
* @return void |
*/ |
function checkbox(&$formtemplate, $id_liste , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) { |
$requete = 'SELECT * FROM bazar_liste_valeurs WHERE blv_ce_liste='.$id_liste.' AND blv_ce_i18n="'.$GLOBALS['_BAZAR_']['langue'].'" ORDER BY blv_label'; |
$resultat = & $GLOBALS['_BAZAR_']['db'] -> query($requete) ; |
if (DB::isError ($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/checkbox.php' ; |
$i=0; |
if (isset($defaut)) $tab=split(', ', $defaut); |
while ($ligne = $resultat->fetchRow()) { |
if ($i==0) $labelchkbox=$label ; else $labelchkbox=' '; |
$checkbox[$i]= & HTML_Quickform::createElement('checkbox', $ligne[1], $labelchkbox, $ligne[2], |
array ('style'=>'display:inline;margin:2px;')) ; |
foreach ($tab as $val) { |
if ($ligne[1]==$val) $checkbox[$i]->setChecked(1); |
} |
$i++; |
} |
$squelette_checkbox =& $formtemplate->defaultRenderer(); |
$squelette_checkbox->setElementTemplate( '<tr><td colspan="2" style="text-align:left;">'."\n".'<fieldset class="bazar_fieldset">'."\n".'<legend>{label}'. |
'<!-- BEGIN required --><span class="symbole_obligatoire"> *</span><!-- END required -->'."\n". |
'</legend>'."\n".'{element}'."\n".'</fieldset> '."\n".'</td></tr>'."\n", 'checkbox'.$id_liste); |
$squelette_checkbox->setGroupElementTemplate( "\n".'<div class="bazar_checkbox">'."\n".'{element}'."\n".'</div>'."\n", 'checkbox'.$id_liste); |
$formtemplate->addGroup($checkbox, 'checkbox'.$id_liste, $label, "\n"); |
if (($dans_moteur_de_recherche==0) && isset($obligatoire) && ($obligatoire==1)) { |
$formtemplate->addGroupRule('checkbox'.$id_liste, $label.' obligatoire', 'required', null, 1, 'client'); |
} |
} |
/** listedatedeb() - Ajoute un élément de type date sous forme de liste au formulaire pour designer une date de début |
* |
* @param mixed L'objet QuickForm du formulaire |
* @param string nom de la table dans la base de donnée |
* @param string label à afficher dans le formulaire |
* @param string première restriction de la taille des champs du formulaire |
* @param string deuxième restriction de la taille des champs du formulaire |
* @param string valeur par défaut du formulaire |
* @param string table source pour les valeurs de la date |
* @param string ce champs est il obligatoire? (required) |
* @return void |
*/ |
function listedatedeb(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) { |
$optiondate = array('language' => BAZ_LANGUE_PAR_DEFAUT, |
'minYear' => date('Y'), |
'maxYear'=> (date('Y')+10), |
'format' => 'd m Y', |
'addEmptyOption' => BAZ_DATE_VIDE, |
); |
$formtemplate->addElement('date', $nom_bdd, $label, $optiondate) ; |
//gestion des valeurs par défaut (date du jour) |
if (isset($defaut) && $defaut!='') $formtemplate->setDefaults(array($nom_bdd => $defaut)); |
else { |
$defauts=array($nom_bdd => array ('d'=>date('d'), 'm'=>date('m'), 'Y'=>date('Y'))); |
$formtemplate->setDefaults($defauts); |
} |
//gestion du champs obligatoire |
if (($dans_moteur_de_recherche==0) && isset($obligatoire) && ($obligatoire==1)) { |
$formtemplate->addRule($nom_bdd, $label.' obligatoire', 'required', '', 'client') ; |
} |
} |
/** listedatefin() - Ajoute un élément de type date sous forme de liste au formulaire pour designer une date de fin |
* |
* @param mixed L'objet QuickForm du formulaire |
* @param string nom de la table dans la base de donnée |
* @param string label à afficher dans le formulaire |
* @param string première restriction de la taille des champs du formulaire |
* @param string deuxième restriction de la taille des champs du formulaire |
* @param string valeur par défaut du formulaire |
* @param string table source pour les valeurs de la date |
* @param string ce champs est il obligatoire? (required) |
* @return void |
*/ |
function listedatefin(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) { |
listedatedeb($formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche); |
} |
/** texte() - Ajoute un élément de type texte au formulaire |
* |
* @param mixed L'objet QuickForm du formulaire |
* @param string nom de la table dans la base de donnée |
* @param string label à afficher dans le formulaire |
* @param string première restriction de la taille des champs du formulaire |
* @param string deuxième restriction de la taille des champs du formulaire |
* @param string valeur par défaut du formulaire |
* @param string table source pour les valeurs du texte (inutile) |
* @param string ce champs est il obligatoire? (required) |
* @return void |
*/ |
function texte(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) { |
$option=array('size'=>$limite1,'maxlength'=>$limite2); |
$formtemplate->addElement('text', $nom_bdd, $label, $option) ; |
//gestion des valeurs par défaut |
$defauts=array($nom_bdd=>$defaut); |
$formtemplate->setDefaults($defauts); |
$formtemplate->applyFilter($nom_bdd, 'addslashes') ; |
//gestion du champs obligatoire |
if (($dans_moteur_de_recherche==0) && isset($obligatoire) && ($obligatoire==1)) { |
$formtemplate->addRule($nom_bdd, $label.' obligatoire', 'required', '', 'client') ; |
} |
} |
/** textelong() - Ajoute un élément de type textearea au formulaire |
* |
* @param mixed L'objet QuickForm du formulaire |
* @param string nom de la table dans la base de donnée |
* @param string label à afficher dans le formulaire |
* @param string taille des colonnes de l'élément |
* @param string taille des lignes de l'élément |
* @param string valeur par défaut du formulaire |
* @param string table source pour les valeurs du texte (inutile) |
* @param string ce champs est il obligatoire? (required) |
* @return void |
*/ |
function textelong(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) { |
$formtexte= new HTML_QuickForm_textarea($nom_bdd, $label, array('style'=>'white-space: normal;')); |
$formtexte->setCols($limite1); |
$formtexte->setRows($limite2); |
$formtemplate->addElement($formtexte) ; |
//gestion des valeurs par défaut |
$defauts=array($nom_bdd=>$defaut); |
$formtemplate->setDefaults($defauts); |
$formtemplate->applyFilter($nom_bdd, 'addslashes') ; |
//gestion du champs obligatoire |
if (($dans_moteur_de_recherche==0) && isset($obligatoire) && ($obligatoire==1)) { |
$formtemplate->addRule($nom_bdd, $label.' obligatoire', 'required', '', 'client') ; |
} |
} |
/** url() - Ajoute un élément de type url internet au formulaire |
* |
* @param mixed L'objet QuickForm du formulaire |
* @param string numero du champs input du formulaire (pour le différencier d'autres champs du meme type dans ce formulaire) |
* @param string label à afficher dans le formulaire |
* @param string taille des colonnes de l'élément |
* @param string taille des lignes de l'élément |
* @param string valeur par défaut du formulaire |
* @param string table source pour les valeurs du texte (inutile) |
* @param string ce champs est il obligatoire? (required) |
* @return void |
*/ |
function url(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) { |
//recherche des URLs deja entrees dans la base |
$html_url= ''; |
if (isset($GLOBALS['_BAZAR_']["id_fiche"])) { |
$requete = 'SELECT bu_id_url, bu_url, bu_descriptif_url FROM bazar_url WHERE bu_ce_fiche='.$GLOBALS['_BAZAR_']["id_fiche"]; |
$resultat = & $GLOBALS['_BAZAR_']['db'] -> query($requete) ; |
if (DB::isError ($resultat)) { |
die ($GLOBALS['_BAZAR_']['db']->getMessage().$GLOBALS['_BAZAR_']['db']->getDebugInfo()) ; |
} |
if ($resultat->numRows()>0) { |
$html_url= '<tr>'."\n".'<td colspan="2">'."\n".'<strong>'.BAZ_LISTE_URL.'</strong>'."\n"; |
$tableAttr = array("class" => "bazar_table") ; |
$table = new HTML_Table($tableAttr) ; |
$entete = array (BAZ_LIEN , BAZ_SUPPRIMER) ; |
$table->addRow($entete) ; |
$table->setRowType(0, "th") ; |
$lien_supprimer=$GLOBALS['_BAZAR_']['url']; |
$lien_supprimer->addQueryString('action', $_GET['action']); |
$lien_supprimer->addQueryString('id_fiche', $GLOBALS['_BAZAR_']["id_fiche"]); |
$lien_supprimer->addQueryString('typeannonce', $_REQUEST['typeannonce']); |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) { |
$lien_supprimer->addQueryString('id_url', $ligne->bu_id_url); |
$table->addRow (array( |
'<a href="'.$ligne->bu_url.'" target="_blank"> '.$ligne->bu_descriptif_url.'</a>', // col 1 : le lien |
'<a href="'.$lien_supprimer->getURL().'" onclick="javascript:return confirm(\''.BAZ_CONFIRMATION_SUPPRESSION_LIEN.'\');" >'.BAZ_SUPPRIMER.'</a>'."\n")) ; // col 2 : supprimer |
$lien_supprimer->removeQueryString('id_url'); |
} |
$table->altRowAttributes(1, array("class" => "ligne_impaire"), array("class" => "ligne_paire")); |
$table->updateColAttributes(1, array("align" => "center")); |
$html_url.= $table->toHTML()."\n".'</td>'."\n".'</tr>'."\n" ; |
} |
} |
$html ='<tr>'."\n".'<td colspan="2">'."\n".'<h4>'.$label.'</h4>'."\n".'</td>'."\n".'</tr>'."\n"; |
$formtemplate->addElement('html', $html) ; |
if ($html_url!='') $formtemplate->addElement('html', $html_url) ; |
$formtemplate->addElement('text', 'url_lien'.$nom_bdd, BAZ_URL_LIEN) ; |
$formtemplate->addElement('text', 'url_texte'.$nom_bdd, BAZ_URL_TEXTE) ; |
//gestion du champs obligatoire |
if (($dans_moteur_de_recherche==0) && isset($obligatoire) && ($obligatoire==1)) { |
$formtemplate->addRule('url_lien'.$nom_bdd, BAZ_URL_LIEN_REQUIS, 'required', '', 'client') ; |
$formtemplate->addRule('url_texte'.$nom_bdd, BAZ_URL_TEXTE_REQUIS, 'required', '', 'client') ; |
} |
} |
/** fichier() - Ajoute un élément de type fichier au formulaire |
* |
* @param mixed L'objet QuickForm du formulaire |
* @param string numero du champs input du formulaire (pour le différencier d'autres champs du meme type dans ce formulaire) |
* @param string label à afficher dans le formulaire |
* @param string taille des colonnes de l'élément |
* @param string taille des lignes de l'élément |
* @param string valeur par défaut du formulaire |
* @param string table source pour les valeurs du texte (inutile) |
* @param string ce champs est il obligatoire? (required) |
* @return void |
*/ |
function fichier(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) { |
//AJOUTER DES FICHIERS JOINTS |
$html_fichier= ''; |
if (isset($GLOBALS['_BAZAR_']["id_fiche"])) { |
$requete = 'SELECT * FROM bazar_fichier_joint WHERE bfj_ce_fiche='.$GLOBALS['_BAZAR_']["id_fiche"]; |
$resultat = & $GLOBALS['_BAZAR_']['db'] -> query($requete) ; |
if (DB::isError ($resultat)) { |
die ($GLOBALS['_BAZAR_']['db']->getMessage().$GLOBALS['_BAZAR_']['db']->getDebugInfo()) ; |
} |
if ($resultat->numRows()>0) { |
$html_fichier = '<tr>'."\n".'<td colspan="2">'."\n".'<strong>'.BAZ_LISTE_FICHIERS_JOINTS.'</strong>'."\n"; |
$tableAttr = array("class" => "bazar_table") ; |
$table = new HTML_Table($tableAttr) ; |
$entete = array (BAZ_FICHIER , BAZ_SUPPRIMER) ; |
$table->addRow($entete) ; |
$table->setRowType(0, "th") ; |
$lien_supprimer=$GLOBALS['_BAZAR_']['url']; |
$lien_supprimer->addQueryString('action', $_GET['action']); |
$lien_supprimer->addQueryString('id_fiche', $GLOBALS['_BAZAR_']["id_fiche"]); |
$lien_supprimer->addQueryString('typeannonce', $_REQUEST['typeannonce']); |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) { |
$lien_supprimer->addQueryString('id_fichier', $ligne->bfj_id_fichier); |
$table->addRow(array('<a href="client/bazar/upload/'.$ligne->bfj_fichier.'"> '.$ligne->bfj_description.'</a>', // col 1 : le fichier et sa description |
'<a href="'.$lien_supprimer->getURL().'" onclick="javascript:return confirm(\''.BAZ_CONFIRMATION_SUPPRESSION_FICHIER.'\');" >'.BAZ_SUPPRIMER.'</a>'."\n")) ; // col 2 : supprimer |
$lien_supprimer->removeQueryString('id_fichier'); |
} |
$table->altRowAttributes(1, array("class" => "ligne_impaire"), array("class" => "ligne_paire")); |
$table->updateColAttributes(1, array("align" => "center")); |
$html_fichier .= $table->toHTML()."\n".'</td>'."\n".'</tr>'."\n" ; |
} |
} |
$html ='<tr>'."\n".'<td colspan="2">'."\n".'<h4>'.$label.'</h4>'."\n".'</td>'."\n".'</tr>'."\n"; |
$formtemplate->addElement('html', $html) ; |
if ($html_fichier!='') $formtemplate->addElement('html', $html_fichier) ; |
$formtemplate->addElement('text', 'texte_fichier'.$nom_bdd, BAZ_FICHIER_DESCRIPTION) ; |
$formtemplate->addElement('file', 'fichier'.$nom_bdd, BAZ_FICHIER_JOINT) ; |
$formtemplate->addRule('image', BAZ_IMAGE_VALIDE_REQUIS, '', '', 'client') ; //a completer pour checker l'image |
$formtemplate->setMaxFileSize($limite1); |
//gestion du champs obligatoire |
if (($dans_moteur_de_recherche==0) && isset($obligatoire) && ($obligatoire==1)) { |
$formtemplate->addRule('texte_fichier'.$nom_bdd, BAZ_FICHIER_LABEL_REQUIS, 'required', '', 'client') ; |
$formtemplate->addRule('fichier'.$nom_bdd, BAZ_FICHIER_JOINT_REQUIS, 'required', '', 'client') ; |
} |
} |
/** image() - Ajoute un élément de type image au formulaire |
* |
* @param mixed L'objet QuickForm du formulaire |
* @param string numero du champs input du formulaire (pour le différencier d'autres champs du meme type dans ce formulaire) |
* @param string label à afficher dans le formulaire |
* @param string taille maximum du fichier colonnes de l'élément |
* @param string taille des lignes de l'élément |
* @param string valeur par défaut du formulaire |
* @param string table source pour les valeurs du texte (inutile) |
* @param string ce champs est il obligatoire? (required) |
* @return void |
*/ |
function image(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) { |
//AJOUTER UNE IMAGE |
$html_image= ''; |
if (isset($GLOBALS['_BAZAR_']["id_fiche"])) { |
$requete = 'SELECT bf_url_image FROM bazar_fiche WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche']; |
$resultat = & $GLOBALS['_BAZAR_']['db'] -> query($requete) ; |
if (DB::isError ($resultat)) { |
die ($GLOBALS['_BAZAR_']['db']->getMessage().$GLOBALS['_BAZAR_']['db']->getDebugInfo()) ; |
} |
if ($resultat->numRows()>0) { |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) { |
$image=$ligne->bf_url_image; |
} |
if ($image!=NULL) { |
$lien_supprimer=$GLOBALS['_BAZAR_']['url']; |
$lien_supprimer->addQueryString('action', $_GET['action']); |
$lien_supprimer->addQueryString('id_fiche', $GLOBALS['_BAZAR_']["id_fiche"]); |
$lien_supprimer->addQueryString('typeannonce', $_REQUEST['typeannonce']); |
$lien_supprimer->addQueryString('image', 1); |
$html_image = '<tr>'."\n". |
'<td>'."\n".'<img src="client/bazar/upload/'.$image.'" alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" width="130" height="130" />'."\n".'</td>'."\n". |
'<td>'."\n".'<a href="'.$lien_supprimer->getURL().'" onclick="javascript:return confirm(\''.BAZ_CONFIRMATION_SUPPRESSION_IMAGE.'\');" >'.BAZ_SUPPRIMER.'</a><br /><br />'."\n". |
'<strong>'.BAZ_POUR_CHANGER_IMAGE.'</strong><br />'."\n".'</td>'."\n".'</tr>'."\n"; |
} |
} |
} |
$html ='<tr>'."\n".'<td colspan="2">'."\n".'<h4>'.$label.'</h4>'."\n".'</td>'."\n".'</tr>'."\n"; |
$formtemplate->addElement('html', $html) ; |
if ($html_image!='') $formtemplate->addElement('html', $html_image) ; |
$formtemplate->addElement('file', 'image', BAZ_IMAGE) ; |
//TODO: controler si c'est une image |
$formtemplate->setMaxFileSize($limite1); |
//gestion du champs obligatoire |
if (($dans_moteur_de_recherche==0) && isset($obligatoire) && ($obligatoire==1)) { |
$formtemplate->addRule('image', BAZ_IMAGE_VALIDE_REQUIS, 'required', '', 'client') ; |
} |
} |
/** wikini() - Ajoute un wikini au formulaire |
* |
* @param mixed L'objet QuickForm du formulaire |
* @param string numero du champs input du formulaire (pour le différencier d'autres champs du meme type dans ce formulaire) |
* @param string label à afficher dans le formulaire |
* @param string taille maximum du fichier colonnes de l'élément |
* @param string taille des lignes de l'élément |
* @param string valeur par défaut du formulaire |
* @param string table source pour les valeurs du texte (inutile) |
* @param string ce champs est il obligatoire? (required) |
* @return void |
*/ |
function wikini(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) { |
return; |
} |
/** labelhtml() - Ajoute un élément de type textearea au formulaire |
* |
* @param mixed L'objet QuickForm du formulaire |
* @param string nom de la table dans la base de donnée (pas utilisé) |
* @param string label à afficher dans le formulaire |
* @param string taille des colonnes de l'élément (pas utilisé) |
* @param string taille des lignes de l'élément (pas utilisé) |
* @param string valeur par défaut du formulaire (pas utilisé) |
* @param string table source pour les valeurs du texte (pas utilisé) |
* @param string ce champs est il obligatoire? (required) (pas utilisé) |
* @return void |
*/ |
function labelhtml(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) { |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/html.php'; |
$formhtml= new HTML_QuickForm_html('<tr>'."\n".'<td colspan="2" style="text-align:left;">'."\n".$label."\n".'</td>'."\n".'</tr>'."\n"); |
$formtemplate->addElement($formhtml) ; |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.21 2006/05/19 13:54:11 florian |
* stabilisation du moteur de recherche, corrections bugs, lien recherche avancee |
* |
* Revision 1.20 2006/04/28 12:46:14 florian |
* integration des liens vers annuaire |
* |
* Revision 1.19 2006/03/02 20:36:52 florian |
* les entrees du formulaire de saisir ne sont plus dans les constantes mias dans des tables qui gerent le multilinguisme. |
* |
* Revision 1.18 2006/03/01 16:01:46 florian |
* correction bug déclaration variable $html |
* |
* Revision 1.17 2006/01/30 10:27:03 florian |
* - ajout des entrées de formulaire fichier, url, et image |
* - correction bug d'affichage du mode de saisie |
* |
* Revision 1.16 2006/01/24 14:11:44 alexandre_tb |
* ajout du paramètre emptyOptionValue dans les champs de date |
* |
* Revision 1.15 2006/01/23 16:57:03 alexandre_tb |
* correction d'un notice |
* |
* Revision 1.14 2006/01/19 17:42:11 florian |
* ajout des cases à cocher pré-cochées pour les maj |
* |
* Revision 1.13 2006/01/13 14:12:51 florian |
* utilisation des temlates dans la table bazar_nature |
* |
* Revision 1.12 2006/01/05 16:28:24 alexandre_tb |
* prise en chage des checkbox, reste la mise à jour à gérer |
* |
* Revision 1.11 2006/01/02 13:24:07 alexandre_tb |
* correction de bug d'un mauvais retour en erreur |
* |
* Revision 1.10 2005/12/01 16:05:41 florian |
* changement des chemins pour appli Pear |
* |
* Revision 1.9 2005/11/24 16:17:13 florian |
* corrections bugs, ajout des cases à cocher |
* |
* Revision 1.8 2005/11/18 16:03:23 florian |
* correction bug html entites |
* |
* Revision 1.7 2005/11/07 17:51:06 florian |
* correction bug liste |
* |
* Revision 1.6 2005/11/07 17:30:36 florian |
* ajout controle sur les listes pour la saisie |
* |
* Revision 1.5 2005/11/07 17:05:45 florian |
* amélioration validation conditions de saisie, ajout des règles spécifiques de saisie des formulaires |
* |
* Revision 1.4 2005/10/25 13:53:02 alexandre_tb |
* ajout d'un filtre dans les formulaire texte et textelong |
* |
* Revision 1.3 2005/07/21 19:03:12 florian |
* nouveautés bazar: templates fiches, correction de bugs, ... |
* |
* Revision 1.1.1.1 2005/02/17 18:05:11 florian |
* Import initial de Bazar |
* |
* Revision 1.1.1.1 2005/02/17 11:09:50 florian |
* Import initial |
* |
* Revision 1.1.1.1 2005/02/16 18:06:35 florian |
* import de la nouvelle version |
* |
* Revision 1.4 2004/07/08 11:17:59 alex |
* ajout de commentaires et d'entete |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/tags/Racine_livraison_menes/bibliotheque/bazar.abonnement.inc.php |
---|
New file |
0,0 → 1,65 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU Lesser General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | Lesser General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU Lesser General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id$ |
/** |
* Fonctions d'abonnement a afficher dans la fiche du bottin |
* |
* |
*@package inscription |
//Auteur original : |
*@author Florian Schmitt <florian@ecole-et-nature.org> |
//Autres auteurs : |
* |
*@copyright Outils-Reseaux 2006-2010 |
*@version $Revision$ $Date$ |
*@version $Revision$ $Date$ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
include_once PAP_CHEMIN_RACINE.'client/bazar/configuration/baz_config.inc.php' ; |
include_once PAP_CHEMIN_RACINE.'client/bazar/bibliotheque/bazar.fonct.php' ; |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
$GLOBALS['id_user']=$id; |
if (isset($_GET['action']) && $_GET['action']==BAZ_VOIR_FLUX_RSS) { |
header('Content-type: text/xml; charset=ISO-8859-1'); |
include(PAP_CHEMIN_RACINE.'client/bazar/bazarRSS.php');exit(0);break; |
} else { |
$abonnement = baz_s_inscrire(); |
} |
//-- Fin du code source ------------------------------------------------------------ |
/* |
* $Log$ |
* Revision 1.1 2006/04/28 12:46:14 florian |
* integration des liens vers annuaire |
* |
* |
*/ |
?> |
/tags/Racine_livraison_menes/bibliotheque/bazar.fonct.rss.php |
---|
New file |
0,0 → 1,1053 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU Lesser General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | Lesser General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU Lesser General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: bazar.fonct.rss.php,v 1.60 2006-10-05 08:53:50 florian Exp $ |
/** |
* |
*@package bazar |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@author Florian Schmitt <florian@ecole-et-nature.org> |
//Autres auteurs : |
*@copyright Tela-Botanica 2000-2006 |
*@version $Revision: 1.60 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
require_once BAZ_CHEMIN_APPLI.'bibliotheque/bazar.class.php'; |
require_once BAZ_CHEMIN_APPLI.'bibliotheque/bazar.fonct.php'; |
/** baz_valeur_template() - Renvoi des valeurs inscrite dans le fichier de template |
* |
* @param string valeur du template de bazar_nature |
* |
* @return mixed tableau contenant les champs du fichier template |
*/ |
function baz_valeurs_template($valeur_template) { |
//Parcours du fichier de templates, pour mettre les champs specifiques |
$tableau= array(); |
$nblignes=0; |
$chaine = explode ("\n", $valeur_template); |
array_pop($chaine); |
foreach ($chaine as $ligne) { |
$souschaine = explode ("***", $ligne) ; |
$tableau[$nblignes]['type'] = trim($souschaine[0]) ; |
if (isset($souschaine[1])) {$tableau[$nblignes]['nom_bdd'] = trim($souschaine[1]);} |
else {$tableau[$nblignes]['nom_bdd'] ='';} |
if (isset($souschaine[2])) $tableau[$nblignes]['label'] = trim($souschaine[2]); |
else {$tableau[$nblignes]['label'] ='';} |
if (isset($souschaine[3])) $tableau[$nblignes]['limite1'] = trim($souschaine[3]); |
else {$tableau[$nblignes]['limite1'] ='';} |
if (isset($souschaine[4])) $tableau[$nblignes]['limite2'] = trim($souschaine[4]); |
else {$tableau[$nblignes]['limite2'] ='';} |
if (isset($souschaine[5])) $tableau[$nblignes]['defaut'] = trim($souschaine[5]); |
else {$tableau[$nblignes]['defaut'] ='';} |
if (isset($souschaine[6])) $tableau[$nblignes]['table_source'] = trim($souschaine[6]); |
else {$tableau[$nblignes]['table_source'] ='';} |
if (isset($souschaine[7])) $tableau[$nblignes]['id_source'] = trim($souschaine[7]); |
else {$tableau[$nblignes]['id_source'] ='';} |
if (isset($souschaine[8])) $tableau[$nblignes]['obligatoire'] = trim($souschaine[8]); |
else {$tableau[$nblignes]['obligatoire'] ='';} |
if (isset($souschaine[9])) $tableau[$nblignes]['recherche'] = trim($souschaine[9]); |
else {$tableau[$nblignes]['recherche'] ='';} |
// traitement des cases à cocher, dans ce cas la, on a une table de jointure entre la table |
// de liste et la table bazar_fiche (elle porte un nom du genre bazar_ont_***) |
// dans le template, à la place d'un nom de champs dans 'nom_bdd', on a un nom de table |
// et 2 noms de champs séparés par un virgule ex : bazar_ont_theme,bot_id_theme,bot_id_fiche |
if (isset($tableau[$nblignes]['nom_bdd']) && preg_match('/,/', $tableau[$nblignes]['nom_bdd'])) { |
$tableau_info_jointe = explode (',', $tableau[$nblignes]['nom_bdd']) ; |
$tableau[$nblignes]['table_jointe'] = $tableau_info_jointe[0] ; |
$tableau[$nblignes]['champs_id_fiche'] = $tableau_info_jointe[1] ; |
$tableau[$nblignes]['champs_id_table_jointe'] = $tableau_info_jointe[2] ; |
} |
$nblignes++; |
} |
return $tableau; |
} |
/** baz_voir_fiches() - Permet de visualiser en detail une liste de fiche au format XHTML |
* |
* @global boolean Rajoute des informations internes à l'application (date de modification, lien vers la page de départ de l'appli) |
* @global integer Tableau d(Identifiant des fiches à afficher |
* |
* @return string HTML |
*/ |
function baz_voir_fiches($danslappli, $idfiches=array()) { |
$res=''; |
foreach($idfiches as $idfiche) { |
$res.=baz_voir_fiche($danslappli, $idfiche); |
} |
return $res; |
} |
/** baz_voir_fiche() - Permet de visualiser en detail une fiche au format XHTML |
* |
* @global boolean Rajoute des informations internes a l'application (date de modification, lien vers la page de départ de l'appli) si a 1 |
* @global integer Identifiant de la fiche a afficher |
* |
* @return string HTML |
*/ |
function baz_voir_fiche($danslappli, $idfiche='') { |
$res=''; |
if (isset($_GET['id_fiche'])) $GLOBALS['_BAZAR_']['id_fiche']=$_GET['id_fiche']; |
if ($idfiche!='') $GLOBALS['_BAZAR_']['id_fiche']=$idfiche; |
$url= $GLOBALS['_BAZAR_']['url']; |
$url->addQueryString('action', BAZ_VOIR_FICHE); |
$url->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
$url = preg_replace ('/&/', '&', $url->getURL()) ; |
//cas ou la fiche a été validee |
if (isset($_GET['publiee'])) { |
publier_fiche($_GET['publiee']); |
} |
//cas on une structure s'approprie une ressource |
if (isset($_GET['appropriation'])) { |
if ($_GET['appropriation']==1) { |
$requete = 'INSERT INTO bazar_appropriation VALUES ('.$GLOBALS['_BAZAR_']['id_fiche'].', '.$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID).')'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
} |
elseif ($_GET['appropriation']==0) { |
$requete = 'DELETE FROM bazar_appropriation WHERE ba_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' AND ba_ce_id_structure='.$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID); |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
} |
} |
//cas ou un commentaire a été entre |
if (isset($_POST['Nom'])) { |
$requete = 'INSERT INTO bazar_commentaires VALUES ('. |
baz_nextid('bazar_commentaires', 'bc_id_commentaire', $GLOBALS['_BAZAR_']['db']). |
', '.$GLOBALS['_BAZAR_']['id_fiche'].', "'.$_POST['Nom'].'", "'.$_POST['Commentaire']. |
'", NOW() )'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
} |
//cas ou un commentaire va etre supprime |
elseif (isset($_GET['id_commentaire'])) { |
$requete = 'DELETE FROM bazar_commentaires WHERE bc_id_commentaire='.$_GET['id_commentaire'].' LIMIT 1'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
} |
else { |
if (isset($_GET['action'])) { |
if ($_GET['action']==BAZ_VOIR_FICHE) { |
//sinon on met a jour le nb de visites pour la fiche, puisque c'est une simple consultation |
$requete = 'UPDATE bazar_fiche SET bf_nb_consultations=bf_nb_consultations+1 WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche']; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
} |
} |
} |
$requete = 'SELECT * FROM bazar_fiche WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche']; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) |
: ''; |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ; |
if (!isset($GLOBALS['_BAZAR_']['typeannonce'])) $GLOBALS['_BAZAR_']['typeannonce'] = $ligne['bf_ce_nature']; |
//on verifie si l'utilisateur est administrateur |
$est_admin=0; |
$requete='SELECT bn_id_nature, bn_template, bn_commentaire FROM bazar_nature WHERE bn_id_nature="'.$GLOBALS['_BAZAR_']['typeannonce'].'"'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
$result = $resultat->fetchRow(DB_FETCHMODE_ASSOC); |
$id_nature = $result['bn_id_nature']; |
if (!isset($GLOBALS['_BAZAR_']['template'])) $GLOBALS['_BAZAR_']['template'] = $result['bn_template']; |
if (!isset($GLOBALS['_BAZAR_']['commentaire'])) $GLOBALS['_BAZAR_']['commentaire'] = $result['bn_commentaire']; |
if ($GLOBALS['AUTH']->getAuth()) { |
if ((niveau_droit($result['bn_id_nature'],$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='administrateur') |
or(niveau_droit('0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')) |
{ |
$est_admin=1; |
} |
} |
//affiche le titre sous forme d'image |
if (isset ($GLOBALS['_BAZAR_']['image_titre']) && $GLOBALS['_BAZAR_']['image_titre']!='') { |
$res .= '<img id="BAZ_img_titre" src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_titre'].'" alt="'.$GLOBALS['_BAZAR_']['typeannonce'].'" />'.'<br />'."\n"; |
} |
//affiche le texte sinon |
else { |
//$res .= '<h2 class="BAZ_titre">'.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n"; |
} |
$res .= '<div class="BAZ_cadre_fiche">'."\n"; |
$GLOBALS['_BAZAR_']['annonceur'] = $ligne['bf_ce_utilisateur'] ; |
//si le template existe, on genere le template |
if ((file_exists(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php'))) { |
include_once(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php'); |
$res .=genere_fiche($ligne); |
} |
//on affiche ligne par ligne sinon |
else { |
//cas d'une image personalisée |
if (isset($ligne['bf_url_image'])) { |
$res .= '<div id="fiche_image">'."\n"; |
$res .= '<img src="client/bazar/upload/'.$ligne['bf_url_image'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" width="130" height="130" />'."\n"; |
$res .= '</div>'."\n"; |
} |
//cas d'une image par défaut |
elseif (isset ($GLOBALS['_BAZAR_']['image_logo']) && $GLOBALS['_BAZAR_']['image_logo']!='') { |
$res .= '<div id="fiche_image">'."\n"; |
$res .= '<img src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_logo'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" width="130" height="130" />'."\n"; |
$res .= '</div>'."\n"; |
} |
$res .= '<h1 id="fiche_titre">'.$ligne['bf_titre'].'</h1>'."\n"; |
$res .= '<div id="BAZ_description">'.nl2br($ligne['bf_description']).'</div>'."\n"; |
$tableau=baz_valeurs_template($GLOBALS['_BAZAR_']['template']); |
for ($i=0; $i<count($tableau); $i++) { |
if (isset($ligne[$tableau[$i]['nom_bdd']]) && ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' ) ) { |
$val=$tableau[$i]['nom_bdd']; |
if (!in_array($val, array ('bf_titre', 'bf_description'))) { |
if ($ligne[$val] != '' and $ligne[$val] != BAZ_CHOISIR and $ligne[$val] != BAZ_NON_PRECISE) { |
$res .= '<span class="rubrique">'.$tableau[$i]['label'].':</span>'."\n"; |
$res .= '<span class="description"> '.nl2br($ligne[$val]).'</span>'."\n".'<br />'."\n"; |
} |
} |
} |
elseif ( $tableau[$i]['type']=='liste' || $tableau[$i]['type']=='checkbox' ) { |
//pour les champs renseignes par une liste, on va chercher le label de la liste, plutot que l'id |
$requete = 'SELECT blv_label FROM bazar_fiche_valeur_liste, bazar_liste_valeurs WHERE bfvl_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche']. |
' AND bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND bfvl_valeur=blv_valeur AND blv_ce_liste='.$tableau[$i]['nom_bdd'].' AND blv_ce_i18n="'.$GLOBALS['_BAZAR_']['langue'].'"'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError ($resultat)) { |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
$val='';$nb=0; |
while ($tab = $resultat->fetchRow()) { |
if ($nb>0) $val .= ', '; |
$val .= $tab[0]; |
$nb++; |
} |
if ($val != '' and $val != BAZ_CHOISIR and $val != BAZ_NON_PRECISE) { |
$res .= '<span class="rubrique">'.$tableau[$i]['label'].':</span>'."\n"; |
$res .= '<span class="description"> '.$val.'</span>'."\n".'<br />'."\n"; |
} |
} |
elseif ( $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ) { |
$val=$tableau[$i]['nom_bdd']; |
if (!in_array($val, array ('bf_date_debut_validite_fiche', 'bf_date_fin_validite_fiche'))) { |
if ($ligne[$val] != '') { |
$res .= '<span class="rubrique">'.$tableau[$i]['label'].':</span>'."\n"; |
$res .= '<span class="description"> '.strftime('%d.%m.%Y',strtotime($ligne[$val])).'</span>'."\n".'<br />'."\n"; |
} |
} |
} |
elseif ( $tableau[$i]['type']=='wikini' ) { |
$res .= '<div class="lien_wikini"><a href="wikini/'.baz_titre_wiki($ligne["bf_titre"]).'">'.BAZ_ENTRER_PROJET.'</a></div>'."\n"; |
} |
} |
//afficher les liens pour l'annonce |
$requete = 'SELECT bu_url, bu_descriptif_url FROM bazar_url WHERE bu_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche']; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows()>0) { |
$res .= '<span class="rubrique">'.BAZ_LIEN_INTERNET.':</span>'."\n"; |
$res .= '<span class="description">'."\n"; |
$res .= '<ul>'."\n"; |
while ($ligne1 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$res .= '<li><a href="'.$ligne1['bu_url'].'" target="_blank">'.$ligne1['bu_descriptif_url'].'</a></li>'."\n"; |
} |
$res .= '</ul></span>'."\n"; |
} |
//afficher les fichiers pour l'annonce |
$requete = 'SELECT bfj_description, bfj_fichier FROM bazar_fichier_joint WHERE bfj_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche']; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows()>0) { |
$res .= '<span class="rubrique">'.BAZ_LISTE_FICHIERS_JOINTS.':</span>'."\n"; |
$res .= '<span class="description">'."\n"; |
$res .= '<ul>'."\n"; |
while ($ligne2 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$res .= '<li><a href="client/bazar/upload/'.$ligne2['bfj_fichier'].'">'.$ligne2['bfj_description'].'</a></li>'."\n"; |
} |
$res .= '</ul></span>'."\n"; |
} |
$res .= '<div class="bulle_haut"> </div>'."\n"; |
$res .= '<div class="bulle_corps">'."\n"; |
//affichage du redacteur de la fiche |
$requete = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.', '.BAZ_CHAMPS_EMAIL. |
' FROM '.BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$ligne['bf_ce_utilisateur']; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
while ($redacteur = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$res .= BAZ_FICHE_ECRITE.'<a href="mailto:'.$redacteur[BAZ_CHAMPS_EMAIL].'">'.$redacteur[BAZ_CHAMPS_PRENOM].' '.$redacteur[BAZ_CHAMPS_NOM].'</a><br />'."\n"; |
} |
$res .= BAZ_NB_VUS.'<strong>'.$ligne['bf_nb_consultations'].'</strong>'.BAZ_FOIS.'<br />'."\n"; |
$res .= '</div>'."\n"; |
$res .= '<div class="bulle_bas"> </div>'."\n"; |
$res .= '<div id="BAZ_bas_page">'; |
} |
//informations complementaires (id fiche, etat publication,... ) |
if ($danslappli==1) { |
if ($ligne['bf_statut_fiche']==1 && $GLOBALS['_BAZAR_']['appropriation']!=1 ) { |
$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_DU.' '.strftime('%d.%m.%Y',strtotime($ligne['bf_date_debut_validite_fiche'])).' '.BAZ_AU.' '.strftime('%d.%m.%Y',strtotime($ligne['bf_date_fin_validite_fiche'])).'<br />'."\n"; |
} |
elseif ($GLOBALS['_BAZAR_']['appropriation']!=1 || $ligne['bf_statut_fiche']!=1) { |
$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_NON; |
if ( $est_admin ) { |
$res .= ' <strong>'.BAZ_VALIDER_PUBLICATION.' : </strong>'."\n"; |
$lien_publie = &$GLOBALS['_BAZAR_']['url']; |
$lien_publie->addQueryString('action', BAZ_VOIR_FICHE); |
$lien_publie->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
$lien_publie->addQueryString('typeannonce', $ligne['bf_ce_nature']); |
$lien_publie->addQueryString('publiee', 1); |
$res .= '<a href="'.$lien_publie->getURL().'">'.BAZ_OUI.'</a> / '; |
$lien_publie->removeQueryString('publiee'); |
$lien_publie->addQueryString('publiee', 0); |
$res .='<a href="'.$lien_publie->getURL().'">'.BAZ_NON.'</a>'."\n"; |
$lien_publie->removeQueryString('publiee'); |
} |
$res .= '<br />'."\n"; |
} |
//affichage des infos pouvant interesser les admins |
if ( $est_admin ) { |
$res .= '<span class="rubrique" id="numero_fiche">'.BAZ_NUM_FICHE.':</span> '.$GLOBALS['_BAZAR_']['id_fiche'].'<br />'."\n"; |
$res .= '<span class="rubrique" id="date_creation">'.BAZ_DATE_CREATION.' :</span> '.strftime('%d.%m.%Y à %H:%M',strtotime($ligne['bf_date_creation_fiche'])).'<br />'."\n"; |
} |
//affichage des infos et du lien pour la mise a jour de la fiche |
if ( $est_admin || $GLOBALS['_BAZAR_']['annonceur']==$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID) ) { |
$res .= '<span class="rubrique" id="date_mise_a_jour">'.BAZ_DATE_MAJ.' :</span> '.strftime('%d.%m.%Y à %H:%M',strtotime($ligne['bf_date_maj_fiche']))."\n"; |
$lien_modifier=$GLOBALS['_BAZAR_']['url']; |
$lien_modifier->addQueryString('action', BAZ_ACTION_MODIFIER); |
$lien_modifier->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
$lien_modifier->addQueryString('typeannonce', $ligne['bf_ce_nature']); |
$res .= ' <a href="'.$lien_modifier->getURL().'" id="modifier_fiche">'.BAZ_MODIFIER_LA_FICHE.'</a>'."\n"; |
} |
} |
$res .= '</div>'."\n"; |
$res .= '</div>'."\n"; |
//on ajoute les appropriations, s'il le faut |
if (($danslappli==1)and($GLOBALS['_BAZAR_']['appropriation']==1)) { |
$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche">'."\n"; |
$res .= '<h3>'.BAZ_LES_STRUCTURES_POSSEDANT_UNE_RESSOURCE.'</h3>'."\n"; |
$requete = 'SELECT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.' FROM bazar_appropriation,'.BAZ_ANNUAIRE.' WHERE ba_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' AND ba_ce_id_structure='.BAZ_CHAMPS_ID.' ORDER BY '.BAZ_CHAMPS_NOM.' ASC'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError ($resultat)) { |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
$possede_ressource=0; |
if ($resultat->numRows()>0) { |
$res .= BAZ_IL_Y_A.$resultat->numRows().' '; |
if ($resultat->numRows()==1) $res .= BAZ_STRUCTURE_POSSEDANT.'<br />'."\n"; |
else $res .= BAZ_STRUCTURES_POSSEDANT.'<br />'."\n"; |
$res .= '<ul>'."\n"; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$res .= '<li><a href="'.BAZ_URL_ANNUAIRE.'&voir_fiche='.$ligne[BAZ_CHAMPS_ID].'" onclick="javascript:window.open(this.href);return false;">'.$ligne[BAZ_CHAMPS_NOM].'</a></li>'."\n"; |
if ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)==$ligne[BAZ_CHAMPS_ID]) $possede_ressource=1; |
} |
$res .= '</ul><br />'."\n"; |
} |
else $res .= BAZ_PAS_D_APPROPRIATION.'<br /><br />'."\n"; |
$res .='<p class="bulle_corps">'."\n"; |
$lien_appropriation = $GLOBALS['_BAZAR_']['url']; |
$lien_appropriation->addQueryString('action', BAZ_VOIR_FICHE); |
$lien_appropriation->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
if ($possede_ressource) { |
$lien_appropriation->addQueryString('appropriation', 0); |
$res .= BAZ_POSSEDE_DEJA_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_VOUS_ENLEVER.'</a>'."\n"; |
$lien_appropriation->removeQueryString('appropriation'); |
} |
elseif ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) { |
$lien_appropriation->addQueryString('appropriation', 1); |
$res .= BAZ_SI_POSSEDE_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_APPARAITRE.'</a>'."\n"; |
$lien_appropriation->removeQueryString('appropriation'); |
} |
elseif ($GLOBALS['AUTH']->getAuth() && !$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) { |
$res .= BAZ_IL_FAUT_ETRE_STRUCTURE."\n"; |
} |
elseif (!$GLOBALS['AUTH']->getAuth()) { |
$res .= BAZ_IL_FAUT_ETRE_IDENTIFIE_STRUCTURE."\n"; |
} |
$res .='</p>'."\n"; |
$res .= '</div>'."\n"; |
} |
//on ajoute les commentaires, s'il le faut |
if (($danslappli==1)and($GLOBALS['_BAZAR_']['commentaire']==1)) { |
$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche">'."\n"; |
$res .= '<h3>'.BAZ_LES_COMMENTAIRES.'</h3>'."\n"; |
$requete = 'SELECT * FROM bazar_commentaires WHERE bc_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' ORDER BY bc_date ASC'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError ($resultat)) { |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows()>0) { |
$res .= BAZ_IL_Y_A.$resultat->numRows().' '; |
if ($resultat->numRows()==1) $res .= BAZ_COMMENTAIRE.'<br />'."\n"; |
else $res .= BAZ_COMMENTAIRES.'<br />'."\n"; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$res .= '<div class="bulle_haut"> </div>'."\n"; |
$res .= '<div class="bulle_corps">'."\n"; |
//affichage du commentaire |
$res .= $ligne['bc_commentaire'].'<br />'."\n"; |
$res .= '</div>'."\n"; |
$res .= '<div class="bulle_bas">'."\n"; |
$res .= '<div style="font-size:9px;margin-left:10px;">'.BAZ_PAR.' : <strong>'.$ligne['bc_nom'].'</strong>'.BAZ_ECRIT_LE.$ligne['bc_date'].'</div>'."\n"; |
//pour les identifies seulement, administrateurs de la rubrique ou superadmins |
if ($est_admin==1) { |
$url_comment= $GLOBALS['_BAZAR_']['url']; |
$url_comment->addQueryString('action', BAZ_VOIR_FICHE); |
$url_comment->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']); |
$url_comment->addQueryString('id_commentaire', $ligne['bc_id_commentaire']); |
$res .= '<a href="'.$url_comment->getURL().'" style="font-size:9px;float:right;">'.BAZ_SUPPRIMER.'</a>'."\n"; |
} |
$res .= '</div>'."\n"; |
} |
} |
else $res .= BAZ_PAS_DE_COMMENTAIRES.'<br /><br />'."\n"; |
//formulaire des commentaires |
$form_commentaire = new HTML_QuickForm('bazar_commentaire', 'post', $url); |
$squelette =& $form_commentaire->defaultRenderer(); |
$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n"); |
$squelette->setElementTemplate( '<label style="width:200px;">{label}'. |
'<!-- BEGIN required --><span class="symbole_obligatoire"> *</span><!-- END required -->'."\n". |
'</label><br />'."\n".'{element}<br />'."\n"); |
$squelette->setRequiredNoteTemplate("\n".'<span class="symbole_obligatoire"> *{requiredNote}</span>'."\n"); |
$option=array('style'=>'width:300px;border:1px solid #000;', 'maxlength'=>100); |
$form_commentaire->addElement('text', 'Nom', BAZ_ENTREZ_VOTRE_NOM, $option); |
$option=array('style'=>'width:95%;height:100px;white-space: pre;padding:3px;border:1px solid #000;'); |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/textarea.php'; |
$formtexte= new HTML_QuickForm_textarea('Commentaire', BAZ_ENTREZ_VOTRE_COMMENTAIRE, $option); |
$form_commentaire->addElement($formtexte) ; |
$option=array('style'=>'border:1px solid #000;'); |
$form_commentaire->addElement('submit', 'Envoyer', BAZ_ENVOYER, $option); |
$form_commentaire->addRule('Nom', BAZ_NOM_REQUIS, 'required', '', 'client') ; |
$form_commentaire->addRule('Commentaire', BAZ_COMMENTAIRE_REQUIS, 'required', '', 'client') ; |
$form_commentaire->setRequiredNote(BAZ_CHAMPS_REQUIS) ; |
$res .= $form_commentaire->toHTML(); |
$res .= '</div>'."\n"; |
} |
return $res ; |
} |
/** RSSversHTML () transforme un flux RSS (en XML) en page HTML |
* |
* On passe en paramètre le contenu du flux RSS, on affiche ou non la description, |
* et on choisit de format de la date à l'affichage. On a en sortie du code HTML à afficher |
* |
* @param string le contenu du flux RSS |
* @param boolean afficher ou non la description |
* @param string choisir le format de date: jmah (12/02/2004 12h34) jmh (12/02 12h34) jma (12/02/2004) jm (12/02) ou rien |
* |
* @return string le code HTML |
*/ |
function RSSversHTML($rss, $voirdesc, $formatdate, $affichenb) { |
if ($rss!='') { |
$rawitems='';$title='';$url='';$cat='';$date=''; |
$res=''; |
if( eregi('<item>(.*)</item>', $rss, $rawitems ) ) { |
$items = explode('<item>', $rawitems[0]); |
$res.='<ul id="BAZ_liste_fiche">'."\n"; |
for( $i = 0; $i < count($items)-1; $i++ ) { |
eregi('<title>(.*)</title>',$items[$i+1], $title ); |
eregi('<link>(.*)</link>',$items[$i+1], $url ); |
eregi('<description>(.*)</description>',$items[$i+1], $cat); |
eregi('<pubDate>(.*)</pubDate>',$items[$i+1], $date); |
$res.='<li>'; |
if ($formatdate=='jm') {$res.=strftime('%d.%m',strtotime($date[1])).': ';} |
if ($formatdate=='jma') {$res.=strftime('%d.%m.%Y',strtotime($date[1])).': ';} |
if ($formatdate=='jmh') {$res.=strftime('%d.%m %H:%M',strtotime($date[1])).': ';} |
if ($formatdate=='jmah') {$res.=strftime('%d.%m.%Y %H:%M',strtotime($date[1])).': ';} |
$res.='<a href="'.preg_replace ('/&/', '&', $url[1]).'">'.$title[1].'</a>'; |
if ($voirdesc) {$res.=$cat[1];} |
// Ajout du bouton supprimer pour les superadministrateur |
if (($GLOBALS['AUTH']->getAuth() && niveau_droit(0,$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')and($url[1]!='#')) { |
$mon_url = preg_replace ('/&/', '&', $url[1]) ; |
$url_suppr = new Net_URL(preg_replace ('/&/', '&', $mon_url)) ; |
$url_suppr->addQueryString('action', BAZ_ACTION_SUPPRESSION) ; |
$res .= ' ( <a href="'.$url_suppr->getURL(). |
'" onclick="javascript:return confirm(\''.BAZ_SUPPRIMER.' ?\');">'. |
BAZ_SUPPRIMER.'</a> )'."\n" ; |
} |
$res.='</li>'."\n"; |
} |
$res.='</ul>'."\n"; |
if ($affichenb==1) { |
//une annonce trouvee, on accorde au singulier |
if (((count($items)-1)==1)and($title!=BAZ_PAS_D_ANNONCES)) { |
$res = '<br /><h4>'.BAZ_IL_Y_A.' 1 '.BAZ_FICHE_CORRESPONDANTE.'</h4><br />'."\n".$res; |
} |
//plusieures annonces trouvees, on accorde au pluriel |
else { |
$res = '<br /><h4>'.BAZ_IL_Y_A.(count($items)-1).' '.BAZ_FICHES_CORRESPONDANTES.'</h4><br />'."\n".$res; |
} |
} |
//cas des fiches pas trouvées |
if (((count($items)-1)==1)and($title[1]==BAZ_PAS_D_ANNONCES)) { |
$res = '<br /><h4>'.BAZ_PAS_D_ANNONCES.'</h4><br />'."\n"; |
} |
} |
} |
else $res = BAZ_PAS_D_ANNONCES; |
return $res; |
} |
/** gen_RSS() - generer un fichier de flux RSS par type d'annonce |
* |
* @param string Le type de l'annonce (laisser vide pour tout type d'annonce) |
* @param integer Le nombre d'annonces a regrouper dans le fichier XML (laisser vide pour toutes) |
* @param integer L'identifiant de l'emetteur (laisser vide pour tous) |
* @param integer L'etat de validation de l'annonce (laisser 1 pour les annonces validees, 0 pour les non-validees) |
* @param string La requete SQL personnalisee |
* @param integer La categorie des fiches bazar |
* |
* @return string Le code du flux RSS |
*/ |
function gen_RSS($typeannonce='', $nbitem='', $emetteur='', $valide=1, $requeteSQL='', $requeteSQLFrom = '', $requeteWhereListe = '', $categorie_nature='') { |
// generation de la requete MySQL personnalisee |
$req_where=0; |
$requete = 'SELECT DISTINCT bf_id_fiche, bf_titre, bf_date_debut_validite_fiche, bf_description, bn_label_nature '. |
'FROM bazar_fiche, bazar_nature '.$requeteSQLFrom.' WHERE '.$requeteWhereListe; |
if ($valide!=2) { |
$requete .= 'bf_statut_fiche='.$valide; |
$req_where=1; |
} |
$nomflux=BAZ_DERNIERE_ACTU; |
if (!is_array ($typeannonce) && $typeannonce!='' and $typeannonce!='toutes') { |
if ($req_where==1) {$requete .= ' AND ';} |
$requete .= 'bf_ce_nature='.$typeannonce; |
$req_where=1; |
//le nom du flux devient le type d'annonce |
$requete_nom_flux = 'select bn_label_nature from bazar_nature where bn_id_nature='.$typeannonce ; |
$nomflux = $GLOBALS['_BAZAR_']['db']->getOne($requete_nom_flux) ; |
} |
// Cas où il y plusieurs type d annonce demande |
if (is_array ($typeannonce)) { |
if ($req_where==1) {$requete .= ' AND ';} |
$requete .= 'bf_ce_nature IN (' ; |
$chaine = ''; |
foreach ($typeannonce as $valeur) $chaine .= '"'.$valeur.'",' ; |
$requete .= substr ($chaine, 0, strlen ($chaine)-1) ; |
$requete .= ') '; |
} |
$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']) ; |
if ($valide!=0) { |
if ($utilisateur->isSuperAdmin()) { |
$req_where=1; |
} else { |
if ($req_where==1) { |
$requete .= ' AND '; |
} |
$requete .= '(bf_date_debut_validite_fiche<=NOW() or bf_date_debut_validite_fiche="0000-00-00")'. |
' AND (bf_date_fin_validite_fiche>=NOW() or bf_date_fin_validite_fiche="0000-00-00") AND bn_id_nature=bf_ce_nature'; |
} |
} |
else $nomflux .= BAZ_A_MODERER; |
if ($emetteur!='' && $emetteur!='tous') { |
if ($req_where==1) {$requete .= ' AND ';} |
$requete .= 'bf_ce_utilisateur='.$emetteur; |
$req_where=1; |
//requete pour afficher le nom de la structure |
$requetenom = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '. |
BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$emetteur; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requetenom) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC); |
$nomflux .= ' ('.$ligne[BAZ_CHAMPS_NOM].' '.$ligne[BAZ_CHAMPS_PRENOM].')'; |
} |
if ($requeteSQL!='') { |
if ($req_where==1) {$requete .= ' AND ';} |
$requete .= '('.$requeteSQL.')'; |
$req_where=1; |
} |
if ($categorie_nature!='') { |
if ($req_where==1) {$requete .= ' AND ';} |
$requete .= 'bn_ce_id_menu='.$categorie_nature.' '; |
$req_where=1; |
} |
$requete .= ' ORDER BY bf_date_debut_validite_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC'; |
if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;} |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
// En-tete du flux RSS version 2.0 |
$xml = '<?xml version="1.0" encoding="ISO-8859-1"?>'."\n".'<rss version="2.0">'."\n"; |
$xml .= '<channel>'."\n".'<title>'.$nomflux.'</title>'."\n".'<link>'.BAZ_RSS_ADRESSESITE.'</link>'."\n"; |
$xml .= '<description>'.BAZ_RSS_DESCRIPTIONSITE.'</description>'."\n".'<language>fr-FR</language>'."\n". |
'<copyright>Copyright 2005 '.BAZ_RSS_NOMSITE.'</copyright>'."\n"; |
// Ajout de la date actuelle de publication (suivant la DTD RSS) |
$xml .= '<lastBuildDate>'.strftime('%d %b %Y %H:%M:%S GMT').'</lastBuildDate>'."\n"; |
// En-tete suite et fin |
$xml .= '<docs>http://www.stervinou.com/projets/rss/</docs>'."\n".'<category>'.BAZ_RSS_CATEGORIE.'</category>'."\n". |
'<managingEditor>'.BAZ_RSS_MANAGINGEDITOR.'</managingEditor>'."\n".'<webMaster>'.BAZ_RSS_WEBMASTER.'</webMaster>'."\n"; |
$xml .= '<ttl>60</ttl>'."\n".'<image>'."\n".'<title>'.BAZ_RSS_NOMSITE.'</title>'."\n".'<url>'.BAZ_RSS_LOGOSITE.'</url>'."\n". |
'<link>'.BAZ_RSS_ADRESSESITE.'</link>'."\n".'</image>'."\n"; |
if ($resultat->numRows()>0) { |
// Creation des items : titre + lien + description + date de publication |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$xml .= '<item>'."\n"; |
$xml .= '<title>'.$ligne['bf_titre'].'</title>'."\n"; |
$lien=$GLOBALS['_BAZAR_']['url']; |
$lien->addQueryString('action', BAZ_VOIR_FICHE); |
$lien->addQueryString('id_fiche', $ligne['bf_id_fiche']); |
$xml .= '<link>'.str_replace ('&', '&', $lien->getURL()).'</link>'."\n"; |
$xml .= '<description>'."\n".'<![CDATA[' ; |
if ($_GET['action'] != BAZ_VOIR_TOUTES_ANNONCES) { |
//$xml .= baz_voir_fiche(0,$ligne['bf_id_fiche']) ; |
$xml .= $ligne['bf_description'] ; |
} |
$xml .= ']]>'."\n".'</description>'."\n"; |
$xml .= '<pubDate>'.strftime('%d %b %Y %H:%M:%S GMT',strtotime($ligne['bf_date_debut_validite_fiche'])).'</pubDate>'."\n"; |
$xml .= '</item>'."\n"; |
} |
} |
else {//pas d'annonces |
$xml .= '<item>'."\n"; |
$xml .= '<title>'.BAZ_PAS_D_ANNONCES.'</title>'."\n"; |
$xml .= '<link>#</link>'."\n"; |
$xml .= '<description>'.BAZ_PAS_D_ANNONCES.'</description>'."\n"; |
$xml .= '<pubDate>'.strftime('%d %b %Y %H:%M:%S GMT',strtotime('12/12/2004')).'</pubDate>'."\n"; |
$xml .= '</item>'."\n"; |
} |
$xml .= '</channel>'."\n".'</rss>'."\n"; |
return $xml; |
} |
/** baz_liste() Formate la liste de toutes les annonces actuelles |
* |
* @return string le code HTML a afficher |
*/ |
function baz_liste($typeannonce='toutes') { |
//creation du lien pour le formulaire de recherche |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES); |
if (isset($_REQUEST['recherche_avancee'])) $GLOBALS['_BAZAR_']['url']->addQueryString ('recherche_avancee', $_REQUEST['recherche_avancee']); |
$lien_formulaire = preg_replace ('/&/', '&', $GLOBALS['_BAZAR_']['url']->getURL()) ; |
$formtemplate = new HTML_QuickForm('formulaire', 'post', $lien_formulaire) ; |
$squelette =& $formtemplate->defaultRenderer(); |
$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'<table style="border:0;width:100%;">'."\n".'{content}'."\n".'</table>'."\n".'</form>'."\n"); |
$squelette->setElementTemplate( '<tr>'."\n".'<td style="font-size:12px;width:120px;text-align:right;">'."\n".'{label}'. |
'<!-- BEGIN required --><span class="symbole_obligatoire"> *</span><!-- END required -->'."\n". |
' :</td>'."\n".'<td style="text-align:left;padding:5px;"> '."\n".'{element}'."\n". |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n". |
'</td>'."\n".'</tr>'."\n"); |
$squelette->setElementTemplate( '<tr>'."\n".'<td colspan="2" class="liste_a_cocher"><strong>{label} {element}</strong>'."\n". |
'<!-- BEGIN required --><span class="symbole_obligatoire"> *</span><!-- END required -->'."\n".'</td>'."\n".'</tr>'."\n", 'accept_condition'); |
$squelette->setElementTemplate( '<tr><td colspan="2">{label}{element}</td></tr>'."\n", 'rechercher'); |
$squelette->setRequiredNoteTemplate("\n".'<tr>'."\n".'<td colspan="2" class="symbole_obligatoire">* {requiredNote}</td></tr>'."\n"); |
//Traduction de champs requis |
$formtemplate->setRequiredNote(BAZ_CHAMPS_REQUIS) ; |
$formtemplate->setJsWarnings(BAZ_ERREUR_SAISIE,BAZ_VEUILLEZ_CORRIGER); |
//cas du formulaire de recherche proposant de chercher parmis tous les types d'annonces |
//requete pour obtenir l'id et le label des types d'annonces |
$requete = 'SELECT bn_id_nature, bn_label_nature '. |
'FROM bazar_nature WHERE bn_ce_id_menu='.$GLOBALS['_BAZAR_']['categorie_nature'].' '. |
'ORDER BY bn_label_nature ASC'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
//on récupère le nb de types de fiches, pour plus tard |
$nb_type_de_fiches=$resultat->numRows(); |
$type_annonce_select['toutes']=BAZ_TOUS_TYPES_FICHES; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$type_annonce_select[$ligne['bn_id_nature']] = $ligne['bn_label_nature']; |
$tableau_typeannonces[] = $ligne['bn_id_nature'] ; |
} |
if ($nb_type_de_fiches>1 && $GLOBALS['_BAZAR_']['typeannonce']=='toutes') { |
$res= '<h2>'.BAZ_TOUTES_LES_ANNONCES.'</h2><br />'."\n"; |
$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;', |
'onchange' => 'javascript:this.form.submit();'); |
$formtemplate->addElement ('select', 'nature', BAZ_TYPEANNONCE, $type_annonce_select, $option) ; |
if (isset($_REQUEST['nature'])) { |
$defauts=array('nature'=>$_REQUEST['nature']); |
$formtemplate->setDefaults($defauts); |
} |
} |
//cas du type d'annonces prédéfini |
else { |
if ($nb_type_de_fiches==1) { |
$GLOBALS['_BAZAR_']['typeannonce']=end($type_annonce_select); |
$GLOBALS['_BAZAR_']['id_typeannonce']=key($type_annonce_select); |
} |
$res = '<h2>'.BAZ_TOUTES_LES_ANNONCES_DE_TYPE.' '.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n"; |
} |
//requete pour obtenir l'id, le nom et prenom de toutes les personnes ayant depose une fiche |
// dans le but de construire l'élément de formulaire select avec les noms des émetteurs de fiche |
if (BAZ_RECHERCHE_PAR_EMETTEUR) { |
$requete = 'SELECT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' '. |
'FROM bazar_fiche,'.BAZ_ANNUAIRE.' WHERE ' ; |
$requete .= ' bf_date_debut_validite_fiche<=NOW() AND bf_date_fin_validite_fiche>=NOW() and'; |
$requete .= ' bf_ce_utilisateur='.BAZ_CHAMPS_ID.' '; |
if (!isset($_REQUEST['nature'])) { |
if (isset($GLOBALS['_BAZAR_']['id_typeannonce'])) { |
$requete .= 'AND bf_ce_nature="'.$GLOBALS['_BAZAR_']['id_typeannonce'].'" '; |
} |
} |
else { |
if ($_REQUEST['nature']!='toutes') { |
$requete .= 'AND bf_ce_nature='.$_REQUEST['nature'].' '; |
} |
} |
$requete .= 'ORDER BY '.BAZ_CHAMPS_NOM.' ASC'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
$personnes_select['tous']=BAZ_TOUS_LES_EMETTEURS; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$personnes_select[$ligne[BAZ_CHAMPS_ID]] = $ligne[BAZ_CHAMPS_NOM]." ".$ligne[BAZ_CHAMPS_PRENOM] ; |
} |
$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;'); |
$formtemplate->addElement ('select', 'personnes', BAZ_EMETTEUR, $personnes_select, $option) ; |
} else { |
$formtemplate->addElement ('hidden', 'personnes', 'tous') ; |
} |
//pour les super-administrateurs, on peut voir les annonces non validées |
//on verifie si l'utilisateur est administrateur |
$utilisateur = new Administrateur_bazar($GLOBALS['AUTH']) ; |
if ($utilisateur->isSuperAdmin()) { |
$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;'); |
$valide_select[0] = BAZ_FICHES_PAS_VALIDEES; |
$valide_select[1] = BAZ_FICHES_VALIDEES; |
$valide_select[2] = BAZ_LES_DEUX; |
$formtemplate->addElement ('select', 'valides', BAZ_VALIDE, $valide_select, $option) ; |
$defauts=array('valides'=>1); |
$formtemplate->setDefaults($defauts); |
} |
//champs texte pour entrer les mots cles |
$option=array('maxlength'=>60,'style'=>'border:1px solid #000;width:200px;font:12px Myriad, Arial, sans-serif;'); |
$formtemplate->addElement('text', 'recherche_mots_cles', BAZ_MOT_CLE, $option) ; |
//option cachee pour savoir si le formulaire a ete appele deja |
$formtemplate->addElement('hidden', 'recherche_effectuee', 1) ; |
// Ajout des options si un type de fiche a ete choisie |
if ( (isset($_REQUEST['nature']) && $_REQUEST['nature'] != 'toutes') || (isset($GLOBALS['_BAZAR_']['categorie_nature']) && $nb_type_de_fiches==1)) { |
if ( BAZ_MOTEUR_RECHERCHE_AVANCEE || ( isset($_REQUEST['recherche_avancee'])&&$_REQUEST['recherche_avancee']==1) ) { |
if ($GLOBALS['_BAZAR_']['categorie_nature'] != '') { |
$champs_requete = '' ; |
if (!isset($_REQUEST['nature']) || $_REQUEST['nature'] == '') { |
$_REQUEST['nature'] = $tableau_typeannonces[0]; |
} |
} |
// Récupération du template |
$requete = 'SELECT bn_template FROM bazar_nature WHERE bn_id_nature="'.$_REQUEST['nature'].'"'; |
$resultat = $GLOBALS['_BAZAR_']['db']->getOne($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
if (isset($_REQUEST['recherche_avancee']) && $_REQUEST['recherche_avancee']==1) { |
foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->addQueryString($cle, $valeur); |
$GLOBALS['_BAZAR_']['url']->addQueryString('recherche_avancee', '0'); |
$lien_recherche_de_base = '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHE_DE_BASE.'</a><br />'; |
//lien recherche de base |
labelhtml($formtemplate,'',$lien_recherche_de_base,'','','','',''); |
} |
$tableau = baz_valeurs_template($resultat) ; |
for ($i=0; $i<count($tableau); $i++) { |
if (($tableau[$i]['type'] == 'liste' || $tableau[$i]['type'] == 'checkbox') && $tableau[$i]['recherche'] == 1) { |
$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'], |
$tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire'], 1) ; |
} |
} |
} |
else { |
foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->addQueryString($cle, $valeur); |
$GLOBALS['_BAZAR_']['url']->addQueryString('recherche_avancee', '1'); |
$lien_recherche_avancee = '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHE_AVANCEE.'</a><br />'; |
} |
} |
//lien recherche avancee |
if (isset($lien_recherche_avancee)) { |
labelhtml($formtemplate,'',$lien_recherche_avancee,'','','','',''); |
} |
//Bouton de validation du formulaire |
$option=array('style'=>'border:1px solid #000;width:100px;font:12px Myriad, Arial, sans-serif;'); |
$formtemplate->addElement('submit', 'rechercher', BAZ_RECHERCHER, $option); |
//affichage du formulaire |
$res.=$formtemplate->toHTML()."\n"; |
// Ajout de la table bazar_fiche_liste_valeur dans le from de la requete |
$case_coche = false ; |
$nb_jointures=0; |
$requeteFrom = '' ; |
$requeteWhere = ' bn_ce_id_menu='.$GLOBALS['_BAZAR_']['categorie_nature'].' AND bn_id_nature=bf_ce_nature AND ' ; |
$requeteWhereListe = '' ; |
if ( isset($tableau) ) { |
for ($i = 0; $i < count ($tableau); $i++) { |
if ($tableau[$i]['type'] == 'checkbox' || $tableau[$i]['type'] == 'liste') { |
$nb_jointures++; |
$nom_liste = $tableau[$i]['type'].$tableau[$i]['nom_bdd'] ; |
if (isset($_REQUEST[$nom_liste]) && is_array($_REQUEST[$nom_liste])) { |
$case_coche = true; |
$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND ' ; // Numéro de la liste |
$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_valeur IN (' ; |
$chaine = ''; |
//var_dump($_REQUEST[$nom_liste]); |
foreach ($_REQUEST[$nom_liste] as $cle =>$valeur) { |
if ($valeur == 1) { |
$chaine .= '"'.$cle.'",' ; |
} |
} |
$requeteWhereListe .= substr ($chaine, 0, strlen ($chaine)-1) ; |
$requeteWhereListe .= ') AND '; |
} else { |
if (isset ($_REQUEST[$nom_liste]) && $_REQUEST[$nom_liste]!=0) { |
$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND ' ; // Numéro de la liste |
$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_valeur='.$_REQUEST[$nom_liste].' AND '; |
$case_coche = true; |
} |
} |
} |
} |
} |
if ($case_coche) { |
for ($i = 0; $i < $nb_jointures ; $i++) { |
$requeteFrom .= ', bazar_fiche_valeur_liste as bfvl'.($i+1) ; |
$requeteWhere .= ' bfvl'.($i+1).'.bfvl_ce_fiche=bf_id_fiche AND '; |
} |
$requeteWhere .= $requeteWhereListe; |
} |
if (isset($_REQUEST['nature']) && $_REQUEST['nature']!='' && $_REQUEST['nature']!='toutes') { |
$requeteWhere = 'bf_ce_nature="'.$_REQUEST['nature'].'" AND '.$requeteWhere; |
} |
//affichage des resultats de la recherche si le formulaire a ete envoye |
$requeteSQL=''; |
if (isset($_REQUEST['recherche_effectuee'])) { |
//preparation de la requete pour trouver les mots cles |
if (($_REQUEST['recherche_mots_cles']!='')and($_REQUEST['recherche_mots_cles']!=BAZ_MOT_CLE)) { |
//decoupage des mots cles |
$recherche = split(' ', $_REQUEST['recherche_mots_cles']) ; |
$nbmots=count($recherche); |
$requeteSQL=''; |
for ($i=0; $i<$nbmots; $i++) { |
if ($i>0) $requeteSQL.=' OR '; |
$requeteSQL.='bf_titre LIKE "%'.$recherche[$i].'%" OR bf_description LIKE "%'.$recherche[$i].'%" '; |
} |
} |
if (!isset($_REQUEST['nature'])) { |
if (!isset ($GLOBALS['_BAZAR_']['id_nature'])) $typedefiches = $tableau_typeannonces; |
else $typedefiches = $GLOBALS['_BAZAR_']['id_nature'] ; |
} else { |
$typedefiches = $_REQUEST['nature'] ; |
if ($typedefiches == 'toutes') $typedefiches = $tableau_typeannonces ; |
} |
if ($typeannonce!='toutes') $typedefiches=$typeannonce; |
if (isset($_REQUEST['valides'])) {$valides=$_REQUEST['valides'];} |
else {$valides=1;} |
//generation de la liste de flux a afficher |
if (!isset($_REQUEST['personne'])) $_REQUEST['personne']='tous'; |
$res .= baz_liste_pagine_HTML($typedefiches, '', $_REQUEST['personne'], $valides, $requeteSQL, $requeteFrom, $requeteWhere); |
} |
else { |
//on affiche toutes les annonces |
$res .= '<br /><p class="zone_info">'."\n".BAZ_ENTRER_VOS_CRITERES_DE_RECHERCHE.'</p>'."\n"; |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action'); |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FLUX_RSS); |
$GLOBALS['_BAZAR_']['url']->addQueryString('annonce', $typeannonce); |
$GLOBALS['_BAZAR_']['url']->addQueryString('categorie_nature', $GLOBALS['_BAZAR_']['categorie_nature']); |
$res .= '{{Syndication titre="Les dernières fiches enregistrées" url="'.preg_replace ('/&/', '&', $GLOBALS['_BAZAR_']['url']->getURL()). |
'" nb=10 nouvellefenetre=0 formatdate="'.BAZ_TYPE_AFFICHAGE_LISTE.'"}}'; |
} |
return $res; |
} |
/** |
* Cette fonction renvoie du HTML |
*/ |
function baz_liste_pagine_HTML($typeannonce, $nbitem, $emetteur, $valide, $requeteSQL = '', $requeteFrom = '', $requeteWhere = '') { |
// generation de la requete MySQL personnalisee |
$req_where=0; |
$requete = 'SELECT DISTINCT bf_id_fiche, bf_titre, bf_ce_utilisateur, bf_date_debut_validite_fiche '. |
'FROM bazar_fiche, bazar_nature '.$requeteFrom.' WHERE '.$requeteWhere; |
if ($valide!=2) { |
if ($req_where==1) {$requete .= ' AND ';} |
$req_where=1; |
$requete .= 'bf_statut_fiche='.$valide; |
} else { |
$requete .= '1 ' ; |
} |
$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']) ; |
if ($valide!=0) { |
if ($utilisateur->isSuperAdmin()) { |
$req_where=1; |
} else { |
if ($req_where==1) {$requete .= ' AND ';} |
$requete .= '(bf_date_debut_validite_fiche<=NOW() or bf_date_debut_validite_fiche="0000-00-00")'. |
' AND (bf_date_fin_validite_fiche>=NOW() or bf_date_fin_validite_fiche="0000-00-00") AND bn_id_nature=bf_ce_nature'; |
$req_where=1; |
} |
} |
if ($emetteur!='' && $emetteur!='tous') { |
if ($req_where==1) {$requete .= ' AND ';} |
$requete .= 'bf_ce_utilisateur='.$emetteur; |
$req_where=1; |
//requete pour afficher le nom de la structure |
$requetenom = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '. |
BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$emetteur; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requetenom) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC); |
$nomflux .= ' ('.$ligne[BAZ_CHAMPS_NOM].' '.$ligne[BAZ_CHAMPS_PRENOM].')'; |
} |
if ($requeteSQL!='') { |
if ($req_where==1) {$requete .= ' AND ';} |
$requete .= '('.$requeteSQL.')'; |
$req_where=1; |
} |
$requete .= ' ORDER BY bf_date_debut_validite_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC'; |
if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;} |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
$res = '<br /><h4>'.BAZ_IL_Y_A.($resultat->numRows()).' '.BAZ_FICHES_CORRESPONDANTES.'</h4><br />'."\n"; |
$res .= '<ul>' ; |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FICHE); |
$donnees = array(); |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) { |
$GLOBALS['_BAZAR_']['url']->addQueryString('id_fiche', $ligne->bf_id_fiche) ; |
array_push ($donnees, array ($ligne->bf_id_fiche,$ligne->bf_titre,$ligne->bf_ce_utilisateur)); |
} |
// Mise en place du Pager |
include_once PAP_CHEMIN_API_PEAR.'Pager/Pager.php'; |
$params = array( |
'mode' => BAZ_MODE_DIVISION, |
'perPage' => BAZ_NOMBRE_RES_PAR_PAGE, |
'delta' => BAZ_DELTA, |
'httpMethod' => 'GET', |
'extraVars' => array_merge($_POST, $_GET), |
'altNext' => BAZ_SUIVANT, |
'altPrev' => BAZ_PRECEDENT, |
'nextImg' => BAZ_SUIVANT, |
'prevImg' => BAZ_PRECEDENT, |
'itemData' => $donnees |
); |
$pager = & Pager::factory($params); |
$data = $pager->getPageData(); |
$links = $pager->getLinks(); |
$res .= '<div class="bazar_numero">'.$pager->links.'</div>'."\n"; |
foreach ($data as $valeur) { |
$GLOBALS['_BAZAR_']['url']->addQueryString('id_fiche', $valeur[0]) ; |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FICHE) ; |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.$valeur[1].'</a>'."\n" ; |
if ($utilisateur->isSuperAdmin() || $GLOBALS['id_user']==$valeur[2]) { |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_MODIFIER); |
$res .= '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">('.BAZ_MODIFIER.')</a> ' ; |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action'); |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_SUPPRESSION); |
$res .= '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'" onclick="javascript:return confirm(\''.BAZ_SUPPRIMER.'\');">('.BAZ_SUPPRIMER.')</a>' ; |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action'); |
} |
$res .= '</li>'; |
} |
$res .= '</ul>'; |
$res .= '<div class="bazar_numero">'.$pager->links.'</div>'."\n"; |
return $res ; |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.59 2006/09/21 14:19:39 florian |
* amélioration des fonctions liés au wikini |
* |
* Revision 1.58 2006/09/15 12:31:40 alexandre_tb |
* correction du nom du flux RSS. |
* |
* Revision 1.57 2006/07/25 13:22:27 alexandre_tb |
* réorganisation du code, sans grand changement |
* |
* Revision 1.56 2006/07/18 14:13:35 alexandre_tb |
* Ajout d identifiant HTML |
* |
* Revision 1.55 2006/07/04 14:29:18 alexandre_tb |
* Ajout du bouton supprimer pour les administrateurs |
* |
* Revision 1.54 2006/07/03 09:51:21 alexandre_tb |
* correction du bug recherche sur fiches validés et invalidés. |
* |
* Revision 1.53 2006/06/29 10:29:51 florian |
* correction bug moteur de recherche |
* |
* Revision 1.52 2006/06/02 09:29:07 florian |
* debut d'integration de wikini |
* |
* Revision 1.51 2006/05/23 15:41:27 alexandre_tb |
* ajout de la numérotation des pages en haut et en bas ds résultats et ajout d'une div class=bazar_numero pour les entourer |
* |
* Revision 1.50 2006/05/22 09:55:12 alexandre_tb |
* ajout de la variable recherche_avancee dans l'action du formulaire |
* |
* Revision 1.49 2006/05/19 13:54:11 florian |
* stabilisation du moteur de recherche, corrections bugs, lien recherche avancee |
* |
* Revision 1.48 2006/05/17 09:50:13 alexandre_tb |
* Ajout du moteur de recherche évolué et du découpage par page |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/tags/Racine_livraison_menes/bibliotheque/bazar.fonct.formulaire.controles.php |
---|
New file |
0,0 → 1,51 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU Lesser General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | Lesser General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU Lesser General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: bazar.fonct.formulaire.controles.php,v 1.1 2005-11-07 17:05:45 florian Exp $ |
/** |
* Formulaire controles |
* |
* Les fonctions de controles de saisie des formulaires |
* |
*@package bazar |
//Auteur original : |
*@author Florian SCHMITT <florian@ecole-et-nature.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2005-11-07 17:05:45 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
//-------------------FONCTIONS DE MISE EN PAGE DES FORMULAIRES |
/** liste_choisir() - Teste si une valeur à été choisie pour une liste |
* |
* |
*/ |
function liste_choisir($element_name,$element_value) { |
if ($element_value == 0) { |
return false; |
} |
else { |
return true; |
} |
} |
?> |
/tags/Racine_livraison_menes/bibliotheque/bazar.class.php |
---|
New file |
0,0 → 1,188 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU Lesser General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | Lesser General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU Lesser General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: bazar.class.php,v 1.3 2006-03-29 13:05:12 alexandre_tb Exp $ |
/** |
* |
*@package bazar |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@author Florian Schmitt <florian@ecole-et-nature.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.3 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | LES CONSTANTES DES NIVEAUX DE DROIT | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
class Administrateur_bazar { |
var $_auth ; |
/** |
* Identifiant de l'utilisateur |
*/ |
var $_id_utilisateur ; |
/** |
* Vaut true si l'utilisateur est un administrateur |
*/ |
var $_isSuperAdmin ; |
/** Constructeur |
* |
* @param object Un objet authentification |
* @return void |
* |
*/ |
function Administrateur_bazar (&$AUTH) { |
$this->_auth = $AUTH ; |
if ($AUTH->getAuth())$this->_id_utilisateur = $this->_auth->getAuthData(BAZ_CHAMPS_ID) ; |
} |
/** isSuperAdmin () - Renvoie true si l'utilisateur est un super administrateur |
* |
*/ |
function isSuperAdmin() { |
// On court-circuite si la question a déjà été posé pour ne pas refaire la requete |
if (isset ($this->_isSuperAdmin)) return $this->_isSuperAdmin ; |
// On court-circuite si l'utilisateur n'est pas loggué |
if (!$this->_auth->getAuth()) return false ; |
// Sinon on interroge la base |
$requete = 'select bd_niveau_droit FROM bazar_droits WHERE bd_id_utilisateur='. |
$this->_id_utilisateur. |
' AND bd_niveau_droit=0'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query ($requete) ; |
if (DB::isError($resultat)) { |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows() != 0) { |
$this->_isSuperAdmin = true ; |
} else { |
$this->_isSuperAdmin = false ; |
} |
return $this->_isSuperAdmin; |
} |
/** isAdmin () - Renvoie true si l'utilisateur est administrateur du type de fiche spécifié |
* |
* @param interger type_annonce Le type de l'annonce |
* |
*/ |
function isAdmin($id_nature) { |
// on court-circuite si l'utilisateur n'est pas loggué |
if (!$this->_auth->getAuth()) return false ; |
return $this->_requeteDroit ($id_nature, 2) ; |
} |
/** isRedacteur() - Renvoie true si l'utilisateur est rédacteur du type de fiche spécifié |
* |
*/ |
function isRedacteur($id_nature) { |
return $this->_requeteDroit ($id_nature, 1) ; |
} |
/** _requeteDroit() - fait une requete sur la table bazar_droit |
* |
*/ |
function _requeteDroit ($id_nature, $niveau) { |
$requete = 'select bd_niveau_droit FROM bazar_droits WHERE bd_id_utilisateur=' |
.$this->_id_utilisateur. |
' AND bd_id_nature_offre="'.$id_nature.'" and bd_niveau_droit='.$niveau; |
$resultat = $GLOBALS['_BAZAR_']['db']->query ($requete) ; |
if (DB::isError($resultat)) { |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows() != 0) { |
return true ; |
} |
return false ; |
} |
} |
class Utilisateur_bazar extends Administrateur_bazar { |
function Utilisateur_bazar($id_utilisateur) { |
$this->_id_utilisateur = $id_utilisateur ; |
} |
function isAdmin($id_nature) { |
return $this->_requeteDroit ($id_nature, 2) ; |
} |
/** isSuperAdmin () - Renvoie true si l'utilisateur est un super administrateur |
* |
*/ |
function isSuperAdmin() { |
// On court-circuite si la question a déjà été posé pour ne pas refaire la requete |
if (isset ($this->_isSuperAdmin)) return $this->_isSuperAdmin ; |
// Sinon on interroge la base |
$requete = 'select bd_niveau_droit FROM bazar_droits WHERE bd_id_utilisateur='. |
$this->_id_utilisateur. |
' AND bd_niveau_droit=0'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query ($requete) ; |
if (DB::isError($resultat)) { |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows() != 0) { |
$this->_isSuperAdmin = true ; |
} else { |
$this->_isSuperAdmin = false ; |
} |
return $this->_isSuperAdmin; |
} |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.2 2006/02/09 11:06:12 alexandre_tb |
* changement dans les id des droit |
* 0 => super administrateur |
* 1 => redacteur |
* 2 => administrateur |
* |
* Revision 1.1 2006/02/07 11:08:06 alexandre_tb |
* version initiale |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/tags/Racine_livraison_menes/bazar.inscription.inc.php |
---|
New file |
0,0 → 1,70 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU Lesser General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | Lesser General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU Lesser General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: bazar.inscription.inc.php,v 1.4 2006-12-01 13:23:17 florian Exp $ |
/** |
* |
*@package bazar |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@author Florian Schmitt <florian@ecole-et-nature.org> |
//Autres auteurs : |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision: 1.4 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// RAPPEL : On se situe dans la fonction afficherContenuCorps() de inscription.php |
// requete pour récupérer l'ensemble des type d'annonces |
$requete = 'select bn_id_nature from bazar_nature where 1' ; |
$resultat = $GLOBALS['ins_db']->query ($requete); |
$SQL = '' ; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) { |
$SQL .= '('.$id_utilisateur.', '.$ligne->bn_id_nature.', 1),' ; |
} |
$SQL = substr ($SQL, 0, strlen ($SQL) - 1) ; |
$requete = 'INSERT INTO bazar_droits VALUES '.$SQL; |
$resultat = $GLOBALS['ins_db']->query($requete); |
if (DB::isError($resultat)) { |
echo ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
unset($resultat) ; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.3 2006/04/28 16:10:17 florian |
* inscrit d'office tous les utilisateurs en rédacteur de fiches |
* |
* Revision 1.2 2006/03/29 13:06:07 alexandre_tb |
* Code initial |
* |
* Revision 1.1 2005/09/29 16:14:17 alexandre_tb |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/tags/Racine_livraison_menes/bazarRSS.php |
---|
New file |
0,0 → 1,114 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU Lesser General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | Lesser General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU Lesser General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: bazarRSS.php,v 1.4 2006-05-19 13:54:32 florian Exp $ |
/** |
* Générateur de flux RSS à partir du bazar |
* |
*@package bazar |
//Auteur original : |
*@author Florian SCHMITT <florian@ecole-et-nature.org> |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
* |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.4 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
include_once 'configuration/baz_config.inc.php'; //fichier de configuration de Bazar |
include_once 'bibliotheque/bazar.fonct.rss.php'; //fichier des fonctions RSS de Bazar |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS DU PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
if (isset($_GET['annonce'])) { |
$annonce=$_GET['annonce']; |
} |
else { |
$annonce=''; |
} |
if (isset($_GET['categorie_nature'])) { |
$categorie_nature=$_GET['categorie_nature']; |
} |
else { |
$categorie_nature=''; |
} |
if (isset($_GET['nbitem'])) { |
$nbitem=$_GET['nbitem']; |
} |
else { |
$nbitem=''; |
} |
if (isset($_GET['emetteur'])) { |
$emetteur=$_GET['emetteur']; |
} |
else { |
$emetteur=''; |
} |
if (isset($_GET['valide'])) { |
$valide=$_GET['valide']; |
} |
else { |
$valide=1; |
} |
if (isset($_GET['sql'])) { |
$requeteSQL=$_GET['sql']; |
} |
else { |
$requeteSQL=''; |
} |
echo html_entity_decode(gen_RSS($annonce, $nbitem, $emetteur, $valide, $requeteSQL, '', '', $categorie_nature)); |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.3 2005/07/21 19:03:12 florian |
* nouveautés bazar: templates fiches, correction de bugs, ... |
* |
* Revision 1.1.1.1 2005/02/17 18:05:11 florian |
* Import initial de Bazar |
* |
* Revision 1.1.1.1 2005/02/17 11:09:50 florian |
* Import initial |
* |
* Revision 1.1.1.1 2005/02/16 18:06:35 florian |
* import de la nouvelle version |
* |
* Revision 1.3 2004/07/08 15:06:48 alex |
* modification de la date |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/tags/Racine_livraison_menes/index.php |
---|
New file |
0,0 → 1,66 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU Lesser General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | Lesser General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU Lesser General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: index.php,v 1.5 2005-11-30 13:58:45 florian Exp $ |
/** |
* Index |
* |
* Première page chargée du répertoire de l'appli bazar. Sert à tester l'appli |
* |
*@package bazar |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@author Florian SCHMITT <florian@ecole-et-nature.org> |
//Autres auteurs : |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.5 $ $Date: 2005-11-30 13:58:45 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
include "bazar.php"; |
echo afficherContenuCorps(); |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.4 2005/07/21 19:03:12 florian |
* nouveautés bazar: templates fiches, correction de bugs, ... |
* |
* Revision 1.2 2005/02/22 15:34:04 florian |
* integration dans Papyrus |
* |
* Revision 1.1.1.1 2005/02/17 18:05:11 florian |
* Import initial de Bazar |
* |
* Revision 1.1.1.1 2005/02/17 11:09:50 florian |
* Import initial |
* |
* Revision 1.1.1.1 2005/02/16 18:06:35 florian |
* import de la nouvelle version |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/tags/Racine_livraison_menes/langues/baz_langue_fr.inc.php |
---|
New file |
0,0 → 1,580 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU Lesser General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | Lesser General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU Lesser General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: baz_langue_fr.inc.php,v 1.42 2006-10-05 08:53:50 florian Exp $ |
/** |
* Fichier de traduction en français de l'application Bazar |
* |
*@package bazar |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@author Florian Schmitt <florian@ecole-et-nature.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.42 $ $Date: 2006-10-05 08:53:50 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
define ('BAZ_TITREAPPLI','Gestionnaire de fiches (Bazar) '); |
define ('BAZ_DESCRIPTIONAPPLI','Découvrez Bazar, une application de gestion de fiches classées, consultables en ligne ou par flux RSS, grandement personnalisable.'); |
define ('BAZ_MOTS_CLES','Bazar, fiches, flux, rss, nouveauté, information, gestionnaire, xml, syndication, info, application, php, dynamique, mise, aacute; , jour '); |
define ('BAZ_TOUTES_LES_ANNONCES', 'Consulter les fiches'); |
define ('BAZ_CONSULTER_FICHES_VALIDEES', 'Consulter les fiches validées'); |
define ('BAZ_TOUTES_LES_ANNONCES_DE_TYPE', 'Consulter toutes les fiches de type:'); |
define ('BAZ_TOUS_TYPES_FICHES', 'Tous types de fiches'); |
define ('BAZ_TOUS_LES_EMETTEURS', 'Tous les emetteurs'); |
define ('BAZ_ENTRER_VOS_CRITERES_DE_RECHERCHE','Précisez vos critères de recherche et appuyez sur le bouton "Rechercher" pour consulter les fiches.'); |
define ('BAZ_MODIFIE_RSS','Modifié: ' ); |
define ('BAZ_NOM', 'Nom') ; |
define ('BAZ_PRENOM', 'Prénom') ; |
define ('BAZ_TOUS', 'Tous'); |
define ('BAZ_TOUTES', 'Toutes'); |
define ('BAZ_MOT_CLE', 'Mots clés (facultatif)'); |
define ('BAZ_EMETTEUR', 'Emetteur'); |
define ('BAZ_NATURE', 'Nature de la fiche' ); |
define ('BAZ_STATUT', 'Statut' ); |
define ('BAZ_DATE_CREATION', 'Date de création' ); |
define ('BAZ_DATE_MAJ', 'Date de mise à jour' ); |
define ('BAZ_URL_IMAGE', 'Image' ); |
define ('BAZ_LANGUES_PARLES', 'Langues parlés :') ; |
define ('BAZ_EMAIL', 'E-mail :') ; |
define ('BAZ_MOT_DE_PASSE', 'Mot de passe') ; |
define ('BAZ_TITREANNONCE', 'Titre de la fiche') ; |
define ('BAZ_TYPEANNONCE', 'Type de fiche') ; |
define ('BAZ_ANNONCEUR', 'Annonceur') ; |
define ('BAZ_REPETE_MOT_DE_PASSE', 'Répéter le mot de passe :') ; |
define ('BAZ_OUI', 'Oui') ; |
define ('BAZ_NON', 'Non') ; |
define ('BAZ_ANNULER', 'Annuler') ; |
define ('BAZ_RETOUR', 'Retour') ; |
define ('BAZ_RETABLIR', 'Rétablir') ; |
define ('BAZ_VALIDER', 'Valider') ; |
define ('BAZ_PUBLIER', 'Valider la publication') ; |
define ('BAZ_ETATPUBLICATION', 'Etat de publication') ; |
define ('BAZ_ENCOURSDEVALIDATION', 'En attente de validation'); |
define ('BAZ_REJETEE', 'Rejetée'); |
define ('BAZ_PUBLIEE', 'Publiée') ; |
define ('BAZ_PAS_DE_FICHE', '<br />Vous n\'avez pas encore déposé de fiches.') ; |
define ('BAZ_PAS_DE_FICHE_A_VALIDER', 'Pas de fiches a valider pour l\'instant.'); |
define ('BAZ_VOS_ANNONCES', 'Vos fiches déposées') ; |
define ('BAZ_ANNONCES_A_ADMINISTRER', 'Les fiches à valider') ; |
define ('BAZ_MOTS_DE_PASSE_DIFFERENTS', 'Les mots de passe sont différents !') ; |
define ('BAZ_EMAIL_REQUIS', 'Vous devez saisir un email.') ; |
define ('BAZ_MOT_DE_PASSE_REQUIS', 'Vous devez saisir un mot de passe.') ; |
define ('BAZ_MAIL_INCORRECT', 'L\'email doit avoir une forme correcte, utilisateur@domaine.ext') ; |
define ('BAZ_MAIL_DOUBLE', 'Cet email est déjà utilisé par quelqu\'un d\'autre') ; |
define ('BAZ_NOTE_REQUIS', 'Indique les champs requis') ; |
define ('BAZ_ERREUR_SAISIE', 'Erreur de saisie ') ; |
define ('BAZ_VEUILLEZ_CORRIGER', 'Veuillez corriger') ; |
define ('BAZ_MODIFIER', 'Modifier') ; |
define ('BAZ_MODIFIER_LA_FICHE', 'Modifier la fiche') ; |
define ('BAZ_SUPPRIMER', 'Supprimer') ; |
define ('BAZ_SELECTION', '--Sélectionnez ici--'); |
define ('BAZ_DROITS_PAR_TYPE', 'Droits par type de fiches:'); |
define ('BAZ_TITRE_SAISIE_ANNONCE', 'Entrer une fiche de type: '); |
define ('BAZ_ACCUEIL','Accueil'); |
define ('BAZ_SORTIRDELAPPLI','Quittez l\'application Bazar'); |
define ('BAZ_DEPOSE_UNE_NOUVELLE_ANNONCE', 'Saisir une fiche') ; |
define ('BAZ_CHOIX_TYPEANNONCE', 'Choisissez le type de fiche que vous souhaitez déposer:') ; |
define ('BAZ_GESTION_DES_DROITS', 'Gestion des droits'); |
define ('BAZ_DESCRIPTION_GESTION_DES_DROITS', 'Veuillez choisir un utilisateur dans la liste déroulante ci-dessous pour administrer ses droits.'); |
define ('BAZ_LABEL_CHOIX_PERSONNE', 'Choix de la personne dans l\'annuaire: '); |
define ('BAZ_CONFIRMATION_SUPPRESSION', 'Etes-vous sûr de vouloir supprimer cette fiche ?') ; |
define ('BAZ_NON_VALIDE', 'Non valide') ; |
define ('BAZ_VALIDE', 'Valide') ; |
define ('BAZ_PRECEDENT', 'Précédent') ; |
define ('BAZ_SUIVANT', 'Suivant') ; |
define ('BAZ_PAS_DE_FICHE_CRIT', 'Pas de fiche correspondant à vos critères.') ; |
define ('BAZ_TEXTE_IMG_ALTERNATIF', 'Image de la fiche'); |
define ('BAZ_NUM_FICHE', 'Numéro de fiche'); |
define ('BAZ_ADMIN_ANNONCES', 'Modifier les types de fiches'); |
define ('BAZ_RECHERCHER_DES_ANNONCES', 'Rechercher des fiches'); |
define ('BAZ_RECHERCHE_AVANCEE', 'Recherche avancée >>'); |
define ('BAZ_RECHERCHE_DE_BASE','<< Recherche simple'); |
define ('BAZ_DESCRIPTION_RECHERCHE', 'En précisant, ci dessus, le type de fiche cherché, vous pourrez obtenir des fonctions de recherche avancé.'); |
define ('BAZ_PAS_D_ANNONCES', 'Pas de fiches trouvées.'); |
define ('BAZ_S_INSCRIRE_AUX_ANNONCES', 'S\'abonner à un type de fiche'); |
define ('BAZ_ABONNE', 'Abonné'); |
define ('BAZ_PAS_ABONNE', 'Pas abonné'); |
define ('BAZ_S_ABONNER', 'S\'abonner'); |
define ('BAZ_LAIUS_S_ABONNER', 'Il y a deux manières de s\'abonner:<br />- soit en s\'abonnant pour recevoir les fiches par mails<br />- soit par flux RSS'); |
define ('BAZ_SE_DESABONNER', 'Se désabonner'); |
define ('BAZ_RSS', 'Flux RSS'); |
define ('BAZ_DERNIERE_ACTU', 'Dernières actualités'); |
define ('BAZ_A_MODERER',' à modérer'); |
define ('BAZ_CONSULTER','Consulter'); |
define ('BAZ_SAISIR','Saisir'); |
define ('BAZ_ADMINISTRER','Administrer'); |
define ('BAZ_FICHE_ECRITE','Fiche écrite par : '); |
define ('BAZ_NB_VUS','Cette fiche a été consultée '); |
define ('BAZ_FOIS', ' fois depuis sa création.'); |
define ('BAZ_LES_COMMENTAIRES', 'Les commentaires sur cette fiche'); |
define ('BAZ_PAS_DE_COMMENTAIRES', 'Pas de commentaires postés pour l\'instant, vous êtes le (la) premier (première) !!'); |
define ('BAZ_IL_Y_A', 'Il y a '); |
define ('BAZ_COMMENTAIRE', 'commentaire : '); |
define ('BAZ_COMMENTAIRES', 'commentaires : '); |
define ('BAZ_ENTREZ_VOTRE_NOM', 'Entrez votre nom : '); |
define ('BAZ_ENTREZ_VOTRE_COMMENTAIRE', 'Entrez votre commentaire : '); |
define ('BAZ_ENVOYER','Envoyer'); |
define ('BAZ_NOM_REQUIS', 'Le champs nom ne doit pas rester vide'); |
define ('BAZ_COMMENTAIRE_REQUIS', 'Le champs commentaire ne doit pas rester vide'); |
define ('BAZ_LES_STRUCTURES_POSSEDANT_UNE_RESSOURCE', 'Les structures possédant cette ressource'); |
define ('BAZ_FICHES_PAS_VALIDEES','Seulement les fiches pas validées'); |
define ('BAZ_FICHES_VALIDEES','Seulement les fiches validées'); |
define ('BAZ_LES_DEUX','Fiches validées et non validées'); |
define ('BAZ_VOIR_VOS_ANNONCES', 'Vos fiches'); |
define ('BAZ_RECHERCHER','Rechercher'); |
define ('BAZ_SAISIR_UNE_NOUVELLE_FICHE','Saisir une nouvelle fiche'); |
define ('BAZ_POUR_CHANGER_IMAGE','Pour changer d\'image, il suffit d\'en saisir une autre ci dessous.'); |
define ('BAZ_CONFIRMATION_SUPPRESSION_LIEN', 'Etes-vous sûr de vouloir supprimer ce lien ?') ; |
define ('BAZ_CONFIRMATION_SUPPRESSION_FICHIER', 'Etes-vous sûr de vouloir supprimer ce fichier ?') ; |
define ('BAZ_CONFIRMATION_SUPPRESSION_IMAGE', 'Etes-vous sûr de vouloir supprimer cette image ?') ; |
define ('BAZ_VALIDER_PUBLICATION', 'Valider la publication'); |
define ('BAZ_ENTRER_PROJET', 'ENTRER SUR L\'ESPACE DU PROJET'); |
//================Textes pour les libellés====================================== |
define ('BAZ_ANNONCES','annonces'); |
define ('BAZ_PUBLICATIONS','publications'); |
define ('BAZ_EVENEMENTS','évènements'); |
define ('BAZ_FORMATIONS','formations'); |
define ('BAZ_SEJOURS','séjours'); |
define ('BAZ_EMPLOIS','emplois'); |
define ('BAZ_RESS_HUMAINES','Ressources humaines'); |
define ('BAZ_RESS_DOCS','Ressources documentaires'); |
define ('BAZ_RESS_PHYSIQUES','Ressources physiques'); |
define ('BAZ_RESS_FINANCIERES','Ressources financières'); |
define ('BAZ_JEUX','jeux'); |
define ('BAZ_PETITES_ANNONCES','petites annonces'); |
define ('BAZ_BREVES','brèves'); |
define('BAZ_COMPTES_RENDUS','comptes rendus'); |
define ('BAZ_REALISATION','réalisation'); |
define ('BAZ_PERSONNES_EXPERTES','personnes expertes'); |
define ('BAZ_THEMATIQUE','thématique'); |
define ('BAZ_THEMATIQUE_REQUIS','la thematique est requise'); |
define ('BAZ_SITE_INTERNET','site internet'); |
define ('BAZ_ADRESSE_CONTACT','Adresse du contact'); |
define ('BAZ_MAIL_CONTACT','Mail du contact'); |
define ('BAZ_MAIL_CONTACT_REQUIS','Le mail du contact est requis'); |
//================Textes pour les formations==================================== |
define ('BAZ_TITRE_FORMATION','Intitulé de la formation'); |
define ('BAZ_TITRE_FORMATION_REQUIS','L\'intitulé de la formation est obligatoire, veuillez le saisir'); |
define ('BAZ_SI_MODULE','Si plusieurs modules de formation'); |
define ('BAZ_NUMERO_MODULE','Numéro de module'); |
define ('BAZ_NB_TOTAL_MODULE','Nombre total de modules'); |
define ('BAZ_TYPE_FORMATION','Type de la formation'); |
define ('BAZ_TYPE_FORMATION_REQUIS','Le type de la formation est obligatoire, veuillez le saisir'); |
define ('BAZ_SI_DIPLOMANTE','Si la formation est diplomante'); |
define ('BAZ_DIPLOME_PREPARE', 'Diplòme préparé'); |
define ('BAZ_NIVEAU', 'Niveau'); |
define ('BAZ_SI_QUALIFIANTE', 'Si la formation est qualifiante'); |
define ('BAZ_QUALIF_PREPAREE', 'Qualification préparée'); |
define ('BAZ_OBJECTIFS', 'Objectifs'); |
define ('BAZ_OBJECTIFS_REQUIS', 'Entrer les objectifs est obligatoire, veuillez les saisir'); |
define ('BAZ_CONTENU', 'Contenu'); |
define ('BAZ_PUBLIC', 'Publics'); |
define ('BAZ_PUBLIC_REQUIS', 'Publics'); |
define ('BAZ_CONDITIONS_ACCES', 'Conditions d\'accès'); |
define ('BAZ_DATE_DEBUT_FORMATION', 'Date de début de la formation'); |
define ('BAZ_DATE_FIN_FORMATION', 'Date de fin de la formation'); |
define ('BAZ_DATE_FIN_INSCRIPTION', 'Date limite d\'inscription'); |
define ('BAZ_CP_LIEU_EVENEMENT', 'Code postal du lieu de l\'événement'); |
define ('BAZ_TARIF_INDIVIDUEL', 'Tarif individuel (en euros)'); |
define ('BAZ_TARIF_ENTREPRISE', 'Tarif entreprise (en euros)'); |
define ('BAZ_TARIF_OPCA', 'Tarif OPCA (en euros)'); |
define ('BAZ_NUM_AGREMENT', 'Numéro d\'agréement de la structure'); |
define ('BAZ_NUM_AGREMENT_REQUIS', 'Le numéro d\'agréement de la structure est obligatoire, veuillez le saisir'); |
define ('BAZ_ANNONCE_REQUIS','Le corps de l\'annonce est requis'); |
define ('BAZ_PRENOM_CONTACT', 'Prénom'); |
define ('BAZ_PRENOM_CONTACT_REQUIS', 'Le prénom de la personne contact est obligatoire, veuillez le saisir'); |
define ('BAZ_NOM_CONTACT', 'Nom'); |
define ('BAZ_NOM_CONTACT_REQUIS', 'Le nom de la personne contact est obligatoire, veuillez le saisir'); |
define ('BAZ_MAIL', 'Adresse électronique'); |
define ('BAZ_TELEPHONE', 'Téléphone'); |
define ('BAZ_TELEPHONE_REQUIS', 'Le téléphone du contact est obligatoire, veuillez le saisir'); |
define ('BAZ_INTERVENANTS', 'Les intervenants'); |
define ('BAZ_INFOS_COMPLEMENTAIRE', 'Informations complémentaires'); |
define ('BAZ_COORDONNEES_CONTACT', 'Coordonnées de la personne contact<br />'); |
define ('BAZ_DUREE_DE_PARUTION', '<strong>Durée de parution:</strong> la date de début de parution indique le moment ou la fiche devient visible sur le site, et la date de fin de parution, le moment où elle disparait.<br />'); |
define ('BAZ_LIGNE_HORIZONTALE', '<hr />'); |
define ('BAZ_CHAMPS_REQUIS', ': champs requis'); |
define ('BAZ_PAR', 'par'); |
define ('BAZ_CHAMPS_INDISPENSABLES_CLASSES', 'Champs indispensables pour les classes<br />'); |
define ('BAZ_ECRIT_LE',', écrit le '); |
define ('BAZ_FICHES_CORRESPONDANTES', 'fiches correspondantes à votre recherche') ; |
define ('BAZ_FICHE_CORRESPONDANTE', 'fiche correspondante à votre recherche') ; |
//================Le formulaire ================================================ |
define ('BAZ_AJOUTER_CHAMPS_DE_BASE', 'Ajouter les informations de base pour la fiche'); |
define ('BAZ_PAYS', 'Pays'); |
define ('BAZ_PAYS_REQUIS', 'Le champs pays est requis!'); |
define ('BAZ_ORGANISME', 'Organisme'); |
define ('BAZ_CONTACT', 'Contact'); |
define ('BAZ_REGION', 'Région'); |
define ('BAZ_REGION_REQUIS', 'Le champs région est requis!'); |
define ('BAZ_DEPARTEMENT', 'Département') ; |
define ('BAZ_DEPARTEMENT_REQUIS', 'Le champs département est requis!'); |
define ('BAZ_LICENCE', 'Type de licence') ; |
define ('BAZ_LICENCE_REQUIS', 'Le type de licence est requis!') ; |
define ('BAZ_TITRE', 'Titre') ; |
define ('BAZ_TITRE_REQUIS', 'Un titre de fiche est requis!') ; |
define ('BAZ_DESCRIPTION', 'Description') ; |
define ('BAZ_DESCRIPTION_REQUIS', 'Une description de la fiche est requise!!') ; |
define ('BAZ_DATEDEBVALID', 'Début de parution' ); |
define ('BAZ_DATEDEBVALID_REQUIS', 'La date de début de parution est requise!!') ; |
define ('BAZ_DATEFINVALID', 'Fin de parution' ); |
define ('BAZ_DATEFINVALID_REQUIS', 'La date de fin de parution est requise!!') ; |
define ('BAZ_DU', 'du') ; |
define ('BAZ_AU', 'au') ; |
define ('BAZ_DATE_DEBUT_EVENEMENT', 'Début de l\'évenement' ); |
define ('BAZ_DATE_DEBUT_EVENEMENT_REQUIS', 'La date de début de l\'évenement est requise!!') ; |
define ('BAZ_DATE_FIN_EVENEMENT', 'Fin de l\'évenement' ); |
define ('BAZ_DATE_FIN_EVENEMENT_REQUIS', 'La date de fin de l\'évenement est requise!!') ; |
define ('BAZ_LIEU_EVENEMENT', 'Lieu de l\'évenement' ); |
define ('BAZ_LIEU_EVENEMENT_REQUIS', 'Le lieu de l\'évenement est requis!!') ; |
define ('BAZ_PAS_UNE_IMAGE', 'Ce fichier n\'est pas une image.' ); |
define ('BAZ_AJOUTER_IMAGE', 'Pour l\'instant, pas d\'image associée à la fiche, vous pouvez en ajouter une ci-dessous.' ); |
define ('BAZ_IMAGE', 'Image pour la fiche (facultatif)' ); |
define ('BAZ_IMAGE_VALIDE_REQUIS', 'Le fichier image n\'est pas valide.') ; |
//================Textes pour les parutions===================================== |
define ('BAZ_CODE', 'Code ISBN ou ISSN (s\'il existe)' ); |
define ('BAZ_NOM_AUTEUR', 'Auteur' ); |
define ('BAZ_NOM_AUTEUR_REQUIS', 'L\'auteur est requis'); |
define ('BAZ_EDITEUR', 'Editeur'); |
define ('BAZ_TYPE_PARUTION', 'Type de parution'); |
define ('BAZ_ANNONCE','Annonce'); |
define ('BAZ_CAPACITE_ACCUEIL', 'Capacité d\'accueil' ); |
define ('BAZ_CAPACITE_ACCUEIL_REQUIS', 'La capacité d\'accueil est requise!!') ; |
define ('BAZ_NB_ANIMATEURS', 'Nombre d\'animateurs' ); |
define ('BAZ_NB_ANIMATEURS_REQUIS', 'Le nombre d\'animateurs est requis!!') ; |
define ('BAZ_TARIF', 'Tarif (en euros)' ); |
define ('BAZ_TARIF_REQUIS', 'Le tarif est requis!!') ; |
define ('BAZ_LISTE_TRANCHES_AGES', 'Tranches d\'àges' ); |
define ('BAZ_LISTE_TRANCHES_AGES_REQUIS', 'Les tranches d\'àges sont requises!!') ; |
define ('BAZ_LISTE_URL', 'Liens associés à l\'annonce: '); |
define ('BAZ_PAS_URL', 'Pour l\'instant, pas de lien associé à la fiche, vous pouvez en ajouter ci-dessous.'); |
define ('BAZ_AJOUTER_URL', 'Ajouter un lien (URL) à la fiche'); |
define ('BAZ_LIEN', 'Lien' ); |
define ('BAZ_LIEN_INTERNET', 'Liens Internet' ); |
define ('BAZ_URL_LIEN', 'Adresse du lien (URL)' ); |
define ('BAZ_URL_LIEN_REQUIS', 'L\'adresse du lien (URL) est requise!!') ; |
define ('BAZ_URL_TEXTE', 'Texte du lien' ); |
define ('BAZ_URL_TEXTE_REQUIS', 'Le texte du lien est requis!!') ; |
define ('BAZ_AJOUTER_FICHIER_JOINT','Ajouter un fichier joint à la fiche'); |
define ('BAZ_FICHIER_JOINT', 'Fichier joint' ); |
define ('BAZ_LISTE_FICHIERS_JOINTS', 'Fichiers associés à la fiche '); |
define ('BAZ_PAS_DE_FICHIERS_JOINTS', 'Pour l\'instant, pas de fichier associé à la fiche, vous pouvez en ajouter ci-dessous.'); |
define ('BAZ_FICHIER','Fichier'); |
define ('BAZ_FICHIER_JOINT_REQUIS', 'Le fichier joint est requis!!') ; |
define ('BAZ_FICHIER_DESCRIPTION', 'Description du fichier' ); |
define ('BAZ_FICHIER_TEXTE_REQUIS', 'Le texte du fichier est requis!!') ; |
define ('BAZ_FICHIER_LABEL', 'Label du fichier') ; |
define ('BAZ_FICHIER_LABEL_REQUIS', 'Le label du fichier est requis!!') ; |
define ('BAZ_FICHIER_EXISTANT', 'Il existe déjà un fichier du même nom sur le site.<br />Votre fiche a été associée avec le fichier existant déjà.'); |
define ('BAZ_ACCEPTE_CONDITIONS', 'J\'accepte les conditions de saisie de la fiche'); |
define ('BAZ_ACCEPTE_CONDITIONS_REQUIS', 'Vous devez accepter les conditions de saisie de la fiche'); |
//================Textes pour les emplois======================================= |
define ('BAZ_INTITULE_POSTE', 'Intitulé du poste'); |
define ('BAZ_INTITULE_POSTE_REQUIS', 'L\'intitulé du poste est requis'); |
define ('BAZ_DESCRIPTION_STRUCTURE', 'Description de la structure qui embauche'); |
define ('BAZ_DESCRIPTION_STRUCTURE_REQUIS', 'La description de la structure qui embauche est requise'); |
define ('BAZ_CP_LIEU_TRAVAIL', 'Code postal du lieu de travail'); |
define ('BAZ_LIEU_TRAVAIL', 'Lieu de travail'); |
define ('BAZ_MISSIONS', 'Missions du poste'); |
define ('BAZ_PROFIL', 'Profil du poste'); |
define ('BAZ_PROFIL_REQUIS', 'Le profil du poste est requis'); |
define ('BAZ_NIVEAU_DIPLOME_DEMANDE', 'Niveau de diplome demandé'); |
define ('BAZ_ELEGIBILITE', 'Elegibilité (CES, Emploi jeune,...)'); |
define ('BAZ_TYPE_CONTRAT', 'Type de contrat'); |
define ('BAZ_TYPE_CONTRAT_REQUIS', 'Type de contrat requis'); |
define ('BAZ_FORME_CANDIDATURE', 'Moyen de candidature (envois de CV par mail, lettre manucrite,...)'); |
define ('BAZ_INDICE_SALAIRE', 'Indice salaire'); |
define ('BAZ_SALAIRE_BRUT_MENSUEL', 'Salaire brut mensuel'); |
define ('BAZ_SALAIRE_BRUT_MENSUEL_REQUIS', 'Le salaire brut mensuel est requis'); |
define ('BAZ_ECHEANCE_CANDIDATURE', 'Date d\'échéance de candidature'); |
define ('BAZ_DATE_DEBUT_EMBAUCHE', 'Date de début d\'embauche'); |
//================Textes pour les ressources======================================= |
define ('BAZ_THEME','Thème'); |
define ('BAZ_THEME_REQUIS','Le thème est requis'); |
define ('BAZ_TRANCHES_AGES','Tranches d\'âge'); |
define ('BAZ_TRANCHES_AGES_REQUIS','les tranches d\'â soTRUCTUREnt requises'); |
define ('BAZ_PERIODE', 'Période'); |
define ('BAZ_PERIODE_REQUIS', 'Période requise'); |
define ('BAZ_NIVEAU_SCOLAIRE', 'Niveau scolaire'); |
define ('BAZ_DATE_DEBUT_SEJOUR', 'Date de début du séjour'); |
define ('BAZ_DATE_DEBUT_SEJOUR_REQUIS', 'Date de début du séjour requise'); |
define ('BAZ_DATE_FIN_SEJOUR', 'Date de fin du séjour'); |
define ('BAZ_DATE_FIN_SEJOUR_REQUIS', 'Date de fin du séjour requise'); |
define ('BAZ_LIEU', 'Lieu'); |
define ('BAZ_LIEU_REQUIS', 'Lieu requis'); |
define ('BAZ_MILIEU_DOMINANT', 'Milieu dominant'); |
define ('BAZ_HEBERGEMENT', 'Hébergement'); |
define ('BAZ_HEBERGEMENT_REQUIS', 'Hébergement requis'); |
define ('BAZ_NOMBRE_PLACES', 'Nombre de places'); |
define ('BAZ_NOMBRE_PLACES_REQUIS', 'Nombre de places requis'); |
define ('BAZ_NOMBRE_ANIMS', 'Nombre d\'animateurs'); |
define ('BAZ_NOMBRE_ANIMS_REQUIS', 'Nombre d\'animateurs requis'); |
define ('BAZ_QUALIF_ANIMS', 'Qualification des animateurs'); |
define ('BAZ_QUALIF_ANIMS_REQUIS', 'Qualification des animateurs requise'); |
define ('BAZ_AGREMENTS', 'Agréments'); |
define ('BAZ_ACTIVITES_DOMINANTES', 'Activités dominantes (en 3 mots clés)'); |
define ('BAZ_ACTIVITES_DOMINANTES_REQUIS', 'Activités dominantes requises'); |
define ('BAZ_PRECISION_PRIX', 'Précision sur le prix'); |
define ('BAZ_PRECISION_PRIX_REQUIS', 'Précision sur le prix requise'); |
define ('BAZ_VOYAGE_COMPRIS', 'Voyage compris'); |
define ('BAZ_VOYAGE_COMPRIS_REQUIS', 'Voyage compris requis'); |
define ('BAZ_AIDES_POSSIBLES', 'Aides possibles'); |
define ('BAZ_CHOISIR', 'Choisir...'); |
define ('BAZ_CHOISIR_OBLIGATOIRE', 'Il faut choisir une option dans la liste '); |
define ('BAZ_INDIFFERENT','Indifférent'); |
define ('BAZ_COORDONNEES','Coordonnées'); |
define ('BAZ_ANNEE_PARUTION','Année de parution'); |
define ('BAZ_LANGUE','Langue'); |
define ('BAZ_THEMES','Thèmes'); |
define ('BAZ_PAS_D_APPROPRIATION','Aucune structure ne s\'est approprié cette ressource pour l\'instant.'); |
define ('BAZ_STRUCTURE_POSSEDANT', 'structure possédant cette ressource.'); |
define ('BAZ_STRUCTURES_POSSEDANT', 'structures possédant cette ressource.'); |
define ('BAZ_SI_POSSEDE_RESSOURCE', 'Si vous possèdez cette ressource dans votre structure:'); |
define ('BAZ_POSSEDE_DEJA_RESSOURCE', 'Vous possèdez cette ressource.'); |
define ('BAZ_CLIQUER_POUR_VOUS_ENLEVER', 'cliquez ici pour vous enlever de la liste.'); |
define ('BAZ_IL_FAUT_ETRE_STRUCTURE', 'Seules les structures identifiées peuvent s\'approprier cette ressource.'); |
define ('BAZ_IL_FAUT_ETRE_IDENTIFIE_STRUCTURE', 'En vous identifiant ou ou vous inscrivant en tant que structure, vous pouvez vous associer cette ressource.'); |
define ('BAZ_CLIQUER_POUR_APPARAITRE', 'cliquez ici pour appaitre dans la liste.'); |
define ('BAZ_NON_PRECISE','Non précisé'); |
define ('BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR', 'Pour saisir des fiches, voir vos fiches ou s\'abonner:<br /> veuillez vous identifier ou vous inscrire.'); |
define ('BAZ_EST_SUPERADMINISTRATEUR', 'Cette personne est un super-administrateur.<br />Il peut modifier le droits des utilisateurs et administrer toutes les rubriques de fiches.'); |
define ('BAZ_CHANGER_SUPERADMINISTRATEUR', 'Changer ses droits de super-administrateur pour en faire un utilisateur sans pouvoir'); |
define ('BAZ_AUCUN_DROIT', 'utilisateur sans pouvoir'); |
define ('BAZ_DROIT_REDACTEUR', 'rédacteur'); |
define ('BAZ_DROIT_ADMIN', 'administrateur'); |
define ('BAZ_PASSER_SUPERADMINISTRATEUR', 'Passer la personne en super administrateur'); |
define ('BAZ_ENLEVER_DROIT', 'Passer en utilisateur sans pouvoir'); |
define ('BAZ_TYPE_ANNONCES', 'Types de fiche'); |
define ('BAZ_DROITS_ACTUELS', 'Droits actuels'); |
define ('BAZ_PASSER_EN', 'Passer en'); |
define ('BAZ_OU_PASSER_EN', 'ou passer en'); |
define ('BAZ_CHECKBOX_SUPERADMIN', 'Super administrateur : '); |
define ('BAZ_RADIO_AUCUN', 'aucun '); |
define ('BAZ_RADIO_REDACTEUR', 'rédacteur '); |
define ('BAZ_RADIO_ADMINISTRATEUR', 'administrateur '); |
//================Textes pour les sejours================================== |
define ('BAZ_TITRE_SEJOUR','Titre du séjour'); |
define ('BAZ_TITRE_SEJOUR_REQUIS','Le titre du séjour est obligatoire, veuillez le saisir'); |
define ('BAZ_MAX_60_CAR', '(maximum 60 caractères)'); |
// ================ Texte pour les structures ============================= |
define ('BAZ_FICHE_STRUCTURE', 'Fiche structure') ; |
define ('BAZ_NOM_STRUCTURE', 'Nom de la structure'); |
define ('BAZ_NOM_STRUCTURE_REQUIS', 'Le nom de la structure est requis'); |
define ('BAZ_RAISON_SOCIALE', 'Raison sociale'); |
define ('BAZ_RAISON_SOCIALE_REQUIS', 'Raison sociale requise'); |
define ('BAZ_OBJET', 'Objet'); |
define ('BAZ_OBJET_REQUIS', 'Objet requis'); |
define ('BAZ_ACTIONS', 'Actions'); |
define ('BAZ_PRODUCTIONS', 'Productions'); |
define ('BAZ_RESEAUX', 'Réseaux'); |
define ('BAZ_ADRESSE', 'Adresse'); |
define ('BAZ_ADRESSE_REQUIS', 'Adresse requise'); |
define ('BAZ_FAX', 'Fax'); |
//================ Calendrier Bazar ======================================= |
define ('BAZ_LUNDI','Lundi'); |
define ('BAZ_MARDI','Mardi'); |
define ('BAZ_MERCREDI','Mercredi'); |
define ('BAZ_JEUDI','Jeudi'); |
define ('BAZ_VENDREDI','Vendredi'); |
define ('BAZ_SAMEDI','Samedi'); |
define ('BAZ_DIMANCHE','Dimanche'); |
define ('BAZ_LUNDI_COURT','Lun'); |
define ('BAZ_MARDI_COURT','Mar'); |
define ('BAZ_MERCREDI_COURT','Mer'); |
define ('BAZ_JEUDI_COURT','Jeu'); |
define ('BAZ_VENDREDI_COURT','Ven'); |
define ('BAZ_SAMEDI_COURT','Sam'); |
define ('BAZ_DIMANCHE_COURT','Dim'); |
define ('BAZ_JANVIER','Janvier'); |
define ('BAZ_FEVRIER','Février'); |
define ('BAZ_MARS','Mars'); |
define ('BAZ_AVRIL','Avril'); |
define ('BAZ_MAI','Mai'); |
define ('BAZ_JUIN','Juin'); |
define ('BAZ_JUILLET','Juillet'); |
define ('BAZ_AOUT','Aoút'); |
define ('BAZ_SEPTEMBRE','Septembre'); |
define ('BAZ_OCTOBRE','Octobre'); |
define ('BAZ_NOVEMBRE','Novembre'); |
define ('BAZ_DECEMBRE','Décembre'); |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.41 2006/09/21 14:19:39 florian |
* amélioration des fonctions liés au wikini |
* |
* Revision 1.40 2006/07/19 12:50:00 alexandre_tb |
* Un accent |
* |
* Revision 1.39 2006/06/29 10:30:26 florian |
* correction de BAZ_MOT_CLE |
* |
* Revision 1.38 2006/05/19 13:53:45 florian |
* stabilisation du moteur de recherche, corrections bugs, lien recherche avancee |
* |
* Revision 1.37 2006/04/28 12:46:14 florian |
* integration des liens vers annuaire |
* |
* Revision 1.36 2006/03/14 17:10:21 florian |
* ajout des fonctions de syndication, changement du moteur de recherche |
* |
* Revision 1.35 2006/03/02 20:36:52 florian |
* les entrees du formulaire de saisir ne sont plus dans les constantes mias dans des tables qui gerent le multilinguisme. |
* |
* Revision 1.34 2006/03/01 16:23:22 florian |
* modifs textes fr et correction bug "undefined index" |
* |
* Revision 1.33 2006/03/01 16:00:17 florian |
* ajout de certains mots par rapport aux formulaires de saisie de ressources |
* |
* Revision 1.32 2006/02/09 18:00:17 florian |
* ajout des trois mots, je sais c'est peu de choses!! |
* |
* Revision 1.31 2006/01/18 10:53:28 florian |
* corrections bugs affichage fiche |
* |
* Revision 1.30 2006/01/05 16:28:25 alexandre_tb |
* prise en chage des checkbox, reste la mise à jour à gérer |
* |
* Revision 1.29 2006/01/04 15:31:46 alexandre_tb |
* ajout de label |
* |
* Revision 1.28 2006/01/03 10:19:31 florian |
* Mise à jour pour accepter des parametres dans papyrus: faire apparaitre ou non le menu, afficher qu'un type de fiches, définir l'action par défaut... |
* |
* Revision 1.27 2006/01/02 13:24:23 alexandre_tb |
* ajout de label |
* |
* Revision 1.26 2005/11/30 13:58:45 florian |
* ajouts graphisme (logos, boutons), changement structure SQL bazar_fiche |
* |
* Revision 1.25 2005/11/24 16:17:13 florian |
* corrections bugs, ajout des cases à cocher |
* |
* Revision 1.24 2005/11/08 16:09:26 florian |
* modifs séjours |
* |
* Revision 1.23 2005/11/08 16:06:41 florian |
* modifs séjours |
* |
* Revision 1.22 2005/11/07 17:30:36 florian |
* ajout controle sur les listes pour la saisie |
* |
* Revision 1.21 2005/11/07 17:05:46 florian |
* amélioration validation conditions de saisie, ajout des règles spécifiques de saisie des formulaires |
* |
* Revision 1.20 2005/11/04 17:13:49 florian |
* ajout des textes et du formulaire pour les annonces |
* |
* Revision 1.19 2005/10/31 17:10:56 ddelon |
* Reintegration des commits mysterieusement disparus |
* |
* Revision 1.18 2005/10/24 09:42:21 florian |
* mise a jour appropriation |
* |
* Revision 1.17 2005/10/21 16:15:04 florian |
* mise a jour appropriation |
* |
* Revision 1.13 2005/10/13 14:43:42 florian |
* corrections pb accents |
* |
* Revision 1.12 2005/10/12 16:28:37 florian |
* corrections fautes orthographes |
* |
* Revision 1.11 2005/10/12 16:27:22 florian |
* ajout textes des Ressources |
* |
* Revision 1.10 2005/10/12 16:17:37 florian |
* corrections pb accents |
* |
* Revision 1.9 2005/10/12 16:12:34 florian |
* corrections pb accents |
* |
* Revision 1.8 2005/10/12 15:31:43 florian |
* corrections pb accents |
* |
* Revision 1.7 2005/10/10 16:22:06 alexandre_tb |
* Modification de label pour les rendre plus générique |
* |
* Revision 1.6 2005/09/30 23:04:31 ddelon |
* calendrier bazar |
* |
* Revision 1.5 2005/09/30 12:22:54 florian |
* Ajouts commentaires pour fiche, modifications graphiques, maj SQL |
* |
* Revision 1.3 2005/07/21 19:03:12 florian |
* nouveautés bazar: templates fiches, correction de bugs, ... |
* |
* Revision 1.1.1.1 2005/02/17 18:05:11 florian |
* Import initial de Bazar |
* |
* Revision 1.1.1.1 2005/02/17 11:09:50 florian |
* Import initial |
* |
* Revision 1.1.1.1 2005/02/16 18:06:35 florian |
* import de la nouvelle version |
* |
* Revision 1.6 2004/07/06 16:21:50 florian |
* débuggage modification + MAJ flux RSS |
* |
* Revision 1.5 2004/07/05 15:13:53 florian |
* changement interface de saisie |
* |
* Revision 1.4 2004/07/02 14:51:41 florian |
* ajouts de labels divers |
* |
* Revision 1.3 2004/07/01 16:37:14 florian |
* ajout de labels |
* |
* Revision 1.2 2004/07/01 13:00:24 florian |
* modif Florian |
* |
* Revision 1.1 2004/06/23 09:58:32 alex |
* version initiale |
* |
* Revision 1.1 2004/06/18 09:00:46 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/tags/Racine_livraison_menes/upload/vide.txt |
---|
--- Racine_livraison_menes/bazar.head.php (revision 0) |
+++ Racine_livraison_menes/bazar.head.php (revision 160) |
@@ -0,0 +1,14 @@ |
+<?php |
+include_once 'configuration/baz_config.inc.php'; //fichier de configuration de Bazar |
+ |
+$requete = 'SELECT bn_id_nature, bn_label_nature FROM bazar_nature' ; |
+$resultat = $GLOBALS['_BAZAR_']['db']->query ($requete) ; |
+if (DB::isError($resultat)) { |
+ die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
+} |
+echo '<link rel="alternate" type="application/rss+xml" title="'.BAZ_TOUTES_LES_ANNONCES.'" href="http://'.$_SERVER['HTTP_HOST'].'/bazar/bazarRSS.php" />'."\n"; |
+while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
+ echo '<link rel="alternate" type="application/rss+xml" title="'.$ligne['bn_label_nature'].'" href="http://'.$_SERVER['HTTP_HOST'].'/bazar/bazarRSS.php?annonce='.$ligne['bn_label_nature'].'" />'."\n"; |
+} |
+ |
+?> |
/tags/Racine_livraison_menes/bazar.php |
---|
New file |
0,0 → 1,346 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU Lesser General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | Lesser General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU Lesser General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: bazar.php,v 1.35 2006-10-05 08:53:50 florian Exp $ |
/** |
* |
*@package bazar |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@author Florian Schmitt <florian@ecole-et-nature.org> |
//Autres auteurs : |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.35 $ $Date: 2006-10-05 08:53:50 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
error_reporting(E_ALL); |
require_once PAP_CHEMIN_API_PEAR.'DB.php' ; |
require_once PAP_CHEMIN_API_PEAR.'Auth.php' ; |
require_once 'configuration/baz_config.inc.php'; //fichier de configuration de Bazar |
require_once 'bibliotheque/bazar.class.php'; |
require_once 'bibliotheque/bazar.fonct.php'; //fichier des fonctions de Bazar |
if (defined('PAP_VERSION')) { //si on est dans Papyrus |
GEN_stockerStyleExterne( 'bazar_interne', 'client/bazar/bazar.interne.css'); |
} |
//********************************************************************************************************** |
//initialisation des paramêtres papyrus |
//********************************************************************************************************** |
//si un parametre est précisé dans le gestionnaire de menus papyrus, on le prends en compte |
//parametre action pour lancer directement l'action indiquée |
if (!isset($_GET['action'])and(isset($GLOBALS['_GEN_commun']['info_application']->action))) { |
$_GET['action']=$GLOBALS['_GEN_commun']['info_application']->action; |
} |
//parametre voir_menu pour afficher le menu ou pas (par défaut, il l'affiche) |
if ((isset($GLOBALS['_GEN_commun']['info_application']->voir_menu))and($GLOBALS['_GEN_commun']['info_application']->voir_menu==0)) { |
$GLOBALS['_BAZAR_']['affiche_menu']=0; |
} |
else $GLOBALS['_BAZAR_']['affiche_menu']=1; |
//parametre categorie_nature pour préciser quels types de fiches sont montrees (par défaut, il affiche les id_menu=0) |
if (isset($GLOBALS['_GEN_commun']['info_application']->categorie_nature)) { |
$GLOBALS['_BAZAR_']['categorie_nature']=$GLOBALS['_GEN_commun']['info_application']->categorie_nature; |
} |
elseif (isset($_REQUEST['categorie_nature'])) { |
$GLOBALS['_BAZAR_']['categorie_nature']=$_REQUEST['categorie_nature']; |
} |
else $GLOBALS['_BAZAR_']['categorie_nature']=0; |
//parametre id_nature pour afficher un certain type de fiche (par défaut, tous les types de fiches) |
if (isset($GLOBALS['_GEN_commun']['info_application']->id_nature)) { |
$GLOBALS['_BAZAR_']['id_typeannonce']=$GLOBALS['_GEN_commun']['info_application']->id_nature; |
} |
elseif (!isset($GLOBALS['_BAZAR_']['typeannonce'])) $GLOBALS['_BAZAR_']['typeannonce']='toutes'; |
//********************************************************************************************************** |
//initialisation de la variable globale de bazar |
//********************************************************************************************************** |
$GLOBALS['id_user']=$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID); |
//Recuperer les eventuelles variables passees en GET ou en POST |
if (isset($_REQUEST['id_fiche'])) { |
$GLOBALS['_BAZAR_']['id_fiche']=$_REQUEST['id_fiche']; |
// récupération du type d'annonce à partir de la fiche |
$requete = 'select bf_ce_nature from bazar_fiche where bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'] ; |
$resultat = $GLOBALS['_BAZAR_']['db']->query ($requete) ; |
if (DB::isError($resultat)) { |
echo $resultat->getMessage().'<br />'.$resultat->getInfoDebug(); |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ; |
$GLOBALS['_BAZAR_']['id_typeannonce'] = $ligne->bf_ce_nature ; |
$resultat->free(); |
} |
if (isset($_REQUEST['typeannonce'])) { |
$GLOBALS['_BAZAR_']['id_typeannonce']=$_REQUEST['typeannonce']; |
} |
if ((isset($GLOBALS['_BAZAR_']['id_typeannonce']))and($GLOBALS['_BAZAR_']['id_typeannonce']!='toutes')) { |
$requete = 'SELECT bn_label_nature, bn_condition, bn_template, bn_commentaire, bn_appropriation, bn_image_titre, bn_image_logo FROM bazar_nature WHERE bn_id_nature='.$GLOBALS['_BAZAR_']['id_typeannonce']; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC); |
$GLOBALS['_BAZAR_']['typeannonce']=$ligne['bn_label_nature']; |
$GLOBALS['_BAZAR_']['condition']=$ligne['bn_condition']; |
$GLOBALS['_BAZAR_']['template']=$ligne['bn_template']; |
$GLOBALS['_BAZAR_']['commentaire']=$ligne['bn_commentaire']; |
$GLOBALS['_BAZAR_']['appropriation']=$ligne['bn_appropriation']; |
$GLOBALS['_BAZAR_']['image_titre']=$ligne['bn_image_titre']; |
$GLOBALS['_BAZAR_']['image_logo']=$ligne['bn_image_logo']; |
} |
if (!isset($GLOBALS['_BAZAR_']['id_typeannonce'])) $GLOBALS['_BAZAR_']['id_typeannonce'] = 'toutes' ; |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
if ($GLOBALS['_BAZAR_']['affiche_menu']) { |
//---------------le menu de l'appli----------- |
function afficherContenuNavigation () { |
$res ='<ul id="BAZ_menu">'."\n"; |
//partie consultation d'annonces |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES); |
$res .= '<li id="consulter"'; |
if (!isset($_GET['action']) || (isset($_GET['action']) && ($_GET['action']==BAZ_VOIR_TOUTES_ANNONCES || $_GET['action']==BAZ_VOIR_FICHE))) $res .=' class="onglet_actif" '; |
$res .='><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_CONSULTER.'</a>'."\n".'</li>'."\n"; |
$GLOBALS['_BAZAR_']['url']->removeQueryString('nature'); |
// Mes fiches |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_VOIR_VOS_ANNONCES); |
$res .= '<li id="consulter"'; |
if (isset($_GET['action']) && $_GET['action']==BAZ_ACTION_VOIR_VOS_ANNONCES) $res .=' class="onglet_actif" '; |
$res .= '><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_VOIR_VOS_ANNONCES.'</a>'."\n".'</li>'."\n"; |
$GLOBALS['_BAZAR_']['url']->removeQueryString('nature'); |
//partie abonnement aux annonces |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_S_INSCRIRE); |
$res .= '<li id="inscrire"'; |
if (isset($_GET['action']) && $_GET['action']==BAZ_S_INSCRIRE) $res .=' class="onglet_actif" '; |
$res .= '><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_S_ABONNER.'</a></li>'."\n" ; |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action'); |
//partie saisie d'annonces |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_DEPOSER_ANNONCE); |
$res .= '<li id="deposer"'; |
if (isset($_GET['action']) && ($_GET['action']==BAZ_DEPOSER_ANNONCE || $_GET['action']==BAZ_ACTION_NOUVEAU_V || $_GET['action']==BAZ_ACTION_MODIFIER)) $res .=' class="onglet_actif" '; |
$res .='><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_SAISIR.'</a>'."\n".'</li>'."\n"; |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action'); |
//choix des administrateurs |
$utilisateur = new Administrateur_bazar($GLOBALS['AUTH']) ; |
$est_admin=0; |
if ($GLOBALS['AUTH']->getAuth()) { |
$requete='SELECT bn_id_nature FROM bazar_nature'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
if ($utilisateur->isAdmin ($ligne['bn_id_nature'])) { |
$est_admin=1; |
} |
} |
if ($est_admin || $utilisateur->isSuperAdmin()) { |
//partie administrer |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ANNONCES_A_VALIDER); |
$res .= '<li id="administrer"'; |
if (isset($_GET['action']) && $_GET['action']==BAZ_ANNONCES_A_VALIDER) $res .=' class="onglet_actif" '; |
$res .='><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMINISTRER.'</a></li>'."\n"; |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action'); |
if ($utilisateur->isSuperAdmin()) { |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_GERER_DROITS); |
$res .= '<li id="gerer"'; |
if (isset($_GET['action']) && $_GET['action']==BAZ_GERER_DROITS) $res .=' class="onglet_actif" '; |
$res .='><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_GESTION_DES_DROITS.'</a></li>'."\n" ; |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action'); |
} |
} |
} |
$res.= '</ul>'."\n"; |
return $res ; |
} |
} |
function afficherContenuCorps() { |
$res = ''; |
$res.='<h1 id="titre_bazar">'.$GLOBALS['_GEN_commun']['info_menu']->gm_titre.'</h1>'."\n"; |
if (isset($_GET['action'])) { |
if (($_GET['action']!=BAZ_ACTION_NOUVEAU_V)and($_GET['action']!=BAZ_ACTION_MODIFIER_V)) unset($_SESSION['formulaire_annonce_valide']); |
switch ($_GET['action']) { |
case BAZ_ACTION_VOIR_VOS_ANNONCES : $res .= mes_fiches(); break; |
case BAZ_VOIR_TOUTES_ANNONCES : $res .= baz_liste($GLOBALS['_BAZAR_']['id_typeannonce']); break; |
case BAZ_DEPOSER_ANNONCE : $res .= baz_formulaire(BAZ_DEPOSER_ANNONCE); break; |
case BAZ_ANNONCES_A_VALIDER : $res .= fiches_a_valider(); break; |
case BAZ_ADMINISTRER_ANNONCES : $res .= baz_administrer_annonces(); break; |
case BAZ_MODIFIER_FICHE : $res .= baz_formulaire(BAZ_ACTION_MODIFIER); break; |
case BAZ_SUPPRIMER_FICHE : $res .= baz_suppression().baz_liste('',$GLOBALS['id_user'],''); break; |
case BAZ_VOIR_FICHE : $res .= baz_voir_fiche(1); break; |
case BAZ_ACTION_NOUVEAU : $res .= baz_formulaire(BAZ_ACTION_NOUVEAU); break; |
case BAZ_ACTION_NOUVEAU_V : $res .= baz_formulaire(BAZ_ACTION_NOUVEAU_V).mes_fiches(); break; |
case BAZ_ACTION_MODIFIER : $res .= baz_formulaire(BAZ_ACTION_MODIFIER); break; |
case BAZ_ACTION_MODIFIER_V : $res .= baz_formulaire(BAZ_ACTION_MODIFIER_V).mes_fiches(); break; |
case BAZ_ACTION_SUPPRESSION : $res .= baz_suppression().mes_fiches(); break; |
case BAZ_ACTION_PUBLIER : publier_fiche(1) ;$res .= fiches_a_valider(); break; |
case BAZ_ACTION_PAS_PUBLIER : publier_fiche(0) ;$res .= fiches_a_valider(); break; |
case BAZ_GERER_DROITS : $res .= baz_gestion_droits(); break; |
case BAZ_S_INSCRIRE : $res .= baz_s_inscrire(); break; |
case BAZ_VOIR_FLUX_RSS : header('Content-type: text/xml; charset=ISO-8859-1');include("bazarRSS.php");exit(0);break; |
default : $res .= baz_liste($GLOBALS['_BAZAR_']['id_typeannonce']) ; |
} |
} |
else { |
$res .= baz_liste($GLOBALS['_BAZAR_']['id_typeannonce']); |
} |
return $res ; |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.34 2006/09/04 15:25:12 alexandre_tb |
* ajout d'un id dans la balise HTML du titre |
* |
* Revision 1.33 2006/06/21 15:41:42 alexandre_tb |
* rétablissement du menu mes fiches |
* |
* Revision 1.32 2006/06/21 15:40:15 alexandre_tb |
* rétablissement du menu mes fiches |
* |
* Revision 1.31 2006/05/19 13:54:32 florian |
* stabilisation du moteur de recherche, corrections bugs, lien recherche avancee |
* |
* Revision 1.30 2006/04/28 12:46:14 florian |
* integration des liens vers annuaire |
* |
* Revision 1.29 2006/04/24 10:16:22 alexandre_tb |
* ajout de la globale filtre. |
* elle remplace (à terme) catégorie nature |
* |
* Revision 1.28 2006/03/29 13:05:41 alexandre_tb |
* utilisation de la classe Administrateur_bazar |
* |
* Revision 1.27 2006/02/07 11:08:36 alexandre_tb |
* utilisation de la classe Utilisateur_bazar pour la vérification des droits |
* |
* Revision 1.26 2006/02/06 09:33:53 alexandre_tb |
* modification de l'affichage lors de la saisie de fiche |
* |
* Revision 1.25 2006/01/30 17:25:38 alexandre_tb |
* correction de bugs |
* |
* Revision 1.24 2006/01/26 11:06:43 alexandre_tb |
* ajout d'une requete pour recupere l'id_nature si un id_fiche est passé dans l'url |
* |
* Revision 1.23 2006/01/17 10:07:36 alexandre_tb |
* en cours |
* |
* Revision 1.22 2006/01/16 15:11:28 alexandre_tb |
* simplification code |
* |
* Revision 1.21 2006/01/13 14:12:52 florian |
* utilisation des temlates dans la table bazar_nature |
* |
* Revision 1.20 2006/01/05 16:28:25 alexandre_tb |
* prise en chage des checkbox, reste la mise à jour à gérer |
* |
* Revision 1.19 2006/01/03 10:19:31 florian |
* Mise à jour pour accepter des parametres dans papyrus: faire apparaitre ou non le menu, afficher qu'un type de fiches, définir l'action par défaut... |
* |
* Revision 1.18 2005/12/02 10:57:03 florian |
* MAJ pour paramétrage dans gestion de menus papyrus |
* |
* Revision 1.17 2005/12/01 16:05:41 florian |
* changement des chemins pour appli Pear |
* |
* Revision 1.16 2005/12/01 15:31:30 florian |
* correction bug modifs et saisies |
* |
* Revision 1.15 2005/11/30 13:58:45 florian |
* ajouts graphisme (logos, boutons), changement structure SQL bazar_fiche |
* |
* Revision 1.14 2005/11/24 16:17:13 florian |
* corrections bugs, ajout des cases à cocher |
* |
* Revision 1.13 2005/11/14 16:04:54 florian |
* maj bug affichage flux |
* |
* Revision 1.12 2005/11/07 17:05:46 florian |
* amélioration validation conditions de saisie, ajout des règles spécifiques de saisie des formulaires |
* |
* Revision 1.11 2005/10/21 16:15:04 florian |
* mise a jour appropriation |
* |
* Revision 1.10 2005/10/12 17:20:33 ddelon |
* Reorganisation calendrier + applette |
* |
* Revision 1.9 2005/10/12 13:35:07 florian |
* amélioration de l'interface de bazar, de manière a simplifier les consultations, et à harmoniser par rapport aux Ressources |
* |
* Revision 1.8 2005/09/30 13:00:05 ddelon |
* Fiche bazar generique |
* |
* Revision 1.7 2005/09/30 12:34:44 ddelon |
* petite modification pour integration bazar dans papyrus |
* |
* Revision 1.6 2005/09/30 12:22:54 florian |
* Ajouts commentaires pour fiche, modifications graphiques, maj SQL |
* |
* Revision 1.4 2005/07/21 19:03:12 florian |
* nouveautés bazar: templates fiches, correction de bugs, ... |
* |
* Revision 1.2 2005/02/22 15:33:32 florian |
* integration dans Papyrus |
* |
* Revision 1.1.1.1 2005/02/17 18:05:11 florian |
* Import initial de Bazar |
* |
* Revision 1.1.1.1 2005/02/17 11:09:50 florian |
* Import initial |
* |
* Revision 1.1.1.1 2005/02/16 18:06:35 florian |
* import de la nouvelle version |
* |
* Revision 1.3 2004/07/05 15:10:14 florian |
* changement interface de saisie |
* |
* Revision 1.2 2004/07/01 10:13:41 florian |
* modif Florian |
* |
* Revision 1.1 2004/06/23 09:58:32 alex |
* version initiale |
* |
* Revision 1.1 2004/06/18 09:00:07 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/tags/Racine_livraison_menes/images/Titre_Formations.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/Titre_Formations.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/BAZ_encadre_haut.jpg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/BAZ_encadre_haut.jpg |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/BAZ_Enfants.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/BAZ_Enfants.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/Titre_Parutions.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/Titre_Parutions.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/BAZ_cadre_haut.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/BAZ_cadre_haut.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/BAZ_encadre_bas.jpg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/BAZ_encadre_bas.jpg |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/BAZ_encadre.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/BAZ_encadre.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/BAZ_formation_continue.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/BAZ_formation_continue.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/Logo_Annonces.jpg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/Logo_Annonces.jpg |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/BAZ_cadre_bas.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/BAZ_cadre_bas.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/Titre_Sejours.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/Titre_Sejours.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/Logo_Emplois.jpg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/Logo_Emplois.jpg |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/Logo_Evenements.jpg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/Logo_Evenements.jpg |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/BAZ_formation_diplomante.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/BAZ_formation_diplomante.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/Titre_Annonces.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/Titre_Annonces.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/Logo_Formations.jpg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/Logo_Formations.jpg |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/BAZ_formation_qualifiante.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/BAZ_formation_qualifiante.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/BAZ_mail.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/BAZ_mail.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/Titre_Emplois.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/Titre_Emplois.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/Logo_Parutions.jpg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/Logo_Parutions.jpg |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/BAZ_telephone.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/BAZ_telephone.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/Titre_Evenements.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/Titre_Evenements.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/BAZ_rss.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/BAZ_rss.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/BAZ_encadre_barre.jpg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/BAZ_encadre_barre.jpg |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/images/Logo_Sejours.jpg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/Racine_livraison_menes/images/Logo_Sejours.jpg |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/Racine_livraison_menes/configuration/baz_config.inc.php |
---|
New file |
0,0 → 1,229 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU Lesser General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | Lesser General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU Lesser General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: baz_config.inc.php,v 1.21 2006-10-05 08:53:50 florian Exp $ |
/** |
* Fichier de configuration du bazar |
* |
* A éditer de façon spécifique à chaque déploiement |
* |
*@package bazar |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@author Florian SCHMITT <florian@ecole-et-nature.org> |
//Autres auteurs : |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.21 $ $Date: 2006-10-05 08:53:50 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | LES CONSTANTES DES ACTIONS DE BAZAR | |
// +------------------------------------------------------------------------------------------------------+ |
define ('BAZ_VOIR_TOUTES_ANNONCES', 1) ; |
define ('BAZ_ACTION_VOIR_VOS_ANNONCES', 2); |
define ('BAZ_DEPOSER_ANNONCE', 3) ; |
define ('BAZ_ANNONCES_A_VALIDER', 4) ; |
define ('BAZ_GERER_DROITS', 5) ; |
define ('BAZ_ADMINISTRER_ANNONCES', 6) ; |
define ('BAZ_MODIFIER_FICHE', 7) ; |
if (!defined('BAZ_VOIR_FICHE')) define ('BAZ_VOIR_FICHE', 8) ; |
define ('BAZ_SUPPRIMER_FICHE', 9) ; |
define ('BAZ_ACTION_NOUVEAU', 10) ; |
define ('BAZ_ACTION_NOUVEAU_V', 11) ; |
define ('BAZ_ACTION_MODIFIER', 12) ; |
define ('BAZ_ACTION_MODIFIER_V', 13) ; |
define ('BAZ_ACTION_SUPPRESSION', 14) ; |
define ('BAZ_ACTION_PUBLIER', 15) ; |
define ('BAZ_ACTION_PAS_PUBLIER', 16) ; |
define ('BAZ_S_INSCRIRE', 17); |
define ('BAZ_VOIR_FLUX_RSS', 18); |
//==================================== LES FLUX RSS================================== |
// Constantes liées aux flux RSS |
//================================================================================== |
define('BAZ_CREER_FICHIERS_XML',0); //0=ne cree pas le fichier XML dans rss/; 1=cree le fichier XML dans rss/ |
define('BAZ_RSS_NOMSITE','Educ-Envir.org'); //Nom du site indiqué dans les flux rss |
define('BAZ_RSS_ADRESSESITE','http://educ-envir.org'); //Adresse Internet du site indiqué dans les flux rss |
define('BAZ_RSS_DESCRIPTIONSITE','Educ-Envir.org, pour mutualiser l\'information en éducation à l\'environnement.'); //Description du site indiquée dans les flux rss |
define('BAZ_RSS_LOGOSITE','http://ecole-et-nature.org/images/Logo_REN-Site.png'); //Logo du site indiqué dans les flux rss |
define('BAZ_RSS_MANAGINGEDITOR', '') ; //Managing editor du site |
define('BAZ_RSS_WEBMASTER', '') ; //Mail Webmaster du site |
define('BAZ_RSS_CATEGORIE', 'Education a l\'environnement'); //catégorie du flux RSS |
//==================================== PARAMETRAGE ================================= |
// Pour régler certaines fonctionnalité de l'application |
//================================================================================== |
define ('BAZ_ETAT_VALIDATION',0); |
//Valeur par défaut d'état de la fiche annonce après saisie |
//Mettre 0 pour 'en attente de validation d'un administrateur' |
//Mettre 1 pour 'directement validée en ligne' |
define ('BAZ_TAILLE_MAX_FICHIER',2000*1024); |
//Valeur maximale en octets pour la taille d'un fichier joint à télécharger |
define ('BAZ_TYPE_AFFICHAGE_LISTE', 'jma'); |
$GLOBALS['_BAZAR_']['db'] = & $GLOBALS['_GEN_commun']['pear_db']; |
$GLOBALS['AUTH'] =& $GLOBALS['_GEN_commun']['pear_auth']; |
define ('BAZ_ANNUAIRE','annuaire'); //Table annuaire |
define ('BAZ_CHAMPS_ID','a_id'); //Champs index sur la table annuaire |
define ('BAZ_CHAMPS_NOM','a_nom'); //Champs nom sur la table annuaire |
define ('BAZ_CHAMPS_PRENOM','a_prenom'); //Champs prenom sur la table annuaire |
define ('BAZ_CHAMPS_EST_STRUCTURE','a_est_structure'); //Champs indiquant si c'est une structure qui est identifiée |
define ('BAZ_CHAMPS_EMAIL','a_mail'); //Champs prenom sur la table annuaire |
define ('BAZ_CHAMPS_NOM_WIKI','a_nom_wikini'); //Champs nom wikini sur la table annuaire |
/** Réglage des droits pour déposer des annonces */ |
// Mettre à true pour limiter le dépot aux rédacteurs |
define ('BAZ_RESTREINDRE_DEPOT', 0) ; |
/** Réglage de l'affichage de la liste deroulante pour la saisie des dates */ |
// Mettre à true pour afficher une liste deroulante vide pour la saisie des dates |
define ('BAZ_DATE_VIDE', 0); |
/** Réglage de l'URL de l'annuaire */ |
// Mettre l'URL correspondant à l'annuaire |
define ('BAZ_URL_ANNUAIRE', 'http://localhost/papyrus/papyrus.php?site=1&menu=13'); |
// Mettre à true pour faire apparaitre un champs texte déroulant dans le formulaire |
// de recherche des fiches, pour choisir les émetteurs |
define ('BAZ_RECHERCHE_PAR_EMETTEUR', 1) ; |
$GLOBALS['_BAZAR_']['url'] = $GLOBALS['_GEN_commun']['url']; |
//BAZ_CHEMIN_APPLI : chemin vers l'application bazar METTRE UN SLASH (/) A LA FIN!!!! |
define('BAZ_CHEMIN_APPLI', PAP_CHEMIN_RACINE.'client/bazar/'); |
//==================================== LES LANGUES ================================== |
// Constantes liées à l'utilisation des langues |
//================================================================================== |
$GLOBALS['_BAZAR_']['langue']='fr-FR'; |
define ('BAZ_LANGUE_PAR_DEFAUT', 'fr') ; //Indique un code langue par défaut |
define ('BAZ_VAR_URL_LANGUE', 'lang') ; //Nom de la variable GET qui sera passée dans l'URL (Laisser vide pour les sites monolingues) |
//code pour l'inclusion des langues NE PAS MODIFIER |
if (BAZ_VAR_URL_LANGUE != '' && isset (${BAZ_VAR_URL_LANGUE})) { |
include_once BAZ_CHEMIN_APPLI.'langues/baz_langue_'.${BAZ_VAR_URL_LANGUE}.'.inc.php'; |
} else { |
include_once BAZ_CHEMIN_APPLI.'langues/baz_langue_'.BAZ_LANGUE_PAR_DEFAUT.'.inc.php'; |
} |
// Option concernant la division des resultats en pages |
define ('BAZ_NOMBRE_RES_PAR_PAGE', 30); |
define ('BAZ_MODE_DIVISION', 'Jumping'); // 'Jumping' ou 'Sliding' voir http://pear.php.net/manual/fr/package.html.pager.compare.php |
define ('BAZ_DELTA', 12); // Le nombre de page à afficher avant le 'next'; |
/** Réglage de l'affichage du formulaire de recherche avancee */ |
// Mettre à true pour afficher automatiquement le formulaire de recherche avancee, à false pour avoir un lien afficher la recherche avancee |
define ('BAZ_MOTEUR_RECHERCHE_AVANCEE', 1); |
// Mettre ici le type d'annonce qui va s'afficher dans les calendriers |
define ('BAZ_NUM_ANNONCE_CALENDRIER', 3); |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.20 2006/07/04 13:59:01 alexandre_tb |
* Ajout de la constante BAZ_NUM_ANNONCE_CALENDRIER dans le fichier de conf. Elle indique le type d'annonce que le calendrier doit afficher |
* |
* Revision 1.19 2006/06/21 15:40:15 alexandre_tb |
* rétablissement du menu mes fiches |
* |
* Revision 1.18 2006/06/02 09:29:30 florian |
* ajout constante nom wikini |
* |
* Revision 1.17 2006/05/19 13:53:57 florian |
* stabilisation du moteur de recherche, corrections bugs, lien recherche avancee |
* |
* Revision 1.16 2006/05/17 09:48:48 alexandre_tb |
* Ajout des constantes pour le découpage en page |
* |
* Revision 1.15 2006/04/28 12:46:14 florian |
* integration des liens vers annuaire |
* |
* Revision 1.14 2006/03/24 09:23:30 alexandre_tb |
* ajout de la variable globale $GLOBALS['_BAZAR_']['filtre'] |
* |
* Revision 1.13 2006/03/14 17:10:21 florian |
* ajout des fonctions de syndication, changement du moteur de recherche |
* |
* Revision 1.12 2006/02/07 13:57:41 alexandre_tb |
* ajout de la constante pour masquer la liste des émetteurs |
* |
* Revision 1.11 2006/01/18 10:03:36 florian |
* recodage de l'insertion et de la maj des données relatives aux listes et checkbox dans des formulaires |
* |
* Revision 1.10 2006/01/03 10:19:31 florian |
* Mise à jour pour accepter des parametres dans papyrus: faire apparaitre ou non le menu, afficher qu'un type de fiches, définir l'action par défaut... |
* |
* Revision 1.9 2005/12/16 15:47:54 alexandre_tb |
* ajout de l'option restreindre dépôt |
* |
* Revision 1.8 2005/10/24 09:42:21 florian |
* mise a jour appropriation |
* |
* Revision 1.7 2005/10/21 16:15:04 florian |
* mise a jour appropriation |
* |
* Revision 1.6 2005/09/30 12:22:54 florian |
* Ajouts commentaires pour fiche, modifications graphiques, maj SQL |
* |
* Revision 1.4 2005/07/21 19:03:12 florian |
* nouveautés bazar: templates fiches, correction de bugs, ... |
* |
* Revision 1.2 2005/02/22 15:34:17 florian |
* integration dans Papyrus |
* |
* Revision 1.1.1.1 2005/02/17 18:05:11 florian |
* Import initial de Bazar |
* |
* Revision 1.1.1.1 2005/02/17 11:09:50 florian |
* Import initial |
* |
* Revision 1.1.1.1 2005/02/16 18:06:35 florian |
* import de la nouvelle version |
* |
* Revision 1.5 2004/07/08 12:15:32 florian |
* ajout constantes pour flux RSS |
* |
* Revision 1.4 2004/07/06 16:21:54 florian |
* débuggage modification + MAJ flux RSS |
* |
* Revision 1.3 2004/07/02 14:50:47 florian |
* ajout configuration de l'etat de l'annonce (visible,masquée,...) |
* |
* Revision 1.2 2004/07/01 10:13:30 florian |
* modif Florian |
* |
* Revision 1.1 2004/06/23 09:58:32 alex |
* version initiale |
* |
* Revision 1.1 2004/06/18 09:00:41 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |