Subversion Repositories eFlore/Applications.bibliobota

Compare Revisions

No changes between 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 ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bb_consultation.php
New file
0,0 → 1,137
<?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: bb_consultation.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Appli bb_consultation : moteur de recherche de Biblio Bota
*
* Cette application permet de gérer les moteurs de recherches et la consultation des informations
* de l'ensemble des données comprise dans le modèle de Biblio Bota :
* - articles
* - livres et média
* - sites web
* - organismes
*
*@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 |
// +------------------------------------------------------------------------------------------------------+
/** Inclusion du fichier de configuration spécifique à l'application consultation de BiblioBota.*/
require_once 'client/biblio_bota/applications/bb_consultation/configuration/bbc_config.inc.php';
/** Inclusion de la bibliothèque de fonction d'affichage spécifique à l'application consultation de BiblioBota.*/
require_once BBC_CHEMIN_BIBLIO.'bbc_affichage.fonct.php';
 
// Initialisation de variables
$sortie .= '<!-- BiblioBota - Consultation : DEBUT -->'."\n";
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
if (!isset($_GET['consultation'])) {
include_once 'bbc_recherche.inc.php';
} elseif (isset($_GET['consultation']) && $_GET['consultation'] == 'avancee') {
global $tbl;
global $var_biblio;
global $def_livre;
global $def_euro;
global $TransTab;
if ((isset($TransTab)) && ($TransTab != '')) {
$tableau = FRAG_decoupageChaine($TransTab);
}
if (empty($tableau['pstart'])) {
$tableau['pstart'] = 0;
}
if (isset($_GET['str']) && !empty($_GET['str'])) {
$tableau['str'] = $_GET['str'];
include_once 'bbc_info_structure.inc.php';
} else if (isset($_GET['coll']) && !empty($_GET['coll'])) {
$tableau['coll'] = $_GET['coll'];
include_once 'bbc_info_collection.inc.php';
} else if (isset($_GET['fasc']) && !empty($_GET['fasc'])) {
$tableau['fasc'] = $_GET['fasc'];
include_once 'bbc_info_fascicule.inc.php';
} else if (isset($_GET['art']) && !empty($_GET['art'])) {
$tableau['art'] = $_GET['art'];
include_once 'bbc_info_article.inc.php';
} else if (isset($_GET['book']) && !empty($_GET['book'])) {
$tableau['book'] = $_GET['book'];
include_once 'bbc_info_livre.inc.php';
} else if (isset($_GET['media']) && !empty($_GET['media'])) {
$tableau['media'] = $_GET['media'];
include_once 'bbc_info_media.inc.php';
} else {
$sortie .= '<p>'."\n";
$sortie .= 'Pas de paramètre str, coll, fasc, art, media ou livre -- Impossible d\'afficher des données.';
if (isset($tableau['str'])) {
$sortie .= ' '.'('.'id_str'.' '.'='.' '.$tableau['str'].')';
}
$sortie .= '</p>'."\n";
}
}
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$sortie .= '<!-- BiblioBota - Consultation : FIN -->'."\n";
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.7 2005/05/17 10:10:08 jpm
* Correction des bogues avant mise en ligne du site v4.
*
* Revision 1.6 2005/02/24 18:32:40 jpm
* Mise en global d'une variable.
*
* Revision 1.5 2004/09/16 12:28:57 jpm
* Ajout de l'affichage d'un message d'erreur.
*
* Revision 1.4 2004/09/16 12:06:39 jpm
* Décomposition du fichier information en plusieurs fichiers.
*
* Revision 1.3 2004/09/14 10:18:31 jpm
* Mise en forme et amélioration du code.
* Passage au XHTML strict.
*
* Revision 1.2 2004/09/10 18:42:44 jpm
* Transformations des ancien pop-up de Bilblio Bota en consultation avancée...
* Ajout d'un fichier fournissant les moteurs de recherche et d'un fichier gérant la consultation avancée.
*
* Revision 1.1 2004/09/10 09:45:28 jpm
* Ajout des fichiers BiblioBota configurer pour Papyrus.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bbc_recherche.inc.php
New file
0,0 → 1,365
<?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_recherche.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Appli bb_consultation : gestion des moteurs de recherche de Biblio Bota
*
* Cette application permet de gérer les moteurs de recherches de l'ensemble des données comprise
* dans le modèle de Biblio Bota :
* - articles botaniques
* - livres et média botaniques
* - sites web
* - organismes liés à 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 |
// +------------------------------------------------------------------------------------------------------+
 
/** Inclusion de la bibliothèque de réaliser les statistiques spécifiques à l'application consultation de BiblioBota.*/
require_once BBC_CHEMIN_BIBLIO.'bbc_statistique.fonct.php';
 
// Globalisation des variables
global $TabFinder, $TransTab, $plugin, $tbl;
if (isset($TransTab)) {
$TabFinder = FRAG_decoupageChaine($TransTab);
}
 
// Vérification de l'utilisation de BiblioBota comme service web
if (empty($TabFinder['plugin'])) {
$TabFinder['plugin'] = '';
}
if (BB_ARGUMENT_SERVICE != '' && $TabFinder['plugin'] == '') {
$TabFinder['plugin'] = BB_ARGUMENT_SERVICE;
}
// Limitation au domaine ?
if (BB_ARGUMENT_DOMAINE != 1) {
$var_biblio['limit_domain'] = 1;
} else {
$var_biblio['limit_domain'] = 0;
}
 
// Gestion du mode du moteur: nomal ou avancé ( = plus d'options)
if (empty($TabFinder['finder_mode'])) {
$TabFinder['finder_mode'] = 'normal';
}
 
// Initialisation de TabFinder au cas ou cela n'aurait pas été fait
if (!isset($TabFinder['plugin'])) $TabFinder['plugin'] = '';
if (!isset($TabFinder['geo'])) $TabFinder['geo'] = '';
if (!isset($TabFinder['chaine'])) $TabFinder['chaine'] = '';
if (!isset($TabFinder['sort'])) $TabFinder['sort'] = $GLOBALS['moteur_biblio']['defaut_sort'];
if (!isset($TabFinder['auteur'])) $TabFinder['auteur'] = '';
if (!isset($TabFinder['categ'])) $TabFinder['categ'] = '';
if (!isset($TabFinder['pstart'])) $TabFinder['pstart'] = '0';
if (!isset($TabFinder['step'])) $TabFinder['step'] = '20';
if (!isset($TabFinder['valid'])) $TabFinder['valid'] = '0';
if (!isset($TabFinder['typque'])) $TabFinder['typque'] = '1';
if (!isset($TabFinder['categ_2'])) $TabFinder['categ_2'] = '';
if (!isset($TabFinder['categ_3'])) $TabFinder['categ_3'] = '';
if (!isset($TabFinder['since'])) $TabFinder['since'] = '';
if (!isset($TabFinder['finder_mode'])) $TabFinder['finder_mode'] = 'normal';
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// no_help est une variable qui est passée par un PlugIn s'il n'y a pas besoin d'aide
global $no_help;
 
// +------------------------------------------------------------------------------------------------------+
// Début de gestion des services Web (plugin)
if ($TabFinder['plugin'] != '') {
// Séparation des éléments du PlugIn
$plugin_exp = explode('-', $TabFinder['plugin']);
// Mise en global des variables utilisées ailleurs
global $plugin_store;
// Création des arguments pour les onglets
$TabFinder['args'] = '&amp;arg_0=plugin%3D'.$TabFinder['plugin'].'&amp;arg_1=plugin%3D'.$TabFinder['plugin'];
 
// L'argument 0 de plugin_exp peut avoir les valeurs :
// str (réduction à une structure), coll (réduction à une collection), aut (réduction à des auteurs)
switch ($plugin_exp[0]) {
case 'str':
// On récupère ici dans plugin l'identifiant d'une structure,
// il faut donc réduire à cette structure dans la requête
if (BB_ARGUMENT_REGROUPEMENT == 'article') {
$plugin_store['count_add_table'] = ', '.$tbl['article'].', '.$tbl['fascicule'].', '.$tbl['serie'].', '.$tbl['collection'];
$plugin_store['count_add_query'] = ' AND B_C_LKSTR = '.$plugin_exp[1].' '.
'AND B_C_CRAI = B_SER_CRAICOLL '.
'AND B_SER_CRAICOLL = B_F_CRAICOLL '.
'AND B_SER_IDSERIE = B_F_CRAISERIE '.
'AND B_F_CRAICOLL = B_A_CRAICOLL '.
'AND B_F_CRAISERIE = B_A_CRAISERIE '.
'AND B_F_NUMERO = B_A_CRAIFASC '.
'AND B_I_IDITEM = B_A_IDART ';
$plugin_store['categ_add_table'] = ', '.$tbl['article'].', '.$tbl['fascicule'].', '.$tbl['item'];
$plugin_store['categ_add_query'] = ' AND B_C_LKSTR = '.$plugin_exp[1].' '.
'AND B_SER_IDSERIE = B_F_CRAISERIE '.
'AND B_F_CRAICOLL = B_A_CRAICOLL '.
'AND B_F_CRAISERIE = B_A_CRAISERIE '.
'AND B_F_NUMERO = B_A_CRAIFASC '.
'AND B_I_IDITEM = B_A_IDART ';
} else if (BB_ARGUMENT_REGROUPEMENT == 'media') {
$plugin_store['count_add_table'] = ', '.$tbl['media'];
$plugin_store['count_add_query'] = ' AND B_M_LKSTR = '.$plugin_exp[1].' '.
'AND B_I_IDITEM = B_M_IDMEDIA ';
$plugin_store['categ_add_table'] = '';
$plugin_store['categ_add_query'] = ' AND B_M_LKSTR = '.$plugin_exp[1].' ';
$plugin_store['query_add_query'] = ' AND B_M_LKSTR = '.$plugin_exp[1].' ';
}
break;
case 'coll':
// On récupère ici dans plugin l'identifiant d'une collection,
// il faut donc réduire à cette collection dans la requête
// cette option n'existe que pour le regroupement ARTICLE
if (BB_ARGUMENT_REGROUPEMENT == 'article') {
$plugin_store['count_add_table'] = ', '.$tbl['article'];
$plugin_store['count_add_query'] = ' AND B_A_CRAICOLL = "'.$plugin_exp[1].'" AND B_I_IDITEM = B_A_IDART ';
$plugin_store['categ_add_table'] = '';
$plugin_store['categ_add_query'] = ' AND B_C_CRAI = "'.$plugin_exp[1].'" ';
$plugin_store['query_add_query'] = ' AND B_C_CRAI = "'.$plugin_exp[1].'" ';
} else if (BB_ARGUMENT_REGROUPEMENT == 'media') {
// leurre pour finir proporement le script
$plugin_store['count_add_table'] = '';
$plugin_store['count_add_query'] = ' AND B_I_IDITEM = "aeiouy"';
$plugin_store['categ_add_table'] = '';
$plugin_store['categ_add_query'] = '';
$plugin_store['query_add_query'] = '';
}
break;
case 'aut':
// On récupère ici dans plugin des identifiants d'auteurs
// il faut donc réduire à ces auteurs dans la requête
// les noms d'auteurs sont séparés par des "!"
$plugin_auteurs = explode('@',$plugin_exp[1]);
$plugin_i = 0;
$plugin_action = ' AND (';
while ($plugin_i < count($plugin_auteurs)) {
if ($plugin_i != 0) {
$plugin_action .= ' OR ';
}
$plugin_action .= 'B_I_AUTEURSAISIE LIKE "%'.$plugin_auteurs[$plugin_i].'%" ';
$plugin_i++;
}
$plugin_action .= ') ';
$plugin_store['count_add_table'] = '';
$plugin_store['count_add_query'] = $plugin_action;
if (BB_ARGUMENT_REGROUPEMENT == 'article') {
$plugin_store['categ_add_table'] = ", ".$tbl['article'].", ".$tbl['fascicule'].", ".$tbl['item'];
$plugin_store['categ_add_query'] = ' '.$plugin_action.' '.
'AND B_C_CRAI = B_SER_CRAICOLL '.
'AND B_SER_CRAICOLL = B_F_CRAICOLL '.
'AND B_SER_IDSERIE = B_F_CRAISERIE '.
'AND B_F_CRAICOLL = B_A_CRAICOLL '.
'AND B_F_CRAISERIE = B_A_CRAISERIE '.
'AND B_F_NUMERO = B_A_CRAIFASC '.
'AND B_I_IDITEM = B_A_IDART ';
$plugin_store['query_add_query'] = ' '.$plugin_action.' ';
} else if (BB_ARGUMENT_REGROUPEMENT == 'media') {
$plugin_store['categ_add_table'] = '';
$plugin_store['categ_add_query'] = ' '.$plugin_action.' ';
$plugin_store['query_add_query'] = ' '.$plugin_action.' ';
}
break;
default:
die('Regroupement PLUGIN impossible... Méthode Plugin par défaut inexistante (méthodes disponibles : str, coll et aut).');
break;
}
} // Fin de gestion des services Web
 
// +------------------------------------------------------------------------------------------------------+
// Création de l'interface du moteur de recherche
require_once BBC_CHEMIN_BIBLIO.'bbc_moteur_'.BB_ARGUMENT_OBJET.'.fonct.php';
$sortie .= mkengine();
// Affichage des résultats d'une recherche
if ((isset($TabFinder)) && ($TabFinder['valid'] == 1)) {
global $nbr_total;
if ($nbr_total > 1) {
$pluriel_tot = 's';
}
// Création de la requête
include_once BBC_CHEMIN_BIBLIO.'bbc_requete_'.BB_ARGUMENT_OBJET.'.fonct.php';
$requete = mkquery();
// DEBOGAGE : pour voir la requete finale
//$GLOBALS['_DEBOGAGE_'] .= $requete.'<br>';
//Requete de calcul du nombre total d'enregistrements de la table
$result_local = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$nbr_local = mysql_num_rows($result_local);
mysql_free_result($result_local);
if ($nbr_local > 1) {
$pluriel_loc = 's';
}
// Requete de sélection sur la quantité de données demandées par l'utilisateur (avec bornes LIMIT)
if ($TabFinder['pstart'] == '') {
$TabFinder['pstart'] = 0;
}
$query_final = ' LIMIT '.$TabFinder['pstart'].', '.$TabFinder['step'];
global $result_final;
$result_final = mysql_query($requete.$query_final) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete.$query_final));
global $nbr_final;
$nbr_final = mysql_num_rows($result_final);
$sortie .= '<p class="insTitle1">';
$TabFinder['pend'] = $nbr_local;
$sortie .= FRAG_afficherTxtNbreResultat('', $TabFinder, $nbr_local, $nbr_total);
$sortie .= '</p>';
if (($nbr_local > 0) && ($TabFinder['step'] < $nbr_local)) {
$sortie .= '<p id="fragmenteur_tete" class="fragmenteur">';
$frag = new fragmenteur();
$sortie .= $frag->fragmente($TabFinder, $nbr_local);
$sortie .= '</p>';
}
include_once BBC_CHEMIN_BIBLIO.'bbc_affichage_'.BB_ARGUMENT_OBJET.'.fonct.php';
$sortie .= mkresu();
mysql_free_result($result_final);
if (($TabFinder['step'] >= 20) && ($nbr_local - $TabFinder['pstart'] >= (20 + $TabFinder['step']))) {
$sortie .= '<p id="fragmenteur_pied" class="fragmenteur">';
$sortie .= $frag->fragmente($TabFinder, $nbr_local);
$sortie .= '</p>'."\n\n";
}
}
 
// Création de l'aide
if ((!isset($TabFinder)) || ($TabFinder['valid'] != 1)) {
if (((!empty($no_help)) && ($no_help == 1))) {
$sortie .= '';
} else {
$sortie .= presa_mk_title('Aide à la recherche : ', 3);
$sortie .= '<p class="texte_tb">'."\n";
// Aide commune
$sortie .= '- Attention aux fautes de frappe : le moteur recherche EXACTEMENT les termes saisis.'."\n";
// Aide switchée sur chaine mot précis ou chaque terme
switch (BB_ARGUMENT_OBJET) {
case 'structure':
$exp_exacte = 'Tela Botanica';
$exp_separe = 'association botanique';
break;
case 'lien':
$exp_exacte = 'Société Botanique du Vaucluse';
$exp_separe = 'botanique Vaucluse';
break;
case 'media':
$exp_exacte = 'écologie végétale';
$exp_separe = 'écologie environnement';
break;
}
$sortie .= '<br /><br />'."\n";
$sortie .= '- Pour rechercher une <strong>chaine de mots précise</strong>, sélectionnez "<strong>Expression Exacte</strong>" ';
$sortie .= '(ex. : <i>'.$exp_exacte.'</i> recherchera la correspondance exacte). ';
$sortie .= 'Pour rechercher <strong>chacun des mots</strong> saisis, sélectionnez "<strong>Mots séparés</strong>" ';
$sortie .= '(ex. : <i>'.$exp_separe.'</i>). ';
$sortie .= 'Attention ! Le moteur ne comprend ni les symboles + ou -, ni les termes logiques ET, OU, AND, OR...'."\n";
// Aide sur les moteurs utilisant les index Full Text
if (BB_ARGUMENT_OBJET == 'media') {
$sortie .= '<br /><br />'."\n";
$sortie .= '- Recherche intelligente : si vous saisissez "ortie", le moteur vous retournera toutes les données contenant cette chaîne de caractères : '.
'"ortie, sortie, ...". Pour rechercher un terme <strong>exact</strong>, vous pouvez le mettre entre crochets : "[ortie]".'."\n";
}
$sortie .= '<br /><br />'."\n";
$sortie .= '- Seule la zone de saisie "Rechercher" peut contenir plusieurs termes ; les autres champs ne doivent contenir qu\'une seule information.'."\n";
// Aide sur les moteurs faisant appel à GEO
if ((BB_ARGUMENT_OBJET == 'structure') || (BB_ARGUMENT_OBJET == 'media')) {
$sortie .= '<br /><br />'."\n";
$sortie .= '- Zone géographique : précisez ici une zone géographique (Pays, nom de département, ville...), '.
'ou un code de département Français (34, 29...).'."\n";
}
// Aide : liste complète
$sortie .= '<br /><br />'."\n";
$sortie .= '- Pour obtenir la liste complète des données : n\'entrez aucune information dans les champs de saisie, '.
'choisissez "Tous" dans les listes déroulantes, puis cliquez sur "Chercher". Pour obtenir toutes les données d\'une '.
'catégorie spécifique, vous pouvez affiner la recherche en sélectionnant une catégorie.'."\n";
$sortie .= '</p>'."\n";
}
}
 
