Subversion Repositories eFlore/Applications.bibliobota

Compare Revisions

Ignore whitespace Rev 1 → Rev 2

/trunk/applications/bb_consultation/bbc_info_collection.inc.php
New file
0,0 → 1,292
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bbc_info_collection.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Appli bb_consultation : gestion des informations avancées "collection" de Biblio Bota
*
* Ce fichier permet d'afficher les informations concernant les "collections" d'un organisme lié à la botanique.
*
*@package BiblioBota-Consultation
//Auteur original :
*@author Jean-Charles GRANGER <tela@vecteur.org>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@clapas.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// DEBUT COLLECTION
 
$tableau['args'] = '&amp;arg_0=str%3D'.$tableau['coll'].'&amp;arg_1=coll%3D'.$tableau['coll'].
'&amp;arg_2=book%3D'.$tableau['coll'].'&amp;arg_3=media%3D'.$tableau['coll'];
 
// Proposition d'édition
/*
if ($var_biblio['open_proposer_collection'] == 1) {
$sortie .= CreateNavigBiblio('add', 'coll', 'un périodique', '', 1, $tableau);
}
*/
 
// Récupèration du nom de la structure
$querybis = 'SELECT '.$tbl['str'].'.B_S_NOM '.
'FROM '.$tbl['str'].' WHERE '.$tbl['str'].'.B_S_IDSTR = '.$tableau['coll'];
$do_querybis = mysql_query($querybis) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $querybis));
$nbbis = mysql_num_rows($do_querybis);
 
// Gestion des messages d'erreurs
if ($nbbis == 1) {
$rowbis = mysql_fetch_object($do_querybis);
$get_nom = $rowbis->B_S_NOM;
} else {
$sortie .= '<p class="erreur"><b>'.'Erreur !!'.'</b> - '.$nbbis.' données trouvées pour la structure source.</p>'."\n";
}
mysql_free_result ($do_querybis);
 
// Affichage du titre de la page
$sortie .= '<h1>'.$get_nom.' : Périodiques'.'</h1>'."\n";
 
// Recherche des périodiques
$query = 'SELECT '.$tbl['collection'].'.*, '.$tbl['str'].'.B_S_NOM '.
'FROM '.$tbl['collection'].', '.$tbl['str'].' '.
'WHERE '.$tbl['collection'].'.B_C_LKSTR = "'.$tableau['coll'].'" '.
'AND '.$tbl['collection'].'.B_C_LKSTR = '.$tbl['str'].'.B_S_IDSTR '.
'AND B_C_CACHER = 0 '.
'ORDER BY B_C_CRAI';
$do_query = mysql_query($query) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query));
$nb = mysql_num_rows($do_query);
 
// Pour savoir à quelle collection on en est
$ktest = 1;
 
