Subversion Repositories eFlore/Applications.bibliobota

Rev

Rev 22 | Go to most recent revision | Details | 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
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: bbc_info_collection.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
23
/**
24
* Appli bb_consultation : gestion des informations avancées "collection" de Biblio Bota
25
*
26
* Ce fichier permet d'afficher les informations concernant les "collections" d'un organisme lié à la botanique.
27
*
28
*@package BiblioBota-Consultation
29
//Auteur original :
30
*@author        Jean-Charles GRANGER <tela@vecteur.org>
31
//Autres auteurs :
32
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
35
// +------------------------------------------------------------------------------------------------------+
36
*/
37
 
38
// +------------------------------------------------------------------------------------------------------+
39
// |                                            ENTETE du PROGRAMME                                       |
40
// +------------------------------------------------------------------------------------------------------+
41
 
42
 
43
// +------------------------------------------------------------------------------------------------------+
44
// |                                            CORPS du PROGRAMME                                        |
45
// +------------------------------------------------------------------------------------------------------+
46
 
47
// DEBUT COLLECTION
48
 
49
$tableau['args'] =  '&amp;arg_0=str%3D'.$tableau['coll'].'&amp;arg_1=coll%3D'.$tableau['coll'].
50
                    '&amp;arg_2=book%3D'.$tableau['coll'].'&amp;arg_3=media%3D'.$tableau['coll'];
51
 
52
// Proposition d'édition
53
/*
54
if ($var_biblio['open_proposer_collection'] == 1) {
55
    $sortie .= CreateNavigBiblio('add', 'coll', 'un périodique', '', 1, $tableau);
56
}
57
*/
58
 
59
// Récupèration du nom de la structure
60
$querybis = 'SELECT '.$tbl['str'].'.B_S_NOM '.
61
            'FROM '.$tbl['str'].' WHERE '.$tbl['str'].'.B_S_IDSTR = '.$tableau['coll'];
62
$do_querybis = mysql_query($querybis) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $querybis));
63
$nbbis = mysql_num_rows($do_querybis);
64
 
65
// Gestion des messages d'erreurs
66
if ($nbbis == 1) {
67
    $rowbis = mysql_fetch_object($do_querybis);
68
    $get_nom = $rowbis->B_S_NOM;
69
} else {
70
    $sortie .= '<p class="erreur"><b>'.'Erreur !!'.'</b> - '.$nbbis.' données trouvées pour la structure source.</p>'."\n";
71
}
72
mysql_free_result ($do_querybis);
73
 
74
// Affichage du titre de la page
75
$sortie .= '<h1>'.$get_nom.' : Périodiques'.'</h1>'."\n";
76
 
77
// Recherche des périodiques
78
$query =    'SELECT '.$tbl['collection'].'.*, '.$tbl['str'].'.B_S_NOM '.
79
            'FROM '.$tbl['collection'].', '.$tbl['str'].' '.
80
            'WHERE '.$tbl['collection'].'.B_C_LKSTR = "'.$tableau['coll'].'" '.
81
            'AND '.$tbl['collection'].'.B_C_LKSTR = '.$tbl['str'].'.B_S_IDSTR '.
82
            'AND B_C_CACHER = 0 '.
83
            'ORDER BY B_C_CRAI';
84
$do_query = mysql_query($query) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query));
85
$nb = mysql_num_rows($do_query);
86
 
87
// Pour savoir à quelle collection on en est
88
$ktest = 1;
89
 