// Réalisation des statistiques sur la recherche effectuée
if ($TabFinder['valid'] == 1) {
spy_validated_finder(BB_ARGUMENT_APPLI, $nbr_total);
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.7 2005/05/17 10:10:08 jpm
* Correction des bogues avant mise en ligne du site v4.
*
* Revision 1.6 2005/02/24 18:32:40 jpm
* Mise en global d'une variable.
*
* Revision 1.5 2005/01/04 16:23:25 jpm
* Affichage de la requête sql.
*
* Revision 1.4 2004/09/16 12:06:39 jpm
* Décomposition du fichier information en plusieurs fichiers.
*
* Revision 1.3 2004/09/15 12:15:55 jpm
* Suppresion du code spécifique au moteur annuaire.
*
* Revision 1.2 2004/09/14 10:18:31 jpm
* Mise en forme et amélioration du code.
* Passage au XHTML strict.
*
* Revision 1.1 2004/09/10 18:41:48 jpm
* Transformations des ancien pop-up de Bilblio Bota en consultation avancée...
* Ajout d'un fichier fournissant les moteurs de recherche et d'un fichier gérant la consultation avancée.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bibliotheque/bbc_moteur_lien.fonct.php
New file
0,0 → 1,203
<?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_moteur_lien.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Fonctions de création du moteur de recherche des liens.
*
* Contient les fonctions permettant de retourner l'affichage du moteur de recherche des liens.
* Valable pour le paramètre "lien".
*
*@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.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
// mkengine() :
// fonction spécifique du moteur LINK
// créé le bloc de recherche pour le paramètre LINK de Finder
// Entrée : -
// Sortie (par retour) : string
function mkengine()
{
global $label_bbota, $tbl, $TabFinder, $nbr_total;
$retour = '';
// Comptage du nombre total de données dans la table (hors CACHER = 1)
$requete = 'SELECT COUNT(*) AS CPT '.
'FROM '.$tbl['link'].' '.
'WHERE B_L_CACHER = 0';
$result = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
if (mysql_num_rows($result) == 1) {
$tmp_nb = mysql_fetch_object($result);
$nbr_total = $tmp_nb->CPT;
if ($nbr_total > 0) {
$chaine = 'parmi '.$nbr_total.' sites web';
}
}
mysql_free_result($result);
// Titre de la page
$retour .= presa_mk_title('Chercher '.$chaine.' :', 1);
// Construction du moteur de liens
$retour .= '<form id="bb_moteur_lien" action="'.BB_URL_COURANTE_CONSULTATION.'" method="post">'."\n";
$retour .= '<ul>'."\n";
// Ligne de recherche
$retour .= '<li>'."\n";
$retour .= form_mk_chaine(stripslashes($TabFinder['chaine'])).' ';
$retour .= form_mk_typque($TabFinder['typque']);
$retour .= form_mk_categ($TabFinder['categ']);
$retour .= '</li>'."\n";
if ($TabFinder['finder_mode'] == 'advance') {
$retour .= '<li>'."\n";
$retour .= form_mk_since($TabFinder['since']);
$retour .= '</li>'."\n";
}
// Ligne de regroupement (frequente)
if ($TabFinder['finder_mode'] == 'advance') {
$retour .= '<li>'."\n".form_mk_step($TabFinder['step']).'</li>'."\n";
$retour .= '<li>'."\n".form_mk_sort($TabFinder['sort']).'</li>'."\n";
}
$retour .= '<li class="bb_aligner_droite">'."\n";
$retour .= form_mk_advance().' '.form_mk_submit();
$retour .= '</li>'."\n";
$retour .= '</ul>'."\n";
$retour .= '</form>'."\n";
// Ajout d'un lien pour les moteurs de recherche
$link = BB_URL_COURANTE_CONSULTATION.'&amp;TransTab=typque,1!valid,1!finder_mode,normal!sort,B_L_TITRE!'.
'pstart,0!step,20!pend,231!plugin,!geo,!chaine,!auteur,!categ,!categ_2,!categ_3,!since,!nom,!prenom,!ville,!dept,!pays,!cotisant,!mail,!';
$retour .= '<p><a href="'.$link.'" style="visibility:hidden;">'.'tout'.'</a></p>'."\n";
return $retour;
}
 
 
// form_mk_sort($actualsort,$class) :
// fonction spécifique du moteur LINK
// créé une liste déroulante TabFinder[sort] pour ordonner les pages de résultats
// Entrée : $actualsort (valeur de TabFinder['sort']), $class (classe CSS) par défaut "insInputForm"
// Sortie (par retour) : string
function form_mk_sort($actualsort, $class = 'bb_champ')
{
$retour = '';
$id = 'TabFinder[sort]';
$retour .= '<label for="'.$id.'">'.'Trier par : '.'</label>';
$retour .= '<select id="'.$id.'" name="'.$id.'" class="'.$class.'">'."\n";
$retour .= ' <option value="B_L_TITRE" ';
if ($actualsort == 'B_L_TITRE') {
$retour .= 'selected="selected"';
}
$retour .= '>'.'titre'.'</option>'."\n";
$retour .= ' <option value="B_L_MAJFICHE" ';
if ($actualsort == 'B_L_MAJFICHE') {
$retour .= 'selected="selected"';
}
$retour .= '>'.'date'.'</option>'."\n";
$retour .= ' <option value="B_L_URL" ';
if ($actualsort == 'B_L_URL') {
$retour .= 'selected="selected"';
}
$retour .= '>'.'adresse'.'</option>'."\n";
$retour .= '</select>'."\n\n";
return $retour;
}
 
 
// form_mk_categ($actualsort,$class) :
// fonction spécifique du moteur LINK
// créé une liste déroulante TabFinder[categ] pour affiner les résultats
// Entrée : $actualcateg (valeur de TabFinder['categ']), $class (classe CSS) par défaut "insInputForm"
// Sortie (par retour) : string
function form_mk_categ($actualcateg, $class = 'bb_champ')
{
global $tbl;
$retour = '';
$retour .= '<select name="TabFinder[categ]" class="'.$class.'">'."\n";
$retour .= ' <option value="0"';
if ($actualcateg == 0) {
$retour .= ' selected="selected"';
}
$retour .= '>'.'Toutes catégories'.'</option>'."\n";
$requete = 'SELECT * '.
'FROM '.$tbl['cat'].' '.
'ORDER BY B_CAT_IDCAT';
$result_cat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
while ($row = mysql_fetch_object($result_cat)) {
$cat_id = $row->B_CAT_IDCAT;
$cat_nom = $row->B_CAT_LABEL;
$retour .= ' <option value="'.$cat_id.'"';
if ($actualcateg == $cat_id) {
$retour .= ' selected="selected"';
}
$retour .= '>'.$cat_nom.'</option>'."\n";
}
mysql_free_result($result_cat);
$retour .= '</select>'."\n\n";
return $retour;
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.4 2005/05/17 10:10:08 jpm
* Correction des bogues avant mise en ligne du site v4.
*
* Revision 1.3 2005/03/03 08:25:38 jpm
* Remplacement d'un & par &amp;
*
* Revision 1.2 2004/09/14 11:49:52 jpm
* Ajout de l'entête au fichier.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bibliotheque/bbc_affichage_lien.fonct.php
New file
0,0 → 1,159
<?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_lien.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Fonctions de création de l'affichage des résultats d'un lien.
*
* Contient une fonction créant l'affichage des résultats pour le paramètre "lien".
*
*@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.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/*Mettre ici les inclusions de fichiers*/
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
/*Mettre ici la liste de fonctions.*/
 
/*
Fichier de traitement de requêtes de l'appli FINDER v. 3.00 - 21/06/2002 - 08h30
Valable pour le paramètre "link".
 
retourne une chaine de données
*/
function mkresu()
{
global $result_final;
global $nbr_final;
global $tbl;
global $TabFinder;
global $var_biblio;
$retour = '';
$retour .= '<ul id="bb_liste_resultat_lien">'."\n";
// Boucle qui affiche les résultats
$i = 1;
while ($row = mysql_fetch_object($result_final)) {
$get_idlink = $row->B_L_IDLINK;
$get_urllink = $row->B_L_URL;
$get_titrelink = $row->B_L_TITRE;
$get_lkstr = $row->B_L_LKSTR;
$get_nomstr = $row->B_S_NOM;
$get_resum = $row->B_L_RESUMCLE;
$get_date = $row->B_L_MAJFICHE;
$get_part = $row->B_L_PARTENAIRE;
$get_ref = $row->B_L_REFERENCE;
$retour .= '<li>';
$retour .= '<img class="'.BB_CLASS_IMG_WEB.'" src="'.BB_IMG_WEB.'" alt="'.'Lien Web'.'" />'."\n";
$retour .= '<a href="'.$get_urllink.'">';
if ($get_titrelink != '') {
$retour .= $get_titrelink;
} else {
$retour .= ColorizeFound($get_urllink, strtolower($TabFinder['chaine']));
}
$retour .= '</a>'."\n";
if ($get_resum != '') {
$retour .= ' - '. ColorizeFound($get_resum, stripslashes($TabFinder['chaine']));
}
if ($get_lkstr != 0) {
$retour .= ' - <b>' . ColorizeFound($get_nomstr, stripslashes($TabFinder['chaine'])).'</b>'."\n\n";
}
// Affichage du lien vers la consultation avancée correspondant à la structure si elle existe dans la base
if ($var_biblio['open_biblio_link'] == true && $get_lkstr != 0) {
// Cross Biblio est le module qui permet d'avoir accès au popup transversal BBPOPUP
$retour .= '<a href="'.BB_URL_COURANTE_CONSULTATION_AVANCEE.'&amp;str='.$get_lkstr.'&amp;arg_0=str%3D'.$get_lkstr.
'&amp;arg_1=coll%3D'.$get_lkstr.'&amp;arg_2=book%3D'.$get_lkstr.'&amp;arg_3=media%3D'.$get_lkstr.'">'.'Plus d\'infos...'.'</a>';
}
if ($get_ref == 1) {
$retour .= '<img class="'.BB_CLASS_IMG_REFERENCE.'" src="'.BB_IMG_REFERENCE.'" alt="'.'Site Référence'.'" /> '."\n";
}
if ($get_part == 1) {
$retour .= '<img class="'.BB_CLASS_IMG_PARTENAIRE.'" src="'.BB_IMG_PARTENAIRE.'" alt="'.'Site Partenaire de Tela Botanica'.'" /> '."\n";
}
// Affichage des infos et des liens pour édition
$retour .= ' <span class="texte_inactif">('.'n°'.$get_idlink;
if ((check_if_modif($tbl['modif'], $tbl['link'], $get_idlink) == 0) && ($var_biblio['open_proposer_link'] == true)) {
$retour .= ' - ';
$retour .= '<a class="texte_inactif" href="'.BB_URL_COURANTE_ADMIN.'&amp;action=edit&ensemble=link&amp;ref='.$get_idlink.'">'.'éditer'.'</a>';
$retour .= ' - ';
$retour .= '<a class="texte_inactif" href="'.BB_URL_COURANTE_ADMIN.'&amp;action=supp&ensemble=link&amp;ref='.$get_idlink.'">'.'supprimer'.'</a>';
}
$retour .= ')'.'</span>'."\n";
if ($i < $nbr_final) {
$retour .= '<br /><br />';
}
$retour .= '</li>'."\n";
$i++;
}
$retour .= '</ul>'."\n";
if ($var_biblio['open_proposer_link'] == true) {
$retour .= '<p align="center">'."\n".
'<hr size="1" />'."\n".
'<a href="'.BB_URL_COURANTE_ADMIN.'&amp;action=new&ensemble=link">'.'Proposer un nouveau lien'.'</a>'."\n".
'<hr size="1" />'."\n".
'</p>'."\n";
}
return $retour;
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.4 2005/05/17 10:10:08 jpm
* Correction des bogues avant mise en ligne du site v4.
*
* Revision 1.3 2004/09/15 15:47:36 jpm
* Ajout des images de site partenaire et référence.
*
* Revision 1.2 2004/09/14 11:49:52 jpm
* Ajout de l'entête au fichier.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bibliotheque/bbc_requete_media.fonct.php
New file
0,0 → 1,377
<?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_requete_media.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Fonctions de création de la requête sur un média.
*
* Contient une fonction créant la requête d'intérogation de la base de données.
* Valable 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.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
/** Fonction mkquery() - Créé une requête intérogeant la base de donnée.
*
* Fonction créant la requête d'intérogation de la base de données pour le
* paramêtre "media".
*
* @return string la requête permettant de récupérer les média.
*/
function mkquery()
{
global $tbl;
global $TabFinder;
global $nbr_total;
global $var_biblio;
global $query_dom;
global $plugin_store;
// si limit_domain vaut 1, alors on réduit les recherches au seul domaine botanique
if ($var_biblio['limit_domain'] == 1) {
$add_from_dom = ', '.$tbl['domaine'].', '.$tbl['domaine_lk'];
// lien domaines -- table de jointure domaines
$add_limit_dom = ' AND ('.$tbl['domaine'].'.B_D_ID = '.$tbl['domaine_lk'].'.B_DL_IDDOM)';
// lien articles -- table de jointure domaines
$add_limit_dom .= ' AND ('.$tbl['item'].'.B_I_IDITEM = '.$tbl['domaine_lk'].'.B_DL_IDITEM)';
$add_limit_dom .= ' AND '.$tbl['domaine'].'.B_D_ID = 1';
} else {
$add_from_dom = ', '.$tbl['domaine'].', '.$tbl['domaine_lk'];
// lien domaines -- table de jointure domaines
$add_limit_dom = ' AND ('.$tbl['domaine'].'.B_D_ID = '.$tbl['domaine_lk'].'.B_DL_IDDOM)';
// lien articles -- table de jointure domaines
$add_limit_dom .= ' AND ('.$tbl['item'].'.B_I_IDITEM = '.$tbl['domaine_lk'].'.B_DL_IDITEM)';
}
/*
Pour une implémentation d'une recherche sur TOUTE LA TABLE ARTICLES
il faut une requête spéciale qui fasse une jointure à la fois avec les
tables structure-coll-serie-fasc-art et les tables str-art-media... gasp...
*/
/* si la variable de catégorie / type vaut 0, il n'y a pas affinage de la requête par catégorie */
if (BB_ARGUMENT_REGROUPEMENT == 'article') {
// On demande ici les articles : mise en place des réducteurs
$add_select = 'B_C_CRAI, '.$tbl['serie'].'.*, B_C_NOMCOMPLET, B_C_ABREGE, B_F_NUMERO, B_F_TITRE, B_F_DATE, B_A_PAGEDEBUT, B_A_PAGEFIN, ';
// $add_select = $tbl['collection'].".B_C_CRAI, ".$tbl['serie'].".*, ".$tbl['collection'].".B_C_NOMCOMPLET, ".$tbl['collection'].".B_C_ABREGE, ".$tbl['fascicule'].".B_F_TITRE, ".$tbl['fascicule'].".B_F_DATE, ".$tbl['article'].".B_A_PAGEDEBUT, ".$tbl['article'].".B_A_PAGEFIN, ";
$add_from = $tbl['collection'].' LEFT JOIN '.$tbl['str'].' ON B_C_LKSTR = B_S_IDSTR, '.$tbl['fascicule'].', '.$tbl['serie'].', '.$tbl['article'].',';
// jointure coll - serie
$special_join = ' AND ('.$tbl['collection'].'.B_C_CRAI = '.$tbl['serie'].'.B_SER_CRAICOLL)';
// jointure serie - fasc
$special_join .= ' AND ('.$tbl['serie'].'.B_SER_CRAICOLL = '.$tbl['fascicule'].'.B_F_CRAICOLL)';
$special_join .= ' AND ('.$tbl['serie'].'.B_SER_IDSERIE = '.$tbl['fascicule'].'.B_F_CRAISERIE)';
// jointure fasc - item
$special_join .= ' AND ('.$tbl['fascicule'].'.B_F_CRAICOLL = '.$tbl['article'].'.B_A_CRAICOLL)';
$special_join .= ' AND ('.$tbl['fascicule'].'.B_F_CRAISERIE = '.$tbl['article'].'.B_A_CRAISERIE)';
$special_join .= ' AND ('.$tbl['fascicule'].'.B_F_NUMERO = '.$tbl['article'].'.B_A_CRAIFASC)';
// jointure item - article
$special_join .= ' AND ('.$tbl['item'].'.B_I_IDITEM = '.$tbl['article'].'.B_A_IDART)';
// réducteur de catégorie (collections) categ
if ($TabFinder['categ'] != '') {
$add_to_query = ' AND ('.$tbl['article'].'.B_A_CRAICOLL like "'.$TabFinder['categ'].'%")';
} else {
$add_to_query = '';
}
} else {
// On demande ici les livres et médias
$add_select = $tbl['media'].'.*, '.$tbl['monnaie'].'.*, ';
// Ajout du FROM
$add_from = $tbl['media'].' LEFT JOIN '.$tbl['str'].' ON B_M_LKSTR = B_S_IDSTR, '.$tbl['monnaie'].', ';
// lien media -- article
$special_join = ' AND ('.$tbl['media'].'.B_M_IDMEDIA = '.$tbl['item'].'.B_I_IDITEM)';
// lien media -- monnaie
$special_join .= ' AND ('.$tbl['media'].'.B_M_LKMONNAIE = '.$tbl['monnaie'].'.GEN_MON_IDMONNAIE)';
//pas de réducteur de catégorie pour les livres
$add_to_query = '';
}
// Compte Total : comptage du nombre de données de la table
// d'abord, créer les critères de sélection physiques et logiques.
if (($TabFinder['categ_3'] == '') || (BB_ARGUMENT_REGROUPEMENT == 'article')) {
if ((!empty($query_dom['log']))) {
$create_log = $query_dom['log'];
} else {
$create_log = '';
}
} else {
$create_log = 'B_I_TYPLOG = '.$TabFinder['categ_3'];
}
if ($TabFinder['categ_2'] == '') {
if ((!empty($query_dom['phy']))) {
$create_phy = $query_dom['phy'];
} else {
$create_phy = '';
}
} else {
$create_phy = 'B_I_TYPPHY = '.$TabFinder['categ_2'];
}
if (($create_phy != "")&&($create_log != "")) {
$create_logphy = "$create_log AND $create_phy";
} else if (($create_phy != "")||($create_log != "")) {
$create_logphy = "$create_log$create_phy";
}
// Création du corps de la requête
// Création du SELECT général
$normal_query = "SELECT DISTINCT $add_select B_D_ID, B_D_LABEL, B_S_IDSTR, B_S_NOM, B_AS_LIBELLE, ".$tbl['item'].".*, ".$tbl['item_typlog'].".*, ".$tbl['item_typphy'].".* ";
// Création du FROM général
$normal_query .= " FROM $add_from ".$tbl['saisie'].", ".$tbl['item'].", ".$tbl['item_typlog'].", ".$tbl['item_typphy']."$add_from_dom";
// Création du WHERE
$normal_query .= " WHERE $create_logphy ";
$normal_query .= " AND B_I_CACHER = 0 ";
if (($TabFinder['typque'] == 0)&&($TabFinder['chaine'] != "")) {
// le mode de moteur demandé est : expression exacte
$normal_query .= " AND (";
// on vérifie si la chaine est entre crochets
$check_method = ereg("\[*\]",$TabFinder['chaine']);
if ($check_method == 1) {
// si oui, on utilise le FULL TEXT
$TabFinder['chaine'] = ereg_replace("\[","",$TabFinder['chaine']);
$TabFinder['chaine'] = ereg_replace("\]","",$TabFinder['chaine']);
$normal_query .= "MATCH(B_I_TITRE) against ('".$TabFinder['chaine']."')";
$normal_query .= " OR MATCH(B_I_RESUMCLE) against ('".$TabFinder['chaine']."')";
$normal_query .= " OR ".$tbl['item'].".B_I_COMMENT like '%".$TabFinder['chaine']."%'";
} else {
// si non, on utilise la methode classique
$normal_query .= $tbl['item'].".B_I_TITRE like '%".$TabFinder['chaine']."%'";
$normal_query .= " OR ".$tbl['item'].".B_I_RESUMCLE like '%".$TabFinder['chaine']."%'";
$normal_query .= " OR ".$tbl['item'].".B_I_COMMENT like '%".$TabFinder['chaine']."%'";
}
$normal_query .= ")";
} else if (($TabFinder['chaine'] != "")&&($TabFinder['typque'] == 1)) {
// le mode du moteur demandé est : chaque terme
$result_from_ex = explode (" ", $TabFinder['chaine']);
if (($result_from_ex != "")&&(count($result_from_ex)>=1)) {
$i_ex = 0;
$normal_query .= " AND (";
while ($i_ex < count($result_from_ex)) {
// on vérifie si la chaine est entre crochets
$check_method = ereg("\[*\]",$result_from_ex[$i_ex]);
if ($check_method == 1) {
$result_from_ex[$i_ex] = ereg_replace("\[","",$result_from_ex[$i_ex]);
$result_from_ex[$i_ex] = ereg_replace("\]","",$result_from_ex[$i_ex]);
// si oui, on utilise le FULL TEXT
$normal_query .= "MATCH(B_I_TITRE) against ('";
if ($result_from_ex[$i_ex] != "") $normal_query .= "$result_from_ex[$i_ex]";
$normal_query .= "') OR ";
$normal_query .= "MATCH(B_I_RESUMCLE) against ('";
if ($result_from_ex[$i_ex] != "") $normal_query .= "$result_from_ex[$i_ex]";
$normal_query .= "') OR ";
$normal_query .= "B_I_COMMENT like '%";
if ($result_from_ex[$i_ex] != "") $normal_query .= "$result_from_ex[$i_ex]";
$normal_query .= "%'";
if ($i_ex < (count($result_from_ex)-1)) $normal_query .= ") AND (";
} else {
// si non, on procède à une recherche classique
$normal_query .= $tbl['item'].".B_I_TITRE like '%";
if ($result_from_ex[$i_ex] != "") $normal_query .= "$result_from_ex[$i_ex]";
$normal_query .= "%' OR ";
$normal_query .= $tbl['item'].".B_I_RESUMCLE like '%";
if ($result_from_ex[$i_ex] != "") $normal_query .= "$result_from_ex[$i_ex]";
$normal_query .= "%' OR ";
$normal_query .= $tbl['item'].".B_I_COMMENT like '%";
if ($result_from_ex[$i_ex] != "") $normal_query .= "$result_from_ex[$i_ex]";
$normal_query .= "%'";
if ($i_ex < (count($result_from_ex)-1)) $normal_query .= ") AND (";
}
$i_ex++;
}
$normal_query .= ") ";
}
}
/* ajout, si nécessaire, de la contrainte categ */
if (($TabFinder['categ'] != '') && (BB_ARGUMENT_REGROUPEMENT == 'media')) {
if ($TabFinder['categ'] == 'VIDE') {
$normal_query .= ' AND (B_M_EDITEUR is null OR B_M_EDITEUR = "")';
} else {
$normal_query .= ' AND (B_M_EDITEUR like "%'.$TabFinder['categ'].'%")';
}
}
// Création des jointures
$normal_query .= " AND (".$tbl['saisie'].".B_AS_ID = ".$tbl['item'].".B_I_AUTEURSAISIE)"; // lien article -- type phy
$normal_query .= " AND (".$tbl['item'].".B_I_TYPPHY = ".$tbl['item_typphy'].".B_IP_ID)"; // lien article -- type phy
$normal_query .= " AND (".$tbl['item'].".B_I_TYPLOG = ".$tbl['item_typlog'].".B_IL_ID)"; // lien article -- type log
$normal_query .= " $add_limit_dom"; // si limitation au domaine principal
$normal_query.= $special_join;
// Si TabFinder['auteur'] est non vide : on ajoute le critère de sélection
if ($TabFinder['auteur'] != '') {
$tmp_auteur = explode(' ', $TabFinder['auteur']);
$normal_query .= ' AND (';
for ($tmp=0;$tmp<count($tmp_auteur);$tmp++) {
$normal_query .= $tbl['item'].'.B_I_AUTEURS like "%'.$tmp_auteur[$tmp].'%"';
if ( $tmp < (count($tmp_auteur) - 1) ) {
$normal_query .= ' AND ';
}
}
$normal_query .= ')';
}
// Si TabFinder['geo'] est non vide :
// 1- si TabFinder['chaine'] est vide on n'ajoute pas de AND
// 2- s'il n'est pas vide on ajoute AND
if ($TabFinder['geo'] != '') {
if ($TabFinder['geo'] == '1' || $TabFinder['geo'] == '2' || $TabFinder['geo'] == '3' || $TabFinder['geo'] == '4'
|| $TabFinder['geo'] == '5' || $TabFinder['geo'] == '6' || $TabFinder['geo'] == '7' || $TabFinder['geo'] == '8' || $TabFinder['geo'] == '9' ) {
$TabFinder['geo'] = '0'.$TabFinder['geo'];
$TabFinder['geo'] = ereg_replace('00', '0', $TabFinder['geo']);
}
$normal_query .= " AND (".$tbl['item'].".B_I_GEO like '%".$TabFinder['geo']."%' ";
/* ajout de la jointure dpt */
$comp_geo = "select * from ".$tbl['dpt']." where GFD_NAME like '%".$TabFinder['geo']."%'";
$comp_do = mysql_query($comp_geo) or die("<B>Erreur de requete GEO :</B> $comp_geo.");
$comp_num = mysql_num_rows($comp_do);
if ($comp_num > 0) {
$i = 1;
while ($row = mysql_fetch_object($comp_do)) {
$tmp_stock = $row->GFD_ID;
if ($tmp_stock != '') {
if ($tmp_stock == '1' || $tmp_stock == '2' || $tmp_stock == '3' || $tmp_stock == '4' ||
$tmp_stock == '5' || $tmp_stock == '6' || $tmp_stock == '7' || $tmp_stock == '8' || $tmp_stock == '9' ) {
$tmp_stock = '0'.$tmp_stock;
$tmp_stock = ereg_replace('00', '0', $tmp_stock);
}
if ($i == 1) {
$normal_query .= ' OR (';
}
$normal_query .= $tbl['item'].'.B_I_GEO like "%'.$tmp_stock.'%"';
if ($i < $comp_num) {
$normal_query .= ' OR ';
}
if ($i == $comp_num) {
$normal_query .= ') ';
}
$i++;
}
}
}
mysql_free_result($comp_do);
$normal_query .= ') ';
}
// traitement du réducteur SINCE (fonction de la date)
if ($TabFinder['since'] != '') {
$since_var = explode('/', $TabFinder['since']);
if (empty($since_var[0])) {
$since_var[0] = '';
}
if (empty($since_var[1])) {
$since_var[1] = '';
}
if (empty($since_var[2])) {
$since_var[2] = '';
}
$timestamp = mktime (NULL,NULL,NULL,$since_var[1],$since_var[0],$since_var[2]);
$normal_query .= ' AND B_I_MAJFICHE > '.$timestamp;
}
// Création de l'ordre de tri
$order_query = " ORDER BY ".$TabFinder['sort'];
// Affectation de la requête à la variable qui va l'envoyer au moteur
if (empty($plugin_store['query_add_query'])) {
$plugin_store['query_add_query'] = '';
}
$unreq = $normal_query.' '.$add_to_query.' '.$plugin_store['query_add_query'].' '.$order_query;
//echo "$unreq";
return $unreq;
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.4 2005/05/17 10:10:08 jpm
* Correction des bogues avant mise en ligne du site v4.
*
* Revision 1.3 2004/09/15 10:32:30 jpm
* Suppression d'une ligne après la balise de fermeture php.
*
* 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 ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bibliotheque/bbc_moteur_media.fonct.php
New file
0,0 → 1,461
<?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_moteur_media.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Fonctions de création du moteur de recherche des médias.
*
* Contient les fonctions permettant de retourner l'affichage du moteur de recherche des média.
* Valable 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.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
/** Fonction mkengine() - Créé le moteur de recherche en XHTML pour les médias.
*
* Fonction créant le moteur de recherche en XHTML pour le
* paramêtre "media".
*
* @return string le XHTML du moteur de recherche permettant de récupérer les média.
*/
function mkengine()
{
// Initialisation des variables globales
global $label_bbota, $tbl, $TabFinder, $nbr_total, $query_dom, $var_biblio;
global $arg_0,$arg_1,$arg_2,$arg_3,$arg_4,$arg_5;
global $plugin_store;
// Initialisation des variables
$url_courante = BB_URL_COURANTE_CONSULTATION;
$retour = '';
$tmp_titre = eregi_replace('_', ' ', BB_ARGUMENT_TITRE);
// Comptage du nombre total de données dans la table (hors CACHER = 1)
if ($var_biblio['limit_domain'] == 1) {
$add_domain_fr = ', '.$tbl['domaine_lk'];
$add_domain_qu = ' AND B_I_IDITEM = B_DL_IDITEM AND B_DL_IDDOM = 1';
} else {
$add_domain_fr = '';
$add_domain_qu = '';
}
if (BB_ARGUMENT_REGROUPEMENT == 'article') {
$requete = 'SELECT DISTINCT COUNT(B_I_IDITEM) AS CPT '.
'FROM '.$tbl['item'].$add_domain_fr.$plugin_store['count_add_table'].' '.
'WHERE B_I_CACHER = 0 '.
'AND B_I_TYPLOG = 1 '.
'AND B_I_TYPPHY = 2 '.
$add_domain_qu.' '.
$plugin_store['count_add_query'];
} else if (BB_ARGUMENT_REGROUPEMENT == 'media') {
$requete = 'SELECT DISTINCT COUNT(B_I_IDITEM) AS CPT '.
'FROM '.$tbl['item'].$add_domain_fr.$plugin_store['count_add_table'].' '.
'WHERE B_I_CACHER = 0 '.
'AND B_I_TYPPHY <> 2 '.
$add_domain_qu.' '.
$plugin_store['count_add_query'];
}
// DEBOGAGE : pour voir la requete de comptage
//$GLOBALS['_DEBOGAGE_'] .= $requete.'<br>';
$resultat = $GLOBALS['db_bb']->query($requete);
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '';
if ($resultat->numRows() == 1) {
$tmp_nb = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
$nbr_total = $tmp_nb->CPT;
if ($nbr_total > 0) {
$chaine = 'parmi '.$nbr_total;
} else {
$retour .= presa_mk_title('Rechercher '.$tmp_titre, 1);
$retour .= '<p class="information">'.'Ce moteur de recherche ne contient aucune donnée...'.'</p>';
// Cette variable sert à éviter l'affichage de l'aide
global $no_help;
$no_help = 1;
return $retour;
}
}
// Affichage du titre
$retour .= presa_mk_title('Rechercher '.$chaine.' '.$tmp_titre.' :', 1);
// Affichage du formulaire du moteur de recherche
$retour .= '<form id="bb_moteur_media" '.
'action="'.$url_courante."&amp;arg_0=$arg_0&amp;arg_1=$arg_1&amp;arg_2=$arg_2&amp;arg_3=$arg_3&amp;arg_4=$arg_4&amp;arg_5=$arg_5".'" '.
'method="post">'."\n";
$retour .= '<ul>'."\n";
$resultat->free();// Fin comptage
// Construction du moteur
// Ligne de recherche 1
$retour .= '<li id="bb_moteur_media_01">'."\n";
$retour .= form_mk_chaine(stripslashes($TabFinder['chaine'])).' '.form_mk_typque($TabFinder['typque']);
$retour .= '</li>'."\n";
// Ligne de recherche 2
$retour .= '<li id="bb_moteur_media_02">'."\n".form_mk_auteur(stripslashes($TabFinder['auteur'])).'</li>'."\n";
// Ligne de recherche 3
$retour .= '<li id="bb_moteur_media_03">'."\n".form_mk_categ($TabFinder['categ']).'</li>'."\n";
// Ligne de recherche 4
$retour .= '<li id="bb_moteur_media_04">'."\n";
$retour .= form_mk_geo(stripslashes($TabFinder['geo'])).' ';
if (BB_ARGUMENT_REGROUPEMENT == 'media') {
$retour .= form_mk_categ_3($TabFinder['categ_3']).' '.form_mk_categ_2($TabFinder['categ_2']);
}
$retour .= '</li>'."\n";
// Mode avancée
if ($TabFinder['finder_mode'] == 'advance') {
$retour .= '<li id="bb_moteur_media_05">'."\n".form_mk_since($TabFinder['since']).'</li>'."\n";
// Lignes de regroupement (frequente)
$retour .= '<li id="bb_moteur_media_06">'."\n".form_mk_step($TabFinder['step']).'</li>'."\n";
$retour .= '<li id="bb_moteur_media_07">'."\n".form_mk_sort($TabFinder['sort']).'</li>'."\n";
}
$retour .= '<li id="bb_moteur_media_08" class="bb_aligner_droite">'."\n";
$retour .= form_mk_plugin($TabFinder['plugin']).form_mk_advance().' '.form_mk_submit()."\n";
$retour .= '</li>'."\n";
$retour .= '</ul>'."\n";
$retour .= '</form>'."\n";
// Ajout de liens pour les moteurs de recherche
// Premier lien...
$retour .= '<p>'."\n";
$link = $url_courante.'&amp;TransTab=typque,1!valid,1!finder_mode,normal!sort,B_I_AUTEURS!';
$link .= 'pstart,0!step,20!pend,231!plugin,!geo,!chaine,!auteur,!categ,!categ_2,!categ_3,!since,!nom,!prenom,!ville,!dept,!pays,!cotisant,!mail,!';
$retour .= ' <a href="'.$link.'" style="visibility:hidden;">all</a>'."\n";
// Second lien...
$link = $url_courante.'&amp;TransTab=typque,1!valid,1!finder_mode,normal!sort,B_I_AUTEURS!';
$link .= 'pstart,0!step,20!pend,231!plugin,!geo,!chaine,!auteur,!categ,!categ_2,!categ_3,!since,!nom,!prenom,!ville,!dept,!pays,!cotisant,!mail,!';
$retour .= ' <a href="'.$link.'" style="visibility:hidden;">all</a>'."\n";
$retour .= '</p>'."\n";
return $retour;
}
 
 
// form_mk_sort($actualsort,$class) :
// fonction spécifique du moteur MEDIA
// créé une liste déroulante TabFinder[sort] pour ordonner les pages de résultats
// Entrée : $actualsort (valeur de TabFinder['sort']), $class (classe CSS) par défaut "insInputForm"
// Sortie (par retour) : string
function form_mk_sort($actualsort, $class = 'bb_champ')
{
global $TabFinder;
$retour = '';
$id = 'TabFinder[sort]';
$retour .= '<label for="'.$id.'">'.'Trier par : '.'</label>';
$retour .= '<select id="'.$id.'" name="'.$id.'" class="'.$class.'">'."\n";
$retour .= ' <option value="B_I_AUTEURS" ';
if ($actualsort == 'B_I_AUTEURS') {
$retour .= 'selected="selected"';
}
$retour .= '>'.'auteur(s)'.'</option>'."\n";
$retour .= ' <option value="B_I_TITRE" ';
if ($actualsort == 'B_I_TITRE') {
$retour .= 'selected="selected"';
}
$retour .= '>'.'titre'.'</option>'."\n";
if (BB_ARGUMENT_REGROUPEMENT == 'media') {
$retour .= ' <option value="B_I_TYPLOG" ';
if ($actualsort == 'B_I_TYPLOG') {
$retour .= 'selected="selected"';
}
$retour .= '>'.'type de contenu'.'</option>'."\n";
$retour .= ' <option value="B_I_TYPPHY" ';
if ($actualsort == 'B_I_TYPPHY') {
$retour .= 'selected="selected"';
}
$retour .= '>'.'type de support'.'</option>'."\n";
}
if (BB_ARGUMENT_REGROUPEMENT == 'article') {
$le_champ = 'B_F_DATE';
} else {
$le_champ = 'B_M_DATE';
}
$retour .= ' <option value="'.$le_champ.'" ';
if ($actualsort == $le_champ) {
$retour .= 'selected';
}
$retour .= '>'.'date'.'</option>'."\n";
$retour .= '</select>'."\n\n";
return $retour;
}
 
 
// form_mk_categ($actualsort,$class) :
// fonction spécifique du moteur LINK
// créé une liste déroulante TabFinder[categ] pour affiner les résultats
// Entrée : $actualcateg (valeur de TabFinder['categ']), $class (classe CSS) par défaut "insInputForm"
// Sortie (par retour) : string
function form_mk_categ($actualcateg, $class = 'bb_champ')
{
global $tbl, $TabFinder, $plugin_store;
$retour = '';
$id = 'TabFinder[categ]';
if (BB_ARGUMENT_REGROUPEMENT == 'article') {
// Affichage du réducteur - collections
$requete = 'SELECT B_C_CRAI, B_C_NOMCOMPLET, B_C_ABREGE '.
'FROM '.$tbl['collection'].', '.$tbl['serie'].$plugin_store['categ_add_table'].' '.
'WHERE B_C_CRAI = B_SER_CRAICOLL '.
'AND B_SER_INTOBIBLIO = 1 '.
$plugin_store['categ_add_query'].
'GROUP BY B_C_CRAI '.
'ORDER BY B_C_NOMCOMPLET';
$result_str = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$nb_results = mysql_num_rows($result_str);
$retour .= '<label for="'.$id.'">'.'Dans :'.'</label>';
$retour .= '<select name="'.$id.'" class="'.$class.'">'."\n";
if ($nb_results > 1) {
$retour .= ' <option value=""';
if ($actualcateg == '') {
$retour .= ' selected="selected"';
}
$retour .= '>Toutes les revues</option>'."\n";
}
while ($row = mysql_fetch_object($result_str)) {
$collection = $row->B_C_NOMCOMPLET;
$abrege = $row->B_C_ABREGE;
$crai = $row->B_C_CRAI;
$retour .= '<option value="'.$crai.'"';
if ($actualcateg == $crai) {
$retour .= ' selected="selected"';
}
$retour .= '>';
if ($abrege == '') {
$retour .= $collection;
} else {
$retour .= $abrege;
}
$retour .= '</option>'."\n";
}
$retour .= ' </select>'."\n\n";
mysql_free_result($result_str);
} else {
global $var_biblio;
// on recherche ici les éditeurs de médias
// si les médias sont autre chose que des livres, on affine
// la liste en ne proposant que les éditeurs publiant des médias.
$requete = 'SELECT B_M_EDITEUR '.
'FROM '.$tbl['media'].', '.$tbl['item'].$plugin_store['categ_add_table'].' '.
'WHERE B_I_IDITEM = B_M_IDMEDIA '.
$plugin_store['categ_add_query'].' '.
'GROUP BY B_M_EDITEUR '.
'ORDER BY B_M_EDITEUR';
$do_editeur_qu = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$nb_edresults = mysql_num_rows($do_editeur_qu);
if ($var_biblio['how_editeurs'] >= $nb_edresults) {
// nb de résultats < $how_editeurs
// on affiche une liste déroulante
$retour .= '<label for="'.$id.'">'.'Pour :'.'</label>';
$retour .= '<select name="'.$id.'" class="'.$class.'">'."\n";
if ($nb_edresults > 1) {
$retour .= '<option value=""';
if ($actualcateg == '') {
$retour .= ' selected="selected"';
}
$retour .= '>';
$retour .= 'tous éditeurs';
$retour .= '</option>'."\n";
}
while ($row_ed = mysql_fetch_object($do_editeur_qu)) {
$tmp_id = $row_ed->B_M_EDITEUR;
if ($tmp_id != '') {
$retour .= '<option value="'.stripslashes($tmp_id).'"';
if (stripslashes(stripslashes($actualcateg)) == $tmp_id) {
$retour .= ' selected="selected"';
}
$retour .= '>';
$retour .= stripslashes($tmp_id);
} else {
$retour .= '<option value="VIDE"';
if (($actualcateg == 'NULL') && ($actualcateg != '')) {
$retour .= ' selected="selected"';
}
$retour .= '>';
$retour .= 'éditeurs inconnus';
}
$retour .= '</option>'."\n";
}
$retour .= ' </select>';
} else {
// nb de résultats > $how_editeurs
// on affiche une zone de texte
$retour .= '<label for="'.$id.'">'.'Éditeur :'.'</label>';
$retour .= '<input type="text" id="'.$id.'" name="'.$id.'" class="'.$class.'" value="'.$TabFinder['categ'].'" />'."\n";
}
mysql_free_result($do_editeur_qu);
}
return $retour;
}
 
 
// form_mk_categ_2($actualcateg_2,$class) :
// fonction spécifique du moteur MEDIA
// créé une liste déroulante TabFinder[categ_2] pour affiner les résultats
// Entrée : $actualcateg_2 (valeur de TabFinder['categ_2']), $class (classe CSS) par défaut "insInputForm"
// Sortie (par retour) : string
 
function form_mk_categ_2($actualcateg_2, $class = 'bb_champ')
{
global $tbl;
$retour = '';
$requete = 'SELECT * '.
'FROM '.$tbl['item_typphy'].' '.
'WHERE B_IP_ID <> 2 '.
'ORDER BY B_IP_LABEL DESC';
$type_phy_do = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$retour .= '<select name="TabFinder[categ_2]" class="'.$class.'">'."\n";
$retour .= '<option value=""';
if ($actualcateg_2 == '') {
$retour .= ' selected="selected"';
}
$retour .= '>';
$retour .= 'tous supports';
$retour .= '</option>'."\n";
while ($row_phy = mysql_fetch_object($type_phy_do)) {
$tmp_label = $row_phy->B_IP_LABEL;
$tmp_id = $row_phy->B_IP_ID;
$this_number = (count_num_of_reductor('B_I_TYPPHY', $tmp_id));
if ($this_number > 0) {
$retour .= '<option value="'.$tmp_id.'"';
if ($actualcateg_2 == $tmp_id) {
$retour .= ' selected="selected"';
}
$retour .= '>';
$retour .= $tmp_label.' ('.$this_number.')';
$retour .= '</option>'."\n";
}
}
$retour .= ' </select>';
mysql_free_result($type_phy_do);
return $retour;
}
 
 
// form_mk_categ_2($actualcateg_2,$class) :
// fonction spécifique du moteur MEDIA
// créé une liste déroulante TabFinder[categ_2] pour affiner les résultats
// Entrée : $actualcateg_2 (valeur de TabFinder['categ_2']), $class (classe CSS) par défaut "insInputForm"
// Sortie (par retour) : string
function form_mk_categ_3($actualcateg_3, $class = 'bb_champ')
{
global $tbl;
$retour = '';
$requete = 'SELECT * '.
'FROM '.$tbl['item_typlog'].' '.
'ORDER BY B_IL_LABEL';
$type_log_do = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$retour .= '<select name="TabFinder[categ_3]" class="'.$class.'">'."\n";
$retour .= '<option value=""';
if ($actualcateg_3 == '') {
$retour .= ' selected="selected"';
}
$retour .= '>';
$retour .= 'tous contenus';
$retour .= '</option>'."\n";
while ($row_phy = mysql_fetch_object($type_log_do)) {
$tmp_label = $row_phy->B_IL_LABEL;
$tmp_id = $row_phy->B_IL_ID;
$this_number = (count_num_of_reductor('B_I_TYPLOG', $tmp_id));
if ($this_number > 0) {
$retour .= '<option value="'.$tmp_id.'"';
if ($actualcateg_3 == $tmp_id) {
$retour .= ' selected="selected"';
}
$retour .= '>';
$retour .= "$tmp_label ($this_number)";
$retour .= '</option>'."\n";
}
}
$retour .= ' </select>';
mysql_free_result($type_log_do);
return $retour;
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.5 2005/05/17 10:10:08 jpm
* Correction des bogues avant mise en ligne du site v4.
*
* Revision 1.4 2005/03/03 08:32:26 jpm
* Suppression de li vide.
*
* Revision 1.3 2004/09/14 11:49:28 jpm
* Ajout de l'info sur les logs cvs en bas de fichier.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bibliotheque/bbc_requete_structure.fonct.php
New file
0,0 → 1,258
<?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_requete_structure.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Fonctions de création de la requête sur une structure.
*
* Contient une fonction créant la requête d'intérogation de la base de données.
* Valable pour le paramètre "structure".
* Ajouts :
* - 27/06/02 : recherche aussi dans la table des collections + jointure coll/str
*
*@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.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
/** Fonction mkquery() - Créé une requête intérogeant la base de donnée.
*
* Fonction créant la requête d'intérogation de la base de données pour le
* paramêtre "structure".
*
* @return string la requête permettant de récupérer les structures.
*/
function mkquery()
{
// Définition des variables globales
global $tbl;
global $TabFinder;
// Initialisation des variables
$normal_query = '';
$add_to_query = '';
$order_query = '';
// Si la variable de catégorie vaut 'tous', il n'y a pas affinage de la requête par catégorie
if ($TabFinder['categ'] != 'tous') {
$add_to_query = ' AND '.$tbl['str'].'.B_S_TYPESTR = '.$TabFinder['categ'].' ';
}
// Ccréation du corps de la requête
// Création du SELECT
$normal_query = 'SELECT DISTINCT '.$tbl['str'].'.*, '.$tbl['pays'].'.GC_NAME, '.$tbl['typestr'].'.B_TYPSTR_LABEL ';
// Création du FROM
$normal_query .= ' FROM '.$tbl['str'].' LEFT JOIN '.$tbl['collection'].' ON '.$tbl['collection'].'.B_C_LKSTR = '.$tbl['str'].'.B_S_IDSTR, '.$tbl['pays'].', '.$tbl['typestr'].' ';
// Création du WHERE
$normal_query .= 'WHERE B_S_IDSTR > 0 '.
'AND B_S_CACHER = 0 '.
'AND ';
if (($TabFinder['typque'] != 1) && ($TabFinder['chaine'] != '')) {
$normal_query .= ' (';
$normal_query .= $tbl['str'].'.B_S_NOM LIKE "%'.$TabFinder['chaine'].'%"';
$normal_query .= ' OR '.$tbl['str'].'.B_S_SIGLE LIKE "%'.$TabFinder['chaine'].'%"';
$normal_query .= ' OR '.$tbl['str'].'.B_S_VOCACTIV LIKE "%'.$TabFinder['chaine'].'%"';
$normal_query .= ' OR '.$tbl['str'].'.B_S_COMMENT LIKE "%'.$TabFinder['chaine'].'%"';
$normal_query .= ' OR '.$tbl['str'].'.B_S_SERVICE LIKE "%'.$TabFinder['chaine'].'%"';
$normal_query .= ' OR '.$tbl['collection'].'.B_C_NOMCOMPLET LIKE "%'.$TabFinder['chaine'].'%"';
$normal_query .= ' OR '.$tbl['collection'].'.B_C_ABREGE LIKE "%'.$TabFinder['chaine'].'%"';
$normal_query .= ' OR '.$tbl['collection'].'.B_C_COMMENT LIKE "%'.$TabFinder['chaine'].'%"';
$normal_query .= ')';
} else if ($TabFinder['chaine'] != '') {
$normal_query .= ' (';
$result_from_ex = explode(' ', $TabFinder['chaine']);
$i_ex = 0;
while ($i_ex < count($result_from_ex)) {
$normal_query .= $tbl['str'].'.B_S_NOM LIKE "%';
if ($result_from_ex[$i_ex] != '') {
$normal_query .= $result_from_ex[$i_ex];
}
$normal_query .= '%" OR ';
$normal_query .= $tbl['str'].'.B_S_VOCACTIV LIKE "%';
if ($result_from_ex[$i_ex] != '') {
$normal_query .= $result_from_ex[$i_ex];
}
$normal_query .= '%" OR ';
$normal_query .= $tbl['str'].'.B_S_SIGLE LIKE "%';
if ($result_from_ex[$i_ex] != '') {
$normal_query .= $result_from_ex[$i_ex];
}
$normal_query .= '%" OR ';
$normal_query .= $tbl['str'].'.B_S_COMMENT LIKE "%';
if ($result_from_ex[$i_ex] != '') {
$normal_query .= $result_from_ex[$i_ex];
}
$normal_query .= '%" OR ';
$normal_query .= $tbl['str'].'.B_S_SERVICE LIKE "%';
if ($result_from_ex[$i_ex] != '') {
$normal_query .= $result_from_ex[$i_ex];
}
$normal_query .= '%" OR ';
$normal_query .= $tbl['collection'].'.B_C_NOMCOMPLET LIKE "%';
if ($result_from_ex[$i_ex] != '') {
$normal_query .= $result_from_ex[$i_ex];
}
$normal_query .= '%" OR ';
$normal_query .= $tbl['collection'].'.B_C_ABREGE LIKE "%';
if ($result_from_ex[$i_ex] != '') {
$normal_query .= $result_from_ex[$i_ex];
}
$normal_query .= '%" OR ';
$normal_query .= $tbl['collection'].'.B_C_COMMENT LIKE "%';
if ($result_from_ex[$i_ex] != '') {
$normal_query .= $result_from_ex[$i_ex];
}
$normal_query .= '%"';
if ($i_ex < (count($result_from_ex) - 1)) {
$normal_query .= ') AND (';
}
$i_ex++;
}
$normal_query .= ')';
}
// Création de la jointure avec les pays et les types
if ($TabFinder['chaine'] != '') {
$normal_query .= ' AND ';
}
$normal_query .= ' B_S_PAYS = GC_ID ';
$normal_query .= ' AND GC_LOCALE = "fr" ';
$normal_query .= ' AND B_S_TYPESTR = B_TYPSTR_ID ';
// Si TabFinder['geo'] est non vide :
// 1- si TabFinder['chaine'] est vide on n'ajoute pas de AND
// 2- s'il n'est pas vide on ajoute AND
if ($TabFinder['geo'] != '') {
preg_replace('/^(\d)$/', "0$1", $TabFinder['geo']);
preg_replace('/^00$/', '0', $TabFinder['geo']);
$normal_query .= ' AND ('.$tbl['str'].'.B_S_CODEPOSTAL LIKE "'.$TabFinder['geo'].'%" '.
'OR '.$tbl['str'].'.B_S_VILLE LIKE "%'.$TabFinder['geo'].'%" '.
'OR '.$tbl['pays'].'.GC_NAME LIKE "%'.$TabFinder['geo'].'%" ';
// Ajout de la jointure dpt
$comp_geo = 'SELECT * '.
'FROM '.$tbl['dpt'].' '.
'WHERE GFD_NAME LIKE "%'.$TabFinder['geo'].'%"';
$comp_do = mysql_query($comp_geo) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $comp_geo));
$comp_num = mysql_num_rows($comp_do);
if ($comp_num > 0) {
$i = 1;
while ($row = mysql_fetch_object($comp_do)) {
$tmp_stock = $row->GFD_ID;
if ($tmp_stock != '') {
preg_replace('^(\d)$', "0$1", $tmp_stock);
preg_replace('^00$', '0', $tmp_stock);
if ($i == 1) {
$normal_query .= ' OR ';
}
$normal_query .= $tbl['str'].'.B_S_CODEPOSTAL LIKE "'.$tmp_stock.'%"';
if ($i < $comp_num) {
$normal_query .= ' OR ';
}
if ($i == $comp_num) {
$normal_query .= ' ';
}
$i++;
}
}
}
mysql_free_result($comp_do);
$normal_query .= ') ';
}
// Traitement du réducteur SINCE (fonction de la date)
if ($TabFinder['since'] != '') {
$since_var = explode('/', $TabFinder['since']);
if (empty($since_var[0])) {
$since_var[0] = '';
}
if (empty($since_var[1])) {
$since_var[1] = '';
}
if (empty($since_var[2])) {
$since_var[2] = '';
}
$timestamp = mktime(NULL, NULL, NULL, $since_var[1], $since_var[0], $since_var[2]);
$normal_query .= ' AND B_S_MAJFICHE > '.$timestamp;
}
// Création de l'ordre de tri
$order_query = 'ORDER BY '.$TabFinder['sort'];
// Affectation de la requête à la variable qui va l'envoyer au moteur
$queries = $normal_query.' '.$add_to_query.' '.$order_query;
return $queries;
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.4 2005/05/17 10:10:08 jpm
* Correction des bogues avant mise en ligne du site v4.
*
* Revision 1.3 2004/09/16 11:05:54 jpm
* Correction bogue mauvaise requete.
*
* Revision 1.2 2004/09/15 11:21:07 jpm
* Début mise en conformité avec la convention de codage et le standard XHTML Strict.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bibliotheque/bbc_moteur_structure.fonct.php
New file
0,0 → 1,208
<?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_moteur_structure.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Fonctions de création du moteur de recherche des structures.
*
* Contient les fonctions permettant de retourner l'affichage du moteur de recherche des structures.
* Valable pour le paramètre "structure".
*
*@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.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
/** Fonction mkengine() - Créé le moteur de recherche en XHTML pour les structures.
*
* Fonction créant le moteur de recherche en XHTML pour le
* paramètre "structure".
*
* @return string le XHTML du moteur de recherche permettant de récupérer les structures.
*/
function mkengine()
{
global $label_bbota, $tbl, $TabFinder, $nbr_total;
$retour = '';
// Comptage du nombre total de données dans la table (hors CACHER = 1)
$requete = 'SELECT COUNT(*) AS cpt '.
'FROM '.$tbl['str'].' '.
'WHERE B_S_CACHER = 0';
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
if (mysql_num_rows($resultat) == 1) {
$tmp_nb = mysql_fetch_object($resultat);
$nbr_total = $tmp_nb->cpt;
if ($nbr_total > 0) {
$chaine = 'parmi '.$nbr_total.' adresses d\'organismes';
} else {
die('<b>'.'Erreur'.'</b>'.' lors du comptage des structures ('.$nbr_total.' trouvées) : '.$requete);
}
} else {
die('<b>'.'Erreur'.'</b>'.' lors du comptage des structures : '.$requete);
}
mysql_free_result($resultat);
// Affichage du titre de la page
$retour .= presa_mk_title('Chercher '.$chaine.' :', 1);
// Construction du moteur de str
$retour .= '<form id="bb_moteur_structure" action="'.BB_URL_COURANTE_CONSULTATION.'" method="post">'."\n";
$retour .= '<ul>'."\n";
// Ligne de recherche
$retour .= '<li>'."\n";
$retour .= form_mk_chaine(stripslashes($TabFinder['chaine'])).' '.
form_mk_typque($TabFinder['typque']).
form_mk_categ($TabFinder['categ']);
$retour .= '</li>'."\n";
// Ligne de géographie
$retour .= '<li>'."\n".form_mk_geo(stripslashes($TabFinder['geo'])).'</li>'."\n";
if ($TabFinder['finder_mode'] == 'advance') {
$retour .= '<li>'."\n".form_mk_since($TabFinder['since']).'</li>'."\n";
}
// Ligne de regroupement (frequente)
if ($TabFinder['finder_mode'] == 'advance') {
$retour .= '<li>'."\n".form_mk_step($TabFinder['step'])."\n".form_mk_sort($TabFinder['sort'])."\n".'</li>'."\n";
}
$retour .= '<li class="bb_aligner_droite">'."\n";
$retour .= form_mk_advance().' '.form_mk_submit()."\n";
$retour .= '</li>'."\n";
$retour .= '</ul>'."\n";
$retour .= '</form>'."\n\n";
// Ajout d'un lien pour les moteurs de recherche
$link = BB_URL_COURANTE_CONSULTATION.'&amp;TransTab=typque,1!valid,1!finder_mode,normal!sort,B_S_NOM!';
$link .= 'pstart,0!step,20!pend,231!plugin,!geo,!chaine,!auteur,!categ,!categ_2,!categ_3,!since,!nom,!prenom,!ville,!dept,!pays,!cotisant,!mail,!';
$retour .= '<a href="'.$link.'" style="visibility:hidden;">all</a>'."\n";
return $retour;
}
 
/** Fonction form_mk_sort() - Créé la liste déroulante XHTML de l'ordre de trie des structures.
*
* Fonction créant liste déroulante XHTML de l'ordre de trie des structures.
*
* @param string la type de trie sélectionné : valeur de TabFinder['sort'].
* @param string la classe à appliquer à la balise <select>.
*
* @return string la liste déroulante XHTML de l'ordre de trie des structures.
*/
function form_mk_sort($actualsort, $class = 'bb_champ')
{
$retour = '';
$id = 'TabFinder[sort]';
$retour .= '<label for="'.$id.'">'.'Trier par : '.'</label>';
$retour .= '<select id="'.$id.'" name="'.$id.'" class="'.$class.'">'."\n";
$retour .= ' <option value="B_S_NOM" ';
if ($actualsort == 'B_S_NOM') {
$retour .= 'selected="selected"';
}
$retour .= '>'.'nom'.'</option>'."\n";
$retour .= ' <option value="GC_NAME" ';
if ($actualsort == 'GC_NAME') {
$retour .= 'selected="selected"';
}
$retour .= '>'.'pays'.'</option>'."\n";
$retour .= '</select>'."\n\n";
return $retour;
}
 
/** Fonction form_mk_categ() - Créé la liste déroulante XHTML des types de structures.
*
* Fonction créant liste déroulante XHTML des types de structures.
*
* @param string l'identifiant du type de structure actuellement sélectionné : valeur de TabFinder['categ'].
* @param string la classe à appliquer à la balise <select>.
*
* @return string la liste déroulante XHTML des types de structures.
*/
function form_mk_categ($actualcateg, $class = 'bb_champ')
{
global $tbl, $label_bbota;
$retour = '';
$retour .= ' <select name="TabFinder[categ]" class="'.$class.'">'."\n";
$retour .= ' <option value="tous" ';
if ($actualcateg == 0) {
$retour .= 'selected="selected"';
}
$retour .= '>'.$label_bbota['all_typstr'].'</option>'."\n";
$requete = 'SELECT * '.
'FROM '.$tbl['typestr'].' '.
'ORDER BY B_TYPSTR_ID';
$result_str = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
while ($row = mysql_fetch_object($result_str)) {
$typstr_id = $row->B_TYPSTR_ID;
$typstr_nom = $row->B_TYPSTR_LABEL;
$retour .= '<option value="'.$typstr_id.'"';
if ($actualcateg == $typstr_id) {
$retour .= ' selected="selected"';
}
$retour .= '>'.$typstr_nom.'</option>'."\n";
}
mysql_free_result($result_str);
$retour .= '</select>'."\n\n";
return $retour;
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/05/17 10:10:08 jpm
* Correction des bogues avant mise en ligne du site v4.
*
* Revision 1.2 2004/09/15 11:21:07 jpm
* Début mise en conformité avec la convention de codage et le standard XHTML Strict.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bibliotheque/bbc_affichage_media.fonct.php
New file
0,0 → 1,364
<?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.1 2005-11-23 10:22:25 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.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | 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 = $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";
$get_auteuritem = strtolower(ColorizeFound($get_auteuritem, stripslashes($TabFinder['auteur'])));
$retour .= ucwords($get_auteuritem);
} 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.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 ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bibliotheque/bbc_affichage.fonct.php
New file
0,0 → 1,486
<?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.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Fonctions de l'interface de consultation de Biblio Bota.
*
* Contient les fonctions fournissant du XHTML pour l'affichage de l'interface de consultation de BibioBota.
*
*@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.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/*Mettre ici les inclusions de fichiers*/
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
/*Mettre ici la liste de fonctions.*/
 
// string ColorizeFound($tomod,$tofind)
// Colorie dans une chaine de texte $tomod la chaine $tofind.
// $tofind peut contenir des espaces, chaque terme sera quand même colorié.
// Retourne la chaine de caractères $tomod convertie.
function ColorizeFound($tomod, $tofind)
{
$words = explode(' ', $tofind);
// Liste de mots générant des problèmes vis à vis de la chaine $edited
$forbid_lst[0] = 'la';
$forbid_lst[1] = 'texte';
$forbid_lst[2] = 'found';
$forbid_lst[3] = 'un';
$forbid_lst[4] = 'fou';
$forbid_lst[5] = 'las';
$forbid_lst[6] = 'class';
$forbid_lst[7] = 'text';
$forbid_lst[8] = 'ou';
$forbid_lst[9] = 'ext';
$forbid_lst[10] = 'te';
$forbid_lst[11] = 'ex';
$forbid_lst[12] = 'und';
$forbid_lst[13] = 'a';
$forbid_lst[14] = 'c';
$forbid_lst[15] = 'd';
$forbid_lst[16] = 'e';
$forbid_lst[17] = 'f';
$forbid_lst[18] = 'l';
$forbid_lst[19] = 'n';
$forbid_lst[20] = 'o';
$forbid_lst[21] = 'p';
$forbid_lst[22] = 's';
$forbid_lst[23] = 't';
$forbid_lst[24] = 'u';
$forbid_lst[25] = 'x';
for ($i = 0; $i < count($words); $i++) {
$words[$i] = ereg_replace('\[', '', $words[$i]);
$words[$i] = ereg_replace('\]', '', $words[$i]);
$edited = '<span class="bb_txt_trouve">'.$words[$i].'</span>';
if (($words[$i] != '') && ($tomod != '') && (! in_array($words[$i], $forbid_lst))){
$tomod = eregi_replace($words[$i], $edited, $tomod);
}
}
return $tomod;
}
 
// form_mk_submit($value) :
// créé un bouton de validation de formulaire
// Entrée : string $value (facultatif), string $class
// Sortie (par retour) : string
function form_mk_submit($value = 'Chercher', $class = 'texte_tb')
{
$retour = '';
$retour .= '<input type="submit" name="valider" value="'.$value.'" class="'.$class.'" />';
$retour .= '<input type="hidden" name="TabFinder[valid]" value="1" />';
return $retour;
}
 
 
// form_mk_reset($value) :
// créé un bouton d'effacement de formulaire
// Entrée : string $value (facultatif)
// Sortie (par retour) : string
function form_mk_reset($value = 'Effacer', $class = 'texte_tb')
{
return '<input type="reset" value="'.$value.'" name="valider" class="'.$class.'" />';
}
 
 
// form_mk_chaine($value,$class) :
// créé un champ texte "chaine"
// Entrée : $value (valeur de TabFinder['chaine']), $class (classe CSS) par défaut "insInputForm"
// Sortie (par retour) : string
function form_mk_chaine($value = '', $class = 'insInputForm')
{
$id = 'TabFinder[chaine]';
$retour = '<label for="'.$id.'">'.'Rechercher : '.'</label>';
$retour .= '<input type="text" id="'.$id.'" name="'.$id.'" class="'.$class.'" value="'.$value.'" />'."\n";
return $retour;
}
 
 
// form_mk_geo($value,$class) :
// créé un champ texte "geo"
// Entrée : $value (valeur de TabFinder['geo']), $class (classe CSS) par défaut "insInputForm"
// Sortie (par retour) : string
function form_mk_geo($value = '', $class = 'insInputForm')
{
$id = 'TabFinder[geo]';
$retour = '<label for="'.$id.'">'.'Zone géo. : '.'</label>';
$retour .= '<input type="text" id="'.$id.'" name="'.$id.'" class="'.$class.'" value="'.$value.'" />'."\n";
return $retour;
}
 
 
// form_mk_auteur($value,$class) :
// créé un champ texte "auteur"
// Entrée : $value (valeur de TabFinder['auteur']), $class (classe CSS) par défaut "insInputForm"
// Sortie (par retour) : string
function form_mk_auteur($value = '', $class = 'insInputForm')
{
$id = 'TabFinder[auteur]';
$retour = '<label for="'.$id.'">'.'Auteur : '.'</label>';
$retour .= '<input type="text" id="'.$id.'" name="'.$id.'" class="'.$class.'" value="'.$value.'" />';
return $retour;
}
 
 
// form_mk_step($actualstep,$class) :
// créé une liste déroulante TabFinder[step] pour fragmenter les pages en x résultats
// Entrée : $actualstep (valeur de TabFinder['step']), $class (classe CSS) par défaut "insInputForm"
// Sortie (par retour) : string
function form_mk_step($actualstep, $class = 'insInputForm')
{
$retour = '';
$id = 'TabFinder[step]';
$retour .= '<label for="'.$id.'">'.'Grouper les résultats : '.'</label>';
$retour .= '<select id="'.$id.'" name="'.$id.'" class="'.$class.'">'."\n";
$retour .= ' <option value="10"';
if ($actualstep == 10) {
$retour .= 'selected="selected"';
}
$retour .= '>par 10</option>'."\n";
$retour .= ' <option value="20"';
if (($actualstep == 20) || ($actualstep == '')) {
$retour .= 'selected="selected"';
}
$retour .= '>par 20</option>'."\n";
$retour .= ' <option value="50"';
if ($actualstep == 50) {
$retour .= 'selected="selected"';
}
$retour .= '>par 50</option>'."\n";
$retour .= '</select>'."\n";
return $retour;
}
 
 
// form_mk_typque($actualstep,$class) :
// créé une liste déroulante TabFinder[step] pour fragmenter les pages en x résultats
// Entrée : $actualtypque (valeur de TabFinder['typque']), $class (classe CSS) par défaut "insInputForm"
// Sortie (par retour) : string
function form_mk_typque($actualtypque, $class = 'insInputForm')
{
global $label_bbota;
$retour = '';
$retour .= '<select name="TabFinder[typque]" size="1" class="'.$class.'">'."\n";
$retour .= ' <option value="1"';
if (($actualtypque == '') || ($actualtypque == 1)) {
$retour .= ' selected="selected"';
}
$retour .= '>'.$label_bbota['bool_separe'].'</option>'."\n";
$retour .= ' <option value="0"';
if (($actualtypque == 0) && ($actualtypque != '')) $retour .= ' selected';
$retour .= '>'.$label_bbota['bool_exacte'].'</option>'."\n";
$retour .= '</select>'."\n";
return $retour;
}
 
// form_mk_since($value,$class) :
// créé un champ texte "since"
// Entrée : $value (valeur de TabFinder['since']), $class (classe CSS) par défaut "insInputForm"
// Sortie (par retour) : string
function form_mk_since($value = '', $class = 'insInputForm')
{
$id = 'TabFinder[since]';
$retour = '<label for="'.$id.'">'.'Réduire aux données mises en ligne depuis le : '.'</label>';
$retour .= '<input type="text" id="'.$id.'" name="'.$id.'" class="'.$class.'" value="'.$value.'" maxlength="10" />';
$retour .= ' (au format jj/mm/aaaa)'."\n";
return $retour;
}
 
 
// form_mk_plugin($value) :
// créé un element de formulaire caché en fonction du contenu de Plugin
// Entrée : string $value
// Sortie (par retour) : string ou void
function form_mk_plugin($value)
{
if ($value != '') {
return '<input type="hidden" name="TabFinder[plugin]" value="'.$value.'" />'."\n";
} else {
return '';
}
}
 
// form_mk_advance() :
// créé un element/lien formulaire appelant la page elle-même pour avoir un formulaire en mode "avancé"
// Entrée :
// Sortie (par retour) : string
function form_mk_advance()
{
global $TabFinder, $arg_0, $arg_1, $arg_2, $arg_3, $arg_4, $arg_5;
if (empty($TabFinder)) {
$TabFinder = '';
}
$stockagevar = '';
foreach($TabFinder as $tmp_stock_i => $value) {
if ($tmp_stock_i != 'args' && $tmp_stock_i != 'finder_mode') {
$stockagevar .= $tmp_stock_i.','.$value.'!';
}
}
$stockagevar = ereg_replace(' ', '{', $stockagevar);
if ($TabFinder['finder_mode'] == 'normal') {
$chaine_url_middle = 'advance';
$chaine_labelle = 'Plus';
} else if ($TabFinder['finder_mode'] == 'advance') {
$chaine_url_middle = 'normal';
$chaine_labelle = 'Moins';
}
$chaine_url_end = '&amp;arg_0='.$arg_0.'&amp;arg_1='.$arg_1.'&amp;arg_2='.$arg_2.'&amp;arg_3='.$arg_3.'&amp;arg_4='.$arg_4.'&amp;arg_5='.$arg_5;
$chaine_url_start = "\n".'<input type="button" class="texte_tb" value="'.$chaine_labelle.' d\'options" '.
'onclick="javascript:window.location.href=\''.$GLOBALS['_GEN_commun']['url']->getURL().
'&amp;TransTab='.$stockagevar.'finder_mode,'.$chaine_url_middle.$chaine_url_end.'\';" />'."\n";
return $chaine_url_start;
}
 
// presa_mk_title($value,$colspan) :
// créé une ligne de titre dans un <tr>
// Entrée : string $value, int $colspan
// ($value : titre ; $colspan : nombre de colonnes fusionnées ; par défaut $colspan = 1)
// Sortie (par retour) : string
 
function presa_mk_title($value, $niveau = '2', $class = 'insTitle1')
{
return '<h'.$niveau.' class="'.$class.'">'.$value.'</h'.$niveau.'>'."\n";
}
 
 
// presa_mk_maxtitle($value,$colspan) :
// créé une ligne de titre dans un <tr>
// Entrée : string $value, int $colspan
// ($value : titre ; $colspan : nombre de colonnes fusionnées ; par défaut $colspan = 1)
// Sortie (par retour) : string
function presa_mk_maxtitle($value, $niveau = '1', $class = 'insMsg')
{
return '<h'.$niveau.' class="'.$class.'">'.$value.'</h'.$niveau.'>'."\n";
}
 
 
// presa_mk_blkline($colspan=1) :
// créé une ligne vide dans un <tr>
// Entrée : int $colspan
// ($colspan : nombre de colonnes fusionnées ; par défaut $colspan = 1)
// Sortie (par retour) : string
function presa_mk_blkline($colspan=1)
{
return '<tr><td class="texte_tb" colspan="'.$colspan.'">&nbsp;</td></tr>'."\n";
}
 
// count_num_of_reductor($table,$id)
// retourne le nombre d'items de la table $tbl['item'] ayant un
// type de réducteur $id dans le champ $champ
 
function count_num_of_reductor($champ, $id)
{
global $tbl;
global $retour_biblio;
global $plugin_store;
if ($retour_biblio['limit_domain'] == 1) {
$from_ajout = ', '.$tbl['domaine_lk'];
$requete_ajout = ' AND B_I_IDITEM = B_DL_IDITEM AND B_DL_IDDOM = 1';
} else {
$from_ajout = '';
$requete_ajout = '';
}
if ((BB_ARGUMENT_REGROUPEMENT == 'media') && ($champ == 'B_I_TYPLOG')) {
$requete_ajout .= ' AND '.$GLOBALS['query_dom']['phy'];
}
$requete = 'SELECT COUNT(B_I_IDITEM) AS CPT '.
'FROM '.$tbl['item'].$plugin_store['count_add_table'].$from_ajout.' '.
'WHERE '.$champ.' = '.$id.' '.
$requete_ajout.' '.
$plugin_store['count_add_query'];
$resultat = $GLOBALS['db_bb']->query($requete);
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '';
$nbre_ligne = $resultat->numRows();
if ($nbre_ligne != 1) {
die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete, 'Erreur : '.$nbre_ligne.' résultat(s) au lieu d\'1.'));
$resultat->free();
return -1;
} else {
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
$nombre = $ligne->CPT;
$resultat->free();
return $nombre;
}
}
 
/**Fonction CreateNavigBiblio() - construit l'interface de navigation de la consultation avancée.
*
* Créée des boutons pour accéder à certains services spécifiques de Biblio Bota
* (listes,modifications...).
* Cette fonction utilise les constantes :
* - BB_URL_COURANTE_CONSULTATION
* - BB_IMG_PRECEDENT
* - BB_CLASS_IMG_PRECEDENT
*
* @param string la destination du bouton (goback ou goto).
* @param string le sujet de destination du bouton (coll, fasc ou art).
* @param array un tableau contenant les arguments des liens des boutons.
* @param string le texte du bouton qui remplacera l'image.
* @param bool booléen indiquant si on doit afficher une image ou pas.
*
* @return array les infos des "voir aussi".
*/
function CreateNavigBiblio($destination, $sujet, $tableau, $texte = '', $image = 0)
{
if (!isset($tableau['pass'])) {
$tableau['pass'] = '';
}
if (!isset($tableau['locusfasc'])) {
$tableau['locusfasc'] = '';
}
$retour = '';
switch ($destination) {
// GoBack permet de créer des retours aux pages précédentes (fasc->coll, art->fasc)
case 'goback':
switch ($sujet) {
case 'coll':
// Permet de retourner des fascicules aux collections
$action = BB_URL_COURANTE_CONSULTATION.'&amp;consultation=avancee&amp;page=1&amp;coll='.$tableau['pass'].$tableau['args'];
$retour = '<p class="bb_navigation">';
$retour .= '<a href="'.$action.'">';
if ($image == 1) {
$retour .= '<img class="'.BB_CLASS_IMG_PRECEDENT.'" src="'.BB_IMG_PRECEDENT.'" alt="'.$texte.'..."/>';
$retour .= ' '.$texte;
} else {
$retour .= ' '.$texte;
}
$retour .= '</a></p>'."\n";
break;
case 'fasc':
// Permet de retourner des articles aux fascicules
$action = BB_URL_COURANTE_CONSULTATION.'&amp;consultation=avancee&amp;page=1&amp;fasc='.$tableau['back'].$tableau['args'].
'&amp;locusfasc='.$tableau['locusfasc'];
$retour = '<p class="bb_navigation">';
$retour .= '<a href="'.$action.'">';
if ($image == 1) {
$retour .= '<img class="'.BB_CLASS_IMG_PRECEDENT.'" src="'.BB_IMG_PRECEDENT.'" alt="'.$texte.'..."/>';
$retour .= ' '.$texte;
} else {
$retour .= ' '.$texte;
}
$retour .= '</a></p>'."\n";
break;
}
break;
// GoTo permet de descendre d'un niveau (coll->fasc->art)
case 'goto':
switch ($sujet) {
case 'fasc':
// Permet de descendre des coll aux fasc
$action = BB_URL_COURANTE_CONSULTATION.'&amp;consultation=avancee&amp;page=1&amp;fasc='.$tableau['pass'].$tableau['args'];
$retour = '<p class="bb_navigation">';
$retour .= '<a href="'.$action.'">';
if ($image == 1) {
$retour .= '<img class="'.BB_CLASS_IMG_PRECEDENT.'" src="'.BB_IMG_PRECEDENT.'" alt="'.$texte.'..."/>';
$retour .= ' '.$texte;
} else {
$retour .= ' '.$texte;
}
$retour .= '</a></p>'."\n";
break;
case 'art':
// Permet de descendre des fasc aux art
$action = BB_URL_COURANTE_CONSULTATION.'&amp;consultation=avancee&amp;page=1&amp;art='.$tableau['pass'].$tableau['args'].
'&amp;locusfasc='.$tableau['locusfasc'];
$retour = ' - ';
$retour .= '<a href="'.$action.'">';
if ($image == 1) {
$retour .= '<img class="'.BB_CLASS_IMG_PRECEDENT.'" src="'.BB_IMG_PRECEDENT.'" alt="'.$texte.'..."/>';
$retour .= ' '.$texte;
} else {
$retour .= ' '.$texte;
}
$retour .= '</a>'."\n";
break;
}
break;
}
return $retour;
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.6 2005/05/17 10:10:08 jpm
* Correction des bogues avant mise en ligne du site v4.
*
* Revision 1.5 2005/01/04 16:23:47 jpm
* Amélioration de la forme.
*
* Revision 1.4 2004/09/16 12:07:30 jpm
* Changement de noms de constantes.
*
* Revision 1.3 2004/09/14 10:18:17 jpm
* Mise en forme et amélioration du code.
* Passage au XHTML strict.
*
* Revision 1.2 2004/09/10 18:44:25 jpm
* Ajout de fonction et mise en forme.
*
* Revision 1.1 2004/09/10 09:45:37 jpm
* Ajout des fichiers BiblioBota configurer pour Papyrus.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bibliotheque/bbc_affichage_structure.fonct.php
New file
0,0 → 1,165
<?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_structure.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Fonctions de création de l'affichage des résultats d'une structure.
*
* Contient une fonction créant l'affichage des résultats pour le paramètre "structure".
*
*@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.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | 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 "structure".
*
* @return string les résultats à afficher.
*/
function mkresu()
{
global $result_final;
global $nbr_final;
global $tbl;
global $TabFinder;
global $var_biblio;
$ret = '';
$ret .= '<ul id="bb_liste_resultat_structure">'."\n";
$i = 1;
while ($ligne = mysql_fetch_object($result_final)) {
$get_idstr = $ligne->B_S_IDSTR;
$get_name = $ligne->B_S_NOM;
$get_cp = $ligne->B_S_CODEPOSTAL;
$get_ville = $ligne->B_S_VILLE;
$get_pays = $ligne->GC_NAME;
$get_date = $ligne->B_S_MAJFICHE;
$get_categ = $ligne->B_S_TYPESTR;
$get_categ_nom = $ligne->B_TYPSTR_LABEL;
$ret .= '<li>'."\n";
$ret .= '<b>';
$ret .= ColorizeFound($get_name, stripslashes($TabFinder['chaine']));
$ret .= '</b> ';
$ret .= '(';
$ret .= ColorizeFound($get_ville, strtoupper($TabFinder['geo']));
if (($get_ville != '') && ($get_pays != '')) {
$ret .= ' - ';
}
if (($get_pays == 'France') && ($get_cp != '')) {
// Calcul du code département pour la France
if ($get_cp < 97000) {
$calc_dpt = floor($get_cp / 1000);
} else {
$calc_dpt = floor($get_cp / 100);
}
$dpt_qu = 'SELECT GFD_NAME '.
'FROM '.$tbl['dpt'].' '.
'WHERE GFD_ID = '.$calc_dpt;
$do_dpt = mysql_query($dpt_qu) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $dpt_qu));
$nbr_dpt = mysql_num_rows($do_dpt);
if ($nbr_dpt == 1) {
$resu_dpt = mysql_fetch_object($do_dpt);
$nom_dpt = $resu_dpt->GFD_NAME;
} else {
return '<b>Erreur lors de la recherche du département :</b> '.$nbr_dpt.' départements trouvés.';
}
$ret .= ColorizeFound($nom_dpt, ucFirst($TabFinder['geo'])) . ' - ';
}
if ($get_pays != '') {
if ($TabFinder['geo'] != '') {
$ret .= ColorizeFound($get_pays, ucFirst($TabFinder['geo']));
} else {
$ret .= $get_pays;
}
}
$ret .= ') - '."\n";
if ($get_categ != '') {
$ret .= $get_categ_nom;
}
// Vérification de l'accès à la consultation avancée transversale de Bilblio Bota.
if ($var_biblio['open_biblio_str'] == true) {
$ret .= ' - <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.'">'.
'Plus d\'infos'.
'</a>';
}
if ($i < $nbr_final) {
$ret .= '<br /><br />';
}
$i++;
$ret .= '</li>'."\n";
}
$ret .= '</ul>'."\n";
// Vérification de l'accès à la proposition de nouvelles structures.
if ($var_biblio['open_proposer_str'] == true) {
$ret .= '<p class="bb_txt_centre">'.
'<hr size="1" />'.
'<a href="'.BB_URL_COURANTE_ADMIN.'&amp;action=new&ensemble=str">'.'Proposer un nouvel organisme'.'</a>'.
'<hr size="1" />'.
'</p>'."\n";
}
return $ret;
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/05/17 10:10:08 jpm
* Correction des bogues avant mise en ligne du site v4.
*
* Revision 1.2 2004/09/15 11:21:07 jpm
* Début mise en conformité avec la convention de codage et le standard XHTML Strict.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bibliotheque/bbc_statistique.fonct.php
New file
0,0 → 1,137
<?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_statistique.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Fonctions de statistique de Biblio Bota.
*
* Contient les fonctions permettant de faire les statistiques de Biblio Bota.
*
*@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.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
/** Fonction spy_validated_finder() - Enregistrement des statistiques.
*
* Fonction insèrant dans la table biblio_spy des données concernant les requêtes
* faites par les utilisateurs de Biblio Botanica.
*
* @param string les arguments d'appel de la page de Biblio Bota.
* @return void les données sont enregistrées dans la base de données.
*/
function spy_validated_finder($page_arg, $nbres)
{
global $doc, $REMOTE_ADDR, $TabFinder, $TransTab;
if (isset($TransTab)) {
$TabFinder = FRAG_decoupageChaine($TransTab);
}
$moment = time();
if (!isset($TabFinder['plugin'])) {
$TabFinder['plugin'] = '';
}
if (!isset($TabFinder['geo'])) {
$TabFinder['geo'] = '';
}
if (!isset($TabFinder['chaine'])) {
$TabFinder['chaine'] = '';
}
if (!isset($TabFinder['sort'])) {
$TabFinder['sort'] = '';
}
if (!isset($TabFinder['auteur'])) {
$TabFinder['auteur'] = '';
}
if (!isset($TabFinder['categ'])) {
$TabFinder['categ'] = '';
}
if (!isset($TabFinder['pstart'])) {
$TabFinder['pstart'] = '';
}
if (!isset($TabFinder['pend'])) {
$TabFinder['pend'] = '';
}
if (!isset($TabFinder['step'])) {
$TabFinder['step'] = '';
}
if (!isset($TabFinder['valid'])) {
$TabFinder['valid'] = '';
}
if (!isset($TabFinder['typque'])) {
$TabFinder['typque'] = '';
}
if (!isset($TabFinder['categ_2'])) {
$TabFinder['categ_2'] = '';
}
if (!isset($TabFinder['categ_3'])) {
$TabFinder['categ_3'] = '';
}
if (!isset($TabFinder['since'])) {
$TabFinder['since'] = '';
}
if ($nbres > 0) {
$calc_pages = 'De '.$TabFinder['pstart'].' à '.$TabFinder['pend'].' sur '.$nbres;
} else {
$calc_pages = 'Pas de résultats';
}
$requete = 'INSERT INTO biblio_spy VALUES ("", "'.$doc.'.'.$TabFinder['plugin'].'", '.
'"'.$page_arg.'", "'.$REMOTE_ADDR.'", "'.$TabFinder['chaine'].'", '.
'"'.$TabFinder['geo'].'", "'.$TabFinder['auteur'].'", "'.$TabFinder['categ'].'", '.
'"'.$TabFinder['categ_2'].'", "'.$TabFinder['categ_3'].'", "'.$TabFinder['typque'].'", '.
'"'.$TabFinder['step'].'", "'.$TabFinder['sort'].'", "'.$TabFinder['since'].'", '.
'"'.$calc_pages.'", "'.$moment.'")';
mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* 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/10 18:43:31 jpm
* Ajout d'une bibliothèque de gestion de fonction de statistique de Biblio Bota.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bibliotheque/bbc_requete_lien.fonct.php
New file
0,0 → 1,183
<?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_requete_lien.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Fonctions de création de la requête sur un lien.
*
* Contient une fonction créant la requête d'intérogation de la base de données.
* Valable pour le paramètre "lien".
*
*@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.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/*Mettre ici les inclusions de fichiers*/
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
/*Mettre ici la liste de fonctions.*/
 
function mkquery()
{
global $TabFinder, $tbl;
// Initialisation
$order_query = '';
// Si la variable de catégorie vaut 0, il n'y a pas affinage de la requête par catégorie. Sinon, on affine.
if ($TabFinder['categ'] != 0) {
$add_to_from = $tbl['cat'].', '.$tbl['categlien'].', ';
$add_to_query = ' AND ('.$tbl['cat'].'.B_CAT_IDCAT = '.$TabFinder['categ'].')';
if ($TabFinder['chaine'] != '') {
$join_categ = ' AND ';
} else {
$join_categ = '';
}
$join_categ .= ' AND ('.$tbl['link'].'.B_L_IDLINK = '.$tbl['categlien'].'.B_LC_IDLINK) AND ('.$tbl['cat'].'.B_CAT_IDCAT = '.$tbl['categlien'].'.B_LC_IDCAT)';
} else {
$add_to_from = '';
$add_to_query = '';
$join_categ = '';
}
// Création du SELECT
$normal_query = 'SELECT '.$tbl['link'].'.*, '.$tbl['str'].'.B_S_NOM ';
// si le raffinement de catégorie vaut autre chose que 0, il faut ajouter les tables de catégories
if ($TabFinder['categ'] != 0) {
$normal_query .= ', '.$tbl['categlien'].'.*, '.$tbl['cat'].'.B_CAT_LABEL, '.$tbl['cat'].'.B_CAT_IDCAT ';
}
// Création du FROM
$normal_query .= 'FROM '.$add_to_from.$tbl['link'].' LEFT JOIN '.$tbl['str'].' ON '.$tbl['link'].'.B_L_LKSTR = '.$tbl['str'].'.B_S_IDSTR ';
// Création du WHERE
$normal_query .= 'WHERE B_L_CACHER = 0 ';
if (($TabFinder['typque'] == 0) && ($TabFinder['chaine'] != '')) {
$normal_query .= ' AND (';
$normal_query .= $tbl['link'].'.B_L_TITRE like "%'.$TabFinder['chaine'].'%" '.
'OR '.$tbl['link'].'.B_L_URL like "%'.$TabFinder['chaine'].'%" '.
'OR '.$tbl['link'].'.B_L_RESUMCLE like "%'.$TabFinder['chaine'].'%" ';
$normal_query .= ') ';
} else if ($TabFinder['chaine'] != '') {
$normal_query .= ' AND (';
// Si la variable de type de recherche vaut 1, il faut que le moteur recherche chaque motif
if ($TabFinder['typque'] == 1) {
$result_from_ex = explode (' ', $TabFinder['chaine']);
}
$i_ex = 0;
while ($i_ex < count($result_from_ex)) {
$normal_query .= $tbl['link'].'.B_L_TITRE LIKE "%';
if ($result_from_ex[$i_ex] != '') {
$normal_query .= $result_from_ex[$i_ex];
}
$normal_query .= '%" OR ';
$normal_query .= $tbl['link'].'.B_L_URL LIKE "%';
if ($result_from_ex[$i_ex] != '') {
$normal_query .= $result_from_ex[$i_ex];
}
$normal_query .= '%" OR ';
$normal_query .= $tbl['link'].'.B_L_RESUMCLE LIKE "%';
if ($result_from_ex[$i_ex] != '') {
$normal_query .= $result_from_ex[$i_ex];
}
$normal_query .= '%"';
if ($i_ex < (count($result_from_ex) - 1)) {
$normal_query .= ') AND (';
}
$i_ex++;
}
$normal_query .= ')';
}
// traitement du réducteur SINCE (fonction de la date)
if ($TabFinder['since'] != '') {
$since_var = explode('/', $TabFinder['since']);
if (empty($since_var[0])) {
$since_var[0] = '';
}
if (empty($since_var[1])) {
$since_var[1] = '';
}
if (empty($since_var[2])) {
$since_var[2] = '';
}
$timestamp = mktime(NULL, NULL, NULL, $since_var[1], $since_var[0], $since_var[2]);
if (!ereg('WHERE', $normal_query)) {
$normal_query .= ' WHERE ';
} else {
$normal_query .= ' AND ';
}
$normal_query .= 'B_L_MAJFICHE > '.$timestamp;
}
// Création de l'ordre de tri
$order_query = ' ORDER BY '.$TabFinder['sort'];
// Affectation de la requête à la variable qui va l'envoyer au moteur
$unreq = $normal_query.' '.$join_categ.' '.$add_to_query.' '.$order_query;
return $unreq;
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.4 2005/06/20 17:32:14 jpm
* Correction erreur de construction de la requête sql.
*
* Revision 1.3 2005/05/17 10:10:08 jpm
* Correction des bogues avant mise en ligne du site v4.
*
* Revision 1.2 2004/09/14 11:49:52 jpm
* Ajout de l'entête au fichier.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bbc_info_fascicule.inc.php
New file
0,0 → 1,234
<?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_fascicule.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Appli bb_consultation : gestion des informations avancées "fascicule" de Biblio Bota
*
* Ce fichier permet d'afficher les informations concernant les "fascicules" 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 |
// +------------------------------------------------------------------------------------------------------+
 
global $locusfasc;
// DEBUT FASCICULE
 
// $unex est composé de :
// - [0] nom de collection
// - [1] point de départ de la requete
 
$unex = explode('-', $tableau['fasc']);
 
$tableau['locusfasc'] = $locusfasc;
if ($tableau['locusfasc'] == '') {
$tableau['locusfasc'] = 0;
}
$requete = 'SELECT '.$tbl['str'].'.B_S_IDSTR,'.$tbl['str'].'.B_S_NOM, '.$tbl['collection'].'.B_C_NOMCOMPLET '.
'FROM '.$tbl['str'].', '.$tbl['collection'].' '.
'WHERE '.$tbl['str'].'.B_S_IDSTR = '.$tbl['collection'].'.B_C_LKSTR '.
'AND B_C_CRAI = "'.$unex[0].'"';
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$nb_titre = mysql_num_rows($resultat);
 
if ($nb_titre != 1) {
$sortie .= '<p class="erreur"><strong>'.'Erreur de récupération des noms (str et coll)'.'</stong>'.' : '.
$requete.' '.'donne'.' '.$nb_titre.' '.'résultats'.'</p>'."\n";
} else {
$ligne = mysql_fetch_object($resultat);
$le_numero = $ligne->B_S_IDSTR;
$le_nom = $ligne->B_S_NOM;
$la_coll = $ligne->B_C_NOMCOMPLET;
mysql_free_result($resultat);
$tableau['args'] = '&amp;arg_0=str%3D'.$le_numero.'&amp;arg_1=coll%3D'.$le_numero.
'&amp;arg_2=book%3D'.$le_numero.'&amp;arg_3=media%3D'.$le_numero;
$tableau['pass'] = $le_numero;
 
if ($tableau['locusfasc'] > 0) {
$tableau['pstart'] = $tableau['locusfasc'];
$depart = $tableau['locusfasc'];
} else {
$depart = $tableau['pstart'];
}
if ($depart == '') {
$depart = 0;
}
// Affichage de la navigation avancée : retour aux collections
$sortie .= CreateNavigBiblio('goback', 'coll', $tableau, 'Retour aux périodiques', 1);
// Affichage du titre de la page
$sortie .= '<h1>'.$le_nom.' '.':'.' '.'fascicules'.'</h1>'."\n";
$sortie .= '<h2>'.'du périodique'.' '.$la_coll.'</h2>'."\n";
// Comptage du nombre total de données
$requete = 'SELECT COUNT(*) AS COMPTE '.
'FROM '.$tbl['serie'].', '.$tbl['fascicule'].' '.
'WHERE B_SER_CRAICOLL = B_F_CRAICOLL '.
'AND B_SER_IDSERIE = B_F_CRAISERIE '.
'AND B_F_CRAICOLL = "'.$unex[0].'" '.
'AND B_F_CACHER = 0';
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$ligne = mysql_fetch_object($resultat);
$num_c = $ligne->COMPTE;
mysql_free_result($resultat);
$requete = 'SELECT '.$tbl['serie'].'.*, '.$tbl['fascicule'].'.*, '.$tbl['collection'].'.* '.
'FROM '.$tbl['serie'].', '.$tbl['fascicule'].', '.$tbl['collection'].' '.
'WHERE B_C_CRAI = B_SER_CRAICOLL '.
'AND B_SER_CRAICOLL = B_F_CRAICOLL '.
'AND B_SER_IDSERIE = B_F_CRAISERIE '.
'AND B_F_CRAICOLL = "'.$unex[0].'" '.
'ORDER BY B_F_NUMERO DESC '.
'LIMIT '.$depart.', '.$var_biblio['how_bloc'];
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$num = mysql_num_rows($resultat);
// Affichage du nombre de résultat trouvé
$tableau['step'] = $var_biblio['how_bloc'];
$tableau['pend'] = $num_c;
$tableau['libelle'] = 'fascicule';
$tableau['feminin'] = 0;
$tableau['locusfasc'] = $tableau['pstart'];
$sortie .= '<p id="frag_nbre_resultat">';
$sortie .= FRAG_afficherTxtNbreResultat('bbpopup', $tableau, $num, $num_c);
$sortie .= '</p>'."\n";
// Fragmenteur de pages, pour une navigation plus facile
$frag = new fragmenteur(' - ', 10, BB_URL_COURANTE_CONSULTATION_AVANCEE.'&amp;fasc='.$tableau['fasc']);
$frag_txt = $frag->fragmente($tableau, $num_c);
if (($frag->nb_pages)>1) {
$sortie .= '<p class="frag_navigation">'.$frag_txt.'</p>'."\n";
}
$sortie .= '<ul id="bb_liste_fascicule">'."\n";
while ($ligne = mysql_fetch_object($resultat)) {
$nom = $ligne->B_C_NOMCOMPLET;
$crai = $ligne->B_F_CRAICOLL;
$serie = $ligne->B_F_CRAISERIE;
$titreserie = $ligne->B_SER_SOUSTITRE;
$fasc = $ligne->B_F_NUMERO;
$titre = $ligne->B_F_TITRE;
$nbpages = $ligne->B_F_NBPAGES;
$date = $ligne->B_F_DATE;
$image = $ligne->B_F_IMAGE;
$comment = $ligne->B_F_COMMENT;
$datemaj = $ligne->B_F_MAJFICHE;
$tableau['pass'] = $crai.'-'.$serie.'-'.$fasc;
$sortie .= '<li>'."\n";
// Affichage de l'image du fascicule
if ($image != '') {
$sortie .= '<img class="bb_img_fascicule" src="'.BB_CHEMIN_IMAGES_ILLUSTRATION.$image.'" alt="'.'Image de la couverture du fascicule'.'" />'."\n";
}
// Affichage des informations sur le fascicule
$sortie .= '<b>'.$nom.'</b>';
if ($titreserie != '') {
$sortie .= ', <b>'.$titreserie.'</b>';
}
$sortie .= ', '.$titre."\n";
 
if ($date > 0) {
$sortie .= ' - '.FormateDateYYYYMMJJ($date);
}
if ($nbpages > 0) {
$sortie .= ' - '.$nbpages.' p.';
}
if ($comment != '') {
$sortie .= ' - '.$comment;
}
// Comptage du nombre d'articles indexés pour le fascicule
$query_ser = 'SELECT COUNT(*) AS CPT '.
'FROM '.$tbl['article'].', '.$tbl['item'].' '.
'WHERE B_A_CRAICOLL = "'.$crai.'" '.
'AND B_A_CRAISERIE = '.$serie.' '.
'AND B_A_CRAIFASC = "'.$fasc.'" '.
'AND B_I_IDITEM = B_A_IDART '.
'AND B_I_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) {
die ('<p><b>'.'Echec du programme'.' '.':'.' '.'</b> '.'Nombre de comptages incohérent'.' '.'('.$nb_ser.')'.'</p>'."\n");
}
$row_ser = mysql_fetch_object($result_ser);
$intobiblio = $row_ser->CPT;
mysql_free_result($result_ser);
// Affichage de la consultation des articles
if ($intobiblio > 1) {
$pluriel_art = 's';
} else {
$pluriel_art = '';
}
if ($intobiblio > 0) {
$sortie .= CreateNavigBiblio('goto', 'art', $tableau, $intobiblio.' article'.$pluriel_art.' '.'indexé'.$pluriel_art, 0);
}
// Affichage des Voir Aussi Fascicules ... s'il y'en a
$UnVoirAussi = new VoirAussi($crai.'-'.$serie.'-'.$fasc, $tbl['fascicule']);
if ($UnVoirAussi->NbVA > 0) {
$sortie .= ' '.'-'.' '.'Consulter'.' '.':'.' ';
$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 .= '</li>'."\n";
}
$sortie .= '</ul>'."\n";
mysql_free_result($resultat);
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bbc_info_media.inc.php
New file
0,0 → 1,290
<?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_media.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Appli bb_consultation : gestion des informations avancées "media" de Biblio Bota
*
* Ce fichier permet d'afficher les informations concernant les "médias" 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 |
// +------------------------------------------------------------------------------------------------------+
 
if ($tableau['pstart']== '') {
$tableau['pstart'] = 0;
}
$tableau['args'] = '&amp;arg_0=str%3D'.$tableau['media'].'&amp;arg_1=coll%3D'.$tableau['media'].'&amp;arg_2=book%3D'.$tableau['media'].'&amp;arg_3=media%3D'.$tableau['media'];
 
// Proposition d'édition
/*
$sortie .= '<p>'."\n";
if ($var_biblio['open_proposer_media'] == 1) {
$sortie .= CreateNavigBiblio('add', 'media', 'Proposer un nouveau media', $tableau['media'], 1, $tableau);
} else {
$sortie .= '&nbsp;';
}
$sortie .= '</p>'."\n";
*/
 
// Récupèration du nom de la structure
$requete = 'SELECT B_S_NOM '.
'FROM '.$tbl['str'].' '.
'WHERE B_S_IDSTR = '.$tableau['media'];
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$num_s = mysql_num_rows($resultat);
 
if ($num_s != 1) {
$sortie .= '<p class="erreur"><strong>'.'Erreur de requête MEDIA !'.'</strong>'.
' nombre de résultats (= '.$num_s.') incohérent pour la requête : '.'<br />'.$requete.'</p>';
} else {
$ligne = mysql_fetch_object($resultat);
$la_structure = $ligne->B_S_NOM;
mysql_free_result($resultat);
// Comptage du nombre de médias
$requete = 'SELECT COUNT(*) AS COMPTAGE '.
'FROM '.$tbl['item'].', '.$tbl['media'].' '.
'WHERE '.$tbl['media'].'.B_M_LKSTR = '.$tableau['media'].' '.
'AND '.$tbl['item'].'.B_I_TYPPHY <> '.$def_livre.' '.
'AND '.$tbl['item'].'.B_I_IDITEM = '.$tbl['media'].'.B_M_IDMEDIA';
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$tmp_nb_c = mysql_fetch_object($resultat);
$num_c = $tmp_nb_c->COMPTAGE;
mysql_free_result($resultat);
$requete = 'SELECT '.$tbl['item'].'.*, '.$tbl['media'].'.*, GEN_MON_SYMBOLE, B_AS_LIBELLE, GEN_MON_VAL1EURO, '.$tbl['item_typphy'].'.*, '.$tbl['item_typlog'].'.*, '.$tbl['domaine'].'.* '.
'FROM '.$tbl['item'].', '.$tbl['media'].', '.$tbl['monnaie'].', '.$tbl['saisie'].', '.$tbl['item_typphy'].', '.$tbl['item_typlog'].', '.$tbl['domaine'].', '.$tbl['domaine_lk'].' '.
'WHERE B_M_LKSTR = '.$tableau['media'].' '.
'AND B_I_TYPPHY <> '.$def_livre.' '.
'AND B_I_IDITEM = B_M_IDMEDIA '.
'AND GEN_MON_IDMONNAIE = B_M_LKMONNAIE '.
'AND B_I_AUTEURSAISIE = B_AS_ID '.
'AND B_I_TYPLOG = B_IL_ID '.
'AND B_I_TYPPHY = B_IP_ID '.
'AND B_I_IDITEM = B_DL_IDITEM '.
'AND B_DL_IDDOM = B_D_ID '.
'ORDER BY B_I_TYPLOG, B_I_TYPPHY, B_I_AUTEURS '.
'LIMIT '.$tableau['pstart'].', '.$var_biblio['how_book'];
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$nb_m = mysql_num_rows($resultat);
// Affichage du titre
$sortie .= '<h1>'.$la_structure.' : médias'.'</h1>'."\n";
// Récupération d'informations
if (empty($tableau['step'])) {
$tableau['step'] = $var_biblio['how_book'];
}
if (empty($tableau['pend'])) {
$tableau['pend'] = $num_c;
}
if (empty($tableau['libelle'])) {
$tableau['libelle'] = 'média';
}
if (empty($tableau['feminin'])) {
$tableau['feminin'] = 0;
}
// Affichage du nbre de résultats
$sortie .= '<p id="frag_nbre_resultat">';
$sortie .= FRAG_afficherTxtNbreResultat('bbpopup', $tableau, $nb_m, $num_c);
$sortie .= '</p>'."\n";
// Ici on fragmente en pages, pour une navigation plus facile
$frag = new fragmenteur(' - ', 10, BB_URL_COURANTE_CONSULTATION_AVANCEE);
$frag_txt = $frag->fragmente($tableau, $num_c);
if (($frag->nb_pages)>1) {
$sortie .= '<p class="frag_navigation">'.$frag_txt.'</p>'."\n";
}
// Affichage des médias
if ($num_c == 0) {
$sortie .= '<p class="information">'.'Aucun média indexé.'.'</p>'."\n";
} else {
$sortie .= '<ul id="bb_liste_article">'."\n";
while ($ligne = mysql_fetch_object($resultat)) {
$id_a = $ligne->B_I_IDITEM;
$titre = $ligne->B_I_TITRE;
$auteurs = $ligne->B_I_AUTEURS;
$geo = $ligne->B_I_GEO;
$langue = $ligne->B_I_LANGUE;
$resum = $ligne->B_I_RESUMCLE;
$image = $ligne->B_I_IMAGE;
$saisie = $ligne->B_AS_LIBELLE;
$comment = $ligne->B_I_COMMENT;
$date = $ligne->B_M_DATE;
$prix = $ligne->B_M_PRIX;
$idmonnaie = $ligne->B_M_LKMONNAIE;
$monnaie = $ligne->GEN_MON_SYMBOLE;
$converter = $ligne->GEN_MON_VAL1EURO;
$volume = $ligne->B_M_VOLUME;
$edite = $ligne->B_M_EDITE;
$vendu = $ligne->B_M_VEND;
$editeur = $ligne->B_M_EDITEUR;
$collection_book = $ligne->B_M_COLLECTION;
$numcoll_book = $ligne->B_M_NUMCOLL;
$get_domaine_id = $ligne->B_D_ID;
$get_domaine_nom = $ligne->B_D_LABEL;
$item_phy = $ligne->B_IP_LABEL;
$icon_phy = $ligne->B_IP_IMAGE;
$item_log = $ligne->B_IL_LABEL;
$icon_log = $ligne->B_IL_IMAGE;
$sortie .= '<li>'."\n";
if ($image != '') {
$sortie .= '<img class="bb_img_media" src="'.BB_CHEMIN_IMAGES_ILLUSTRATION.$image.'" '.
'alt="'.'Illustration du média : '.$titre.'" />';
}
$sortie .= '<span class="texte_inactif">';
if ($get_domaine_id != 1) {
$sortie .= '['.$get_domaine_nom.']'."\n";
}
if ($icon_phy != '') {
$sortie .= '<img class="'.BB_CLASS_IMG_ICONE.'" src="'.BB_CHEMIN_IMAGES_TYPE_PHYSIQUE.$icon_phy.'" alt="'.$item_phy.'" />';
} else {
$sortie .= '['.$item_phy.']';
}
if (($icon_phy == '') && ($icon_log)) {
$sortie .= ' - ';
}
if ($icon_log != '') {
$sortie .= '<img class="'.BB_CLASS_IMG_ICONE.'" src="'.BB_CHEMIN_IMAGES_TYPE_LOGIQUE.$icon_log.'" alt="'.$item_log.'" />';
} else {
$sortie .= '['.$item_log.']';
}
$sortie .= '</span> ';
$sortie .= $auteurs.' - '.'<strong>'.$titre.'</strong>'.' -'."\n";
$sortie .= ' Éditeur : ';
if ($editeur != '') {
$sortie .= $editeur;
} else {
$sortie .= 'inconnu';
}
$sortie .= ' - ';
if (($collection_book != '') || ($numcoll_book != '')) {
$sortie .= 'Collection : '.$collection_book.' '.$numcoll_book.' - ';
}
if ($geo != '') {
$sortie .= 'Départ./Région : '.'<em>'.$geo.'</em>'.' -';
}
if ($date > 0) {
$sortie .= ' '.DAT_formaterDateYYYYMMJJ($date).', ';
}
if ($volume != '') {
$sortie .= $volume.', ';
}
if ($prix > 0) {
$sortie .= $prix.' '.$monnaie;
}
if (($def_euro != $idmonnaie) && ($converter > 0)) {
$sortie .= ' (env. '.round($prix / $converter, 2).' &euro;)';
}
if ($langue != '') {
$sortie .= ' ('.$langue.')';
}
if (($resum != '') || ($comment != '')) {
$sortie .= ' - '.'<em>'.$comment;
if (($resum != '') && ($comment != '')) {
$sortie .= ' - ';
}
$sortie .= $resum.'</em>';
}
if ($vendu == -1) {
$sortie .= ' - '.'<img class="'.BB_CLASS_IMG_EPUISE.'" src="'.BB_IMG_EPUISE.'" alt="'.'Épuisé'.'" />';
}
if (($edite == 1) || ($vendu == 1)) {
$sortie .= ' - '.'Organisme ';
if ($edite == 1) {
$sortie .= 'éditeur';
}
if (($edite == 1) && ($vendu == 1)) {
$sortie .= ' et ';
}
if ($vendu == 1) {
$sortie .= 'vendeur';
}
$sortie .= ' de l\'article';
}
if ($saisie != '') {
$sortie .= '<span class="texte_inactif">'.' - '.'Saisie : '.$saisie.' - '.'Art. n°'.$id_a.'.'.'</span>';
}
// Là on affiche les Voir Aussi Médias ... si y'en a
$UnVoirAussi = new VoirAussi($id_a, $tbl['article']);
if ($UnVoirAussi->NbVA > 0) {
$sortie .= '<br />'.'Consulter : ';
$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 .= '</li>'."\n";
}
$sortie .= '</ul>'."\n";
}
mysql_free_result($resultat);
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bbc_info_structure.inc.php
New file
0,0 → 1,318
<?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_structure.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Appli bb_consultation : gestion des informations avancées "structure" de Biblio Bota
*
* Ce fichier permet d'afficher les informations sur les organismes liés à 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 |
// +------------------------------------------------------------------------------------------------------+
 
if ($var_biblio['open_proposer_str'] == 1) {
// Si Open Moderation est ouvert, alors proposer la modification des données
$the_url_edit = BB_URL_COURANTE_ADMIN.'&amp;action=edit&ensemble=str&amp;ref='.$tableau['str'];
$sortie .= '<p>'."\n";
$sortie .= '<a href="'.$the_url_edit.'">'."\n".
'<img class="'.BB_CLASS_IMG_MODIFIER.'" src="'.BB_IMG_MODIFIER.'" alt="'.'Modifier la fiche structure'.'" />'."\n".
'</a>'."\n";
$sortie .= '<a class="texte_tb2" href="'.$the_url_edit.'">'.'Corriger la fiche...'.'</a>'."\n";
$sortie .= '</p>'."\n";
}
 
$query = 'SELECT * '.
'FROM '.$tbl['str'].', '.$tbl['pays'].', '.$tbl['typestr'].' '.
'WHERE ('.$tbl['str'].'.B_S_IDSTR = '.$tableau['str'].') '.
'AND ('.$tbl['str'].'.B_S_TYPESTR = '.$tbl['typestr'].'.B_TYPSTR_ID) '.
'AND ('.$tbl['str'].'.B_S_PAYS = '.$tbl['pays'].'.GC_ID) '.
'AND ('.$tbl['pays'].'.GC_LOCALE = "'.$GLOBALS['_GEN_commun']['i18n'].'")';
$do_query = mysql_query($query) or die('<b>Erreur de requête (choix de structure)</b> : '.$query);
$nb = mysql_num_rows($do_query);
 
if ($nb == 0) {
$sortie .= '<p class="erreur">'.
'<b>Erreur !</b> :<br /><br/>aucune structure ne correspond à l\'identifiant str='.$tableau['str'].'.'.
'</p>'."\n";
} else if ($nb > 1) {
$sortie .= '<p class="erreur">'.
'<b>Erreur !</b> :<br /><br />le moteur bbc_information a trouvé plusieurs données pour l\'identifiant str='.$tableau['str'].'.'.
'</p>'."\n";
} else {
$row = mysql_fetch_object($do_query);
$get_nom = $row->B_S_NOM;
$get_sigle = $row->B_S_SIGLE;
$get_service = $row->B_S_SERVICE;
$get_typestr = $row->B_TYPSTR_LABEL;
$get_numtypestr = $row->B_S_TYPESTR;
$get_datecreation = $row->B_S_DATECREATION;
$get_nbrperso = $row->B_S_NBRPERSO;
$get_vocactiv = $row->B_S_VOCACTIV;
$get_adresse1 = $row->B_S_ADRESSE1;
$get_adresse2 = $row->B_S_ADRESSE2;
$get_cp = $row->B_S_CODEPOSTAL;
$get_ville = $row->B_S_VILLE;
$get_pays = $row->GC_NAME;
$get_tel = $row->B_S_TEL;
$get_fax = $row->B_S_FAX;
$get_mail = $row->B_S_MAIL;
$get_image = $row->B_S_IMAGE;
$get_comment = $row->B_S_COMMENT;
$get_majfiche = $row->B_S_MAJFICHE;
mysql_free_result($do_query);
// Titre de la structure
$sortie .= '<h1 class="titlePage">';
$sortie .= $get_nom;
if ($get_sigle != '') {
$sortie .= ' ('.$get_sigle.')';
}
$sortie .= '</h1>'."\n";
// Type de structure et vocation
$sortie .= '<h2 class="insTitle1">'.'Type de structure, vocation'.'</h2>'."\n";
$sortie .= '<p>'."\n";
if ($get_typestr != '') {
$sortie .= '<span class="champ_cle">'.'Type de structure :'.'</span> <span class="champ_valeur">'.$get_typestr.'</span>'."\n";
}
if ($get_vocactiv != '') {
if ($get_typestr != '') {
$sortie .= '<br />'."\n";
}
$sortie .= '<span class="champ_cle">'.'Vocation / Activité :'.'</span> <span class="champ_valeur">'.$get_vocactiv.'</span>'."\n";
}
$sortie .= '</p>'."\n";
// Bloc d'adresse
$sortie .= '<h2 class="insTitle1">'.'Adresse'.'</h2>'."\n";
$sortie .= '<p>'."\n";
if ($get_service != '') {
$sortie .= $get_service."\n";
}
if ($get_adresse1 != '') {
if ($get_service != '') {
$sortie .= '<br />'."\n";
}
$sortie .= $get_adresse1."\n";
}
if ($get_adresse2 != '') {
if (($get_service != '') || ($get_adresse1 != '')) {
$sortie .= '<br />'."\n";
}
$sortie .= $get_adresse2."\n";
}
if ($get_cp != '') {
if (($get_service != '') || ($get_adresse1 != '') || ($get_adresse2 != '')) {
$sortie .= '<br />'."\n";
}
$sortie .= $get_cp."\n";
}
if ($get_ville != '') {
$sortie .= ' '.$get_ville."\n";
}
if ($get_pays != '') {
if (($get_service != '') || ($get_adresse1 != '') || ($get_ville != '') || ($get_cp != '')) {
$sortie .= '<br />'."\n";
}
$sortie .= $get_pays."\n";
}
// Bloc contact
$sortie .= '<br /><br />'."\n";
if ($get_tel != '') {
$sortie .= '<span class="champ_cle">'.'Téléphone :'.'</span> <span class="champ_valeur">'.$get_tel.'</span>'."\n";
}
if ($get_fax != '') {
if ($get_tel != '') {
$sortie .= '<br />'."\n";
}
$sortie .= '<span class="champ_cle">'.'Fax :'.'</span> <span class="champ_valeur">'.$get_fax.'</span>'."\n";
}
if ($get_mail != '') {
if (($get_fax != '') || ($get_tel != '')) {
$sortie .= '<br />'."\n";
}
$sortie .= '<span class="champ_cle">'.'Courriel :'.'</span> '.
'<span class="champ_valeur"> '.
'<a href="mailto:'.$get_mail.'">'.$get_mail.'</a>'.
'</span>'."\n";
}
// Logo ou image de la structure
if ($get_image != '') {
$sortie .= '<img class="bb_img_structure" src="'.BB_CHEMIN_IMAGES_ILLUSTRATION.$get_image.'" '.
'alt="'.'Illustration de la structure : '.$get_nom.'" />';
}
$sortie .= '</p>'."\n";
// Bloc info supplémentaires
if ($get_nbrperso > 0 OR $get_datecreation > 0 OR $get_comment != '') {
$sortie .= '<h2 class="insTitle1">'.'Informations supplémentaires'.'</h2>'."\n";
$sortie .= '<p>'."\n";
// Calcul de la date de création
if ($get_datecreation > 0) {
$sortie .= '<span class="champ_cle">'.'Date de création :'.'</span> '.
'<span class="champ_valeur">'.FormateDateYYYYMMJJ($get_datecreation).'</span>'."\n";
}
// Nbre de salariés ou de membres
if ($get_nbrperso > 0) {
if ($get_datecreation > 0) {
$sortie .= '<br />'."\n";
}
if ($get_numtypestr == 3) {
$sticker = 'salariés';
} else {
$sticker = 'membres';
}
$sortie .= '<span class="champ_cle">'.'Nombre de '.$sticker.' :'.'</span> '.
'<span class="champ_valeur">'.$get_nbrperso.'</span>'."\n";
}
// Info - commentaires
if ($get_comment != '') {
if (($get_datecreation > 0) || ($get_nbrperso > 0)) {
$sortie .= '<br />'."\n";
}
$sortie .= '<span class="champ_cle">'.'Informations complémentaires :'.'</span> '.
'<span class="champ_valeur">'.$get_comment.'</span>'."\n";
}
$sortie .= '</p>'."\n";
}
// A partir d'ici on affiche les liens de la structure
$sortie .= '<h2 class="insTitle1">'.'Liens web'.'</h2>'."\n";
$sortie .= '<p>'."\n";
$query_lk = 'SELECT '.$tbl['link'].'.* '.
'FROM '.$tbl['link'].' '.
'WHERE '.$tbl['link'].'.B_L_LKSTR = '.$tableau['str'].' '.
'AND B_L_CACHER = 0 '.
'ORDER BY B_L_TITRE';
$do_query_lk = mysql_query($query_lk) or die('<b>Erreur de requête (liens web)</b> : '.$query_lk);
$nb_lk = mysql_num_rows($do_query_lk);
if ($nb_lk == 0) {
$sortie .= 'Pas de lien web référencé.';
} else {
$o = 1;
while ($row = mysql_fetch_object($do_query_lk)) {
$idlink = $row->B_L_IDLINK;
$titrelink = $row->B_L_TITRE;
$urllink = $row->B_L_URL;
$resumlink = $row->B_L_RESUMCLE;
$comlink = $row->B_L_COMMENT;
$datelink = $row->B_L_MAJFICHE;
$get_part = $row->B_L_PARTENAIRE;
$get_ref = $row->B_L_REFERENCE;
$sortie .= '<img class="'.BB_CLASS_IMG_WEB.'" src="'.BB_IMG_WEB.'" alt="'.'Lien Web'.'" /> '."\n";
$sortie .= '<a href="'.$urllink.'" target="_blank">';
if ($titrelink != '') {
$sortie .= $titrelink;
} else {
$sortie .= $urllink;
}
$sortie .= '</a>'."\n";
if ($resumlink != '') {
$sortie .= ' - '.$resumlink;
}
if ($comlink != '') {
$sortie .= ' - '.$comlink;
}
// if ($datelink > 0) $sortie .= " [".date('d/m/Y',$datelink)."]";
if (($nb_lk - $o) > 0) {
$sortie .= '<br />'."\n";
}
if ($get_ref == 1) {
$sortie .= ' <img class="'.BB_CLASS_IMG_REFERENCE.'" src="'.BB_IMG_REFERENCE.'" alt="'.'Site Référence'.'" /> '."\n";
}
if ($get_part == 1) {
$sortie .= ' <img class="'.BB_CLASS_IMG_PARTENAIRE.'" src="'.BB_IMG_PARTENAIRE.'" alt="'.'Site Partenaire de Tela Botanica'.'" /> '."\n";
}
$o++;
}
}
$sortie .= '</p>'."\n";
mysql_free_result($do_query_lk);
// Là on affiche les Voir Aussi Structures ... si y'en a
$UnVoirAussi = new VoirAussi($tableau['str'],$tbl['str']);
if ($UnVoirAussi->NbVA > 0) {
$liste_va = $UnVoirAussi->ListerVoirAussi();
$sortie .= '<h2 class="insTitle1">'.'Voir Aussi'.'</h2>'."\n";
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'] != '') {
$sortie .= ' - '.'<i>'.$liste_va[$i]['desc'].'</i>';
}
if (($i != 0) && ($i < ($UnVoirAussi->NbVA))) {
$sortie .= '<br />'."\n";
}
}
$sortie .= '<br />'."\n";
}
// Affichage des méta données
$sortie .= '<p class="bb_txt_centre texte_inactif">'.
'Dernière mise à jour de la fiche : '.date('d/m/Y',$get_majfiche).' - fiche '.$tableau['str'].
'</p>'."\n\n";
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* 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 ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bbc_info_livre.inc.php
New file
0,0 → 1,274
<?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_livre.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Appli bb_consultation : gestion des informations avancées "livre" de Biblio Bota
*
* Ce fichier permet d'afficher les informations concernant les "livres" 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 |
// +------------------------------------------------------------------------------------------------------+
 
if ($tableau['pstart']== '') {
$tableau['pstart'] = 0;
}
 
// Ligne de proposition d'édition
if ($var_biblio['open_proposer_media'] == 1) {
$sortie .= CreateNavigBiblio('add', 'book', 'Proposer un nouveau livre', $tableau['book'], 1, $tableau);
} else {
$sortie .= '&nbsp;';
}
*/
 
// Ligne de titre
$requete = 'SELECT B_S_NOM '.
'FROM '.$tbl['str'].' '.
'WHERE B_S_IDSTR = '.$tableau['book'];
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$num_s = mysql_num_rows($resultat);
 
if ($num_s != 1) {
$sortie .= '<p class="erreur"><strong>'.'Erreur de requête LIVRE !'.'</strong>'.
' nombre de résultats (= '.$num_s.') incohérent pour la requête : '.'<br />'.$requete.'</p>';
} else {
// Récupération des infos sur la structure
$ligne = mysql_fetch_object($resultat);
$la_structure = $ligne->B_S_NOM;
mysql_free_result($resultat);
$tableau['args'] = '&amp;book='.$tableau['book'];
// Comptage du nombre de livres
$requete = 'SELECT COUNT(*) AS COMPTAGE '.
'FROM '.$tbl['item'].', '.$tbl['media'].' '.
'WHERE '.$tbl['media'].'.B_M_LKSTR = '.$tableau['book'].' '.
'AND '.$tbl['item'].'.B_I_TYPPHY = '.$def_livre.' '.
'AND '.$tbl['item'].'.B_I_IDITEM = '.$tbl['media'].'.B_M_IDMEDIA';
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$ligne = mysql_fetch_object($resultat);
$num_c = $ligne->COMPTAGE;
mysql_free_result($resultat);
global $def_livre;
$requete = 'select '.$tbl['item'].'.*, '.$tbl['media'].'.*, GEN_MON_SYMBOLE, B_AS_LIBELLE, GEN_MON_VAL1EURO, '.$tbl['domaine'].'.* '.
'FROM '.$tbl['item'].', '.$tbl['media'].', '.$tbl['monnaie'].', '.$tbl['saisie'].', '.$tbl['domaine'].', '.$tbl['domaine_lk'].' '.
'WHERE B_M_LKSTR = '.$tableau['book'].' '.
'AND B_I_TYPPHY = '.$def_livre.' '.
'AND B_I_IDITEM = B_M_IDMEDIA '.
'AND GEN_MON_IDMONNAIE = B_M_LKMONNAIE '.
'AND B_I_AUTEURSAISIE = B_AS_ID '.
'AND B_I_IDITEM = B_DL_IDITEM '.
'AND B_DL_IDDOM = B_D_ID '.
'ORDER BY B_I_AUTEURS '.
'LIMIT '.$tableau['pstart'].', '.$var_biblio['how_book'];
$resultat = mysql_query($requete) or die (BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$nb_m = mysql_num_rows($resultat);
// Titre de la page
$sortie .= '<h1>'.$la_structure.' : livres'.'</h1>'."\n";
// Récupération d'informations
if (empty($tableau['step'])) {
$tableau['step'] = $var_biblio['how_book'];
}
if (empty($tableau['how_bloc'])) {
$tableau['step'] = $var_biblio['how_book'];
}
if (empty($tableau['pend'])) {
$tableau['pend'] = $num_c;
}
if (empty($tableau['libelle'])) {
$tableau['libelle'] = 'livre';
}
if (empty($tableau['feminin'])) {
$tableau['feminin'] = 0;
}
// Affichage du nbre de résultats
$sortie .= '<p id="frag_nbre_resultat">';
$sortie .= FRAG_afficherTxtNbreResultat('bbpopup', $tableau, $nb_m, $num_c);
$sortie .= '</p>'."\n";
// Ici on fragmente en pages, pour une navigation plus facile
$frag = new fragmenteur(' - ', 10, BB_URL_COURANTE_CONSULTATION_AVANCEE);
$frag_txt = $frag->fragmente($tableau, $num_c);
if (($frag->nb_pages) > 1) {
$sortie .= '<p class="frag_navigation">'.$frag_txt.'</p>'."\n";
}
// Affichage des livres
if ($num_c == 0) {
$sortie .= '<p class="information">'.'Aucun livre indexé.'.'</p>';
} else {
$sortie .= '<ul id="bb_liste_livre">'."\n";
while ($ligne = mysql_fetch_object($resultat)) {
$id_a = $ligne->B_I_IDITEM;
$titre = $ligne->B_I_TITRE;
$auteurs = $ligne->B_I_AUTEURS;
$geo = $ligne->B_I_GEO;
$langue = $ligne->B_I_LANGUE;
$resum = $ligne->B_I_RESUMCLE;
$image = $ligne->B_I_IMAGE;
$saisie = $ligne->B_AS_LIBELLE;
$comment = $ligne->B_I_COMMENT;
$date = $ligne->B_M_DATE;
$prix = $ligne->B_M_PRIX;
$idmonnaie = $ligne->B_M_LKMONNAIE;
$monnaie = $ligne->GEN_MON_SYMBOLE;
$converter = $ligne->GEN_MON_VAL1EURO;
$volume = $ligne->B_M_VOLUME;
$edite = $ligne->B_M_EDITE;
$vendu = $ligne->B_M_VEND;
$editeur = $ligne->B_M_EDITEUR;
$collection_book = $ligne->B_M_COLLECTION;
$numcoll_book = $ligne->B_M_NUMCOLL;
$get_domaine_id = $ligne->B_D_ID;
$get_domaine_nom = $ligne->B_D_LABEL;
$sortie .= '<li>'."\n";
if ($image != '') {
$sortie .= '<img class="bb_img_livre" src="'.BB_CHEMIN_IMAGES_ILLUSTRATION.$image.'" '.
'alt="'.'Illustration du livre : '.$titre.'" />';
}
if ($get_domaine_id != 1) {
$sortie .= '<span class="texte_inactif">'.'['.$get_domaine_nom.']'.'</span>'."\n";
}
if (($auteurs == '') || ($auteurs == 'ANONYME')) {
$sortie .= 'Inconnu ou Anonyme'.' - ';
} else {
$sortie .= $auteurs.' - ';
}
$sortie .= '<strong>'.$titre.'</strong>'.' -'."\n";
$sortie .= ' Éditeur : ';
if ($editeur != '') {
$sortie .= $editeur;
} else {
$sortie .= 'inconnu';
}
$sortie .= ' - ';
if (($collection_book != '') || ($numcoll_book != '')) {
$sortie .= 'Collection : '.$collection_book.' '.$numcoll_book.' - ';
}
if ($geo != '') {
$sortie .= 'Départ./Région : '.'<em>'.$geo.'</em>'.' -';
}
if ($date > 0) {
$sortie .= ' '.DAT_formaterDateYYYYMMJJ($date).', ';
}
if ($volume != '') {
$sortie .= $volume.', ';
}
if ($prix > 0) {
$sortie .= $prix.' '.$monnaie;
}
if (($def_euro != $idmonnaie) && ($converter > 0)) {
$sortie .= ' (env. '.round($prix/$converter, 2).' &euro;)';
}
if ($langue != '') {
$sortie .= ' ('.$langue.')';
}
if (($resum != '') || ($comment != '')) {
$sortie .= ' - '.'<em>'.$comment;
if (($resum != '') && ($comment != '')) {
$sortie .= ' - ';
}
$sortie .= $resum.'</em>';
}
if ($vendu == -1) {
$sortie .= ' - '.'<img class="'.BB_CLASS_IMG_EPUISE.'" src="'.BB_IMG_EPUISE.'" alt="'.'Épuisé'.'" />';
}
if (($edite == 1) || ($vendu == 1)) {
$sortie .= ' - '.'Organisme ';
if ($edite == 1) {
$sortie .= 'éditeur';
}
if (($edite == 1) && ($vendu == 1)) {
$sortie .= ' et ';
}
if ($vendu == 1) {
$sortie .= 'vendeur';
}
$sortie .= ' de l\'article';
}
if ($saisie != '') {
$sortie .= '<span class="texte_inactif">'.' - '.'Saisie : '.$saisie.' - Art. n°'.$id_a.'.'.'</span>';
}
// Là on affiche les Voir Aussi Livres ... si y'en a
$UnVoirAussi = new VoirAussi($id_a, $tbl['article']);
if ($UnVoirAussi->NbVA > 0) {
$sortie .= '<br />'.'Consulter : ';
$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 .= '</li>'."\n";
}
$sortie .= '</ul>'."\n";
}
mysql_free_result($resultat);
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/bbc_info_article.inc.php
New file
0,0 → 1,248
<?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_article.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Appli bb_consultation : gestion des informations avancées "article" de Biblio Bota
*
* Ce fichier permet d'afficher les informations concernant les "articles" 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 |
// +------------------------------------------------------------------------------------------------------+
 
global $locusfasc;
if (!empty($locusfasc)) {
$tableau['locusfasc'] = $locusfasc;
} else {
$tableau['locusfasc'] = 0;
}
 
/*
$unex est composé de :
- [0] collection
- [1] serie
- [2] fascicule
- [3] point de départ de la requete
*/
$unex = explode ('-', $tableau['art']);
 
$requete = 'SELECT B_S_IDSTR, B_S_NOM, B_C_NOMCOMPLET, B_SER_SOUSTITRE, B_F_TITRE, B_F_DATE '.
'FROM '.$tbl['str'].', '.$tbl['collection'].', '.$tbl['serie'].', '.$tbl['fascicule'].' '.
'WHERE B_S_IDSTR = B_C_LKSTR '.
'AND B_C_CRAI = B_SER_CRAICOLL '.
'AND B_SER_CRAICOLL = B_F_CRAICOLL '.
'AND B_SER_IDSERIE = B_F_CRAISERIE '.
'AND B_F_CRAICOLL = "'.$unex[0].'" '.
'AND B_F_CRAISERIE = "'.$unex[1].'" '.
'AND B_F_NUMERO = "'.$unex[2].'"';
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$num = mysql_num_rows($resultat);
 
if ($num != 1) {
$sortie .= '<p class="erreur"><strong>'.'Erreur de requête de sélection l\'en-tête articles :'.'</strong>'.
' nombre de résultats (= '.$num.') incohérent pour la requête : '.'<br />'.$requete.'</p>';
} else {
$ligne = mysql_fetch_object($resultat);
$le_numero = $ligne->B_S_IDSTR;
$le_nom = $ligne->B_S_NOM;
$la_coll = $ligne->B_C_NOMCOMPLET;
$le_titre = $ligne->B_F_TITRE;
$la_date = $ligne->B_F_DATE;
mysql_free_result($resultat);
$tableau['args'] = '&amp;art='.$tableau['art'].'&amp;arg_0=str%3D'.$le_numero.'&amp;arg_1=coll%3D'.$le_numero.'&amp;arg_2=book%3D'.$le_numero.'&amp;arg_3=media%3D'.$le_numero;
$tableau['back'] = $unex[0].'-'.$unex[1];
// Affichage de la navigation avancée : retour aux fascicules
$sortie .= CreateNavigBiblio('goback', 'fasc', $tableau, 'Retour aux fascicules', 1);
// Affichage du titre
$sortie .= '<h1>'.$le_nom.' : articles'.'</h1>'."\n";
$sortie .= '<h2>'.'du fascicule '.$le_titre.' du périodique '.$la_coll.'</h2>'."\n";
// Comptage du total d'article
$requete = 'SELECT COUNT(*) AS COMPTAGE '.
'FROM '.$tbl['article'].', '.$tbl['item'].' '.
'WHERE B_A_CRAICOLL = "'.$unex[0].'" '.
'AND B_A_CRAISERIE = "'.$unex[1].'" '.
'AND B_A_CRAIFASC = "'.$unex[2].'" '.
'AND B_I_IDITEM = B_A_IDART '.
'AND B_I_TYPLOG = 1 '.
'AND B_I_TYPPHY = 2 '.
'AND B_I_CACHER = 0';
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$ligne = mysql_fetch_object($resultat);
$num_c = $ligne->COMPTAGE;
mysql_free_result($resultat);
// Liste des articles
if (($tableau['locusfasc'] > 0) && ($tableau['locusfasc'] <= $num_c)) {
$depart = $tableau['locusfasc'];
} else {
$depart = $tableau['pstart'];
}
if ($depart == '') {
$depart = 0;
}
$requete = 'SELECT * '.
'FROM '.$tbl['article'].', '.$tbl['item'].', '.$tbl['saisie'].', '.$tbl['domaine'].', '.$tbl['domaine_lk'].' '.
'WHERE B_A_CRAICOLL = "'.$unex[0].'" '.
'AND B_A_CRAISERIE = "'.$unex[1].'" '.
'AND B_A_CRAIFASC = "'.$unex[2].'" '.
'AND B_I_IDITEM = B_A_IDART '.
'AND B_I_TYPLOG = 1 '.
'AND B_I_TYPPHY = 2 '.
'AND B_I_CACHER = 0 '.
'AND B_I_AUTEURSAISIE = B_AS_ID '.
'AND B_I_IDITEM = B_DL_IDITEM '.
'AND B_DL_IDDOM = B_D_ID '.
'ORDER BY B_A_PAGEDEBUT, B_I_AUTEURS '.
'LIMIT '.$depart.', '.$var_biblio['how_bloc'];
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$num_a = mysql_num_rows($resultat);
// Récupération d'informations
if ($tableau['pstart'] == '') {
$tableau['pstart'] = 0;
}
$tableau['step'] = $var_biblio['how_bloc'];
$tableau['pend'] = $num_c;
$tableau['libelle'] = 'article';
$tableau['feminin'] = 0;
// Affichage du nbre de résultats
$sortie .= '<p id="frag_nbre_resultat">';
$sortie .= FRAG_afficherTxtNbreResultat('bbpopup', $tableau, $num_a, $num_c);
$sortie .= '</p>'."\n";
// Ici on fragmente en pages, pour une navigation plus facile
$frag = new fragmenteur(' - ', 10, BB_URL_COURANTE_CONSULTATION_AVANCEE);
$frag_txt = $frag->fragmente($tableau, $num_c);
if (($frag->nb_pages) > 1) {
$sortie .= '<p class="frag_navigation">'.$frag_txt.'</p>'."\n";
}
// Affichage des articles
$sortie .= '<ul id="bb_liste_article">'."\n";
while ($row_a = mysql_fetch_object($resultat)) {
$id_a = $row_a->B_I_IDITEM;
$titre = $row_a->B_I_TITRE;
$aut = $row_a->B_I_AUTEURS;
$paged = $row_a->B_A_PAGEDEBUT;
$pagef = $row_a->B_A_PAGEFIN;
$geo = $row_a->B_I_GEO;
$langue = $row_a->B_I_LANGUE;
$resum = $row_a->B_I_RESUMCLE;
$image = $row_a->B_I_IMAGE;
$aut_s = $row_a->B_AS_LIBELLE;
$domaine_id = $row_a->B_D_ID;
$domaine_nom = $row_a->B_D_LABEL;
$comment = $row_a->B_I_COMMENT;
$maj = $row_a->B_I_MAJFICHE;
$sortie .= '<li>'."\n";
if (!empty($image)) {
$sortie .= '<img class="bb_img_article" src="'.BB_CHEMIN_IMAGES_ILLUSTRATION.$image.'" '.
'alt="'.'Illustration de l\'article : '.$titre.'" />';
}
if ($domaine_id != 1) {
$sortie .= '<span class="texte_inactif">'.'['.$domaine_nom.']'.'</span>'."\n";
}
if (($aut == '') || ($aut == 'ANONYME')) {
$sortie .= 'Inconnu ou Anonyme';
} else {
$sortie .= $aut;
}
$sortie .= ' - <strong>'.$titre.'</strong>'.' - '.FormateDateYYYYMMJJ($la_date);
if (($paged > 0) && ($pagef > 0)) {
$sortie .= ', p. '.$paged;
}
if ($pagef > $paged) {
$sortie .= ' à '.$pagef;
}
if ($resum != '') {
$sortie .= ' - '.'<em>'.$resum.'</em> ';
}
if ($comment != '') {
$sortie .= ' - '.'<em>'.$comment.'</em>'."\n";
}
if ($geo != '') {
$sortie .= ' - '.'Départ./Région : '.'<em>'.$geo.'</em>'."\n";
}
if ($langue != '') {
$sortie .= ' - '.'Langue : '.$langue."\n";
}
if ($aut_s != '') {
$sortie .= '<span class="texte_inactif">'.' - '.'Saisie : '.$aut_s.' Art. n°'.$id_a.'.</span>';
}
// Là on affiche les Voir Aussi Articles ... si y'en a
$UnVoirAussi = new VoirAussi($id_a,$tbl['article']);
if ($UnVoirAussi->NbVA > 0) {
$sortie .= ' '.'-'.' '.'Consulter'.' '.':'.' ';
$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 .= '</li>'."\n";
}
$sortie .= '</ul>'."\n";
if ($num_a > 0) {
mysql_free_result($resultat);
}
}
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_consultation/configuration/bbc_config.inc.php
New file
0,0 → 1,50
<?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_config.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Configuration de l'application de consultation de Biblio Bota
*
* Ce fichier permet de stocker les valeurs de configuration spécifique à l'application
* de consultation de Biblio Bota.
*
*@package BiblioBota-Consultation
*@subpackage Configuration
//Auteur original :
*@author Jean-Charles GRANGER <tela@vecteur.org>
//Autres auteurs :
*@author Jean-Pascal MILENT <jpm@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/*Mettre ici les inclusions de fichiers*/
 
// +------------------------------------------------------------------------------------------------------+
// Définition des chemins de fichiers.
/** Constante stockant le chemin du dossier contenant les styles de l'application de consultation de Biblio Bota..*/
define('BBC_CHEMIN_STYLES', BB_CHEMIN_APPLI.'bb_consultation/presentations/styles/');
/** Constante stockant le chemin du dossier contenant la bibliothèque de code de l'application de consultation de Biblio Bota.*/
define('BBC_CHEMIN_BIBLIO', BB_CHEMIN_APPLI.'bb_consultation/bibliotheque/');
/trunk/applications/bb_synthese/langues/bbsy_langue_fr.inc.php
New file
0,0 → 1,98
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of BB-Synthèse. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar 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 General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bbsy_langue_fr.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Fichier de traduction en français de l'application Synthèse.
*
* Traduction en langue française.
*
*@package BiblioBota-Synthese
//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 |
// +------------------------------------------------------------------------------------------------------+
/** Titre de la page.*/
define('BBSY_LG_PAGE_TITRE', 'Synthèses des discussions des forums Tela Botanica');
 
/** Titre de la présentation des synthèses.*/
define('BBSY_LG_PRESENTATION_TITRE', 'Le projet synthèses des discussions');
/** Descriptif paragraphe 1. */
define('BBSY_LG_PARA_01', 'Les échanges sur des thèmes botaniques variés qui ont lieu sur les listes de discussion '.
'Tela Botanica depuis le mois de mai 1999 sont riches en contenu.');
/** Descriptif paragraphe 2. */
define('BBSY_LG_PARA_02', 'Un groupe de travail constitué de quelques membres de ces listes a décidé de prendre en '.
'main la réalisation de synthèses des échanges sur des sujets jugés intéressants.'.
' Ces synthèses permettent de garder en mémoire des échanges très spécialisés et de '.
's\'y reporter très facilement.');
/** Descriptif paragraphe 3. */
define('BBSY_LG_PARA_03', 'Les 3 niveaux de synthèses');
/** Texte alternatif de l'image des synthèses. */
define('BBSY_LG_SYNTH_IMG_ALT', '+');
/** Titre synthèse niveau non évalué. */
define('BBSY_LG_SYNTH_NIV_00_TITRE', 'Niveau non évalué');
/** Titre synthèse niveau 1. */
define('BBSY_LG_SYNTH_NIV_01_TITRE', 'Niveau 1 - collecte des messages :');
/** Info synthèse niveau 1. */
define('BBSY_LG_SYNTH_NIV_01_INFO', 'Redonne la totalité des échanges (pas de traitement autre que de rassembler tous '.
'les messages dans l\'ordre et de faire un nettoyage de forme) sur un sujet.');
/** Titre synthèse niveau 2. */
define('BBSY_LG_SYNTH_NIV_02_TITRE', 'Niveau 2 - collecte et mise en forme :');
/** Info synthèse niveau 2. */
define('BBSY_LG_SYNTH_NIV_02_INFO', 'Synthèse intermédiaire avec un peu de mise en forme.');
/** Titre synthèse niveau 3. */
define('BBSY_LG_SYNTH_NIV_03_TITRE', 'Niveau 3 - synthèse :');
/** Info synthèse niveau 3. */
define('BBSY_LG_SYNTH_NIV_03_INFO', 'Synthèse enrichie (avec additions et contrôles des références).');
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2005/04/25 13:57:32 jpm
* Mise en forme.
*
* Revision 1.1 2005/02/24 18:35:03 jpm
* Ajout du fichier de traduction de l'application synthèse.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_synthese/presentations/images/bbsy_synthese.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/applications/bb_synthese/presentations/images/bbsy_synthese.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/applications/bb_synthese/configuration/bbsy_config.inc.php
New file
0,0 → 1,94
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of BB-Synthèse. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar 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 General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bbsy_config.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Configuration de l'application Synthèse.
*
* Fichier de configuration de l'application Synthèse.
*
*@package BiblioBota-Synthese
//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 |
// +------------------------------------------------------------------------------------------------------+
/** Constante stockant le chemin du dossier contenant l'application Synthèse de Biblio Bota.*/
define('BBSY_CHEMIN_RACINE', BB_CHEMIN_APPLI.'bb_synthese/');
/** Constante stockant le chemin du dossier contenant les traductions.*/
define('BBSY_CHEMIN_LANGUES', BBSY_CHEMIN_RACINE.'langues/');
/** Constante stockant le chemin du dossier contenant la présentation (images, styles, scripts...).*/
define('BBSY_CHEMIN_PRESENTATION', BBSY_CHEMIN_RACINE.'presentations/');
/** Constante stockant le chemin du dossier contenant les images.*/
define('BBSY_CHEMIN_IMAGES', BBSY_CHEMIN_PRESENTATION.'images/');
 
// +------------------------------------------------------------------------------------------------------+
// Définition des chemins d'accès aux images.
/** Constante stockant le chemin d'accès au fichier bb_precedent.png de Biblio Bota.*/
define('BBSY_IMG_SYNTHESE', BBSY_CHEMIN_IMAGES.'bbsy_synthese.png');
/** Constante stockant le nom de la classe du fichier bb_precedent.png de Biblio Bota.*/
define('BBSY_CLASS_IMG_SYNTHESE', 'bbsy_img_synthese');
 
// +------------------------------------------------------------------------------------------------------+
// Définition des classes css
/** Constante stockant le nom de la classe du paragraphe affichant le nombre de résultat.*/
define('BBSY_CLASS_IMG_SYNTHESE', 'bbsy_img_synthese');
 
// +------------------------------------------------------------------------------------------------------+
// Paramétrage d'origine de l'application
 
// Nbre de synthèses par page
$var_biblio['how_bloc'] = 10;
 
// nom de la collection à rechercher pour ajouter un terme : ajouter une ligne
// $var_biblio['seak_string'][x] = "chaine";
// où x est un incrément de 1 de la valeur précedente (ex : $var_biblio['seak_string'][1])
$var_biblio['seek_string'][0] = 'TELABOTANICA';
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2005/02/24 18:34:55 jpm
* Ajout du fichier de config de l'application synthèse.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_synthese/bb_synthese.php
New file
0,0 → 1,286
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of BB-Synthèse. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar 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 General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bb_synthese.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Application affichant la liste des synthèses de Tela Botanica.
*
* Fournit la liste des synthèses de Tela Botanica.
*
*@package BiblioBota-Synthese
//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 |
// +------------------------------------------------------------------------------------------------------+
/** Inclusion du fichier de configuration de l'application Synthèse. */
require_once BB_CHEMIN_APPLI.'bb_synthese/configuration/bbsy_config.inc.php';
 
// Appel du fichier de traduction des textes de l'application Synthèse de Biblio Bota
if (file_exists(BBSY_CHEMIN_LANGUES.'bbsy_langue_'.BB_URL_I18N.'.inc.php')) {
/** Inclusion du fichier de traduction de l'application Synthèse. */
include_once BBSY_CHEMIN_LANGUES.'bbsy_langue_'.BB_URL_I18N.'.inc.php';
} else {
/** Inclusion du fichier de traduction fr par défaut. */
include_once BBSY_CHEMIN_LANGUES.'bbsy_langue_fr.inc.php';
}
 
// +------------------------------------------------------------------------------------------------------+
// Initialisation des variables
global $TransTab, $tbl;
$ret = '';
$ret .= '<!-- BiblioBota - Synthèse : DEBUT -->'."\n";
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
if ((isset($TransTab)) && ($TransTab != '')) {
$tableau = FRAG_decoupageChaine($TransTab);
}
 
if (empty($tableau['pstart'])) {
$tableau['pstart'] = 0;
}
 
// Début de l'applicatif
$ret .= '<h1>'.BBSY_LG_PAGE_TITRE.'</h1>'."\n";
$ret .= '<h2>'.BBSY_LG_PRESENTATION_TITRE.'</h2>'."\n";
$ret .= '<p>'.BBSY_LG_PARA_01.'</p>'."\n";
$ret .= '<p>'.BBSY_LG_PARA_02.'</p>'."\n";
$ret .= '<h2>'.BBSY_LG_PARA_03.'</h2>'."\n";
$ret .= '<h3>'.'<img src="'.BBSY_IMG_SYNTHESE.'" alt="'.BBSY_LG_SYNTH_IMG_ALT.'" /> '.BBSY_LG_SYNTH_NIV_01_TITRE.'</h3>'."\n";
$ret .= '<p>'.BBSY_LG_SYNTH_NIV_01_INFO.'</p>'."\n";
$ret .= '<h3>'.str_repeat('<img src="'.BBSY_IMG_SYNTHESE.'" alt="'.BBSY_LG_SYNTH_IMG_ALT.'" /> ', 2).BBSY_LG_SYNTH_NIV_02_TITRE.'</h3>'."\n";
$ret .= '<p>'.BBSY_LG_SYNTH_NIV_02_INFO.'</p>'."\n";
$ret .= '<h3>'.str_repeat('<img src="'.BBSY_IMG_SYNTHESE.'" alt="'.BBSY_LG_SYNTH_IMG_ALT.'" /> ', 3).BBSY_LG_SYNTH_NIV_03_TITRE.'</h3>'."\n";
$ret .= '<p>'.BBSY_LG_SYNTH_NIV_03_INFO.'</p>'."\n";
 
 
// (1) récupération des chaines id des synthèses
$seeker = '';
foreach ($var_biblio['seek_string'] as $key => $values) {
if ($key != 0) {
$seeker .= ' OR ';
}
$seeker .= ' B_A_CRAICOLL = "'.$values.'" ';
}
 
// (2) comptage du nombre de synthèses
$requete = 'SELECT COUNT(*) AS comptage '.
'FROM '.$tbl['article'].', '.$tbl['item'].' '.
'WHERE '.$seeker.' '.
'AND B_I_CACHER = 0 '.
'AND B_I_IDITEM = B_A_IDART';
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$tmp_nb = mysql_fetch_object($resultat);
$nb = $tmp_nb->comptage;
mysql_free_result($resultat);
 
// Affichage du nombre de synthèses requis
if ($nb == 0) {
$ret .= '<p>'.'Pas de synthèses référencées.'.'</p>'."\n";
}
 
$requete = 'SELECT '.$tbl['article'].'.*, '.$tbl['item'].'.*, '.$tbl['item_typlog'].'.B_IL_LABEL, '.$tbl['item_typphy'].'.B_IP_LABEL '.
'FROM '.$tbl['article'].', '.$tbl['item'].', '.$tbl['item_typlog'].', '.$tbl['item_typphy'].' '.
'WHERE '.$seeker.' '.
'AND B_I_CACHER = 0 '.
'AND B_I_TYPLOG = B_IL_ID '.
'AND B_I_TYPPHY = B_IP_ID '.
'AND B_I_IDITEM = B_A_IDART '.
'ORDER BY B_I_REM DESC '.
'LIMIT '.$tableau['pstart'].', '.$var_biblio['how_bloc'];
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$nb_s = mysql_num_rows($resultat);
 
if (empty($tableau['pend'])) {
$tableau['pend'] = $nb;
}
if (empty($tableau['pstep'])) {
$tableau['step'] = $var_biblio['how_bloc'];
}
 
// Informations sur le nombre de synthèse.
$ret .= '<p id="frag_nbre_resultat">'.FRAG_afficherTxtNbreResultat('synth', $tableau, $nb_s, $nb).'</p>'."\n";
 
// Ici on fragmente en pages, pour une navigation plus facile
$frag = new fragmenteur();
$frag_txt = $frag->fragmente($tableau, $nb);
if (($frag->nb_pages) > 1) {
$ret .= '<p class="frag_navigation">'.$frag_txt.'</p>'."\n";
}
// Fin fragmentation
 
// Affichage des résultats
// 1- listing des synthèses
// 2- dedans : listing des voir aussi
$n = 1;
$ret .= '<ul>'."\n";
while ($ligne = mysql_fetch_object($resultat)) {
$id_a = $ligne->B_A_IDART;
$titre = $ligne->B_I_TITRE;
$auteurs = $ligne->B_I_AUTEURS;
$geo = $ligne->B_I_GEO;
$langue = $ligne->B_I_LANGUE;
$resum = $ligne->B_I_RESUMCLE;
$image = $ligne->B_I_IMAGE;
$comment = $ligne->B_I_COMMENT;
$rem = $ligne->B_I_REM;
$exp_rem = explode('+', $rem);
$ret .= '<li>'."\n";
if ($image != '') {
$ret .= '<img src="'.BB_CHEMIN_IMAGES.$image.'" alt="" />';
}
// Récupération des données spécifiques stockées dans le champ REM
// $exp_rem[0] : date aaaa.mm.jj
// $exp_rem[1] : niveau de synthèse
// $exp_rem[++] : adresses mails des auteurs
// $exp_rem[2] : 1er auteur
// $exp_rem[3] : 2ème auteur etc. ...
if ($exp_rem[1] == '') {
$exp_rem[1] = 0;
}
switch ($exp_rem[1]) {
case 0 :
$alt = BBSY_LG_SYNTH_NIV_00_TITRE;
break;
case 1 :
$alt = BBSY_LG_SYNTH_NIV_01_TITRE;
break;
case 2 :
$alt = BBSY_LG_SYNTH_NIV_02_TITRE;
break;
case 3 :
$alt = BBSY_LG_SYNTH_NIV_03_TITRE;
break;
}
$ret .= str_repeat('<img class="'.BBSY_CLASS_IMG_SYNTHESE.'" src="'.BBSY_IMG_SYNTHESE.'" alt="'.BBSY_LG_SYNTH_IMG_ALT.'" /> ', $exp_rem[1]);
// Désactivation des de ma mise en tag des mails des auteurs.
/*// comptage du nombre d'auteurs
$exp_auteurs = explode (", ",$auteurs);
$tmp_count = count($exp_auteurs);
// affichage des auteurs et de leur mail s'il est précisé
$ct = 0; // variable de controle du nom de l'auteur
$tc = 2; // variable de controle du mail de l'auteur (début du listing des auteurs)
while ($ct <= $tmp_count) {
if ($exp_rem[$tc] != '') {
$ret .= "<zup href=\"mailto:$exp_rem[$tc]?subject=Synthèse $titre\">$exp_auteurs[$ct]</zup>";
} else {
$ret .= "$exp_auteurs[$ct]";
}
if ($ct < $tmp_count-1) {
$ret .= ", ";
}
$ct++;
$tc++;
}*/
$ret .= $auteurs;
$ret .= ' - '.'<b>'.$titre.'</b>';
if ($exp_rem[0] > 0) {
$ret .= ' - '.FormateDateYYYYMMJJ($exp_rem[0]);
}
if ($resum != '') {
$ret .= ' - '.'<i>'.$resum.'</i>';
}
if ($comment != '') {
$ret .= ' - '.'<i>'.$comment.'</i>';
}
if ($geo != '') {
$ret .= ' - '.'Départ./Région : '.'<i>'.$geo.'</i>';
}
if ($langue != '') {
$ret .= ' - '.$langue;
}
// Recherche des liens vers la synthèse
// Là on affiche les Voir Aussi Fascicules ... si y'en a
$UnVoirAussi = new VoirAussi($id_a, $tbl['article']);
if ($UnVoirAussi->NbVA > 0) {
$liste_va = $UnVoirAussi->ListerVoirAussi();
$ret .= ' - '.'Consulter : ';
for ($i = 0; $i == (($UnVoirAussi->NbVA) - 1); $i++) {
$ret .= '<img class="'.BB_CLASS_IMG_ICONE.'" src="'.$liste_va[$i]['icon_src'].'" alt="'.$liste_va[$i]['icon_alt'].'" /> ';
$ret .= '<a '.$liste_va[$i]['target'].'>'.$liste_va[$i]['texte'].'</a>';
if ($liste_va[$i]['desc'] != '') {
$ret .= ' - '.'<i>'.$liste_va[$i]['desc'].'</i>';
}
}
}
// fin des Voir Aussi Fascicule
if ($n < $nb_s) {
$ret .= '<br /><br />';
}
$ret .= "\n\n";
$n++;
$ret .= '</li>'."\n";
}
$ret .= '</ul>'."\n";
mysql_free_result($resultat);
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$ret .= '<!-- BiblioBota - Synthèse : FIN -->'."\n";
$sortie = $ret;
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/04/25 13:58:15 jpm
* Résolution de problèmes liés à la base de données et simplification de l'affichage des images représentant le niveau des synthèses.
*
* Revision 1.2 2005/03/01 15:18:48 jpm
* Ajout de commentaire html de début et fin d'appli.
*
* Revision 1.1 2005/02/24 18:34:41 jpm
* Ajout de l'application synthèse.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_admin/bibliotheque/bba_droit_mail.fonct.php
New file
0,0 → 1,267
<?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: bba_droit_mail.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Fonctions de gestion des mails et des droits de l'application administration de Biblio Bota.
*
* Contient des fonctions de gestion des mails et des droits d'accès.
*
*@package BiblioBota-Administration
*@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.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/*Mettre ici les inclusions de fichiers*/
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
/*Mettre ici la liste de fonctions.*/
/* ***********************************
boolean create_mail($from,$to,$to_cc="",$to_bcc="",$subject="",$body,$head="",$format="plain")
permet de générer un mail correctement formaté
 
ENTREE :
- string array $from : adresse de l'expéditeur ; tableau texte à deux entrées $from['name'] et $from['address']
- string array $to : adresses des destinataires ; tableau texte à deux entrées $to[$i]['name'] et $to[$i]['address']
- string array $to_cc : adresses mises en copies conformes ; tableau texte à deux entrées $to_cc[$i]['name'] et $to_cc[$i]['address']
- string array $to_bcc : adresses mises en copies conformes cachées ; tableau texte à deux entrées $to_bcc[$i]['name'] et $to_bcc[$i]['address']
- string $subject : sujet du mail
- string $body : contenu du mail
- string array $head : ajouter des lignes d'en-têtes au mail ; tableau texte à deux entrées $head[$i]['title'] et $head[$i]['value']. Exemple : $head[0]['title']="Reply-To" et $head[0]['value']="\"Tela Botanica\"<accueil@tela-botanica.org>\n"
- string $format : format du mail (valeurs possibles : plain [défaut], html)
 
SORTIE : void
*********************************** */
function create_mail($from,$to,$to_cc="",$to_bcc="",$subject="",$body,$head="",$format="plain")
{
// on initialise $head avec en un tableau avec une valeur bidon
// s'il est vide, afin de pouvoir utiliser in_array plus loin
if ($head == ""){
$head['novalue'] = "";
}
 
// on formate correctement le champ from
if (empty($from['name'])){
$from['name'] = $from['address'];
}
$from_string = "\"".$from['name']."\" <".$from['address'].">";
 
// on créé une chaine contenant les adresses To
 
$to_string = "";
if ($to != ""){
$to_string = "";
$nb_to = count($to);
$i = 0;
while ($i <= ($nb_to-1)){
if (!empty($to[$i]['name'])){
$le_nom = $to[$i]['name'];
}
else{
$le_nom = $to[$i]['address'];
}
$le_mail = $to[$i]['address'];
if ($le_mail != ""){
$to_string .= "\"$le_nom\" <$le_mail>";
if ($i < ($nb_to-1)){
$to_string .= ",\n";
}
else{
$to_string .= "\n";
}
}
$i++;
}
}
 
// on créé une chaine contenant les adresses CC
 
$cc_string = "";
if ($to_cc != ""){
$cc_string = "Cc: ";
$nb_cc = count($to_cc);
$i = 0;
while ($i <= ($nb_cc-1)){
if (!empty($to_cc[$i]['name'])){
$le_nom = $to_cc[$i]['name'];
}
else{
$le_nom = $to_cc[$i]['address'];
}
$le_mail = $to_cc[$i]['address'];
if ($le_mail != ""){
$cc_string .= "\"$le_nom\" <$le_mail>";
if ($i < ($nb_cc-1)){
$cc_string .= ",\n";
}
else{
$cc_string .= "\n";
}
}
$i++;
}
}
// on créé une chaine contenant les adresses BCC
$bcc_string = "";
if ($to_bcc != ""){
$bcc_string = "Bcc: ";
$nb_bcc = count($to_bcc);
$i = 0;
while ($i <= ($nb_bcc-1)){
if (!empty($to_bcc[$i]['name'])){
$le_nom = $to_bcc[$i]['name'];
}
else{
$le_nom = $to_bcc[$i]['address'];
}
$le_mail = $to_bcc[$i]['address'];
if ($le_mail != ""){
$bcc_string .= "\"$le_nom\" <$le_mail>";
if ($i < ($nb_bcc-1)){
$bcc_string .= ",\n";
}
else{
$bcc_string .= "\n";
}
}
$i++;
}
}
// on créé une chaine contenant le format
$format_string = "Content-Type: text/$format;\n charset=\"iso-8859-1\"";
// on créé une chaine contenant l'en-tête
// définition de l'en-tête par defaut
$head_def['Return-Path'] = "accueil@tela-botanica.org";
$head_def['Organization'] = "Tela Botanica";
$head_def['MIME-Version'] = "1.0";
$head_def['X-Priority'] = "3";
$head_def['X-Mailer'] = "Tela Botanica / PHP";
$head_def['Reply-To'] = $from_string;
$head_string = "";
// on construit l'entete à partir de l'entete par defaut, sauf si une valeur existe dans $head
$head_string .= $format_string."\n";
foreach($head_def as $key => $value){
if ((!isset($head[$key])) && ($value != "")){
$head_string .= "$key: $value\n";
}
}
// on ajoute l'entete supplémentaire
if ($head != ""){
foreach($head as $key => $value){
if ($value != ""){
$head_string .= "$key: $value\n";
}
}
}
$head_string .= $cc_string;
$head_string .= $bcc_string;
// fin de l'entete
// envoi du mail
//echo "De : ".$from_string."<BR><BR>".$to_string."<BR><BR>".$cc_string."<BR><BR>".$bcc_string."<BR><BR>Message: ".$body."<BR><BR>".$head_string;
return mail($to_string,$subject,$body,$head_string);
}
/* ***********************************
array get_his_rights($table,$appli,$user)
récupère les droits d'un utilisateur sur un appli
Entrée :
- string $table : nom de la table où sont les données d'autorisations
- string $appli : nom de l'appli recherché
- int $user : id de la personne pour qui on veut récupérer les droits
 
Sortie : ARRAY de la forme :
$table['nom_du_droit'] = "level pour ce droit (un entier)"
Dans le programme appelant, il suffit de faire if (isser($table['nom_du_droit']))
pour savoir un un utilisateur dispose d'un droit particulier
*********************************** */
 
function get_his_rights($table,$appli,$user)
{
$query = "select GEN_AUT_DROIT, GEN_AUT_LVL, GEN_AUT_PARAM from $table where GEN_AUT_USER = $user AND GEN_AUT_APPLI = '$appli'";
$resu = mysql_query($query) or die("<B>ERREUR !!</B>. Echec de la récupéreration des droits de l'utilisateur : $query");
$droits[0] = "";
while ($row = mysql_fetch_object($resu)){
$nom_droit = $row->GEN_AUT_DROIT;
$lvl_droit = $row->GEN_AUT_LVL;
$param_droit = $row->GEN_AUT_PARAM;
if (($nom_droit != "")&&($lvl_droit >= 0)){
$droits[$nom_droit]['lvl'] = $lvl_droit;
$droits[$nom_droit]['param'] = $param_droit;
}
}
mysql_free_result($resu);
return $droits;
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2004/09/14 11:12:27 jpm
* Ajout des fonctions de gestion des mails et des droits d'accès de BiblioBota admin.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_organisme_carto/bb_organisme_carto.php
New file
0,0 → 1,252
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of BiblioBota - Organisme Carto. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar 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 General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bb_organisme_carto.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Application affichant une cartographie des organismes
*
* Fournit une carte des organimes liés à la botanique stockés dans la base Biblio Bota.
*
*@package BiblioBota-OrganismeCarto
//Auteur original :
*@author Jean-Charles GRANGER <tela@vecteur.org>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@clapas.org>
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/** Inclusion du fichier de configuration de l'application Organisme Carto. */
require_once BB_CHEMIN_APPLI.'bb_organisme_carto/configuration/bboc_config.inc.php';
 
// Appel du fichier de traduction des textes de l'application Organisme Carto de Biblio Bota
if (file_exists(BBOC_CHEMIN_LANGUES.'bboc_langue_'.BB_URL_I18N.'.inc.php')) {
/** Inclusion du fichier de traduction de l'application Organisme Carto. */
include_once BBOC_CHEMIN_LANGUES.'bboc_langue_'.BB_URL_I18N.'.inc.php';
} else {
/** Inclusion du fichier de traduction fr par défaut. */
include_once BBOC_CHEMIN_LANGUES.'bboc_langue_fr.inc.php';
}
 
/** Inclusion du fichier comportant des fonctions fournissant des informations pour l'application Organisme Carto.*/
include_once BBOC_CHEMIN_BIBLIO.'bboc_information.fonct.php';
 
/** Inclusion de la bibliothèque Cartographie. */
require_once BBOC_CHEMIN_BIBLIO_CARTO.'carto_carte.class.php';
 
// +------------------------------------------------------------------------------------------------------+
// Initialisation des variables
$res = '';
$res .= '<!-- BiblioBota - Organisme Carto : DEBUT -->'."\n";
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// +------------------------------------------------------------------------------------------------------+
// Instanciation du tableau contenant les champs de la table action
$info_table_action['nom_table_action'] = BB_BDD_NOM_CARTO.'.carto_ACTION';
$info_table_action['nom_chp_id_carte'] = 'CA_ID_Carte';
$info_table_action['nom_chp_id_zg_action'] = 'CA_ID_Zone_geo';
$info_table_action['nom_chp_type_zg'] = 'CA_Type_zone';
$info_table_action['nom_chp_action'] = 'CA_Action';
$info_table_action['nom_chp_id_carte_destination'] = 'CA_ID_Carte_destination';
 
// +------------------------------------------------------------------------------------------------------+
$requete_01 = 'SELECT DISTINCT CP_ID_Continent, count(CP_ID_Continent) as nbr '.
'FROM '.BB_BDD_NOM.'.biblio_str, '.BB_BDD_NOM_CARTO.'.carto_PAYS '.
'WHERE B_S_PAYS = CP_ID_Pays '.
'AND CP_ID_Continent <> 0 '.
'GROUP BY CP_ID_Continent';
 
$resultat_01 = mysql_query($requete_01) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete_01));
 
$tableau_asso_continent = array();
 
while ($ligne_01 = mysql_fetch_object($resultat_01)) {
$tableau_asso_continent[$ligne_01->CP_ID_Continent] = $ligne_01->nbr;
}
 
$info_continent['nom_table_zone'] = BB_BDD_NOM_CARTO.'.carto_CONTINENT';
$info_continent['nom_chp_id_zone'] = 'CC_ID_Continent';
$info_continent['nom_chp_nom_zone'] = 'CC_Intitule_continent';
$info_continent['nom_chp_rouge'] = 'CC_Couleur_R';
$info_continent['nom_chp_vert'] = 'CC_Couleur_V';
$info_continent['nom_chp_bleu'] = 'CC_Couleur_B';
$info_continent['nom_chp_zone_sup'] = '';
$info_continent['tableau_valeurs_zone'] = $tableau_asso_continent;
 
// +------------------------------------------------------------------------------------------------------+
$requete_02 = 'SELECT CC_ID_Continent '.
'FROM '.BB_BDD_NOM_CARTO.'.carto_CONTINENT';
 
$resultat_02 = mysql_query ($requete_02) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete_02));
 
while ($ligne_02 = mysql_fetch_object($resultat_02)) {
$requete_03 = 'SELECT CP_ID_Pays, count(B_S_PAYS) as nbr '.
'FROM '.BB_BDD_NOM.'.biblio_str, '.BB_BDD_NOM_CARTO.'.carto_PAYS '.
'WHERE B_S_PAYS = CP_ID_Pays '.
'AND CP_ID_Continent = "'.$ligne_02->CC_ID_Continent.'" '.
'GROUP BY B_S_PAYS';
$resultat_03 = mysql_query($requete_03) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete_03));
$tableau_asso_pays = array();
while ($ligne_03 = mysql_fetch_object($resultat_03)) {
$tableau_asso_pays[$ligne_03->CP_ID_Pays] = $ligne_03->nbr;
}
$info_pays[$ligne_02->CC_ID_Continent]['nom_table_zone'] = BB_BDD_NOM_CARTO.'.carto_PAYS';
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_id_zone'] = 'CP_ID_Pays';
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_nom_zone'] = 'CP_Intitule_pays';
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_rouge'] = 'CP_Couleur_R';
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_vert'] = 'CP_Couleur_V';
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_bleu'] = 'CP_Couleur_B';
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_zone_sup'] = 'CP_ID_Continent';
$info_pays[$ligne_02->CC_ID_Continent]['tableau_valeurs_zone'] = $tableau_asso_pays;
}
 
// +------------------------------------------------------------------------------------------------------+
$requete_04 = 'SELECT CD_ID_Departement, COUNT(CD_ID_Departement) AS nbr '.
'FROM '.BB_BDD_NOM.'.biblio_str, '.BB_BDD_NOM_CARTO.'.carto_DEPARTEMENT '.
'WHERE B_S_PAYS = "fr" '.
'AND CD_ID_Departement = IF (SUBSTRING(B_S_CODEPOSTAL,1,2)<>"97", SUBSTRING(B_S_CODEPOSTAL, 1,2), SUBSTRING(B_S_CODEPOSTAL,1,3)) '.
'GROUP BY CD_ID_Departement';
$resultat_04 = mysql_query($requete_04) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete_04));
 
$tableau_asso_dpt_france = array();
 
while ($ligne_04 = mysql_fetch_object($resultat_04)) {
$tableau_asso_dpt_france[$ligne_04->CD_ID_Departement] = $ligne_04->nbr;
}
 
$info_dpt_france['nom_table_zone'] = BB_BDD_NOM_CARTO.'.carto_DEPARTEMENT';
$info_dpt_france['nom_chp_id_zone'] = 'CD_ID_Departement';
$info_dpt_france['nom_chp_nom_zone'] = 'CD_Intitule_departement';
$info_dpt_france['nom_chp_rouge'] = 'CD_Couleur_R';
$info_dpt_france['nom_chp_vert'] = 'CD_Couleur_V';
$info_dpt_france['nom_chp_bleu'] = 'CD_Couleur_B';
$info_dpt_france['nom_chp_zone_sup'] = 'CD_ID_Pays';
$info_dpt_france['tableau_valeurs_zone'] = $tableau_asso_dpt_france;
 
// On cree tout d'abords l'arborescence
$monde = new Carto_Carte('continent', '', 'Monde', 'monde_masque5c.png', 'monde5c.png', BBOC_CHEMIN_CARTE, $info_continent, $info_table_action);
 
$monde->historique_cartes = isset($GLOBALS['historique_cartes']) ? $GLOBALS['historique_cartes'] : '';
$monde->image_x = isset($GLOBALS['image_x']) ? $GLOBALS['image_x'] : '';
$monde->image_y = isset($GLOBALS['image_y']) ? $GLOBALS['image_y'] : '';
$monde->liste_zone_carte = isset($GLOBALS['liste_zone_carte']) ? $GLOBALS['liste_zone_carte'] : '';
$monde->url = $GLOBALS['_BIBLIO_']['url']->getURL();
 
foreach ($info_pays as $cle => $valeur) {
$requete_05 = 'SELECT CDC_Titre_carte, CDC_ID_Carte, CDC_Carte_fond, CDC_Carte_masque, CDC_ID_Zone_geo_carte '.
'FROM '.BB_BDD_NOM_CARTO.'.carto_DESCRIPTION_CARTE, '.BB_BDD_NOM_CARTO.'.carto_ACTION '.
'WHERE CA_ID_Zone_geo = "'.$cle.'" '.
'AND CA_Type_zone = 1 '.
'AND CA_ID_Carte_destination = CDC_ID_Carte';
$resultat_05 = mysql_query($requete_05) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete_05));
$resultat_05_nbre = mysql_num_rows($resultat_05);
 
if ($resultat_05_nbre > 0) {
$ligne_05 = mysql_fetch_object($resultat_05);
$monde->ajouterFils( $ligne_05->CDC_ID_Carte, $ligne_05->CDC_ID_Zone_geo_carte, $ligne_05->CDC_Titre_carte,
$ligne_05->CDC_Carte_masque, $ligne_05->CDC_Carte_fond, $valeur, $info_table_action);
}
}
 
$monde->fils['europe']->ajouterFils('france', 'fr', 'France' ,'france_masque.png', 'france.png', $info_dpt_france, $info_table_action);
 
// Une fois l'arborescence créée on lance la méthode donnerFormulaireImage() pour récuperer le formulaire de la carte
// (dans $img). S'il n'y a pas de carte à afficher donnerFormulaireImage() renvoi false. On peut alors récupérer
// le niveau ou on en est grâce à $monde->historique (du type continent*namerique*ca).
$img = $monde->donnerFormulaireImage();
 
// Test d'img
if (!$img ) {
/** Inclusion du fichier d'affichage des infos sur les organismes d'une zone. */
include_once BBOC_CHEMIN_RACINE.'bboc_organisme_liste.inc.php';
} else {
// Construction du titre de la carte et de l'historique de navigation dans les cartes
$historique_carte = new Carto_Historique($monde, '&gt;', 'lien_non_souligne');
$tab = explode('*',$monde->historique);
$id_carte = $tab[(count($tab)-1)];
$requete_06 = 'SELECT CDC_Titre_carte, CDC_Type_zone_carte, CDC_ID_Zone_geo_carte '.
'FROM '.BB_BDD_NOM_CARTO.'.carto_DESCRIPTION_CARTE '.
'WHERE CDC_ID_Carte = "'.$id_carte.'"';
$resultat_06 = mysql_query($requete_06) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete_06));
$ligne_06 = mysql_fetch_object($resultat_06);
$structure_nbre = bboc_consulterNbreStructure($id_carte, $ligne_06->CDC_Type_zone_carte, $ligne_06->CDC_ID_Zone_geo_carte);
$titre = '';
if ($structure_nbre == 0) {
$titre .= $ligne_06->CDC_Titre_carte.' : aucun organisme répertorié';
} else if ($structure_nbre == 1) {
$titre .= $ligne_06->CDC_Titre_carte.' : '.$structure_nbre.' organisme répertorié';
} else {
$titre .= $ligne_06->CDC_Titre_carte.' : '.$structure_nbre.' organismes répertoriés';
}
// Sortie XHTML
$res .= '<h1 class="titre1_cartographie">'.$titre.'</h1>'."\n";
$res .= '<p><strong>'.$historique_carte->afficherHistoriqueCarte().'</strong></p>'."\n";
$res .= '<h2 class="titre2_cartographie">Cliquez sur une zone de la carte pour zoomer.</h2>'."\n";
$res .= '<p>La couleur est proportionnelle au nombre d\'organisations.'."\n";
$res .= $img;
$res .= '<h2 class="titre2_cartographie">'.'Avertissement et déni de responsabilité : '.'</h2>'."\n";
$res .= '<p>'.'La représentation et l\'utilisation des frontières, des noms géographiques et autres données employés '."\n".
'sur les cartes et utilisés dans les listes, les tableaux, les documents et les bases de données de ce site '."\n".
'ne sont pas garanties sans erreurs, de même qu\'elles n\'engagent pas la responsabilité de l\'association '."\n".
'ni n\'impliquent de reconnaissance officielle de sa part.'.'</p>'."\n";
}
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$res .= '<!-- BiblioBota - Organisme Carto : FIN -->'."\n";
$sortie = $res;
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.4 2005/05/30 09:10:26 jpm
* Ajout de class aux titres!
*
* Revision 1.3 2005/05/17 10:10:08 jpm
* Correction des bogues avant mise en ligne du site v4.
*
* Revision 1.2 2005/04/13 10:12:29 jpm
* Ajout de la constante indiquant la bdd des tables de la carto.
*
* Revision 1.1 2005/03/01 15:19:17 jpm
* Ajout des fichiers principaux de l'application Organisme Carto de Biblio Bota.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_organisme_carto/bboc_organisme_liste.inc.php
New file
0,0 → 1,258
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of BiblioBota - Organisme Carto. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar 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 General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bboc_organisme_liste.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Liste des organismes d'une zone géographique.
*
* Fichier fournissant la liste des organismes présents dans une zone géographique donnée.
*
*@package BiblioBota-OrganismeCarto
//Auteur original :
*@author Jean-Charles GRANGER <tela@vecteur.org>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@clapas.org>
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$res .= '<!-- BiblioBota - Organisme Carto Liste : DEBUT -->'."\n";
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$tabmonde = explode ('*', $monde->historique);
// +------------------------------------------------------------------------------------------------------+
// Nous avons à faire à un pays.
if (count($tabmonde) == 3) {
$argument = $tabmonde[2];
$query = 'SELECT * '.
'FROM gen_COUNTRY '.
'WHERE GC_ID = "'.$argument.'"';
$result = mysql_query($query);
$row = mysql_fetch_object($result) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query));
$capitale = $row->GC_CAPITAL;
$pays = $row->GC_NAME;
$monde->nom = $monde->nom.'*'.$pays;
// Titre de la page
$query2 = 'SELECT COUNT(B_S_IDSTR) AS nbr '.
'FROM biblio_str '.
'WHERE B_S_PAYS = "'.$argument.'"';
$result2 = mysql_query($query2);
$row2 = mysql_fetch_object($result2) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query2));
$res .= '<h1 class="titre1_cartographie">';
if ($row2->nbr == 0) {
$res .= $pays.' ('.$capitale.') : aucun organisme répertorié.';
} else if ($row2->nbr==1) {
$res .= $pays.' ('.$capitale.') : '.$row2->nbr.' organisme répertorié';
} else {
$res .= $pays.' ('.$capitale.') : '.$row2->nbr.' organismes répertoriés';
}
$res .= '</h1>'."\n";
// Chemin historique navigation dans les cartes
$tabonglet = explode('*', $monde->historique);
$tabnom = explode('*', $monde->nom);
$res .= '<p><strong>'."\n";
foreach ($tabonglet as $key => $value) {
if ($key == 0) {
$chemin = $value;
$value = 'monde';
$res .= '<a class="lien_non_souligne" href="'.$monde->url.'&amp;historique_cartes='.$chemin.'">'.
'&nbsp;&gt;&nbsp;'.$tabnom[$key].
'</a>';
} else if ($key == (count($tabonglet) - 1)) {
$res .= '<a class="lien_non_souligne">'.
'&nbsp;&gt;&nbsp;'.$pays.
'</a>';
} else {
$chemin .= '*'.$value;
$res .= '<a class="lien_non_souligne" href="'.$monde->url.'&amp;historique_cartes='.$chemin.'">'.
'&nbsp;&gt;&nbsp;'.$tabnom[$key].
'</a>';
}
}
$res .= '</strong></p>'."\n";
// Création de la liste des organismes de la zone géographique.
$query = 'SELECT * '.
'FROM biblio_str, biblio_str_type '.
'WHERE B_S_PAYS = "'.$argument.'" '.
'AND B_S_CACHER = 0 '.
'AND B_S_TYPESTR = B_TYPSTR_ID '.
'ORDER BY B_S_NOM';
$result = mysql_query($query);
$nbr_final = mysql_num_rows($result) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query));
$res .= '<h1 class="titre1_cartographie">'.'Liste des organismes :'.'</h1>'."\n";
$res .= '<ul>'."\n";
$i = 0;
while ($row = mysql_fetch_object($result)) {
$get_idstr = $row->B_S_IDSTR;
$get_name = $row->B_S_NOM;
$get_cp = $row->B_S_CODEPOSTAL;
$get_ville = $row->B_S_VILLE;
$get_date = $row->B_S_MAJFICHE;
$get_categ = $row->B_S_TYPESTR;
$get_categ_nom = $row->B_TYPSTR_LABEL;
$res .= '<li>';
$res .= '<strong>'.$get_name.'</strong> ';
if ($get_ville != '') {
$res .= '('.$get_ville.')';
}
$res .= ' - ';
if ($get_categ > 0) {
$res .= $get_categ_nom;
}
/* Cross Biblio est le module qui permet d'avoir accès au popup transversal BBPOPUP */
if ($GLOBALS['var_biblio']['open_biblio_str'] == true) {
$res .= ' - <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.'">'.
'Plus d\'infos'.'</a>';
}
$res .= '</li>'."\n";
$i++;
}
$res .= '</ul>'."\n";
// +------------------------------------------------------------------------------------------------------+
// Nous avons à faire à un département français.
} else if (count($tabmonde) == 4) {
$argument = $tabmonde[3];
$query = 'SELECT *'.
' FROM gen_FRENCH_DPT'.
' WHERE GFD_ID = "'.$argument.'"';
$result = mysql_query($query);
$row = mysql_fetch_object($result) or die (BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query));
$nom = $row->GFD_NAME;
// Titre de la page
$query2 = ' SELECT count(B_S_IDSTR) as nbr'.
' FROM biblio_str'.
' WHERE if (substring(B_S_CODEPOSTAL,1,2)<>"97", substring(B_S_CODEPOSTAL, 1,2), substring(B_S_CODEPOSTAL,1,3)) = '.$argument.
' AND B_S_PAYS="fr"';
$result2 = mysql_query($query2);
$row2 = mysql_fetch_object($result2) or die (BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query2));
$res .= '<h1 class="titre1_cartographie">';
if ($row2->nbr == 0) {
$res .= $nom.' : aucun organisme répertoriée';
} else if ($row2->nbr == 1) {
$res .= $nom.' : '.$row2->nbr.' organisme répertorié';
} else {
$res .= $nom.' : '.$row2->nbr.' organismes répertoriés';
}
$res .= '</h1>'."\n";
// Chemin historique navigation dans les cartes
$tabonglet = explode ('*', $monde->historique);
$tabnom = explode ('*', $monde->nom);
$res .= '<p><strong>'."\n";
foreach ($tabonglet as $key => $value) {
if ($key == 0) {
$chemin = $value;
$value = 'monde';
$res .= '<a class="lien_non_souligne" href="'.$monde->url.'&amp;historique_cartes='.$chemin.'">'.
'&nbsp;&gt;&nbsp;'.$tabnom[$key].
'</a>';
} else if ($key == (count($tabonglet) - 1)) {
$res .= '<a class="lien_non_souligne">'.
'&nbsp;&gt;&nbsp;'.$nom.
'</a>';
} else {
$chemin .= '*'.$value;
$res .= '<a class="lien_non_souligne" href="'.$monde->url.'&amp;historique_cartes='.$chemin.'">'.
'&nbsp;&gt;&nbsp;'.$tabnom[$key].
'</a>';
}
}
$res .= '</strong></p>'."\n";
// Création de la liste des organismes de la zone géographique.
$query = 'SELECT *'.
' FROM biblio_str, biblio_str_type'.
' WHERE B_S_PAYS="fr"'.
' AND if (substring(B_S_CODEPOSTAL,1,2) <> "97", substring(B_S_CODEPOSTAL, 1,2), substring(B_S_CODEPOSTAL,1,3)) = '.$argument.
' AND B_S_CACHER = 0'.
' AND B_S_TYPESTR = B_TYPSTR_ID'.
' ORDER BY B_S_NOM';
$result = mysql_query($query);
$nbr_final = mysql_num_rows($result) or die (BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query));
$res .= '<h1 class="titre1_cartographie">'.'Liste des organismes :'.'</h1>'."\n";
$res .= '<ul>'."\n";
$i = 0;
while ($row = mysql_fetch_object($result)) {
$get_idstr = $row->B_S_IDSTR;
$get_name = $row->B_S_NOM;
$get_cp = $row->B_S_CODEPOSTAL;
$get_ville = $row->B_S_VILLE;
$get_date = $row->B_S_MAJFICHE;
$get_categ = $row->B_S_TYPESTR;
$get_categ_nom = $row->B_TYPSTR_LABEL;
$res .= '<li>';
$res .= '<strong>'.$get_name.'</strong> ';
if ($get_ville != '') {
$res .= '('.$get_ville.')';
}
$res .= ' - ';
if ($get_categ > 0) {
$res .= $get_categ_nom;
}
/* Cross Biblio est le module qui permet d'avoir accès au popup transversal BBPOPUP */
if ($GLOBALS['var_biblio']['open_biblio_str'] == true) {
$res .= ' - <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.'">'.
'Plus d\'infos'.'</a>';
}
$res .= '</li>'."\n";
$i++;
}
$res .= '</ul>'."\n";
}
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$res .= '<!-- BiblioBota - Organisme Carto Liste : FIN -->'."\n";
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2005/05/30 09:14:04 jpm
* Ajout de class aux titres!
*
* Revision 1.1 2005/03/01 15:19:17 jpm
* Ajout des fichiers principaux de l'application Organisme Carto de Biblio Bota.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_organisme_carto/configuration/bboc_config.inc.php
New file
0,0 → 1,79
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of BiblioBota - Organisme Carto. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar 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 General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bboc_config.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Configuration de l'application Organisme Carto.
*
* Fichier de configuration de l'application Organisme Carto.
*
*@package BiblioBota-OrganismeCarto
//Auteur original :
*@author Jean-Pascal MILCENT <jpm@clapas.org>
//Autres auteurs :
*@author Jean-Charles GRANGER <tela@vecteur.org>
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// +------------------------------------------------------------------------------------------------------+
// Définition des chemins d'accès
/** Constante stockant le chemin du dossier contenant l'application Organisme Carto de Biblio Bota.*/
define('BBOC_CHEMIN_RACINE', BB_CHEMIN_APPLI.'bb_organisme_carto/');
/** Constante stockant le chemin du dossier contenant les traductions.*/
define('BBOC_CHEMIN_LANGUES', BBOC_CHEMIN_RACINE.'langues/');
/** Constante stockant le chemin du dossier bibliothèque.*/
define('BBOC_CHEMIN_BIBLIO', BBOC_CHEMIN_RACINE.'bibliotheque/');
/** Constante stockant le chemin du dossier de la bibliothèque cartographique.*/
define('BBOC_CHEMIN_BIBLIO_CARTO', BB_CHEMIN_BIBLIO_CARTO);
/** Constante stockant le chemin vers le dossier des images png de la bibliothèque cartographique.*/
define('BBOC_CHEMIN_CARTE', BB_CHEMIN_CARTE);
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2005/03/01 16:01:05 jpm
* Transfère de la bibliothèque cartographique dans le dossier bibliothèque général de Biblio Bota.
*
* Revision 1.1 2005/03/01 15:20:00 jpm
* Ajout du fichier de config de l'application Organisme Carto de Biblio Bota.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_organisme_carto/bibliotheque/bboc_information.fonct.php
New file
0,0 → 1,115
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of BiblioBota - Organisme Carto. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar 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 General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bboc_information.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Fonctions de l'application Organisme Carto.
*
* Fichier de fonctions fournissant des informations de l'application Organisme Carto.
*
*@package BiblioBota-OrganismeCarto
//Auteur original :
*@author Jean-Charles GRANGER <tela@vecteur.org>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@clapas.org>
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
/**
* Fonction bboc_consulterNbreStructure() - Donne le nombre de structure.
*
* La fonction bboc_consulterNbreStructure() renvoit une phrase complete
* indiquant le nombre de structure dans la carte passée en argument
*
* @param int l'identifiant de la carte.
* @param int l'identifiant du type de zones contenues dans la carte.
* @param int l'identifiant de la zone géo de la carte.
* @return string une chaine XHTML donnant le nombre de structure.
*/
function bboc_consulterNbreStructure($id_carte, $type_zone_carte, $id_zone_geo_carte)
{
switch ($type_zone_carte){
case '0' :
$requete =
'SELECT count(B_S_IDSTR) as nbr '.
'FROM '.BB_BDD_NOM.'.biblio_str '.
'WHERE B_S_CACHER = 0';
break;
case '1' :
$requete =
'SELECT count(CP_ID_Continent) as nbr '.
'FROM '.BB_BDD_NOM.'.biblio_str, '.BB_BDD_NOM_CARTO.'.carto_PAYS '.
'WHERE B_S_CACHER = 0 '.
'AND B_S_PAYS = CP_ID_Pays '.
'AND CP_ID_Continent <> 0 '.
'AND CP_ID_Continent = "'.$id_zone_geo_carte.'"';
break;
case '2' :
$requete =
'SELECT count(B_S_IDSTR) as nbr '.
'FROM '.BB_BDD_NOM.'.biblio_str '.
'WHERE B_S_CACHER = 0 '.
'AND B_S_PAYS = "fr"';
break;
}
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$ligne = mysql_fetch_object($resultat);
return $ligne->nbr;
}
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/05/17 10:10:08 jpm
* Correction des bogues avant mise en ligne du site v4.
*
* Revision 1.2 2005/04/13 10:12:34 jpm
* Ajout de la constante indiquant la bdd des tables de la carto.
*
* Revision 1.1 2005/03/01 15:19:44 jpm
* Ajout du fichier contenant les fonctions permettant de fournir des informations.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_organisme_carto/langues/bboc_langue_fr.inc.php
New file
0,0 → 1,64
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of BiblioBota - Organisme Carto. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar 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 General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bboc_langue_fr.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Traduction de l'application Organisme Carto : fr.
*
* Fichier de traduction en français de l'application Organisme Carto.
*
*@package BiblioBota-OrganismeCarto
//Auteur original :
*@author Jean-Pascal MILCENT <jpm@clapas.org>
//Autres auteurs :
*@author Jean-Charles GRANGER <tela@vecteur.org>
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2005/03/01 15:20:07 jpm
* Ajout du fichier de traduction de l'application Organisme Carto de Biblio Bota.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_lien_favoris/configuration/bblf_config.inc.php
New file
0,0 → 1,82
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of BiblioBota - Lien Favoris. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar 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 General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bblf_config.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Configuration de l'application Lien Favoris.
*
* Fichier de configuration de l'application Lien Favoris.
*
*@package BiblioBota-Partenaire
//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 |
// +------------------------------------------------------------------------------------------------------+
/** Constante stockant le chemin du dossier contenant l'application Lien Favoris de Biblio Bota.*/
define('BBLF_CHEMIN_RACINE', BB_CHEMIN_APPLI.'bb_lien_favoris/');
/** Constante stockant le chemin du dossier contenant les traductions.*/
define('BBLF_CHEMIN_LANGUES', BBLF_CHEMIN_RACINE.'langues/');
 
