Subversion Repositories Sites.tela-botanica.org

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 david 1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
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                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: bbc_affichage_media.fonct.php,v 1.4 2005/05/17 10:10:08 jpm Exp $
23
/**
24
* Fonctions de création de l'affichage des résultats d'un média.
25
*
26
* Contient une fonction créant l'affichage des résultats pour le paramètre "media".
27
*
28
*@package BiblioBota-Consultation
29
*@subpackage Fonctions
30
//Auteur original :
31
*@author        Jean-Charles GRANGER <tela@vecteur.org>
32
//Autres auteurs :
33
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
34
*@copyright     Tela-Botanica 2000-2004
35
*@version       $Revision: 1.4 $ $Date: 2005/05/17 10:10:08 $
36
// +------------------------------------------------------------------------------------------------------+
37
*/
38
 
39
// +------------------------------------------------------------------------------------------------------+
40
// |                                            ENTETE du PROGRAMME                                       |
41
// +------------------------------------------------------------------------------------------------------+
42
                                    /*Mettre ici les inclusions de fichiers*/
43
 
44
 
45
// +------------------------------------------------------------------------------------------------------+
46
// |                                           LISTE de FONCTIONS                                         |
47
// +------------------------------------------------------------------------------------------------------+
48
                                        /*Mettre ici la liste de fonctions.*/
49
 