if ($nb > 1) {
$pluriel = 's';
} else {
$pluriel = '';
}
$sortie .= '<p id="frag_nbre_resultat"><b>'.$nb.'</b> '.'périodique'.$pluriel.' trouvé'.$pluriel.'.'.'</p>'."\n";
if ($nb == 0) {
$sortie .= '<p class="information">'.'Aucun périodique indexé.'.'</p>'."\n";
} else {
// Il y a des resultats : on affiche les collections (périodiques) de la structure.
$sortie .= '<ul id="bb_liste_periodique">'."\n";
while ($row = mysql_fetch_object($do_query)) {
$idcoll = $row->B_C_CRAI;
$tableau['pass'] = $idcoll;
$nom = $row->B_C_NOMCOMPLET;
$nom_str = $row->B_S_NOM;
$abrege = $row->B_C_ABREGE;
$date = $row->B_C_DATECREATION;
$faissuite = $row->B_C_FAISSUITE;
$datefin = $row->B_C_DATEFIN;
$devient = $row->B_C_DEVIENT;
$perio = $row->B_C_PERIODICITE;
$contact = $row->B_C_CONTACTNOM;
$mail = $row->B_C_CONTACTMAIL;
$image = $row->B_C_IMAGE;
$comment = $row->B_C_COMMENT;
$datemaj = $row->B_C_MAJFICHE;
$sortie .= '<li>'."\n";
// Affichage d'un image du périodique
if ($image != '') {
$sortie .= '<img class="bb_img_periodique" src="'.BB_CHEMIN_IMAGES_ILLUSTRATION.$image.'" '.
'alt="'.'Photo de couverture de la revue : '.$nom.'" />'."\n";
}
// Affichage du titre de la collection
$sortie .= '<h3>'.$nom;
if ($abrege != '') {
$sortie .= ' ('.$abrege.')';
}
$sortie .= ' </h3>'."\n";
// Comptage du nombre de fascicules indexés
$query_ser = 'SELECT COUNT(*) AS CPT '.
'FROM '.$tbl['fascicule'].' '.
'WHERE B_F_CRAICOLL = "'.$idcoll.'" '.
'AND B_F_CACHER = 0';
$result_ser = mysql_query($query_ser) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_ser));
$nb_ser = mysql_num_rows($result_ser);
if($nb_ser != 1) {
$sortie .= '<p class="erreur"><strong>'.'Échec du programme : '.'</strong> '.'Nombre de fascicules incohérent'.' '.'('.$nb_ser.')</p>'."\n";
} else {
$row_ser = mysql_fetch_object($result_ser);
$intobiblio = $row_ser->CPT;
mysql_free_result($result_ser);
// Affichage de la navigation avancée
if ($intobiblio > 0) {
$sortie .= CreateNavigBiblio('goto', 'fasc', $tableau, 'Liste des fascicules indexés', 0)."\n";
}
$sortie .= '<p>'."\n";
if ($date > 0) {
$sortie .= '<span class="champ_cle">'.'Créé en'.' </span>'.FormateDateYYYYMMJJ($date).'.'.'<br />'."\n";
}
if ($faissuite != '') {
$sortie .= '<span class="champ_cle">'.'Fait suite à'.' '.':'.'</span> '.$faissuite.'.'.'<br />'."\n";
}
if ($datefin > 0) {
$sortie .= '<span class="champ_cle">'.'S\'est arrêté en'.'</span> '.FormateDateYYYYMMJJ($datefin).'.'.'<br />'."\n";
}
if ($devient != '') {
$sortie .= '<span class="champ_cle">'.'Est devenu'.' '.':'.'</span> '.$devient.'.'.'<br />'."\n";
}
if (($date > 0) || ($faissuite != '') || ($datefin > 0) || ($devient != '')) {
$sortie .= '<br />';
}
if ($comment != '') {
$sortie .= '<span class="champ_cle">'.'Remarques'.' '.':'.'</span> '.$comment.'<br />'."\n";
}
if ($perio != '') {
$sortie .= '<span class="champ_cle">'.'Périodicité'.' '.':'.'</span> '.$perio.'<br />'."\n";
}
if ($mail != '') {
if ($contact != '') {
$aff_url = $contact;
} else {
$aff_url = $mail;
}
$sortie .= '<span class="champ_cle">'.'Contact'.' '.':'.'</span> <a href="mailto:'.$mail.'">'.$aff_url.'</a><br />'."\n";
}
// Visualisation des séries
$query_visu = 'SELECT * '.
'FROM '.$tbl['serie'].' '.
'WHERE B_SER_CRAICOLL = "'.$idcoll.'" '.
'ORDER BY B_SER_CRAICOLL, B_SER_IDSERIE';
$resu_visu = mysql_query($query_visu) or die("<B>Erreur de récup des séries</B> : $query_visu");
$nb_visu = mysql_num_rows($resu_visu);
$sortie .= '</p>'."\n";
if ($nb_visu > 0) {
$sortie .= '<p>'."\n";
$sortie .= '<span class="champ_cle">'.'Séries'.' '.':'.'</span> '."\n";
$sortie .= '</p>'."\n";
$sortie .= '<ul>'."\n";
while ($row = mysql_fetch_object($resu_visu)) {
$visu_id_serie = $row->B_SER_IDSERIE;
$visu_ss_titre = $row->B_SER_SOUSTITRE;
$visu_debut = $row->B_SER_DATEDEBUT;
$visu_fin = $row->B_SER_DATEFIN;
$visu_into = $row->B_SER_INTOBIBLIO;
$sortie .= '<li>'."\n";
if ($visu_ss_titre == '') {
$visu_ss_titre = 'Série n°'.$visu_id_serie;
}
$sortie .= ' '.$visu_ss_titre.' ';
if (($visu_ss_titre != '') && ($visu_debut > 0)) {
$sortie .= '-';
}
if ($visu_debut > 0) {
$sortie .= ' <i>'.'Début'.'</i> '.':'.' '.FormateDateYYYYMMJJ($visu_debut);
}
if (($visu_debut > 0) && ($visu_fin > 0)) {
$sortie .= ' -';
}
if ($visu_fin > 0) {
$sortie .= ' <i>'.'Fin'.'</i> '.':'.' '.FormateDateYYYYMMJJ($visu_fin);
}
if ($visu_into == 1) {
$visu_aff = ' '.'['.'indexée'.']'."\n";
} else {
$visu_aff = ' '.'['.'non indexée'.']'."\n";
}
$sortie .= $visu_aff;
$sortie .= '</li>'."\n";
}
$sortie .= '</ul>'."\n";
}
mysql_free_result($resu_visu);
// Là on affiche les Voir Aussi Collections ... si y'en a
$UnVoirAussi = new VoirAussi($idcoll, $tbl['collection']);
if ($UnVoirAussi->NbVA > 0) {
$sortie .= '<p>'."\n";
$sortie .= '<strong>'.'Consulter'.' '.':'.'</strong><br />';
$liste_va = $UnVoirAussi->ListerVoirAussi();
for ($i = 0; $i == (($UnVoirAussi->NbVA) - 1); $i++) {
$sortie .= '<img class="'.BB_CLASS_IMG_ICONE.'" src="'.$liste_va[$i]['icon_src'].'" alt="'.$liste_va[$i]['icon_alt'].'" /> ';
$sortie .= '<a '.$liste_va[$i]['target'].'>'.$liste_va[$i]['texte'].'</a>';
if ($liste_va[$i]['desc'] != '') {
$ret .= ' - '.'<em>'.$liste_va[$i]['desc'].'</em>';
}
}
$sortie .= '</p>'."\n";
}
// Affichage des méta-données
$sortie .= '<p class="texte_inactif bb_txt_centre">';
if ($datemaj > 0) {
$sortie .= 'Dernière mise à jour de la fiche'.' '.':'.' '.date('d/m/Y',$datemaj).' '.'-'.' ';
} else {
$sortie .= 'Réf.'.' ';
}
$sortie .= $idcoll;
$sortie .= '</p>'."\n";
// Affichage d'un séparateur
if ($ktest < $nb) {
$sortie .= '<hr class="bb_separateur_horizontal" />'."\n";
}
$sortie .= '</li>'."\n";
$ktest++;
}
}
$sortie .= '</ul>'."\n";
}
mysql_free_result($do_query);
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/08/18 10:43:15 jpm
* Correction chemin.
*
* Revision 1.2 2005/05/17 10:10:08 jpm
* Correction des bogues avant mise en ligne du site v4.
*
* Revision 1.1 2004/09/16 12:06:31 jpm
* Décomposition du fichier information en plusieurs fichiers.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>