// +------------------------------------------------------------------------------------------------------+
// Paramétrage d'origine de l'application
/* Permettre la moderation (0/1) ? */
$open_moderation = 0;
/* Nombre d'éditeurs max à afficher dans une liste déroulante avant que le moteur ne bascule en mode zone de saisie */
$how_editeurs = 20;
/* Nbre de données par page */
$how_bloc = 20;
/* Nbre de livres par page */
$how_bloc_book = 10;
 
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2005/02/28 14:34:08 jpm
* Changement du nom de l'appli en Lien Favoris.
*
* Revision 1.1 2005/02/28 14:23:51 jpm
* Ajout des fichiers de l'application Lien Favoris.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_lien_favoris/bb_lien_favoris.php
New file
0,0 → 1,208
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of BiblioBota - Lien Favoris. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar 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 General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bb_lien_favoris.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Application affichant des listes des sites web
*
* Fournit la liste des sites web favoris de Tela Botanica.
* Il est possible d'afficher une liste de sites web :
* - partenaires
* - références
*
*@package BiblioBota-LienFavoris
//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 |
// +------------------------------------------------------------------------------------------------------+
/** Inclusion du fichier de configuration de l'application Lien Favoris. */
require_once BB_CHEMIN_APPLI.'bb_lien_favoris/configuration/bblf_config.inc.php';
 
