Subversion Repositories Sites.gentiana.org

Compare Revisions

Ignore whitespace Rev 65 → Rev 66

/trunk/client/bazar/bazar.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.php,v 1.42 2007-07-05 08:29:24 alexandre_tb Exp $
// CVS : $Id: bazar.php,v 1.45 2007-09-18 14:24:01 alexandre_tb Exp $
/**
*
*@package bazar
28,7 → 28,7
*@author Florian Schmitt <florian@ecole-et-nature.org>
//Autres auteurs :
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.42 $ $Date: 2007-07-05 08:29:24 $
*@version $Revision: 1.45 $ $Date: 2007-09-18 14:24:01 $
// +------------------------------------------------------------------------------------------------------+
*/
 
62,6 → 62,12
$_GET[BAZ_VARIABLE_VOIR]=$GLOBALS['_GEN_commun']['info_application']->vue;
}
 
// Si le parametre vue est vide on le positionne a 1
if (!isset($_GET[BAZ_VARIABLE_VOIR])) {
$_GET[BAZ_VARIABLE_VOIR] = BAZ_VOIR_CONSULTER;
}
 
 
//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;
257,11 → 263,13
case BAZ_VOIR_SAISIR :
if (isset ($_GET['action'])) $res .= baz_formulaire($_GET['action']) ; else $res .= baz_formulaire(BAZ_DEPOSER_ANNONCE);
break;
case BAZ_VOIR_ADMIN: $res .= fiches_a_valider();
case BAZ_VOIR_ADMIN:
if (isset($_GET['action'])) $res .= baz_formulaire($_GET['action']) ; else $res .= fiches_a_valider();
break;
case BAZ_VOIR_GESTION_DROITS: $res .= baz_gestion_droits();
break;
default :
$res .= baz_liste($GLOBALS['_BAZAR_']['id_typeannonce']);
}
}
return $res ;
271,6 → 279,16
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: bazar.php,v $
* Revision 1.45 2007-09-18 14:24:01 alexandre_tb
* onglet administrer
*
* Revision 1.44 2007-09-06 15:39:28 alexandre_tb
* fixation d une valeur par defaut a la variable vue pour
* eviter un ecran vide si pas de parametres dans le menu
*
* Revision 1.43 2007-08-27 12:26:04 alexandre_tb
* Mise en place de l action BAZ_VOIR_ADMIN
*
* Revision 1.42 2007-07-05 08:29:24 alexandre_tb
* modification du charset iso-8859-1 vers utf8 lors l'envoie des entetes xml.
*
/trunk/client/bazar/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.67 2007-07-04 10:01:30 alexandre_tb Exp $
// CVS : $Id: bazar.fonct.php,v 1.69 2007-09-18 07:39:42 alexandre_tb 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.67 $ $Date: 2007-07-04 10:01:30 $
*@version $Revision: 1.69 $ $Date: 2007-09-18 07:39:42 $
// +------------------------------------------------------------------------------------------------------+
*/
 
165,7 → 165,7
}
$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>';
//$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>';
 
// Nettoyage de l'url
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
261,9 → 261,8
* @return string HTML
*/
function mes_fiches() {
$res= '<h2>'.BAZ_VOS_ANNONCES.'</h2><br />'."\n";
if ($GLOBALS['AUTH']->getAuth()) {
$res= '<h2>'.BAZ_VOS_ANNONCES.'</h2><br />'."\n";
// 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 IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') ORDER BY bf_date_maj_fiche DESC,bf_ce_nature ASC';
327,7 → 326,7
else {
$res .= BAZ_IDENTIFIEZ_VOUS_PRESENTATION_XHTML;
$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" class="form_identification" action="' ;
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_VOIR_VOS_ANNONCES);
$res .= $GLOBALS['_BAZAR_']['url']->getURL();
$res .= '" method="post">
344,8 → 343,11
// Nettoyage de l'url
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
$GLOBALS['_BAZAR_']['url']->removeQueryString('id_fiche');
$GLOBALS['_BAZAR_']['url']->removeQueryString('typeannonce');
$GLOBALS['_BAZAR_']['url']->removeQueryString('typeannonce');*/
include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazarTemplate.class.php';
$modele = new bazarTemplate($GLOBALS['_BAZAR_']['db']);
$res .= $modele->getTemplate(BAZ_TEMPLATE_MESSAGE_LOGIN, $GLOBALS['_BAZAR_']['langue']);
}
return $res;
}
 
