Subversion Repositories Applications.bazar

Compare Revisions

Ignore whitespace Rev 23 → Rev 24

/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.9 2005-10-10 16:22:52 alexandre_tb Exp $
// CVS : $Id: bazar.fonct.php,v 1.10 2005-10-12 15:14:06 florian Exp $
/**
*
* Fonctions du module bazar
30,7 → 30,7
*@author Florian Schmitt <florian@ecole-et-nature.org>
//Autres auteurs :
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.9 $ $Date: 2005-10-10 16:22:52 $
*@version $Revision: 1.10 $ $Date: 2005-10-12 15:14:06 $
// +------------------------------------------------------------------------------------------------------+
*/
 
52,7 → 52,7
/** 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 logguée)
* @param integer Id de la personne (par défaut la personne loguée)
*
* @return string Retourne 'redacteur', 'administrateur', 'superadministrateur', ou 'aucun'
*/
155,21 → 155,22
* @return string HTML
*/
function mes_fiches() {
$res= '<h2>'.BAZ_VOS_ANNONCES.'</h2>'."\n";
// requête pour voir si l'utilisateur a des fiches à son nom, classées 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['_GEN_commun']['info_menu']->gm_id_menu.' or bn_ce_id_menu=0 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") ;
if ($GLOBALS['AUTH']->getAuth()) {
$res= '<h2>'.BAZ_VOS_ANNONCES.'</h2>'."\n";
// requête pour voir si l'utilisateur a des fiches à son nom, classées 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['_GEN_commun']['info_menu']->gm_id_menu.' or bn_ce_id_menu=0 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;
208,10 → 209,12
$table->updateColAttributes(3, array("align" => "center"));
$table->updateColAttributes(4, array("align" => "center"));
$res .= $table->toHTML() ;
}
else {
$res .= BAZ_PAS_DE_FICHE ;
}
}
else {
$res .= BAZ_PAS_DE_FICHE ;
}
else $res=BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR;;
return $res;
}
 
226,7 → 229,7
}
 
 
/** baz_afficher_formulaire_annonce() - Genère le formulaire de saisie d'une annonce
/** baz_afficher_formulaire_annonce() - Génère le formulaire de saisie d'une annonce
*
* @param string type de formulaire: insertion ou modification
* @param mixed objet quickform du formulaire
458,7 → 461,8
* @return string HTML
*/
function baz_formulaire($mode = 'inscription') {
//Récuperer les éventuelles variables passées en GET ou en POST
if ($GLOBALS['AUTH']->getAuth()) {
//Récupérer les éventuelles variables passées en GET ou en POST
if (isset($_GET['id_fiche'])) $GLOBALS['_BAZAR_']['id_fiche']=$_GET['id_fiche'];
if (isset($_REQUEST['typeannonce'])) {
$GLOBALS['_BAZAR_']['typeannonce']=$_REQUEST['typeannonce'];
507,7 → 511,7
$res = '';
//requete pour obtenir le nom et la description des types d'annonce
$requete = "SELECT bn_id_nature, bn_label_nature, bn_description, bn_condition FROM bazar_nature WHERE bn_ce_id_menu=".$_REQUEST['menu']." or bn_ce_id_menu=0 ORDER BY bn_label_nature ASC";
$requete = "SELECT bn_id_nature, bn_label_nature, bn_description, bn_condition FROM bazar_nature WHERE bn_ce_id_menu=".$GLOBALS['_GEN_commun']['info_menu']->gm_id_menu." or bn_ce_id_menu=0 ORDER BY bn_label_nature ASC";
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
585,7 → 589,7
else $personne=0;
//Cas ou les droits ont étés changés
//Cas ou les droits ont été changés
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
730,6 → 734,8
}
}
}
}
else $res=BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR;
return $res;
}
 
1066,9 → 1072,10
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
}
$res= '<h2>'.BAZ_S_INSCRIRE_AUX_ANNONCES.'</h2>'."\n";
if ($GLOBALS['AUTH']->getAuth()) {
$res= '<h2>'.BAZ_S_ABONNER.'</h2>'."\n";
$res= BAZ_LAIUS_S_ABONNER."\n";
//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['_GEN_commun']['info_menu']->gm_id_menu .' or bn_ce_id_menu=0';
1126,11 → 1133,13
}
}
$table->altRowAttributes(1, array('class' => 'ligne_impaire'), array('class' => 'ligne_paire'));
$table->updateColAttributes(0, array('align' => 'left'));
$table->updateColAttributes(0, array('style' => 'text-align:left;'));
$table->updateColAttributes(1, array('align' => 'center'));
$table->updateColAttributes(2, array('align' => 'center'));
$table->updateColAttributes(3, array('align' => 'center'));
$table->updateColAttributes(3, array('style' => 'text-align:center;'));
$res.=$table->toHTML() ;
}
else $res=BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR;
return $res;
}
1227,7 → 1236,7
}
$res.= $formtemplate->toHTML() ;
//préparation de la requète pour trouver les mots clés
//préparation de la requête pour trouver les mots clés
if ($_POST['recherche_mots_cles']!='') {
//découpage des mots clés
$recherche = split(' ', $_POST['recherche_mots_cles']) ;
1328,9 → 1337,9
'?' => '&#8225;',
'?' => '&#710;',
'?' => '&#8240;',
'¦' => '&#352;',
'à' => '&#352;',
'?' => '&#8249;',
'¼' => '&#338;',
'à' => '&#338;',
'?' => '&#8216;',
'?' => '&#8217;',
'?' => '&#8220;',
1340,11 → 1349,11
'?' => '&#8212;',
'?' => '&#732;',
'?' => '&#8482;',
'¨' => '&#353;',
'à' => '&#353;',
'?' => '&#8250;',
'½' => '&#339;',
'¾' => '&#376;',
'¤' => '&#8364;');
'à' => '&#339;',
'à' => '&#376;',
'à' => '&#8364;');
return str_replace(array_keys($entites),
array_values($entites),
$chaine);
1353,6 → 1362,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* 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
*
1381,10 → 1393,10
* ajout commentaires + petits debuggages
*
* Revision 1.8 2004/07/07 14:30:19 florian
* débuggage RSS
* débogage RSS
*
* Revision 1.7 2004/07/06 16:22:01 florian
* débuggage modification + MAJ flux RSS
* débogage modification + MAJ flux RSS
*
* Revision 1.6 2004/07/06 09:28:26 florian
* changement interface de modification