50
/** Fonction mkresu() - Traitement des requêtes.
51
*
52
* Fonction traitant la requête d'intérogation de la base de données pour le
53
* paramêtre "media".
54
*
55
* @return  string les résultats à afficher.
56
*/
57
function mkresu()
58
{
59
    global $result_final;
60
    global $nbr_final;
61
    global $tbl;
62
    global $TabFinder;
63
    global $nbr_total;
64
    global $var_biblio;
65
    global $query_dom;
66
    global $phy;
67
 
68
    // Initialisation des variables
69
 
70
    $retour = '';
71
    $retour .= '<ul id="bb_liste_resultat_media">'."\n";
72
    $j = 1;
73
    while ($row = mysql_fetch_object($result_final)) {
74
        $retour .= '<li>';
75
 
76
        // Récupération des données
77
        $get_idstr = $row->B_S_IDSTR;
78
        $get_nomstr =  $row->B_S_NOM;
79
        $get_iditem = $row->B_I_IDITEM;
80
        $get_titreitem = $row->B_I_TITRE;
81
        $get_auteuritem = $row->B_I_AUTEURS;
82
        $get_geo = $row->B_I_GEO;
83
        $get_langue = $row->B_I_LANGUE;
84
        $get_resumcle = $row->B_I_RESUMCLE;
85
        $get_image = $row->B_I_IMAGE;
86
        $get_saisie = $row->B_AS_LIBELLE;
87
        $get_comment = $row->B_I_COMMENT;
88
        $get_domaine_id = $row->B_D_ID;
89
        $get_domaine_nom = $row->B_D_LABEL;
90
 
91
        if ($get_domaine_id != 1) {
92
            $retour .= '<span class="texte_unactive">['.$get_domaine_nom.']</span>'."\n";
93
        }
94
 
95
        if (BB_ARGUMENT_REGROUPEMENT == 'article') {
96
            $get_idcoll = $row->B_C_CRAI;
97
            $get_seriecoll = $row->B_SER_IDSERIE;
98
            $get_titreserie = $row->B_SER_SOUSTITRE;
99
            $get_nomcoll = $row->B_C_NOMCOMPLET;
100
            $get_abrege = $row->B_C_ABREGE;
101
            $get_idfasc = $row->B_F_NUMERO;
102
            $get_titrefasc = $row->B_F_TITRE;
103
            $get_datefasc = $row->B_F_DATE;
104
            $get_debut = $row->B_A_PAGEDEBUT;
105
            $get_fin = $row->B_A_PAGEFIN;
106
        } else {
107
            $collection_book = $row->B_M_COLLECTION;
108
            $numcoll_book = $row->B_M_NUMCOLL;
109
            $isbn = $row->B_M_ISBN;
110
            $editeur = $row->B_M_EDITEUR;
111
            $get_datefasc = $row->B_M_DATE;
112
            $prix = $row->B_M_PRIX;
113
            $idmonnaie = $row->B_M_LKMONNAIE;
114
            $monnaie = $row->GEN_MON_SYMBOLE;
115
            $converter = $row->GEN_MON_VAL1EURO;
116
            $volume = $row->B_M_VOLUME;
117
            $edite = $row->B_M_EDITE;
118
            $vendu = $row->B_M_VEND;
119
        }
120
 
121
        if ((BB_ARGUMENT_REGROUPEMENT == 'media') || (BB_ARGUMENT_REGROUPEMENT == 'mixte')) {
122
            // TODO : affichage du type de média
123
            $id_phy = $row->B_IP_ID;
124
            $item_phy = $row->B_IP_LABEL;
125
            $icon_phy = $row->B_IP_IMAGE;
126
            $id_log = $row->B_IL_ID;
127
            $item_log = $row->B_IL_LABEL;
128
            $icon_log = $row->B_IL_IMAGE;
129
 
130
            $retour .= '<span class="texte_inactif">';
131
 
132
            if ($icon_phy != '') {
133
                $retour .= '<img class="bb_img_icone" src="'.BB_CHEMIN_IMAGES_TYPE_PHYSIQUE.$icon_phy.'" alt="'.$item_phy.'" /> ';
134
            } else {
135
                $retour .= '['.$item_phy.']';
136
            }
137
            if (($icon_phy == '') && ($icon_log)) {
138
                $retour .= ' - ';
139
            }
140
            if ($icon_log != '') {
141
                $retour .= ' <img class="bb_img_icone" src="'.BB_CHEMIN_IMAGES_TYPE_LOGIQUE.$icon_log.'" alt="'.$item_log.'" />';
142
            } else {
143
                $retour .= '['.$item_log.']';
144
            }
145
            $retour .= '</span> ';
146
        }
147
 
148
        // début de l'affichage
149
 
150
        if ($get_auteuritem != '') {
151
            $retour .= "\n";
152
            $get_auteuritem = strtolower(ColorizeFound($get_auteuritem, stripslashes($TabFinder['auteur'])));
153
            $retour .= ucwords($get_auteuritem);
154
        } else {
155
            $retour .= 'Anonyme';
156
        }
157
 
158
        $retour .= ' -'."\n".'<b>'.ColorizeFound($get_titreitem, stripslashes($TabFinder['chaine'])).'</b>'."\n";
159
 
160
        if ($get_datefasc > 0) {
161
            $retour .= ' - ' . DAT_formaterDateYYYYMMJJ($get_datefasc);
162
        }
163
 
164
        if (($get_resumcle != '') || ($get_comment != '')) {
165
            $retour .= ' - <i>';
166
            if ($get_resumcle != '') {
167
                $retour .= ColorizeFound($get_resumcle, strtolower(stripslashes($TabFinder['chaine'])));
168
            }
169
            if (($get_resumcle != '') && ($get_comment != '')) {
170
                $retour .= ' - ';
171
            }
172
            if ($get_comment != '') {
173
                $retour .= ColorizeFound($get_comment, strtolower(stripslashes($TabFinder['chaine'])));
174
            }
175
            $retour .= '</i>';
176
        }
177
 
178
        if ((!empty($get_debut)) && (!empty($get_fin))) {
179
            if (($get_debut > 0)||($get_fin > 0)) {
180
                $retour .= ', p. ';
181
                $retour .= $get_debut;
182
                if (($get_debut > 0) && ($get_fin > 0)) {
183
                    $retour .= '-';
184
                }
185
                $retour .= $get_fin;
186
            }
187
        }
188
 
189
        if ((!empty($volume))) {
190
            $retour .= ' - '.$volume;
191
        }
192
 
193
        if (!empty($get_geo)) {
194
            $retour .= ' - '.'Départ./Région : '.'<i>' . ColorizeFound($get_geo,ucFirst(stripslashes($TabFinder['geo']))).'</i>';
195
        }
196
 
197
        $retour .= ' - ';
198
 
199
        if (BB_ARGUMENT_REGROUPEMENT == 'article') {
200
            if (!empty($get_nomstr)) $retour .= "$get_nomstr, ";
201
 
202
            if (empty($get_abrege)) {
203
                $retour .= $get_nomcoll;
204
            } else {
205
                $retour .= $get_abrege;
206
            }
207
 
208
            if (!empty($get_titreserie)) {
209
                $retour .= ', '.$get_titreserie;
210
            }
211
 
212
            if (($var_biblio['open_biblio_str'] == true) && ($get_nomstr != '')) {
213
                $retour .= ', <a href="'.BB_URL_COURANTE_CONSULTATION_AVANCEE.'&amp;art='.$get_idcoll.'-'.$get_seriecoll.'-'.$get_idfasc.
214
                                '&amp;arg_0=str%3D'.$get_idstr.'&amp;arg_1=coll%3D'.$get_idstr.
215
                                '&amp;arg_2=book%3D'.$get_idstr.'&amp;arg_3=media%3D'.$get_idstr.'">'.
216
                                $get_titrefasc.
217
                        '</a>';
218
            } else {
219
                $retour .= ', '.$get_titrefasc;
220
            }
221
        } else if (BB_ARGUMENT_REGROUPEMENT == 'media') {
222
            $retour .= 'Editeur : ';
223
            if (($var_biblio['open_biblio_str'] == true) && ($editeur != '') && ($edite == 1) && ($get_idstr != '')) {
224
                // sert à accéder à des pages différentes selon le type physique
225
                // désactivé pour homogénéiser les accès au popup
226
                if ($id_phy == $phy['perio']) {
227
                    $tmp_word = 'str';
228
                    $tmp_page = 0;
229
                } else {
230
                    $tmp_word = 'str';
231
                    $tmp_page = 0;
232
                }
233
                $retour .= ' <a href="'.BB_URL_COURANTE_CONSULTATION_AVANCEE.'&amp;page='.$tmp_page.'&amp;'.
234
                            $tmp_word.'='.$get_idstr.'&amp;arg_0=str%3D'.$get_idstr.'&amp;arg_1=coll%3D'.$get_idstr.'&amp;arg_2=book%3D'.$get_idstr.
235
                            '&amp;arg_3=media%3D'.$get_idstr.'">'.$editeur.'</a>';
236
            } else if (!empty($editeur)) {
237
                $retour .= $editeur;
238
            } else {
239
                $retour .= 'inconnu';
240
            }
241
        } else {
242
            if ($var_biblio['open_biblio_str'] == true) {
243
                $retour .= '<a href="'.BB_URL_COURANTE_CONSULTATION_AVANCEE.'&amp;str='.$get_idstr.
244
                            '&amp;arg_0=str%3D'.$get_idstr.'&amp;arg_1=coll%3D'.$get_idstr.
245
                            '&amp;arg_2=book%3D'.$get_idstr.'&amp;arg_3=media%3D'.$get_idstr.'">
246
                            '.$get_nomstr.
247
                        '</a>';
248
            } else {
249
                $retour .= $get_nomstr;
250
            }
251
        }
252
 
253
        if (((!empty($collection_book) && ($collection_book != ''))) || ((!empty($numcoll_book) && ($numcoll_book != '')))) {
254
            $retour .= ' - '.'Collection : '.$collection_book.' '.$numcoll_book;
255
        }
256
 
257
        if ((!empty($isbn) && ($isbn != ''))) {
258
            $retour .= ' - '.'ISBN : '.$isbn;
259
        }
260
 
261
        if ((!empty($prix) && ($prix > 0))) {
262
            $retour .= ' - '.$prix.' '.$monnaie;
263
        }
264
 
265
        if ((!empty($vendu)&&($vendu == -1))) {
266
            $retour .= ' - <img class="'.BB_CLASS_IMG_EPUISE.'" src="'.BB_IMG_EPUISE.'" alt="'.'Epuisé'.'" />';
267
        }
268
 
269
        if ((!empty($var_biblio['val_euro'])) && (!empty($idmonnaie)) && (!empty($converter))) {
270
            if (($var_biblio['val_euro'] != $idmonnaie) && ($converter > 0) && ($prix > 0)) {
271
                $retour .= ' ('.'env. '.round($prix/$converter,2).' &euro;)';
272
            }
273
        }
274
 
275
        if ((!empty($get_langue) && ($get_langue != ''))) {
276
            $retour .= ' - '.$get_langue;
277
        }
278
 
279
        if ($get_saisie != '') {
280
            $get_saisie = 'Saisie : '.$get_saisie.' -';
281
        } else if ($get_saisie == '') {
282
            $get_saisie = 'Saisie : '.'? -';
283
        }
284
 
285
        /*    correction du 28 nov 2002
286
        if (($get_saisie != "")&&($get_saisie == $get_nomstr)) $get_saisie = "";
287
        else if ($get_saisie != "") $get_saisie = "Saisie : $get_saisie -";
288
        else if ($get_saisie == "") $get_saisie = "Saisie : ? -";
289
        */
290
        // Là on affiche les Voir Aussi ... si y'en a
291
        $UnVoirAussi = new VoirAussi($get_iditem, $tbl[BB_ARGUMENT_REGROUPEMENT]);
292
 
293
        if ($UnVoirAussi->NbVA > 0) {
294
            $liste_va = $UnVoirAussi->ListerVoirAussi();
295
 
296
            $retour .= ' - '.'Consulter : ';
297
 
298
            for ($i = 0; $i == (($UnVoirAussi->NbVA) - 1) ; $i++) {
299
                $retour .= '<img class="'.BB_CLASS_IMG_ICONE.'" src="'.$liste_va[$i]['icon_src'].'" alt="'.$liste_va[$i]['icon_alt'].'"/> ';
300
                $retour .= '<a '.$liste_va[$i]['target'].'>'.$liste_va[$i]['texte'].'</a>';
301
                if ($liste_va[$i]['desc'] != '') {
302
                    $retour .= ' - <i>'.$liste_va[$i]['desc'].'</i>';
303
                }
304
                if (($i != 0) && ($i < ($UnVoirAussi->NbVA))) {
305
                    $retour .= '<br />'."\n";
306
                }
307
            }
308
        }
309
        // Fin des Voir Aussi
310
 
311
        $retour .= ' - <span class="texte_inactif">';
312
 
313
        if ((BB_ARGUMENT_REGROUPEMENT != 'article') && ($edite == 0)) {
314
            $retour .= 'Donnée fournie par ';
315
            if ($get_idstr != 0) {
316
                $retour .= '<a href="'.BB_URL_COURANTE_CONSULTATION_AVANCEE.'&amp;str='.$get_idstr.'&amp;page=0&amp;arg_0=str%3D'.$get_idstr.'&amp;arg_1=coll%3D'.
317
                $get_idstr.'&amp;arg_2=book%3D'.$get_idstr.'&amp;arg_3=media%3D'.$get_idstr.'">'.$get_nomstr.'</a>';
318
            } else {
319
                $retour .= $get_nomstr;
320
            }
321
            $retour .= ' - ';
322
        }
323
 
324
        $retour .= $get_saisie.' Art. n°'.$get_iditem.'.</span>';
325
 
326
        $retour .= "\n";
327
 
328
        if ($j < $nbr_final) {
329
            $retour .= '<br /><br/>';
330
        }
331
        $retour .= '</li>'."\n";
332
        $j++;
333
    }
334
 
335
    $retour .= '</ul>'."\n";
336
 
337
    return $retour;
338
}
339
 
340
/* +--Fin du code ----------------------------------------------------------------------------------------+
341
*
342
* $Log: bbc_affichage_media.fonct.php,v $
343
* Revision 1.4  2005/05/17 10:10:08  jpm
344
* Correction des bogues avant mise en ligne du site v4.
345
*
346
* Revision 1.3  2005/02/24 18:33:26  jpm
347
* Modification de la gestion des voir aussi.
348
*
349
* Revision 1.2  2004/09/14 10:18:17  jpm
350
* Mise en forme et amélioration du code.
351
* Passage au XHTML strict.
352
*
353
* Revision 1.1  2004/09/10 18:44:02  jpm
354
* Ajout des fichiers de gestion du moteur de recherche des médias.
355
*
356
*
357
* +-- Fin du code ----------------------------------------------------------------------------------------+
358
*/
359
?>