90
if ($nb > 1) {
91
    $pluriel = 's';
92
} else {
93
    $pluriel = '';
94
}
95
$sortie .= '<p id="frag_nbre_resultat"><b>'.$nb.'</b> '.'périodique'.$pluriel.' trouvé'.$pluriel.'.'.'</p>'."\n";
96
if ($nb == 0) {
97
    $sortie .= '<p class="information">'.'Aucun périodique indexé.'.'</p>'."\n";
98
} else {
99
    // Il y a des resultats : on affiche les collections (périodiques) de la structure.
100
    $sortie .= '<ul id="bb_liste_periodique">'."\n";
101
    while ($row = mysql_fetch_object($do_query)) {
102
        $idcoll = $row->B_C_CRAI;
103
        $tableau['pass'] = $idcoll;
104
        $nom = $row->B_C_NOMCOMPLET;
105
        $nom_str = $row->B_S_NOM;
106
        $abrege = $row->B_C_ABREGE;
107
        $date = $row->B_C_DATECREATION;
108
        $faissuite = $row->B_C_FAISSUITE;
109
        $datefin = $row->B_C_DATEFIN;
110
        $devient = $row->B_C_DEVIENT;
111
        $perio = $row->B_C_PERIODICITE;
112
        $contact = $row->B_C_CONTACTNOM;
113
        $mail = $row->B_C_CONTACTMAIL;
114
        $image = $row->B_C_IMAGE;
115
        $comment = $row->B_C_COMMENT;
116
        $datemaj = $row->B_C_MAJFICHE;
117
 
118
        $sortie .= '<li>'."\n";
119
 
120
        // Affichage d'un image du périodique
121
        if ($image != '') {
122
            $sortie .=  '<img class="bb_img_periodique" src="'.BB_CHEMIN_IMAGES_ILLUSTRATION.$image.'" '.
123
                        'alt="'.'Photo de couverture de la revue : '.$nom.'" />'."\n";
124
        }
125
 
126
        // Affichage du titre de la collection
127
        $sortie .= '<h3>'.$nom;
128
        if ($abrege != '') {
129
            $sortie .= ' ('.$abrege.')';
130
        }
131
        $sortie .= ' </h3>'."\n";
132
 
133
        // Comptage du nombre de fascicules indexés
134
        $query_ser =    'SELECT COUNT(*) AS CPT '.
135
                        'FROM '.$tbl['fascicule'].' '.
136
                        'WHERE B_F_CRAICOLL = "'.$idcoll.'" '.
137
                        'AND B_F_CACHER = 0';
138
        $result_ser = mysql_query($query_ser) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_ser));
139
        $nb_ser = mysql_num_rows($result_ser);
140
 
