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('&', '&', $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.' '.$GLOBALS['_BAZAR_']['typeannonce'].'</h2><br />'."\n"; |
if (!BAZ_UTILISE_TEMPLATE) $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"); |
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) |