// Appel du fichier de traduction des textes de l'application Lien Favoris de Biblio Bota
if (file_exists(BBLF_CHEMIN_LANGUES.'bblf_langue_'.BB_URL_I18N.'.inc.php')) {
/** Inclusion du fichier de traduction de l'application Lien Favoris. */
include_once BBLF_CHEMIN_LANGUES.'bblf_langue_'.BB_URL_I18N.'.inc.php';
} else {
/** Inclusion du fichier de traduction fr par défaut. */
include_once BBLF_CHEMIN_LANGUES.'bblf_langue_fr.inc.php';
}
 
// Initialisation de la variable à retourner
$var_to_ret = '';
$var_to_ret .= '<!-- BiblioBota - Partenaire : DEBUT -->'."\n";
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
global $GS_GLOBAL, $TransTab;
 
if ((isset($TransTab)) && ($TransTab != '')) {
$tableau = FRAG_decoupageChaine($TransTab);
}
if (empty($tableau['pstart'])) {
$tableau['pstart'] = 0;
}
if (empty($tableau['step'])) {
$tableau['step'] = $how_bloc;
}
$tableau['libelle'] = 'lien';
$tableau['feminin'] = 0;
 
// Récupèration des arguments de l'application pour la page donnée
$tableau['selecteur'] = $GLOBALS['_GEN_commun']['info_application']->selecteur;
 
