Subversion Repositories Applications.bazar

Compare Revisions

Ignore whitespace Rev 153 → Rev 154

/trunk/bibliotheque/bazar.fonct.php
19,7 → 19,7
// | 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.56 2006-09-28 15:41:36 alexandre_tb Exp $
// CVS : $Id: bazar.fonct.php,v 1.57 2006-10-05 08:53:50 florian Exp $
/**
*
* Fonctions du module bazar
31,7 → 31,7
*@author Florian Schmitt <florian@ecole-et-nature.org>
//Autres auteurs :
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.56 $ $Date: 2006-09-28 15:41:36 $
*@version $Revision: 1.57 $ $Date: 2006-10-05 08:53:50 $
// +------------------------------------------------------------------------------------------------------+
*/
 
146,7 → 146,9
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;
}
 
156,8 → 158,8
* @return string HTML
*/
function mes_fiches() {
if ($GLOBALS['AUTH']->getAuth()) {
$res= '<h2>'.BAZ_VOS_ANNONCES.'</h2><br />'."\n";
$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';
205,7 → 207,7
'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(1, array("align" => "left"));
$table->updateColAttributes(2, array("align" => "center"));
$table->updateColAttributes(3, array("align" => "center"));
$table->updateColAttributes(4, array("align" => "center"));
214,8 → 216,26
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=BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR;
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;
}
 
553,7 → 573,7
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" class="form_identification" action="' ;
$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">
1029,7 → 1049,7
$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 bn_ce_id_menu='.$GLOBALS['_BAZAR_']['categorie_nature'];
'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()) ;
1042,7 → 1062,13
'<b>'.BAZ_RSS.'</b>',)) ;
$table->setRowType (0, 'th') ;
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
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']);
1054,11 → 1080,9
$lien_se_desabonner->addQueryString('inscrip', 0);
$lien_RSS=$GLOBALS['_BAZAR_']['url'];
$lien_RSS->addQueryString('action', BAZ_VOIR_FLUX_RSS);
$lien_RSS->addQueryString('action', BAZ_VOIR_FLUX_RSS);
'http://'.$_SERVER['HTTP_HOST'].'/client/bazar/bazarRSS.php?annonce='.$ligne['bn_id_nature'];
//requete pour savoir si la personne est inscrite à ce type d'annonce
//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'];
1092,7 → 1116,22
$table->updateColAttributes(3, array('style' => 'text-align:center;'));
$res.=$table->toHTML() ;
}
else $res .= '<p class="zone_info">'.BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR.'</p>'."\n";
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;
}
1129,7 → 1168,7
}
$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' || $tableau[$i]['type']=='wikini') {
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']]);
}
}
1216,6 → 1255,9
/* +--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
*
/trunk/bibliotheque/bazar.abonnement.inc.php
46,11 → 46,20
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
$GLOBALS['id_user']=$id;
$abonnement = baz_s_inscrire();
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
*
*
*/
?>
/trunk/bibliotheque/bazar.fonct.rss.php
19,7 → 19,7
// | 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.59 2006-09-21 14:19:39 florian Exp $
// CVS : $Id: bazar.fonct.rss.php,v 1.60 2006-10-05 08:53:50 florian Exp $
/**
*
*@package bazar
28,7 → 28,7
*@author Florian Schmitt <florian@ecole-et-nature.org>
//Autres auteurs :
*@copyright Tela-Botanica 2000-2006
*@version $Revision: 1.59 $
*@version $Revision: 1.60 $
// +------------------------------------------------------------------------------------------------------+
*/
 
706,7 → 706,10
}
//cas du type d'annonces prédéfini
else {
if ($nb_type_de_fiches==1) $GLOBALS['_BAZAR_']['typeannonce']=end($type_annonce_select);
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";
}
 
762,14 → 765,12
//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) ;
//$defauts=array('recherche_mots_cles'=>BAZ_MOT_CLE);
//$formtemplate->setDefaults($defauts);
//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 ( (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 = '' ;
784,7 → 785,7
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
if ($_REQUEST['recherche_avancee']==1) {
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 />';
814,9 → 815,7
}
//Bouton de validation du formulaire
$option=array('style'=>'border:1px solid #000;width:100px;font:12px Myriad, Arial, sans-serif;');
//$bouton[] = &HTML_QuickForm::createElement('submit', 'rechercher', BAZ_RECHERCHER, $option);
//$formtemplate->addGroup($bouton, null, null, '');
$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
827,7 → 826,7
$case_coche = false ;
$nb_jointures=0;
$requeteFrom = '' ;
$requeteWhere = '' ;
$requeteWhere = ' bn_ce_id_menu='.$GLOBALS['_BAZAR_']['categorie_nature'].' AND bn_id_nature=bf_ce_nature AND ' ;
$requeteWhereListe = '' ;
if ( isset($tableau) ) {
916,7 → 915,7
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_date_debut_validite_fiche '.
$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 ';}
970,7 → 969,7
$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));
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';
994,7 → 993,10
$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()) {
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>&nbsp;' ;
$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');
1010,6 → 1012,9
/* +--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.
*