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