// +------------------------------------------------------------------------------------------------------+
// Création du contenu
if ($tableau['selecteur'] == 'ref') {
$add_to_query = 'B_L_REFERENCE';
$le_titre = ' de référence';
$le_texte = '&nbsp;';
} else if ($tableau['selecteur'] == 'part') {
$add_to_query = 'B_L_PARTENAIRE';
$le_titre = ' des partenaires de Tela Botanica';
$le_texte = '&nbsp;';
} else {
$le_titre = '';
$le_texte = '';
}
 
// Titre de la page
$var_to_ret .= '<h1>'.'Sites '.$le_titre.'</h1>';
// Petit descriptif
$var_to_ret .= '<p>'.$le_texte.'</p>'."\n";
 
if (($tableau['selecteur'] == 'ref') || ($tableau['selecteur'] == 'part')) {
$query_tot = 'SELECT COUNT(*) AS cpt '.
'FROM '.$GLOBALS['tbl']['link'].' '.
'WHERE '.$add_to_query.' = 1 '.
'AND B_L_CACHER = 0';
$do_query_tot = mysql_query($query_tot) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_tot));
$tmp_total = mysql_fetch_object($do_query_tot);
$nb_total = $tmp_total->cpt;
mysql_free_result($do_query_tot);
if ($nb_total == 0) {
$var_to_ret .= '<p>'.'Pas encore de liens indexés...'.'</p>'."\n";
} else {
$query = 'SELECT '.$GLOBALS['tbl']['link'].'.* '.
'FROM '.$GLOBALS['tbl']['link'].' '.
'WHERE '.$add_to_query.' = 1 '.
'AND B_L_CACHER = 0 '.
'ORDER BY B_L_TITRE '.
'LIMIT '.$tableau['pstart'].', '.$tableau['step'];
$do_query = mysql_query($query) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query));
$nb_results = mysql_num_rows($do_query);
if (empty($tableau['pend'])) {
$tableau['pend'] = $nb_total;
}
$var_to_ret .= '<p id="frag_nbre_resultat">'.FRAG_afficherTxtNbreResultat('synth', $tableau, $nb_results, $nb_total).'</p>'."\n";
// Ici on fragmente en pages, pour une navigation plus facile
$frag = new fragmenteur();
$frag_txt = $frag->fragmente($tableau, $nb_total);
if (($frag->nb_pages) > 1) {
$var_to_ret .= '<p id="frag_navigation">';
$var_to_ret .= $frag_txt;
$var_to_ret .= '</p>'."\n";
}
// Fin fragmentation
$o = 1;
while ($row = mysql_fetch_object($do_query)) {
$idlink = $row->B_L_IDLINK;
$titrelink = $row->B_L_TITRE;
$urllink = $row->B_L_URL;
$resumlink = $row->B_L_RESUMCLE;
$comlink = $row->B_L_COMMENT;
$get_part = $row->B_L_PARTENAIRE;
$get_ref = $row->B_L_REFERENCE;
$var_to_ret .= '<img class="'.BB_CLASS_IMG_WEB.'" src="'.BB_IMG_WEB.'" alt="'.'Lien Web'.'"/>'."\n";
$var_to_ret .= '<a href="'.$urllink.'">';
if ($titrelink != '') {
$var_to_ret .= $titrelink;
} else {
$var_to_ret .= $urllink;
}
$var_to_ret .= '</a>'."\n";
if ($resumlink != '') {
$var_to_ret .= ' - '.$resumlink;
}
if ($comlink != '') {
$var_to_ret .= ' - '.$comlink;
}
if (($get_ref == 1) && ($tableau['selecteur'] == 'part')) {
$var_to_ret .= ' <img class="'.BB_CLASS_IMG_REFERENCE.'" src="'.BB_IMG_REFERENCE.'" alt="'.'Site Référence'.'" /> '."\n";
}
if (($get_part == 1) && ($tableau['selecteur'] == 'ref')) {
$var_to_ret .= ' <img class="'.BB_CLASS_IMG_PARTENAIRE.'" src="'.BB_IMG_PARTENAIRE.'" alt="'.'Site Partenaire de Tela Botanica'.'" /> '."\n";
}
if ($comlink != '') {
$var_to_ret .= ' - '.$comlink;
}
if ($o < $nb_results) {
$var_to_ret .= '<br /><br />';
}
$o++;
}
mysql_free_result($do_query);
}
} else {
$var_to_ret .= '<p>'.'Echec d\'exécution du script : pas de paramètre valide [réf|part].'.'</p>'."\n";
}
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$var_to_ret .= '<!-- BiblioBota - Partenaire : FIN -->'."\n";
$sortie .= $var_to_ret;
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/03/01 15:18:37 jpm
* Ajout de commentaire html de début et fin d'appli.
*
* Revision 1.2 2005/02/28 14:34:10 jpm
* Changement du nom de l'appli en Lien Favoris.
*
* Revision 1.1 2005/02/28 14:23:51 jpm
* Ajout des fichiers de l'application Lien Favoris.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/bb_lien_favoris/langues/bblf_langue_fr.inc.php
New file
0,0 → 1,64
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of BiblioBota - Lien Favoris. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar 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 General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bblf_langue_fr.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Fichier de traduction en français de l'application Lien Favoris.
*
* Traduction en langue française.
*
*@package BiblioBota-Partenaire
//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 |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2005/02/28 14:23:51 jpm
* Ajout des fichiers de l'application Lien Favoris.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>