605,7 → 607,10
if (DB::isError($resultat)) {
return ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
$res.='<h2>'.BAZ_DEPOSE_UNE_NOUVELLE_ANNONCE.'</h2>'."\n";
//$res.='<h2>'.BAZ_DEPOSE_UNE_NOUVELLE_ANNONCE.'</h2>'."\n";
include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazarTemplate.class.php';
$modele = new bazarTemplate($GLOBALS['_BAZAR_']['db']);
$res .= $modele->getTemplate(BAZ_TEMPLATE_FORMULAIRE_ACCUEIL, $GLOBALS['_BAZAR_']['langue']);
if ($resultat->numRows()==1) {
$ligne = $resultat->fetchRow (DB_FETCHMODE_ASSOC);
$GLOBALS['_BAZAR_']['id_typeannonce']=$ligne['bn_id_nature'];
663,8 → 668,15
unset ($_SESSION['formulaire_annonce_valide']) ;
$lien_formulaire->addQueryString('action', BAZ_ACTION_NOUVEAU_V);
$formtemplate->updateAttributes(array('action' => str_replace('&amp;', '&', $lien_formulaire->getURL())));
 
$res = baz_afficher_formulaire_annonce('insertion',$formtemplate);
// Appel du modele
include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazarTemplate.class.php';
$modele = new bazarTemplate($GLOBALS['_BAZAR_']['db']);
$html = $modele->getTemplate(BAZ_TEMPLATE_FORMULAIRE, $GLOBALS['_BAZAR_']['langue'],$GLOBALS['_BAZAR_']['categorie_nature']);
if (!PEAR::isError($html)) {
$res = str_replace ('{FORMULAIRE}', baz_afficher_formulaire_annonce('insertion',$formtemplate), $html);
} else {
$res = baz_afficher_formulaire_annonce('insertion',$formtemplate);
}
}
//------------------------------------------------------------------------------------------------
747,9 → 759,9
baz_suppression_image($GLOBALS['_BAZAR_']['id_fiche']);
}
}
$res = '';
//titre de la rubrique
$res= '<h2>'.BAZ_TITRE_SAISIE_ANNONCE.'&nbsp;'.$GLOBALS['_BAZAR_']['typeannonce'].'</h2><br />'."\n";
if (!BAZ_UTILISE_TEMPLATE) $res= '<h2>'.BAZ_TITRE_SAISIE_ANNONCE.'&nbsp;'.$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");
953,6 → 965,7
$utilisateur = new Administrateur_bazar($GLOBALS['AUTH']);
if ($utilisateur->isRedacteur($GLOBALS['_BAZAR_']['id_typeannonce'])) {
$mails = bazar::getMailAdmin($GLOBALS['_BAZAR_']['id_typeannonce']);
include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazarTemplate.class.php';
$template = new bazarTemplate($GLOBALS['_BAZAR_']['db']);
$sujet = $template->getTemplate(BAZ_TEMPLATE_MAIL_NOUVELLE_FICHE_SUJET, $GLOBALS['_BAZAR_']['langue'], $GLOBALS['_BAZAR_']['id_typeannonce']);
$corps = $template->getTemplate(BAZ_TEMPLATE_MAIL_NOUVELLE_FICHE_CORPS, $GLOBALS['_BAZAR_']['langue'], $GLOBALS['_BAZAR_']['id_typeannonce']);
1411,6 → 1424,12
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: bazar.fonct.php,v $
* Revision 1.69 2007-09-18 07:39:42 alexandre_tb
* correction d un bug lors d une insertion
*
* Revision 1.68 2007-08-27 12:31:31 alexandre_tb
* mise en place de modele
*
* Revision 1.67 2007-07-04 10:01:30 alexandre_tb
* mise en place de divers templates :
* - mail pour admin (sujet et corps)