| Line 17... |
Line 17... |
| 17 |
// | |
|
17 |
// | |
|
| 18 |
// | You should have received a copy of the GNU Lesser General Public |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
| 19 |
// | License along with this library; if not, write to the Free Software |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
| 20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
| 21 |
// +------------------------------------------------------------------------------------------------------+
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
| 22 |
// CVS : $Id: bazar.fonct.rss.php,v 1.88 2007-08-27 12:32:14 alexandre_tb Exp $
|
22 |
// CVS : $Id: bazar.fonct.rss.php,v 1.89 2007-09-18 07:38:43 alexandre_tb Exp $
|
| 23 |
/**
|
23 |
/**
|
| 24 |
*
|
24 |
*
|
| 25 |
*@package bazar
|
25 |
*@package bazar
|
| 26 |
//Auteur original :
|
26 |
//Auteur original :
|
| 27 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
27 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
| 28 |
*@author Florian Schmitt <florian@ecole-et-nature.org>
|
28 |
*@author Florian Schmitt <florian@ecole-et-nature.org>
|
| 29 |
//Autres auteurs :
|
29 |
//Autres auteurs :
|
| 30 |
*@copyright Tela-Botanica 2000-2006
|
30 |
*@copyright Tela-Botanica 2000-2006
|
| 31 |
*@version $Revision: 1.88 $
|
31 |
*@version $Revision: 1.89 $
|
| 32 |
// +------------------------------------------------------------------------------------------------------+
|
32 |
// +------------------------------------------------------------------------------------------------------+
|
| 33 |
*/
|
33 |
*/
|
| Line 34... |
Line 34... |
| 34 |
|
34 |
|
| 35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
| Line 91... |
Line 91... |
| 91 |
return $tableau;
|
91 |
return $tableau;
|
| 92 |
}
|
92 |
}
|
| Line 93... |
Line 93... |
| 93 |
|
93 |
|
| 94 |
/** baz_voir_fiches() - Permet de visualiser en detail une liste de fiche au format XHTML
|
94 |
/** baz_voir_fiches() - Permet de visualiser en detail une liste de fiche au format XHTML
|
| 95 |
*
|
95 |
*
|
| 96 |
* @global boolean Rajoute des informations internes à l'application (date de modification, lien vers la page de départ de l'appli)
|
96 |
* @global boolean Rajoute des informations internes a l'application (date de modification, lien vers la page de départ de l'appli)
|
| 97 |
* @global integer Tableau d(Identifiant des fiches à afficher
|
97 |
* @global integer Tableau d(Identifiant des fiches a afficher
|
| 98 |
*
|
98 |
*
|
| 99 |
* @return string HTML
|
99 |
* @return string HTML
|
| 100 |
*/
|
100 |
*/
|
| 101 |
function baz_voir_fiches($danslappli, $idfiches=array()) {
|
101 |
function baz_voir_fiches($danslappli, $idfiches=array()) {
|
| Line 107... |
Line 107... |
| 107 |
}
|
107 |
}
|
| Line 108... |
Line 108... |
| 108 |
|
108 |
|
| 109 |
|
109 |
|
| 110 |
/** baz_voir_fiche() - Permet de visualiser en detail une fiche au format XHTML
|
110 |
/** baz_voir_fiche() - Permet de visualiser en detail une fiche au format XHTML
|
| 111 |
*
|
111 |
*
|
| 112 |
* @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
|
112 |
* @global boolean Rajoute des informations internes a l'application (date de modification, lien vers la page de depart de l'appli) si a 1
|
| 113 |
* @global integer Identifiant de la fiche a afficher
|
113 |
* @global integer Identifiant de la fiche a afficher
|
| 114 |
*
|
114 |
*
|
| 115 |
* @return string HTML
|
115 |
* @return string HTML
|
| Line 334... |
Line 334... |
| 334 |
$res .= '<span class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'" id="date_creation">'.BAZ_DATE_CREATION.'</span> '.strftime('%d.%m.%Y %H:%M',strtotime($ligne['bf_date_creation_fiche']))."\n";
|
334 |
$res .= '<span class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'" id="date_creation">'.BAZ_DATE_CREATION.'</span> '.strftime('%d.%m.%Y %H:%M',strtotime($ligne['bf_date_creation_fiche']))."\n";
|
| 335 |
$res .= '<span class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'" id="date_mise_a_jour">'.BAZ_DATE_MAJ.'</span> '.strftime('%d.%m.%Y %H:%M',strtotime($ligne['bf_date_maj_fiche']))."\n";
|
335 |
$res .= '<span class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'" id="date_mise_a_jour">'.BAZ_DATE_MAJ.'</span> '.strftime('%d.%m.%Y %H:%M',strtotime($ligne['bf_date_maj_fiche']))."\n";
|
| 336 |
}
|
336 |
}
|
| 337 |
$res .= '</div>'."\n";
|
337 |
$res .= '</div>'."\n";
|
| Line 338... |
Line 338... |
| 338 |
|
338 |
|
| 339 |
if ( $est_admin || $GLOBALS['_BAZAR_']['annonceur']==$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID) ) {
|
339 |
if ( $est_admin || $GLOBALS['_BAZAR_']['annonceur']==$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID) ) {
|
| 340 |
$res .='<div class="BAZ_actions_fiche BAZ_actions_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
|
340 |
$res .='<div class="BAZ_actions_fiche BAZ_actions_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
|
| 341 |
if ( $est_admin ) {
|
341 |
if ( $est_admin ) {
|
| 342 |
$res .= '<ul>'."\n";
|
342 |
$res .= '<ul>'."\n";
|
| 343 |
$lien_publie = &$GLOBALS['_BAZAR_']['url'];
|
343 |
$lien_publie = &$GLOBALS['_BAZAR_']['url'];
|
| Line 820... |
Line 820... |
| 820 |
$requete = 'SELECT bn_id_nature, bn_label_nature '.
|
820 |
$requete = 'SELECT bn_id_nature, bn_label_nature '.
|
| 821 |
'FROM bazar_nature WHERE bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') '.
|
821 |
'FROM bazar_nature WHERE bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') '.
|
| 822 |
'ORDER BY bn_label_nature ASC';
|
822 |
'ORDER BY bn_label_nature ASC';
|
| 823 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
823 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
| 824 |
if (DB::isError($resultat)) {
|
824 |
if (DB::isError($resultat)) {
|
| 825 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
825 |
return ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
| 826 |
}
|
826 |
}
|
| 827 |
//on recupere le nb de types de fiches, pour plus tard
|
827 |
//on recupere le nb de types de fiches, pour plus tard
|
| 828 |
$nb_type_de_fiches=$resultat->numRows();
|
828 |
$nb_type_de_fiches=$resultat->numRows();
|
| 829 |
$type_annonce_select['toutes']=BAZ_TOUS_TYPES_FICHES;
|
829 |
$type_annonce_select['toutes']=BAZ_TOUS_TYPES_FICHES;
|
| 830 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
830 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
| 831 |
$type_annonce_select[$ligne['bn_id_nature']] = $ligne['bn_label_nature'];
|
831 |
$type_annonce_select[$ligne['bn_id_nature']] = $ligne['bn_label_nature'];
|
| 832 |
$tableau_typeannonces[] = $ligne['bn_id_nature'] ;
|
832 |
$tableau_typeannonces[] = $ligne['bn_id_nature'] ;
|
| 833 |
}
|
833 |
}
|
| 834 |
if ($nb_type_de_fiches>1 && $GLOBALS['_BAZAR_']['typeannonce']=='toutes') {
|
834 |
if ($nb_type_de_fiches>1 && $GLOBALS['_BAZAR_']['typeannonce']=='toutes' && BAZ_AFFICHER_FILTRE_MOTEUR) {
|
| 835 |
$res= '<h2>'.BAZ_TOUTES_LES_ANNONCES.'</h2><br />'."\n";
|
835 |
$res= '<h2>'.BAZ_TOUTES_LES_ANNONCES.'</h2><br />'."\n";
|
| 836 |
$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;',
|
836 |
$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;',
|
| 837 |
'onchange' => 'javascript:this.form.submit();');
|
837 |
'onchange' => 'javascript:this.form.submit();');
|
| 838 |
$formtemplate->addElement ('select', 'nature', BAZ_TYPEANNONCE, $type_annonce_select, $option) ;
|
838 |
$formtemplate->addElement ('select', 'nature', BAZ_TYPEANNONCE, $type_annonce_select, $option) ;
|
| 839 |
if (isset($_REQUEST['nature'])) {
|
839 |
if (isset($_REQUEST['nature'])) {
|
| Line 917... |
Line 917... |
| 917 |
}
|
917 |
}
|
| 918 |
// Recuperation du template
|
918 |
// Recuperation du template
|
| 919 |
$requete = 'SELECT bn_template FROM bazar_nature WHERE bn_id_nature = '.$_REQUEST['nature'];
|
919 |
$requete = 'SELECT bn_template FROM bazar_nature WHERE bn_id_nature = '.$_REQUEST['nature'];
|
| 920 |
$resultat = $GLOBALS['_BAZAR_']['db']->getOne($requete) ;
|
920 |
$resultat = $GLOBALS['_BAZAR_']['db']->getOne($requete) ;
|
| 921 |
if (DB::isError($resultat)) {
|
921 |
if (DB::isError($resultat)) {
|
| 922 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
922 |
return ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
|
| 923 |
}
|
923 |
}
|
| Line 924... |
Line 924... |
| 924 |
|
924 |
|
| 925 |
if (isset($_REQUEST['recherche_avancee']) && $_REQUEST['recherche_avancee']==1) {
|
925 |
if (isset($_REQUEST['recherche_avancee']) && $_REQUEST['recherche_avancee']==1) {
|
| 926 |
foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->addQueryString($cle, $valeur);
|
926 |
foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->addQueryString($cle, $valeur);
|
| Line 932... |
Line 932... |
| 932 |
|
932 |
|
| 933 |
$tableau = baz_valeurs_template($resultat) ;
|
933 |
$tableau = baz_valeurs_template($resultat) ;
|
| 934 |
for ($i=0; $i<count($tableau); $i++) {
|
934 |
for ($i=0; $i<count($tableau); $i++) {
|
| 935 |
if (($tableau[$i]['type'] == 'liste' || $tableau[$i]['type'] == 'checkbox') && $tableau[$i]['recherche'] == 1) {
|
935 |
if (($tableau[$i]['type'] == 'liste' || $tableau[$i]['type'] == 'checkbox') && $tableau[$i]['recherche'] == 1) {
|
| 936 |
$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'],
|
936 |
$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'],
|
| 937 |
$tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire'], 1) ;
|
937 |
$tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire'], 1, 'bazar') ;
|
| 938 |
}
|
938 |
}
|
| Line 939... |
Line 939... |
| 939 |
}
|
939 |
}
|
| 940 |
|
940 |
|
| Line 1203... |
Line 1203... |
| 1203 |
}
|
1203 |
}
|
| Line 1204... |
Line 1204... |
| 1204 |
|
1204 |
|
| 1205 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
1205 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
| 1206 |
*
|
1206 |
*
|
| - |
|
1207 |
* $Log: not supported by cvs2svn $
|
| - |
|
1208 |
* Revision 1.88 2007-08-27 12:32:14 alexandre_tb
|
| - |
|
1209 |
* suppression de un notice
|
| 1207 |
* $Log: not supported by cvs2svn $
|
1210 |
*
|
| 1208 |
* Revision 1.87 2007-07-05 08:27:35 alexandre_tb
|
1211 |
* Revision 1.87 2007-07-05 08:27:35 alexandre_tb
|
| 1209 |
* dans le flux ajout utf8_encode pour la description et le titre des flux
|
1212 |
* dans le flux ajout utf8_encode pour la description et le titre des flux
|
| 1210 |
*
|
1213 |
*
|
| 1211 |
* indentation du code, et correction bug lorsque plusieurs catégories nature étaient demandé lors de consultation de fiche.
|
1214 |
* indentation du code, et correction bug lorsque plusieurs catégories nature étaient demandé lors de consultation de fiche.
|