Subversion Repositories eFlore/Applications.bibliobota

Rev

Rev 11 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 jp_milcent 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
// +------------------------------------------------------------------------------------------------------+
30 mathias 22
// CVS : $Id: bbc_affichage_media.fonct.php,v 1.3 2006/09/20 14:16:32 jp_milcent Exp $
2 jp_milcent 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
30 mathias 35
*@version       $Revision: 1.3 $ $Date: 2006/09/20 14:16:32 $
2 jp_milcent 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;
11 jp_milcent 81
        $get_auteuritem = str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', stripslashes($row->B_I_AUTEURS)))));
2 jp_milcent 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
            $id_phy = $row->B_IP_ID;
123
            $item_phy = $row->B_IP_LABEL;
124
            $icon_phy = $row->B_IP_IMAGE;
125
            $id_log = $row->B_IL_ID;
126
            $item_log = $row->B_IL_LABEL;
127
            $icon_log = $row->B_IL_IMAGE;
128
 
129
            $retour .= '<span class="texte_inactif">';
130
 
131
            if ($icon_phy != '') {
132
                $retour .= '<img class="bb_img_icone" src="'.BB_CHEMIN_IMAGES_TYPE_PHYSIQUE.$icon_phy.'" alt="'.$item_phy.'" /> ';
133
            } else {
134
                $retour .= '['.$item_phy.']';
135
            }
136
            if (($icon_phy == '') && ($icon_log)) {
137
                $retour .= ' - ';
138
            }
139
            if ($icon_log != '') {
140
                $retour .= ' <img class="bb_img_icone" src="'.BB_CHEMIN_IMAGES_TYPE_LOGIQUE.$icon_log.'" alt="'.$item_log.'" />';
141
            } else {
142
                $retour .= '['.$item_log.']';
143
            }
144
            $retour .= '</span> ';
145
        }
146
 
147
        // début de l'affichage
148
 
149
        if ($get_auteuritem != '') {
11 jp_milcent 150
            $retour .= "\n".ColorizeFound($get_auteuritem, $TabFinder['auteur']);
2 jp_milcent 151
        } else {
152
            $retour .= 'Anonyme';
153
        }
154
 
155
        $retour .= ' -'."\n".'<b>'.ColorizeFound($get_titreitem, stripslashes($TabFinder['chaine'])).'</b>'."\n";
156
 
157
        if ($get_datefasc > 0) {
158
            $retour .= ' - ' . DAT_formaterDateYYYYMMJJ($get_datefasc);
159
        }
160
 
161
        if (($get_resumcle != '') || ($get_comment != '')) {
162
            $retour .= ' - <i>';
163
            if ($get_resumcle != '') {
164
                $retour .= ColorizeFound($get_resumcle, strtolower(stripslashes($TabFinder['chaine'])));
165
            }
166
            if (($get_resumcle != '') && ($get_comment != '')) {
167
                $retour .= ' - ';
168
            }
169
            if ($get_comment != '') {
170
                $retour .= ColorizeFound($get_comment, strtolower(stripslashes($TabFinder['chaine'])));
171
            }
172
            $retour .= '</i>';
173
        }
174
 
175
        if ((!empty($get_debut)) && (!empty($get_fin))) {
176
            if (($get_debut > 0)||($get_fin > 0)) {
177
                $retour .= ', p. ';
178
                $retour .= $get_debut;
179
                if (($get_debut > 0) && ($get_fin > 0)) {
180
                    $retour .= '-';
181
                }
182
                $retour .= $get_fin;
183
            }
184
        }
185
 
186
        if ((!empty($volume))) {
187
            $retour .= ' - '.$volume;
188
        }
189
 
190
        if (!empty($get_geo)) {
191
            $retour .= ' - '.'Départ./Région : '.'<i>' . ColorizeFound($get_geo,ucFirst(stripslashes($TabFinder['geo']))).'</i>';
192
        }
193
 
194
        $retour .= ' - ';
195
 
