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_info_article.inc.php,v 1.1 2005/11/23 10:22:25 jp_milcent Exp $
|
2 |
jp_milcent |
23 |
/**
|
|
|
24 |
* Appli bb_consultation : gestion des informations avancées "article" de Biblio Bota
|
|
|
25 |
*
|
|
|
26 |
* Ce fichier permet d'afficher les informations concernant les "articles" 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
|
30 |
mathias |
34 |
*@version $Revision: 1.1 $ $Date: 2005/11/23 10:22:25 $
|
2 |
jp_milcent |
35 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
36 |
*/
|
|
|
37 |
|
|
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
39 |
// | ENTETE du PROGRAMME |
|
|
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
41 |
|
|
|
42 |
|
|
|
43 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
44 |
// | CORPS du PROGRAMME |
|
|
|
45 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
46 |
|
|
|
47 |
global $locusfasc;
|
|
|
48 |
if (!empty($locusfasc)) {
|
|
|
49 |
$tableau['locusfasc'] = $locusfasc;
|
|
|
50 |
} else {
|
|
|
51 |
$tableau['locusfasc'] = 0;
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
/*
|
|
|
55 |
$unex est composé de :
|
|
|
56 |
- [0] collection
|
|
|
57 |
- [1] serie
|
|
|
58 |
- [2] fascicule
|
|
|
59 |
- [3] point de départ de la requete
|
|
|
60 |
*/
|
|
|
61 |
$unex = explode ('-', $tableau['art']);
|
|
|
62 |
|
|
|
63 |
$requete = 'SELECT B_S_IDSTR, B_S_NOM, B_C_NOMCOMPLET, B_SER_SOUSTITRE, B_F_TITRE, B_F_DATE '.
|
|
|
64 |
'FROM '.$tbl['str'].', '.$tbl['collection'].', '.$tbl['serie'].', '.$tbl['fascicule'].' '.
|
|
|
65 |
'WHERE B_S_IDSTR = B_C_LKSTR '.
|
|
|
66 |
'AND B_C_CRAI = B_SER_CRAICOLL '.
|
|
|
67 |
'AND B_SER_CRAICOLL = B_F_CRAICOLL '.
|
|
|
68 |
'AND B_SER_IDSERIE = B_F_CRAISERIE '.
|
|
|
69 |
'AND B_F_CRAICOLL = "'.$unex[0].'" '.
|
|
|
70 |
'AND B_F_CRAISERIE = "'.$unex[1].'" '.
|
|
|
71 |
'AND B_F_NUMERO = "'.$unex[2].'"';
|
|
|
72 |
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
|
|
|
73 |
$num = mysql_num_rows($resultat);
|
|
|
74 |
|
|
|
75 |
if ($num != 1) {
|
|
|
76 |
$sortie .= '<p class="erreur"><strong>'.'Erreur de requête de sélection l\'en-tête articles :'.'</strong>'.
|
|
|
77 |
' nombre de résultats (= '.$num.') incohérent pour la requête : '.'<br />'.$requete.'</p>';
|
|
|
78 |
} else {
|
|
|
79 |
$ligne = mysql_fetch_object($resultat);
|
|
|
80 |
$le_numero = $ligne->B_S_IDSTR;
|
|
|
81 |
$le_nom = $ligne->B_S_NOM;
|
|
|
82 |
$la_coll = $ligne->B_C_NOMCOMPLET;
|
|
|
83 |
$le_titre = $ligne->B_F_TITRE;
|
|
|
84 |
$la_date = $ligne->B_F_DATE;
|
|
|
85 |
mysql_free_result($resultat);
|
|
|
86 |
|
|
|
87 |
$tableau['args'] = '&art='.$tableau['art'].'&arg_0=str%3D'.$le_numero.'&arg_1=coll%3D'.$le_numero.'&arg_2=book%3D'.$le_numero.'&arg_3=media%3D'.$le_numero;
|
|
|
88 |
$tableau['back'] = $unex[0].'-'.$unex[1];
|
|
|
89 |
|
|
|
90 |
// Affichage de la navigation avancée : retour aux fascicules
|
|
|
91 |
$sortie .= CreateNavigBiblio('goback', 'fasc', $tableau, 'Retour aux fascicules', 1);
|
|
|
92 |
|
|
|
93 |
// Affichage du titre
|
|
|
94 |
$sortie .= '<h1>'.$le_nom.' : articles'.'</h1>'."\n";
|
7 |
jp_milcent |
95 |
$sortie .= '<h2>'.'du '.$le_titre.' du périodique '.$la_coll.'</h2>'."\n";
|
2 |
jp_milcent |
96 |
|
|
|
97 |
// Comptage du total d'article
|
|
|
98 |
$requete = 'SELECT COUNT(*) AS COMPTAGE '.
|
|
|
99 |
'FROM '.$tbl['article'].', '.$tbl['item'].' '.
|
|
|
100 |
'WHERE B_A_CRAICOLL = "'.$unex[0].'" '.
|
|
|
101 |
'AND B_A_CRAISERIE = "'.$unex[1].'" '.
|
|
|
102 |
'AND B_A_CRAIFASC = "'.$unex[2].'" '.
|
|
|
103 |
'AND B_I_IDITEM = B_A_IDART '.
|
|
|
104 |
'AND B_I_TYPLOG = 1 '.
|
|
|
105 |
'AND B_I_TYPPHY = 2 '.
|
|
|
106 |
'AND B_I_CACHER = 0';
|
|
|
107 |
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
|
|
|
108 |
$ligne = mysql_fetch_object($resultat);
|
|
|
109 |
$num_c = $ligne->COMPTAGE;
|
|
|
110 |
mysql_free_result($resultat);
|
|
|
111 |
|
|
|
112 |
// Liste des articles
|
|
|
113 |
if (($tableau['locusfasc'] > 0) && ($tableau['locusfasc'] <= $num_c)) {
|
|
|
114 |
$depart = $tableau['locusfasc'];
|
|
|
115 |
} else {
|
|
|
116 |
$depart = $tableau['pstart'];
|
|
|
117 |
}
|
|
|
118 |
if ($depart == '') {
|
|
|
119 |
$depart = 0;
|
|
|
120 |
}
|
|
|
121 |
|
|
|
122 |
$requete = 'SELECT * '.
|
|
|
123 |
'FROM '.$tbl['article'].', '.$tbl['item'].', '.$tbl['saisie'].', '.$tbl['domaine'].', '.$tbl['domaine_lk'].' '.
|
|
|
124 |
'WHERE B_A_CRAICOLL = "'.$unex[0].'" '.
|
|
|
125 |
'AND B_A_CRAISERIE = "'.$unex[1].'" '.
|
|
|
126 |
'AND B_A_CRAIFASC = "'.$unex[2].'" '.
|
|
|
127 |
'AND B_I_IDITEM = B_A_IDART '.
|
|
|
128 |
'AND B_I_TYPLOG = 1 '.
|
|
|
129 |
'AND B_I_TYPPHY = 2 '.
|
|
|
130 |
'AND B_I_CACHER = 0 '.
|
|
|
131 |
'AND B_I_AUTEURSAISIE = B_AS_ID '.
|
|
|
132 |
'AND B_I_IDITEM = B_DL_IDITEM '.
|
|
|
133 |
'AND B_DL_IDDOM = B_D_ID '.
|
|
|
134 |
'ORDER BY B_A_PAGEDEBUT, B_I_AUTEURS '.
|
|
|
135 |
'LIMIT '.$depart.', '.$var_biblio['how_bloc'];
|
|
|
136 |
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
|
|
|
137 |
$num_a = mysql_num_rows($resultat);
|
|
|
138 |
|
|
|
139 |
// Récupération d'informations
|
|
|
140 |
if ($tableau['pstart'] == '') {
|
|
|
141 |
$tableau['pstart'] = 0;
|
|
|
142 |
}
|
|
|
143 |
$tableau['step'] = $var_biblio['how_bloc'];
|
|
|
144 |
$tableau['pend'] = $num_c;
|
|
|
145 |
$tableau['libelle'] = 'article';
|
|
|
146 |
$tableau['feminin'] = 0;
|
|
|
147 |
|
|
|
148 |
// Affichage du nbre de résultats
|
|
|
149 |
$sortie .= '<p id="frag_nbre_resultat">';
|
|
|
150 |
$sortie .= FRAG_afficherTxtNbreResultat('bbpopup', $tableau, $num_a, $num_c);
|
|
|
151 |
$sortie .= '</p>'."\n";
|
|
|
152 |
|
|
|
153 |
// Ici on fragmente en pages, pour une navigation plus facile
|
|
|
154 |
$frag = new fragmenteur(' - ', 10, BB_URL_COURANTE_CONSULTATION_AVANCEE);
|
|
|
155 |
$frag_txt = $frag->fragmente($tableau, $num_c);
|
|
|
156 |
if (($frag->nb_pages) > 1) {
|
|
|
157 |
$sortie .= '<p class="frag_navigation">'.$frag_txt.'</p>'."\n";
|
|
|
158 |
}
|
|
|
159 |
|
|
|
160 |
// Affichage des articles
|
|
|
161 |
$sortie .= '<ul id="bb_liste_article">'."\n";
|
|
|
162 |
while ($row_a = mysql_fetch_object($resultat)) {
|
|
|
163 |
$id_a = $row_a->B_I_IDITEM;
|
|
|
164 |
$titre = $row_a->B_I_TITRE;
|
|
|
165 |
$aut = $row_a->B_I_AUTEURS;
|
|
|
166 |
$paged = $row_a->B_A_PAGEDEBUT;
|
|
|
167 |
$pagef = $row_a->B_A_PAGEFIN;
|
|
|
168 |
$geo = $row_a->B_I_GEO;
|
|
|
169 |
$langue = $row_a->B_I_LANGUE;
|
|
|
170 |
$resum = $row_a->B_I_RESUMCLE;
|
|
|
171 |
$image = $row_a->B_I_IMAGE;
|
|
|
172 |
$aut_s = $row_a->B_AS_LIBELLE;
|
|
|
173 |
$domaine_id = $row_a->B_D_ID;
|
|
|
174 |
$domaine_nom = $row_a->B_D_LABEL;
|
|
|
175 |
$comment = $row_a->B_I_COMMENT;
|
|
|
176 |
$maj = $row_a->B_I_MAJFICHE;
|
|
|
177 |
|
|
|
178 |
$sortie .= '<li>'."\n";
|
|
|
179 |
|
|
|
180 |
if (!empty($image)) {
|
|
|
181 |
$sortie .= '<img class="bb_img_article" src="'.BB_CHEMIN_IMAGES_ILLUSTRATION.$image.'" '.
|
|
|
182 |
'alt="'.'Illustration de l\'article : '.$titre.'" />';
|
|
|
183 |
}
|
|
|
184 |
|
|
|
185 |
if ($domaine_id != 1) {
|
|
|
186 |
$sortie .= '<span class="texte_inactif">'.'['.$domaine_nom.']'.'</span>'."\n";
|
|
|
187 |
}
|
|
|
188 |
|
|
|
189 |
if (($aut == '') || ($aut == 'ANONYME')) {
|
|
|
190 |
$sortie .= 'Inconnu ou Anonyme';
|
|
|
191 |
} else {
|
|
|
192 |
$sortie .= $aut;
|
|
|
193 |
}
|
|
|
194 |
|
|
|
195 |
$sortie .= ' - <strong>'.$titre.'</strong>'.' - '.FormateDateYYYYMMJJ($la_date);
|
|
|
196 |
|
|
|
197 |
if (($paged > 0) && ($pagef > 0)) {
|
|
|
198 |
$sortie .= ', p. '.$paged;
|
|
|
199 |
}
|
|
|
200 |
if ($pagef > $paged) {
|
|
|
201 |
$sortie .= ' à '.$pagef;
|
|
|
202 |
}
|
|
|
203 |
|
|
|
204 |
if ($resum != '') {
|
|
|
205 |
$sortie .= ' - '.'<em>'.$resum.'</em> ';
|
|
|
206 |
}
|
|
|
207 |
if ($comment != '') {
|
|
|
208 |
$sortie .= ' - '.'<em>'.$comment.'</em>'."\n";
|
|
|
209 |
}
|
|
|
210 |
if ($geo != '') {
|
|
|
211 |
$sortie .= ' - '.'Départ./Région : '.'<em>'.$geo.'</em>'."\n";
|
|
|
212 |
}
|
|
|
213 |
if ($langue != '') {
|
|
|
214 |
$sortie .= ' - '.'Langue : '.$langue."\n";
|
|
|
215 |
}
|
|
|
216 |
if ($aut_s != '') {
|
|
|
217 |
$sortie .= '<span class="texte_inactif">'.' - '.'Saisie : '.$aut_s.' Art. n°'.$id_a.'.</span>';
|
|
|
218 |
}
|
|
|
219 |
|
|
|
220 |
// Là on affiche les Voir Aussi Articles ... si y'en a
|
|
|
221 |
$UnVoirAussi = new VoirAussi($id_a,$tbl['article']);
|
|
|
222 |
if ($UnVoirAussi->NbVA > 0) {
|
|
|
223 |
$sortie .= ' '.'-'.' '.'Consulter'.' '.':'.' ';
|
|
|
224 |
$liste_va = $UnVoirAussi->ListerVoirAussi();
|
|
|
225 |
for ($i = 0; $i == (($UnVoirAussi->NbVA) - 1); $i++) {
|
|
|
226 |
$sortie .= '<img class="'.BB_CLASS_IMG_ICONE.'" src="'.$liste_va[$i]['icon_src'].'" alt="'.$liste_va[$i]['icon_alt'].'" /> ';
|
|
|
227 |
$sortie .= '<a '.$liste_va[$i]['target'].'>'.$liste_va[$i]['texte'].'</a>';
|
|
|
228 |
if ($liste_va[$i]['desc'] != '') {
|
|
|
229 |
$ret .= ' - '.'<em>'.$liste_va[$i]['desc'].'</em>';
|
|
|
230 |
}
|
|
|
231 |
}
|
|
|
232 |
}
|
|
|
233 |
|
|
|
234 |
$sortie .= '</li>'."\n";
|
|
|
235 |
}
|
|
|
236 |
$sortie .= '</ul>'."\n";
|
|
|
237 |
|
|
|
238 |
if ($num_a > 0) {
|
|
|
239 |
mysql_free_result($resultat);
|
|
|
240 |
}
|
|
|
241 |
}
|
|
|
242 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
|
|
243 |
*
|
30 |
mathias |
244 |
* $Log: bbc_info_article.inc.php,v $
|
7 |
jp_milcent |
245 |
* Revision 1.1 2005/11/23 10:22:25 jp_milcent
|
|
|
246 |
* Ajout au dépot de l'application BiblioBota.
|
|
|
247 |
* Elle doit à terme migrer dans eFlore.
|
2 |
jp_milcent |
248 |
*
|
7 |
jp_milcent |
249 |
*
|
2 |
jp_milcent |
250 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
251 |
*/
|
|
|
252 |
?>
|