141
        if($nb_ser != 1) {
142
            $sortie .= '<p class="erreur"><strong>'.'Échec du programme : '.'</strong> '.'Nombre de fascicules incohérent'.' '.'('.$nb_ser.')</p>'."\n";
143
        } else {
144
            $row_ser = mysql_fetch_object($result_ser);
145
            $intobiblio = $row_ser->CPT;
146
            mysql_free_result($result_ser);
147
 
148
            // Affichage de la navigation avancée
149
            if ($intobiblio > 0) {
150
                $sortie .= CreateNavigBiblio('goto', 'fasc', $tableau, 'Liste des fascicules indexés', 0)."\n";
151
            }
152
 
153
            $sortie .= '<p>'."\n";
154
 
155
            if ($date > 0) {
156
                $sortie .= '<span class="champ_cle">'.'Créé en'.' </span>'.FormateDateYYYYMMJJ($date).'.'.'<br />'."\n";
157
            }
158
            if ($faissuite != '') {
159
                $sortie .= '<span class="champ_cle">'.'Fait suite à'.' '.':'.'</span> '.$faissuite.'.'.'<br />'."\n";
160
            }
161
            if ($datefin > 0) {
162
                $sortie .= '<span class="champ_cle">'.'S\'est arrêté en'.'</span> '.FormateDateYYYYMMJJ($datefin).'.'.'<br />'."\n";
163
            }
164
            if ($devient != '') {
165
                $sortie .= '<span class="champ_cle">'.'Est devenu'.' '.':'.'</span> '.$devient.'.'.'<br />'."\n";
166
            }
167
            if (($date > 0) || ($faissuite != '') || ($datefin > 0) || ($devient != '')) {
168
                $sortie .= '<br />';
169
            }
170
            if ($comment != '') {
171
                $sortie .= '<span class="champ_cle">'.'Remarques'.' '.':'.'</span> '.$comment.'<br />'."\n";
172
            }
173
            if ($perio != '') {
174
                $sortie .= '<span class="champ_cle">'.'Périodicité'.' '.':'.'</span> '.$perio.'<br />'."\n";
175
            }
176
 
177
            if ($mail != '') {
178
                if ($contact != '') {
179
                    $aff_url = $contact;
180
                } else {
181
                    $aff_url = $mail;
182
                }
183
                $sortie .= '<span class="champ_cle">'.'Contact'.' '.':'.'</span> <a href="mailto:'.$mail.'">'.$aff_url.'</a><br />'."\n";
184
            }
185
 
186
            // Visualisation des séries
187
            $query_visu =   'SELECT * '.
188
                            'FROM '.$tbl['serie'].' '.
189
                            'WHERE B_SER_CRAICOLL = "'.$idcoll.'" '.
190
                            'ORDER BY B_SER_CRAICOLL, B_SER_IDSERIE';
191
            $resu_visu = mysql_query($query_visu) or die("<B>Erreur de récup des séries</B> : $query_visu");
192
            $nb_visu = mysql_num_rows($resu_visu);
193
            $sortie .= '</p>'."\n";
194
 
195
            if ($nb_visu > 0) {
196
                $sortie .= '<p>'."\n";
197
                $sortie .= '<span class="champ_cle">'.'Séries'.' '.':'.'</span> '."\n";
198
                $sortie .= '</p>'."\n";
199
                $sortie .= '<ul>'."\n";
200
                while ($row = mysql_fetch_object($resu_visu)) {
201
                    $visu_id_serie = $row->B_SER_IDSERIE;
202
                    $visu_ss_titre = $row->B_SER_SOUSTITRE;
203
                    $visu_debut = $row->B_SER_DATEDEBUT;
204
                    $visu_fin = $row->B_SER_DATEFIN;
205
                    $visu_into = $row->B_SER_INTOBIBLIO;
206
 
207
                    $sortie .= '<li>'."\n";
208
                    if ($visu_ss_titre == '') {
209
                        $visu_ss_titre = 'Série n°'.$visu_id_serie;
210
                    }
211
                    $sortie .= ' '.$visu_ss_titre.' ';
212
                    if (($visu_ss_titre != '') && ($visu_debut > 0)) {
213
                        $sortie .= '-';
214
                    }
215
                    if ($visu_debut > 0) {
216
                        $sortie .= ' <i>'.'Début'.'</i> '.':'.' '.FormateDateYYYYMMJJ($visu_debut);
217
                    }
218
                    if (($visu_debut > 0) && ($visu_fin > 0)) {
219
                        $sortie .= ' -';
220
                    }
221
                    if ($visu_fin > 0) {
222
                        $sortie .= ' <i>'.'Fin'.'</i> '.':'.' '.FormateDateYYYYMMJJ($visu_fin);
223
                    }
224
 
225
                    if ($visu_into == 1) {
226
                        $visu_aff = ' '.'['.'indexée'.']'."\n";
227
                    } else {
228
                        $visu_aff = ' '.'['.'non indexée'.']'."\n";
229
                    }
230
                    $sortie .= $visu_aff;
231
                    $sortie .= '</li>'."\n";
232
                }
233
                $sortie .= '</ul>'."\n";
234
            }
235
            mysql_free_result($resu_visu);
236
 
237
 
238
            // Là on affiche les Voir Aussi Collections ... si y'en a
239
            $UnVoirAussi = new VoirAussi($idcoll, $tbl['collection']);
240
            if ($UnVoirAussi->NbVA > 0) {
241
                $sortie .= '<p>'."\n";
242
                $sortie .= '<strong>'.'Consulter'.' '.':'.'</strong><br />';
243
                $liste_va = $UnVoirAussi->ListerVoirAussi();
244
                for ($i = 0; $i == (($UnVoirAussi->NbVA) - 1); $i++) {
245
                    $sortie .= '<img class="'.BB_CLASS_IMG_ICONE.'" src="'.$liste_va[$i]['icon_src'].'" alt="'.$liste_va[$i]['icon_alt'].'" /> ';
246
                    $sortie .= '<a '.$liste_va[$i]['target'].'>'.$liste_va[$i]['texte'].'</a>';
247
                    if ($liste_va[$i]['desc'] != '') {
248
                        $ret .= ' - '.'<em>'.$liste_va[$i]['desc'].'</em>';
249
                    }
250
                }
251
                $sortie .= '</p>'."\n";
252
            }
253
 
254
            // Affichage des méta-données
255
            $sortie .= '<p class="texte_inactif bb_txt_centre">';
256
            if ($datemaj > 0) {
257
                $sortie .= 'Dernière mise à jour de la fiche'.' '.':'.' '.date('d/m/Y',$datemaj).' '.'-'.' ';
258
            } else {
259
                $sortie .= 'Réf.'.' ';
260
            }
261
            $sortie .= $idcoll;
262
            $sortie .= '</p>'."\n";
263
 
264
            // Affichage d'un séparateur
265
            if ($ktest < $nb) {
266
                $sortie .= '<hr class="bb_separateur_horizontal" />'."\n";
267
            }
268
 
269
            $sortie .= '</li>'."\n";
270
            $ktest++;
271
        }
272
    }
273
    $sortie .= '</ul>'."\n";
274
}
275
mysql_free_result($do_query);
276
 
277
/* +--Fin du code ----------------------------------------------------------------------------------------+
278
*
279
* $Log: not supported by cvs2svn $
280
* Revision 1.3  2005/08/18 10:43:15  jpm
281
* Correction chemin.
282
*
283
* Revision 1.2  2005/05/17 10:10:08  jpm
284
* Correction des bogues avant mise en ligne du site v4.
285
*
286
* Revision 1.1  2004/09/16 12:06:31  jpm
287
* Décomposition du fichier information en plusieurs fichiers.
288
*
289
*
290
* +-- Fin du code ----------------------------------------------------------------------------------------+
291
*/
292
?>