196
        if (BB_ARGUMENT_REGROUPEMENT == 'article') {
197
            if (!empty($get_nomstr)) $retour .= "$get_nomstr, ";
198
 
199
            if (empty($get_abrege)) {
200
                $retour .= $get_nomcoll;
201
            } else {
202
                $retour .= $get_abrege;
203
            }
204
 
205
            if (!empty($get_titreserie)) {
206
                $retour .= ', '.$get_titreserie;
207
            }
208
 
209
            if (($var_biblio['open_biblio_str'] == true) && ($get_nomstr != '')) {
210
                $retour .= ', <a href="'.BB_URL_COURANTE_CONSULTATION_AVANCEE.'&amp;art='.$get_idcoll.'-'.$get_seriecoll.'-'.$get_idfasc.
211
                                '&amp;arg_0=str%3D'.$get_idstr.'&amp;arg_1=coll%3D'.$get_idstr.
212
                                '&amp;arg_2=book%3D'.$get_idstr.'&amp;arg_3=media%3D'.$get_idstr.'">'.
213
                                $get_titrefasc.
214
                        '</a>';
215
            } else {
216
                $retour .= ', '.$get_titrefasc;
217
            }
218
        } else if (BB_ARGUMENT_REGROUPEMENT == 'media') {
219
            $retour .= 'Editeur : ';
220
            if (($var_biblio['open_biblio_str'] == true) && ($editeur != '') && ($edite == 1) && ($get_idstr != '')) {
221
                // sert à accéder à des pages différentes selon le type physique
222
                // désactivé pour homogénéiser les accès au popup
223
                if ($id_phy == $phy['perio']) {
224
                    $tmp_word = 'str';
225
                    $tmp_page = 0;
226
                } else {
227
                    $tmp_word = 'str';
228
                    $tmp_page = 0;
229
                }
230
                $retour .= ' <a href="'.BB_URL_COURANTE_CONSULTATION_AVANCEE.'&amp;page='.$tmp_page.'&amp;'.
231
                            $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.
232
                            '&amp;arg_3=media%3D'.$get_idstr.'">'.$editeur.'</a>';
233
            } else if (!empty($editeur)) {
234
                $retour .= $editeur;
235
            } else {
236
                $retour .= 'inconnu';
237
            }
238
        } else {
239
            if ($var_biblio['open_biblio_str'] == true) {
240
                $retour .= '<a href="'.BB_URL_COURANTE_CONSULTATION_AVANCEE.'&amp;str='.$get_idstr.
241
                            '&amp;arg_0=str%3D'.$get_idstr.'&amp;arg_1=coll%3D'.$get_idstr.
242
                            '&amp;arg_2=book%3D'.$get_idstr.'&amp;arg_3=media%3D'.$get_idstr.'">
243
                            '.$get_nomstr.
244
                        '</a>';
245
            } else {
246
                $retour .= $get_nomstr;
247
            }
248
        }
249
 
250
        if (((!empty($collection_book) && ($collection_book != ''))) || ((!empty($numcoll_book) && ($numcoll_book != '')))) {
251
            $retour .= ' - '.'Collection : '.$collection_book.' '.$numcoll_book;
252
        }
253
 
254
        if ((!empty($isbn) && ($isbn != ''))) {
255
            $retour .= ' - '.'ISBN : '.$isbn;
256
        }
257
 
258
        if ((!empty($prix) && ($prix > 0))) {
259
            $retour .= ' - '.$prix.' '.$monnaie;
260
        }
261
 
262
        if ((!empty($vendu)&&($vendu == -1))) {
263
            $retour .= ' - <img class="'.BB_CLASS_IMG_EPUISE.'" src="'.BB_IMG_EPUISE.'" alt="'.'Epuisé'.'" />';
264
        }
265
 
266
        if ((!empty($var_biblio['val_euro'])) && (!empty($idmonnaie)) && (!empty($converter))) {
267
            if (($var_biblio['val_euro'] != $idmonnaie) && ($converter > 0) && ($prix > 0)) {
268
                $retour .= ' ('.'env. '.round($prix/$converter,2).' &euro;)';
269
            }
270
        }
271
 
272
        if ((!empty($get_langue) && ($get_langue != ''))) {
273
            $retour .= ' - '.$get_langue;
274
        }
275
 
276
        if ($get_saisie != '') {
277
            $get_saisie = 'Saisie : '.$get_saisie.' -';
278
        } else if ($get_saisie == '') {
279
            $get_saisie = 'Saisie : '.'? -';
280
        }
281
 
