Subversion Repositories eFlore/Applications.bibliobota

Compare Revisions

Ignore whitespace Rev 28 → Rev 29

/tags/2015_03_02/applications/bb_consultation/bibliotheque/bbc_affichage_media.fonct.php
New file
0,0 → 1,369
<?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_affichage_media.fonct.php,v 1.3 2006-09-20 14:16:32 jp_milcent Exp $
/**
* Fonctions de création de l'affichage des résultats d'un média.
*
* Contient une fonction créant l'affichage des résultats pour le paramètre "media".
*
*@package BiblioBota-Consultation
*@subpackage Fonctions
//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.3 $ $Date: 2006-09-20 14:16:32 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/*Mettre ici les inclusions de fichiers*/
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
/*Mettre ici la liste de fonctions.*/
 
/** Fonction mkresu() - Traitement des requêtes.
*
* Fonction traitant la requête d'intérogation de la base de données pour le
* paramêtre "media".
*
* @return string les résultats à afficher.
*/
function mkresu()
{
global $result_final;
global $nbr_final;
global $tbl;
global $TabFinder;
global $nbr_total;
global $var_biblio;
global $query_dom;
global $phy;
// Initialisation des variables
$retour = '';
$retour .= '<ul id="bb_liste_resultat_media">'."\n";
$j = 1;
while ($row = mysql_fetch_object($result_final)) {
$retour .= '<li>';
// Récupération des données
$get_idstr = $row->B_S_IDSTR;
$get_nomstr = $row->B_S_NOM;
$get_iditem = $row->B_I_IDITEM;
$get_titreitem = $row->B_I_TITRE;
$get_auteuritem = str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', stripslashes($row->B_I_AUTEURS)))));
$get_geo = $row->B_I_GEO;
$get_langue = $row->B_I_LANGUE;
$get_resumcle = $row->B_I_RESUMCLE;
$get_image = $row->B_I_IMAGE;
$get_saisie = $row->B_AS_LIBELLE;
$get_comment = $row->B_I_COMMENT;
$get_domaine_id = $row->B_D_ID;
$get_domaine_nom = $row->B_D_LABEL;
if ($get_domaine_id != 1) {
$retour .= '<span class="texte_unactive">['.$get_domaine_nom.']</span>'."\n";
}
if (BB_ARGUMENT_REGROUPEMENT == 'article') {
$get_idcoll = $row->B_C_CRAI;
$get_seriecoll = $row->B_SER_IDSERIE;
$get_titreserie = $row->B_SER_SOUSTITRE;
$get_nomcoll = $row->B_C_NOMCOMPLET;
$get_abrege = $row->B_C_ABREGE;
$get_idfasc = $row->B_F_NUMERO;
$get_titrefasc = $row->B_F_TITRE;
$get_datefasc = $row->B_F_DATE;
$get_debut = $row->B_A_PAGEDEBUT;
$get_fin = $row->B_A_PAGEFIN;
} else {
$collection_book = $row->B_M_COLLECTION;
$numcoll_book = $row->B_M_NUMCOLL;
$isbn = $row->B_M_ISBN;
$editeur = $row->B_M_EDITEUR;
$get_datefasc = $row->B_M_DATE;
$prix = $row->B_M_PRIX;
$idmonnaie = $row->B_M_LKMONNAIE;
$monnaie = $row->GEN_MON_SYMBOLE;
$converter = $row->GEN_MON_VAL1EURO;
$volume = $row->B_M_VOLUME;
$edite = $row->B_M_EDITE;
$vendu = $row->B_M_VEND;
}
if ((BB_ARGUMENT_REGROUPEMENT == 'media') || (BB_ARGUMENT_REGROUPEMENT == 'mixte')) {
$id_phy = $row->B_IP_ID;
$item_phy = $row->B_IP_LABEL;
$icon_phy = $row->B_IP_IMAGE;
$id_log = $row->B_IL_ID;
$item_log = $row->B_IL_LABEL;
$icon_log = $row->B_IL_IMAGE;
$retour .= '<span class="texte_inactif">';
if ($icon_phy != '') {
$retour .= '<img class="bb_img_icone" src="'.BB_CHEMIN_IMAGES_TYPE_PHYSIQUE.$icon_phy.'" alt="'.$item_phy.'" /> ';
} else {
$retour .= '['.$item_phy.']';
}
if (($icon_phy == '') && ($icon_log)) {
$retour .= ' - ';
}
if ($icon_log != '') {
$retour .= ' <img class="bb_img_icone" src="'.BB_CHEMIN_IMAGES_TYPE_LOGIQUE.$icon_log.'" alt="'.$item_log.'" />';
} else {
$retour .= '['.$item_log.']';
}
$retour .= '</span> ';
}
// début de l'affichage
if ($get_auteuritem != '') {
$retour .= "\n".ColorizeFound($get_auteuritem, $TabFinder['auteur']);
} else {
$retour .= 'Anonyme';
}
$retour .= ' -'."\n".'<b>'.ColorizeFound($get_titreitem, stripslashes($TabFinder['chaine'])).'</b>'."\n";
if ($get_datefasc > 0) {
$retour .= ' - ' . DAT_formaterDateYYYYMMJJ($get_datefasc);
}
if (($get_resumcle != '') || ($get_comment != '')) {
$retour .= ' - <i>';
if ($get_resumcle != '') {
$retour .= ColorizeFound($get_resumcle, strtolower(stripslashes($TabFinder['chaine'])));
}
if (($get_resumcle != '') && ($get_comment != '')) {
$retour .= ' - ';
}
if ($get_comment != '') {
$retour .= ColorizeFound($get_comment, strtolower(stripslashes($TabFinder['chaine'])));
}
$retour .= '</i>';
}
if ((!empty($get_debut)) && (!empty($get_fin))) {
if (($get_debut > 0)||($get_fin > 0)) {
$retour .= ', p. ';
$retour .= $get_debut;
if (($get_debut > 0) && ($get_fin > 0)) {
$retour .= '-';
}
$retour .= $get_fin;
}
}
if ((!empty($volume))) {
$retour .= ' - '.$volume;
}
if (!empty($get_geo)) {
$retour .= ' - '.'Départ./Région : '.'<i>' . ColorizeFound($get_geo,ucFirst(stripslashes($TabFinder['geo']))).'</i>';
}
$retour .= ' - ';
if (BB_ARGUMENT_REGROUPEMENT == 'article') {
if (!empty($get_nomstr)) $retour .= "$get_nomstr, ";
if (empty($get_abrege)) {
$retour .= $get_nomcoll;
} else {
$retour .= $get_abrege;
}
if (!empty($get_titreserie)) {
$retour .= ', '.$get_titreserie;
}
if (($var_biblio['open_biblio_str'] == true) && ($get_nomstr != '')) {
$retour .= ', <a href="'.BB_URL_COURANTE_CONSULTATION_AVANCEE.'&amp;art='.$get_idcoll.'-'.$get_seriecoll.'-'.$get_idfasc.
'&amp;arg_0=str%3D'.$get_idstr.'&amp;arg_1=coll%3D'.$get_idstr.
'&amp;arg_2=book%3D'.$get_idstr.'&amp;arg_3=media%3D'.$get_idstr.'">'.
$get_titrefasc.
'</a>';
} else {
$retour .= ', '.$get_titrefasc;
}
} else if (BB_ARGUMENT_REGROUPEMENT == 'media') {
$retour .= 'Editeur : ';
if (($var_biblio['open_biblio_str'] == true) && ($editeur != '') && ($edite == 1) && ($get_idstr != '')) {
// sert à accéder à des pages différentes selon le type physique
// désactivé pour homogénéiser les accès au popup
if ($id_phy == $phy['perio']) {
$tmp_word = 'str';
$tmp_page = 0;
} else {
$tmp_word = 'str';
$tmp_page = 0;
}
$retour .= ' <a href="'.BB_URL_COURANTE_CONSULTATION_AVANCEE.'&amp;page='.$tmp_page.'&amp;'.
$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.
'&amp;arg_3=media%3D'.$get_idstr.'">'.$editeur.'</a>';
} else if (!empty($editeur)) {
$retour .= $editeur;
} else {
$retour .= 'inconnu';
}
} else {
if ($var_biblio['open_biblio_str'] == true) {
$retour .= '<a href="'.BB_URL_COURANTE_CONSULTATION_AVANCEE.'&amp;str='.$get_idstr.
'&amp;arg_0=str%3D'.$get_idstr.'&amp;arg_1=coll%3D'.$get_idstr.
'&amp;arg_2=book%3D'.$get_idstr.'&amp;arg_3=media%3D'.$get_idstr.'">
'.$get_nomstr.
'</a>';
} else {
$retour .= $get_nomstr;
}
}
if (((!empty($collection_book) && ($collection_book != ''))) || ((!empty($numcoll_book) && ($numcoll_book != '')))) {
$retour .= ' - '.'Collection : '.$collection_book.' '.$numcoll_book;
}
if ((!empty($isbn) && ($isbn != ''))) {
$retour .= ' - '.'ISBN : '.$isbn;
}
if ((!empty($prix) && ($prix > 0))) {
$retour .= ' - '.$prix.' '.$monnaie;
}
if ((!empty($vendu)&&($vendu == -1))) {
$retour .= ' - <img class="'.BB_CLASS_IMG_EPUISE.'" src="'.BB_IMG_EPUISE.'" alt="'.'Epuisé'.'" />';
}
if ((!empty($var_biblio['val_euro'])) && (!empty($idmonnaie)) && (!empty($converter))) {
if (($var_biblio['val_euro'] != $idmonnaie) && ($converter > 0) && ($prix > 0)) {
$retour .= ' ('.'env. '.round($prix/$converter,2).' &euro;)';
}
}
if ((!empty($get_langue) && ($get_langue != ''))) {
$retour .= ' - '.$get_langue;
}
if ($get_saisie != '') {
$get_saisie = 'Saisie : '.$get_saisie.' -';
} else if ($get_saisie == '') {
$get_saisie = 'Saisie : '.'? -';
}
/* correction du 28 nov 2002
if (($get_saisie != "")&&($get_saisie == $get_nomstr)) $get_saisie = "";
else if ($get_saisie != "") $get_saisie = "Saisie : $get_saisie -";
else if ($get_saisie == "") $get_saisie = "Saisie : ? -";
*/
// Là on affiche les Voir Aussi ... si y'en a
$UnVoirAussi = new VoirAussi($get_iditem, $tbl[BB_ARGUMENT_REGROUPEMENT]);
if ($UnVoirAussi->NbVA > 0) {
$liste_va = $UnVoirAussi->ListerVoirAussi();
$retour .= ' - '.'Consulter : ';
for ($i = 0; $i == (($UnVoirAussi->NbVA) - 1) ; $i++) {
$retour .= '<img class="'.BB_CLASS_IMG_ICONE.'" src="'.$liste_va[$i]['icon_src'].'" alt="'.$liste_va[$i]['icon_alt'].'"/> ';
$retour .= '<a '.$liste_va[$i]['target'].'>'.$liste_va[$i]['texte'].'</a>';
if ($liste_va[$i]['desc'] != '') {
$retour .= ' - <i>'.$liste_va[$i]['desc'].'</i>';
}
if (($i != 0) && ($i < ($UnVoirAussi->NbVA))) {
$retour .= '<br />'."\n";
}
}
}
// Fin des Voir Aussi
$retour .= ' - <span class="texte_inactif">';
if ((BB_ARGUMENT_REGROUPEMENT != 'article') && ($edite == 0)) {
$retour .= 'Donnée fournie par ';
if ($get_idstr != 0) {
$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'.
$get_idstr.'&amp;arg_2=book%3D'.$get_idstr.'&amp;arg_3=media%3D'.$get_idstr.'">'.$get_nomstr.'</a>';
} else {
$retour .= $get_nomstr;
}
$retour .= ' - ';
}
$retour .= $get_saisie.' Art. n°'.$get_iditem.'.</span>';
$retour .= "\n";
if ($j < $nbr_final) {
$retour .= '<br /><br/>';
}
$retour .= '</li>'."\n";
$j++;
}
$retour .= '</ul>'."\n";
return $retour;
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2006/09/20 13:18:35 jp_milcent
* Amélioration de la mise ne majuscule des noms d'auteurs.
*
* Revision 1.1 2005/11/23 10:22:25 jp_milcent
* Ajout au dépot de l'application BiblioBota.
* Elle doit à terme migrer dans eFlore.
*
* Revision 1.6 2005/08/18 10:43:15 jpm
* Correction chemin.
*
* Revision 1.5 2005/05/31 13:03:51 jpm
* Correction affichage lien vers structure inconnue.
*
* Revision 1.4 2005/05/17 10:10:08 jpm
* Correction des bogues avant mise en ligne du site v4.
*
* Revision 1.3 2005/02/24 18:33:26 jpm
* Modification de la gestion des voir aussi.
*
* Revision 1.2 2004/09/14 10:18:17 jpm
* Mise en forme et amélioration du code.
* Passage au XHTML strict.
*
* Revision 1.1 2004/09/10 18:44:02 jpm
* Ajout des fichiers de gestion du moteur de recherche des médias.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>