282
        /*    correction du 28 nov 2002
283
        if (($get_saisie != "")&&($get_saisie == $get_nomstr)) $get_saisie = "";
284
        else if ($get_saisie != "") $get_saisie = "Saisie : $get_saisie -";
285
        else if ($get_saisie == "") $get_saisie = "Saisie : ? -";
286
        */
287
        // Là on affiche les Voir Aussi ... si y'en a
288
        $UnVoirAussi = new VoirAussi($get_iditem, $tbl[BB_ARGUMENT_REGROUPEMENT]);
289
 
290
        if ($UnVoirAussi->NbVA > 0) {
291
            $liste_va = $UnVoirAussi->ListerVoirAussi();
292
 
293
            $retour .= ' - '.'Consulter : ';
294
 
295
            for ($i = 0; $i == (($UnVoirAussi->NbVA) - 1) ; $i++) {
296
                $retour .= '<img class="'.BB_CLASS_IMG_ICONE.'" src="'.$liste_va[$i]['icon_src'].'" alt="'.$liste_va[$i]['icon_alt'].'"/> ';
297
                $retour .= '<a '.$liste_va[$i]['target'].'>'.$liste_va[$i]['texte'].'</a>';
298
                if ($liste_va[$i]['desc'] != '') {
299
                    $retour .= ' - <i>'.$liste_va[$i]['desc'].'</i>';
300
                }
301
                if (($i != 0) && ($i < ($UnVoirAussi->NbVA))) {
302
                    $retour .= '<br />'."\n";
303
                }
304
            }
305
        }
306
        // Fin des Voir Aussi
307
 
308
        $retour .= ' - <span class="texte_inactif">';
309
 
310
        if ((BB_ARGUMENT_REGROUPEMENT != 'article') && ($edite == 0)) {
311
            $retour .= 'Donnée fournie par ';
312
            if ($get_idstr != 0) {
313
                $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'.
314
                $get_idstr.'&amp;arg_2=book%3D'.$get_idstr.'&amp;arg_3=media%3D'.$get_idstr.'">'.$get_nomstr.'</a>';
315
            } else {
316
                $retour .= $get_nomstr;
317
            }
318
            $retour .= ' - ';
319
        }
320
 
321
        $retour .= $get_saisie.' Art. n°'.$get_iditem.'.</span>';
322
 
323
        $retour .= "\n";
324
 
325
        if ($j < $nbr_final) {
326
            $retour .= '<br /><br/>';
327
        }
328
        $retour .= '</li>'."\n";
329
        $j++;
330
    }
331
 
332
    $retour .= '</ul>'."\n";
333
 
334
    return $retour;
335
}
336
 
337
/* +--Fin du code ----------------------------------------------------------------------------------------+
338
*
30 mathias 339
* $Log: bbc_affichage_media.fonct.php,v $
340
* Revision 1.3  2006/09/20 14:16:32  jp_milcent
341
* Modification de l'emplacement où l'on traite la chaine auteurs.
342
*
11 jp_milcent 343
* Revision 1.2  2006/09/20 13:18:35  jp_milcent
344
* Amélioration de la mise ne majuscule des noms d'auteurs.
345
*
10 jp_milcent 346
* Revision 1.1  2005/11/23 10:22:25  jp_milcent
347
* Ajout au dépot de l'application BiblioBota.
348
* Elle doit à terme migrer dans eFlore.
349
*
2 jp_milcent 350
* Revision 1.6  2005/08/18 10:43:15  jpm
351
* Correction chemin.
352
*
353
* Revision 1.5  2005/05/31 13:03:51  jpm
354
* Correction affichage lien vers structure inconnue.
355
*
356
* Revision 1.4  2005/05/17 10:10:08  jpm
357
* Correction des bogues avant mise en ligne du site v4.
358
*
359
* Revision 1.3  2005/02/24 18:33:26  jpm
360
* Modification de la gestion des voir aussi.
361
*
362
* Revision 1.2  2004/09/14 10:18:17  jpm
363
* Mise en forme et amélioration du code.
364
* Passage au XHTML strict.
365
*
366
* Revision 1.1  2004/09/10 18:44:02  jpm
367
* Ajout des fichiers de gestion du moteur de recherche des médias.
368
*
369
*
370
* +-- Fin du code ----------------------------------------------------------------------------------------+
371
*/
372
?>