Subversion Repositories eFlore/Archives.herbiers

Compare Revisions

Ignore whitespace Rev 1 → Rev 2

/trunk/applications/hb_consultation/langues/hbc_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 Herbier - Consultation. |
// | |
// | 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: hbc_langue_fr.inc.php,v 1.1 2005-11-23 10:32:32 jp_milcent Exp $
/**
* Fichier de traduction en français de l'application Herbier - Consultation.
*
* Traduction en langue française.
*
*@package Herbier-Consultation
*@subpackage Traduction
//Auteur original :
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@clapas.org>
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:32:32 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2005/03/08 13:49:17 jpm
* Ajout de l'application de consultation sous forme de moteur de recherche.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/hb_consultation/hbc_info_collection.inc.php
New file
0,0 → 1,306
<?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 Herbier - Consultation. |
// | |
// | 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: hbc_info_collection.inc.php,v 1.1 2005-11-23 10:32:32 jp_milcent Exp $
/**
* Application fournissant des informations sur les collections
*
* Fournit des informations sur une collection enregistrée dans la base de données.
*
*@package Herbier-Consultation
//Auteur original :
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@clapas.org>
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:32:32 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
// Stockage du fichier javascript nécessaire pour ouvri-fermer les infos.
GEN_stockerFichierScript('herbiers', HB_CHEMIN_SCRIPTS.'hb_ouvrir_fermer.js');
 
// Initialisation des variables:
global $id_org;
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
// Si le visiteur est connecté et qu'il a des droits sur l'édition d'un herbier, on met $estEditeur à true
if ($GLOBALS['_GEN_commun']['pear_auth']->getAuth()) {
// Si le visiteur est connecté, on regarde si l'herbier visité lui appartient
// auquel on ajoutera des menus d'éditions rapide
$query_auth = 'SELECT EDP_ID_DROIT '.
'FROM EFLORE_DROIT_POSSEDER '.
'WHERE ( EDP_ID_PROJET = 1 '.
'AND EDP_ID_UTILISATEUR = '.$GLOBALS['_HERBIER_']['auth']->getAuthData(HB_BDD_TAB_ANNUAIRE_CHP_ID).' '.
'AND EDP_ID_DROIT = 1)';
$result_auth = mysql_query($query_auth) or die (BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_auth));
if (mysql_num_rows($result_auth) != 0) {
$estEditeur = true;
} else {
$req_administrer = 'SELECT HA_ID_ANNUAIRE '.
'FROM HERBIERS_ADMINISTRER '.
'WHERE HA_ID_ANNUAIRE = '.$GLOBALS['_HERBIER_']['auth']->getAuthData(HB_BDD_TAB_ANNUAIRE_CHP_ID);
$res_administrer = mysql_query($req_administrer) or die (BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $req_administrer));
if (mysql_num_rows($res_administrer) != 0) {
$estEditeur = true;
} else {
$estEditeur = false;
}
}
mysql_free_result($result_auth);
} else {
$estEditeur = false;
}
 
// Création d'un objet H_organisation et récupération des informations afférentes
$herb = new H_organisation();
$herb->getFromSQL($id_org);
 
// Entête
$sortie .= '<h1>'.$herb->INSTITUTION_NAME.'</h1>'."\n";
// On affiche la source des données cad soit IH soit le nom de la personne qui a saisi.
$sortie .= '<p class="hb_source_donnee">'.'Source des données : ';
if ($herb->SOURCE_DES_DONNEES != '') {
$sortie .= $herb->SOURCE_DES_DONNEES;
} else {
$sortie .= $herb->U_NAME.' '.$herb->U_SURNAME;
}
$sortie .= '</p>'."\n";
 
// 1. les renseignements administratifs
$sortie .= '<p class="hb_menu">'.'</p>'."\n";//lien_retour('herbiers')
 
// 2. les collections
if (is_array($herb->collections) && count($herb->collections) != 0) {
$sortie .= '<h2>'.'Les collections'.'</h2>'."\n";
// Une boucle sur l'ensemble des collections
for ($i = 0; $i < count($herb->collections); $i++) {
$sortie .= '<div id="el'.$i.'Parent" class="parent">'."\n".
'<a href="#" onclick="expandBase(\'el'.$i.'\', true); return false;">'."\n".
'<img name="imEx" id="el'.$i.'Img" class="'.HB_CLASS_IMG_ICONE.'" src="'.HB_IMG_OUVRIR.'" alt="+" />'."\n".
'</a>'."\n".
'<h3 class="hb_titre_en_ligne">'.$herb->collections[$i]->NOM_COLLECTION;
if ($estEditeur) {
$sortie .= ' <a class="hb_edition_rapide" href="'.
sprintf(HB_URL_COURANTE_ADMIN_ACTION_ORG_COLL, MOD_DESC, $id_org, $herb->collections[$i]->ID).
'">'.
'(Édition rapide)'.
'</a></h3>'."\n";
} else {
$sortie .= '</h3>'."\n";
}
$sortie .= '</div>'."\n";
$sortie .= '<div id="el'.$i.'Child" class="child">'."\n";
$sortie .= '<dl class="hb_affichage_tabulaire">'."\n";
if ($herb->collections[$i]->COLLECTION_CODE) {
$sortie .= '<dt>'.'Code de la collection : '.'</dt>'.
'<dd>'.$herb->collections[$i]->COLLECTION_CODE.'</dd>'."\n";
}
if ($herb->collections[$i]->DESCRIPTION) {
$sortie .= '<dt>'.'Description : '.'</dt>'.
'<dd>'.preg_replace("/\n/", '<br />', $herb->collections[$i]->DESCRIPTION).'</dd>'."\n";
}
if ($herb->collections[$i]->LABEL) {
$sortie .= '<dt>'.'Statut de la collection : '.'</dt>'.
'<dd>'.$herb->collections[$i]->LABEL.'</dd>'."\n";
}
if ($herb->collections[$i]->DATE_DEBUT&& $herb->collections[$i]->DATE_DEBUT != '0000-00-00') {
$sortie .= '<dt>'.'Début de récolte : '.'</dt>'.
'<dd>'.$herb->collections[$i]->LABEL_DATE_DEBUT_CARAC.' '.
$herb->collections[$i]->DATE_DEBUT.'</dd>'."\n";
}
if ($herb->collections[$i]->DATE_FIN && $herb->collections[$i]->DATE_FIN != "0000-00-00") {
$sortie .= '<dt>'.'Fin de récolte : '.'</dt>'.
'<dd>'.$herb->collections[$i]->LABEL_DATE_FIN_CARAC.' '.
$herb->collections[$i]->DATE_FIN.'</dd>'."\n";
}
if ($herb->collections[$i]->included_type) {
$sortie .= '<dt>'.'Échantillons-types : '.'</dt>'.
'<dd>'.$herb->collections[$i]->included_type.'</dd>'."\n";
}
if (count($herb->collections[$i]->preservation_method) != 0) {
$sortie .= '<dt>'.'Méthode de préservation : '.'</dt>'."\n";
$sortie .= '<dd><ul>';
for ($j = 0; $j < count($herb->collections[$i]->preservation_method); $j++) {
$sortie .= '<li>'.$herb->collections[$i]->preservation_method[$j].'</li>'."\n";
}
$sortie .= '</ul></dd>'."\n";
}
if ($herb->collections[$i]->NUM_SPECIMENS) {
$sortie .= '<dt>'.'Nombre de spécimens : '.'</dt>'.
'<dd>'.$herb->collections[$i]->NUM_SPECIMENS ;
if ($herb->collections[$i]->PREC_SPECIMENS == 'ESTI') {
$sortie .= ' <span class="hb_estimation">'.'(estimation)'.'</span>';
}
$sortie .= '</dd>'."\n";
}
if ($herb->collections[$i]->NUM_SPECIES) {
$sortie .= '<dt>'.'Nombre d\'espèces : '.'</dt>'.
'<dd>'.$herb->collections[$i]->NUM_SPECIES;
if ($herb->collections[$i]->PREC_SPECIES == 'ESTI') {
$sortie .= ' <span class="hb_estimation">'.'(estimation)'.'</span>';
}
$sortie .= '</dd>'."\n";
}
if ($herb->collections[$i]->URL != '') {
$sortie .= '<dt>'.'Site : '.'</dt>'.
'<dd><a href="'.$herb->collections[$i]->URL.'">'.$herb->collections[$i]->URL.'</a></dd>'."\n";
}
// Les différents états de la collection
if ($herb->collections[$i]->ETAT_SPECIMENS) {
$sortie .= '<dt>'.'État des spécimens : '.'</dt>'.
'<dd>'.$herb->collections[$i]->ETAT_SPECIMENS.'</dd>'."\n";
}
if ($herb->collections[$i]->ETAT_CLASSEMENT) {
$sortie .= '<dt>'.'État du classement : '.'</dt>'.
'<dd>'.$herb->collections[$i]->ETAT_CLASSEMENT.'</dd>'."\n";
}
if ($herb->collections[$i]->ETAT_PRESENTATION) {
$sortie .= '<dt>'.'État de la présentation : '.'</dt>'.
'<dd>'.$herb->collections[$i]->ETAT_PRESENTATION.'</dd>'."\n";
}
if ($herb->collections[$i]->MODE_CLASSEMENT != '') {
$sortie .= '<dt>'.'Méthode de classement : '.'</dt>'.
'<dd>'.preg_replace("/\n/", '<br />', $herb->collections[$i]->MODE_CLASSEMENT).'</dd>'."\n";
}
if ($herb->collections[$i]->DOC_STATE != '') {
$sortie .= '<dt>'.'État de la documentation : '.'</dt>'.
'<dd>'.preg_replace("/\n/", '<br />', $herb->collections[$i]->DOC_STATE).'</dd>'."\n";
}
$sortie .= '</dl>'."\n";
// Les collecteurs
if (isset($herb->collections[$i]->COLLECTEURS) && $herb->collections[$i]->COLLECTEURS != '') {
$tableau_collecteur = preg_split("/\r\n/", $herb->collections[$i]->COLLECTEURS, -1, PREG_SPLIT_NO_EMPTY);
$sortie .= '<div id="elcollecteur'.$i.'Parent" class="parent">'."\n".
'<a href="#" onclick="expandBase(\'elcollecteur'.$i.'\', true); return false;">'."\n".
'<img name="imEx" id="elcollecteur'.$i.'Img" class="'.HB_CLASS_IMG_ICONE.'" src="'.HB_IMG_OUVRIR.'" alt="+" />'."\n".
'</a>'."\n".
'<h3 class="hb_titre_en_ligne">'.'Les collecteurs - '.count($tableau_collecteur).'</h3>'."\n".
'</div>'."\n";
$sortie .= '<div id="elcollecteur'.$i.'Child" class="child">'."\n";
$sortie .= '<table border="1" cellspacing="0" width="100%">'."\n";
$compteur_auteur = 0;
for ($ligne = 1; $ligne <= ceil(count($tableau_collecteur) / 3); $ligne++) {
$sortie .= '<tr>';
for ($col = 1 ; $col < 4 ; $col++) {
if (isset($tableau_collecteur[$compteur_auteur]) && $tableau_collecteur[$compteur_auteur] != '') {
$sortie .= '<td>'.$tableau_collecteur[$compteur_auteur].'</td>';
$compteur_auteur++;
}
}
$sortie .= '</tr>'."\n";
}
$sortie .= '</table>'."\n";
$sortie .= '</div>'."\n";
}
// Les indications supplémentaires
if (is_array($herb->collections[$i]->indic) && count($herb->collections[$i]->indic) != 0) {
$sortie .= '<div id="elindic'.$i.'Parent" class="parent">'.
'<a href="#" onclick="expandBase(\'elindic'.$i.'\', true); return false;">'.
'<img name="imEx" id="elindic'.$i.'Img" class="'.HB_CLASS_IMG_ICONE.'" src="'.HB_IMG_OUVRIR.'" alt="+" />'.
'</a>'.
'<h3 class="hb_titre_en_ligne">'.'Compléments d\'information'.'</h3>'.
'</div>'."\n";
$sortie .= '<div id="elindic'.$i.'Child" class="child">'."\n";
$sortie .= '<dl>'."\n";
//$sortie .= '<dt>Débogage</dt><dd><pre>'.print_r($herb->collections[$i], true).'</pre></dd>'."\n";
for ($k = 0; $k < count($herb->collections[$i]->indic); $k++) {
if (isset($herb->collections[$i]->indic[$k]->type_indic) && count($herb->collections[$i]->indic[$k]->type_indic) != 0) {
$sortie .= '<dt>';
for ($l = 0; $l < count($herb->collections[$i]->indic[$k]->type_indic); $l++) {
$sortie .= $herb->collections[$i]->indic[$k]->type_indic[$l]->LABEL_TYPE;
if ($l < count($herb->collections[$i]->indic[$k]->type_indic) - 1) {
$sortie .= ' - ';
}
}
if ($estEditeur) {
$sortie .= ' <a class="hb_edition_rapide" href="'.
sprintf(HB_URL_COURANTE_ADMIN_ACTION_ORG_NOTE, MOD_NOTE, $id_org, $herb->collections[$i]->indic[$k]->ID_INDIC).
'">'.
'(Édition rapide)'.
'</a>'."\n";
}
$sortie .= '</dt>'."\n";
}
if ($herb->collections[$i]->indic[$k]->TXT_INDIC) {
$sortie .= '<dd>'.preg_replace("/\n/", '<br />', $herb->collections[$i]->indic[$k]->TXT_INDIC).'</dd>'."\n";
}
if ($herb->collections[$i]->indic[$k]->REM_INDIC) {
$sortie .= '<dd><i>'.preg_replace("/\n/", '<br />', $herb->collections[$i]->indic[$k]->REM_INDIC).'</i></dd>'."\n";
}
// Affichage de l'historique des modifications des notes
if (isset($herb->collections[$i]->indic[$k]->indic_hist) && (count($herb->collections[$i]->indic[$k]->indic_hist) != 0)) {
for ($l = 0; $l < count($herb->collections[$i]->indic[$k]->indic_hist); $l++) {
if ($herb->collections[$i]->indic[$k]->indic_hist[$l]->DATE_INDIC != '') {
$sortie .= '<dd>';
if ($l) {
$sortie .= 'Modifié le '.'<i>';
} else {
$sortie .= 'Dernière modification le '.'<i>';
}
$sortie .= $herb->collections[$i]->indic[$k]->indic_hist[$l]->DATE_INDIC.', par '
.$herb->collections[$i]->indic[$k]->indic_hist[$l]->ID_INDICATEUR.'</i></dd>'."\n";
}
}
}
}
$sortie .= '</dl>'."\n";
$sortie .= '</div>'."\n";
}
// une ligne vide entre chaque collection
$sortie .= '<hr class="hb_ligne" />'."\n";
$sortie .= '</div>'."\n";
}
}
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/03/30 09:48:58 jpm
* Début gestion des raccourcis vers l'administration.
*
* Revision 1.2 2005/03/09 15:55:02 jpm
* Correction bogue d'affichage quand donnée vide.
*
* Revision 1.1 2005/03/08 13:49:17 jpm
* Ajout de l'application de consultation sous forme de moteur de recherche.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/hb_consultation/hb_consultation.php
New file
0,0 → 1,233
<?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 Herbier - Consultation. |
// | |
// | 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: hb_consultation.php,v 1.1 2005-11-23 10:32:32 jp_milcent Exp $
/**
* Application fournissant un moteur de recherche sur les herbiers
*
* Fournit la liste des herbiers enregistrés dans la base de données.
*
*@package Herbier-Consultation
//Auteur original :
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@clapas.org>
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:32:32 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/** Inclusion du fichier de configuration de l'application Herbier - Consultation. */
require_once HB_CHEMIN_APPLI.'hb_consultation'.GEN_SEP.'configuration'.GEN_SEP.'hbc_config.inc.php';
/** Inclusion du fichier de configuration de l'application Herbier - Administration. */
require_once HB_CHEMIN_APPLI.'hb_admin'.GEN_SEP.'configuration'.GEN_SEP.'hba_config.inc.php';
 
/** Inclusion de l'API Fragmenteur */
require_once HB_CHEMIN_API_FRAGMENTEUR.'FRAG_fragmenteur.fonct.php';
/** Inclusion de l'API Formulaire - classe : Form */
require_once HB_CHEMIN_API_FORM.'FORM_formulaire.class.php';
/** Inclusion de l'API Formulaire - classe : formFromTable */
require_once HB_CHEMIN_API_FORM.'FORM_formulaire_table.class.php';
 
/** Inclusion de la classe principale d'Herbier : herbier */
require_once HB_CHEMIN_BIBLIO.'hb_herbier.class.php';
/** Inclusion de la classe Herbier : collection */
require_once HB_CHEMIN_BIBLIO.'hb_collection.class.php';
/** Inclusion de la classe Herbier : indic */
require_once HB_CHEMIN_BIBLIO.'hb_indic.class.php';
/** Inclusion de la classe Herbier : indic_hist */
require_once HB_CHEMIN_BIBLIO.'hb_indic_hist.class.php';
/** Inclusion de la classe Herbier : organisation */
require_once HB_CHEMIN_BIBLIO.'hb_organisation.class.php';
/** Inclusion de la classe Herbier : type */
require_once HB_CHEMIN_BIBLIO.'hb_type.class.php';
/** Inclusion de la classe Herbier : equipe */
require_once HB_CHEMIN_BIBLIO.'hb_equipe.class.php';
 
// Appel du fichier de traduction des textes de l'application Consultation de Herbier
if (file_exists(HBC_CHEMIN_LANGUES.'hbc_langue_'.HB_I18N.'.inc.php')) {
/** Inclusion du fichier de traduction de l'application Consultation de Herbier. */
include_once HBC_CHEMIN_LANGUES.'hbc_langue_'.HB_I18N.'.inc.php';
} else {
/** Inclusion du fichier de traduction fr par défaut. */
include_once HBC_CHEMIN_LANGUES.'hbc_langue_fr.inc.php';
}
 
// Initialisation de la variable à retourner
$sortie .= '<!-- Herbier - Consultation : DEBUT -->'."\n";
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
global $project;
global $TransTab;
global $RECHERCHE, $INSTITUTION, $T_REPONSE, $TYPE_R;
if (!isset($_GET['consultation'])) {
// ici on écrase les valeurs des variables globales précédentes au cas où
// on vient de cliquez sur un chiffre du fragmenteur
if (empty($T_REPONSE)) {
$T_REPONSE = 20;
}
if ($TransTab) {
$values = FRAG_decoupageChaine($TransTab);
}
if (!empty($values)) {
foreach ($values as $key => $val) {
if ($val != '') {
$GLOBALS[$key] = $val ;
}
}
}
$sortie .= '<h1>'.'Rechercher un herbier :'.'</h1>'."\n";
$form_1 = new form($GLOBALS['_HERBIER_']['bdd']);
$sortie .= '<form action="'.$GLOBALS['_HERBIER_']['url']->getURL().'" method="post">'."\n";
$sortie .= '<p>'."\n";
$sortie .= '<label for="RECHERCHE">'.'Recherche : '.'</label>'."\n";
$sortie .= '<input id="RECHERCHE" type="text" name="RECHERCHE" class="insInputForm"';
if (!empty($RECHERCHE)) {
$sortie .= ' value="'.$RECHERCHE.'"';
}
$sortie .= '/>'."\n";
$sortie .= '<label for="">'.'Grouper les résultats : '.'</label>'."\n";
$sortie .= $form_1->selectFromTableau('T_REPONSE',array(10, 'par 10', 20, 'par 20', 50, 'par 50'), $T_REPONSE);
$sortie .= $form_1->submit('rechercher')."\n";
$sortie .= '</p>'."\n";
$sortie .= '</form>'."\n";
$sortie .= '<p>'.'Le moteur recherche dans tous les champs de la de la base :'.'</p>'."\n";
'<ul>'."\n".
'<li>'.'Nom d\'institution, adresse, ville, région'.'</li>'."\n".
'<li>'.'Index herbariorum'.'</li>'."\n".
'<li>'.'Nom de collection, description, collecteurs, notes'.'</li>'."\n".
'<li>'.'Indications taxonomiques, historiques, géographiques'.'</li>'."\n".
'</ul>'."\n";
$sortie .= '<p>'.'Vous pouvez utiliser le caractère % pour remplacer n\'importe quelle chaine.'.'</p>'."\n";
if (!empty($T_REPONSE) ) {//&& !empty($RECHERCHE)
$query_data = 'SELECT DISTINCT(ID_ORG) '.
'FROM HERBIERS_INDIC LEFT JOIN HERBIERS_COLLECTION ON HERBIERS_INDIC.ID = HERBIERS_COLLECTION.ID, HERBIERS_ORGANISATION '.
'WHERE (HERBIERS_COLLECTION.PARENT_ID = HERBIERS_ORGANISATION.ID_ORG '.
'AND (HERBIERS_INDIC.REM_INDIC LIKE "%'.$RECHERCHE.'%" '.
'OR HERBIERS_INDIC.TXT_INDIC LIKE "%'.$RECHERCHE.'%")) '.
'OR (HERBIERS_ORGANISATION.ID_ORG = HERBIERS_COLLECTION.PARENT_ID '.
'AND (HERBIERS_COLLECTION.DESCRIPTION LIKE "%'.$RECHERCHE.'%" '.
'OR HERBIERS_COLLECTION.NOTES LIKE "%'.$RECHERCHE.'%" '.
'OR HERBIERS_COLLECTION.COLLECTION_FOCUS LIKE "%'.$RECHERCHE.'%" '.
'OR HERBIERS_COLLECTION.PURPOSE LIKE "%'.$RECHERCHE.'%" '.
'OR HERBIERS_COLLECTION.COLLECTEURS LIKE "%'.$RECHERCHE.'%" '.
'OR HERBIERS_COLLECTION.STRENGTH LIKE "%'.$RECHERCHE.'%" '.
'OR HERBIERS_COLLECTION.NOM_COLLECTION LIKE "%'.$RECHERCHE.'%" '.
'OR HERBIERS_COLLECTION.COLLECTION_CODE LIKE "%'.$RECHERCHE.'%")) '.
'OR HERBIERS_ORGANISATION.INSTITUTION_NAME LIKE "%'.$RECHERCHE.'%" '.
'OR ADRESS_TEXT LIKE "%'.$RECHERCHE.'%" '.
'OR TOWN LIKE "%'.$RECHERCHE.'%" '.
'OR REGION LIKE "%'.$RECHERCHE.'%" '.
'OR INDEX_HERB LIKE "%'.$RECHERCHE.'%" '.
'ORDER BY TOWN';
if (empty($values['pstart'])) {
$values['pstart'] = 0 ;
}
// Autre requete pour obtenir le nombre total de réponse
// car la clause limit x,y limite le nombre de résultat
$query_nombre = $query_data;
// Ajout de la clause limit pour les données à afficher
$query_data .= ' LIMIT '.$values['pstart'].','.$T_REPONSE;
$result_data = mysql_query($query_data) or die (BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_data));
$result_nombre = mysql_query($query_nombre) or die (BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_nombre));
$nombre = mysql_num_rows($result_nombre);
mysql_free_result($result_nombre);
// Utilisation du fragmentateur
$mon_frag = new fragmenteur();
$tableau = array();
$tableau['pstart'] = $values['pstart'];
$tableau['step'] = $T_REPONSE;
$tableau['pend'] = $nombre;
// Construction de la variable TransTab
$tableau['TYPE_R'] = $TYPE_R;
$tableau['T_REPONSE'] = $T_REPONSE;
$sortie .= '<p id="frag_nbre_resultat">'.FRAG_afficherTxtNbreResultat('', $tableau, mysql_num_rows($result_data), $nombre).'</p>'."\n";
if ((mysql_num_rows($result_data) > 0) && ($tableau['step'] < $nombre)) {
$sortie .= '<p id="frag_navigation">';
$sortie .= $mon_frag->fragmente($tableau, $nombre);
$sortie .= '</p>'."\n";
}
$sortie .= '<ul>'."\n";
while ($row1 = mysql_fetch_object($result_data)) {
$resultat = new H_organisation() ;
$resultat->getFromSQL($row1->ID_ORG);
$sortie .= '<li>'.$resultat->TOWN.' - ';
$sortie .= '<a href="'.HB_URL_COURANTE_CONSULTATION_FICHE_HERBIER.'&amp;id_org='.$row1->ID_ORG.'">'.
$resultat->INSTITUTION_NAME.
'</a>';
$sortie .= '</li>'."\n";
}
$sortie .= '</ul>'."\n";
if ((mysql_num_rows($result_data) > 0) && ($tableau['step'] < $nombre)) {
$sortie .= '<p>'.$mon_frag->fragmente($tableau, $nombre).'</p>'."\n";
}
}
} elseif (isset($_GET['consultation']) && $_GET['consultation'] == 'herbier') {
include_once 'hbc_info_herbier.inc.php';
} elseif (isset($_GET['consultation']) && $_GET['consultation'] == 'collection') {
include_once 'hbc_info_collection.inc.php';
}
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$sortie .= '<!-- Herbier - Consultation : FIN -->'."\n";
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/03/30 09:48:58 jpm
* Début gestion des raccourcis vers l'administration.
*
* Revision 1.2 2005/03/09 15:55:17 jpm
* Changement du nom de l'appli.
*
* Revision 1.1 2005/03/08 13:49:17 jpm
* Ajout de l'application de consultation sous forme de moteur de recherche.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/hb_consultation/hbc_info_herbier.inc.php
New file
0,0 → 1,259
<?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 Herbier - Consultation. |
// | |
// | 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: hbc_info_herbier.inc.php,v 1.1 2005-11-23 10:32:32 jp_milcent Exp $
/**
* Application fournissant des informations sur les herbiers
*
* Fournit des informations sur un herbier enregistré dans la base de données.
*
*@package Herbier-Consultation
//Auteur original :
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@clapas.org>
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:32:32 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
// Stockage du fichier javascript nécessaire pour ouvri-fermer les infos.
GEN_stockerFichierScript('herbiers', HB_CHEMIN_SCRIPTS.'hb_ouvrir_fermer.js');
 
// Initialisation des variables:
global $id_org;
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
// Si le visiteur est connecté et qu'il a des droits sur l'édition d'un herbier, on met $estEditeur à true
if ($GLOBALS['_HERBIER_']['auth']->getAuth()) {
// Le visiteur est connecté : on regarde si l'herbier visité lui appartient pour ajouter des menus d'éditions rapide
$query_auth = 'SELECT EDP_ID_DROIT '.
'FROM EFLORE_DROIT_POSSEDER '.
'WHERE (EDP_ID_PROJET = 1 '.
'AND EDP_ID_UTILISATEUR = '.$GLOBALS['_HERBIER_']['auth']->getAuthData(HB_BDD_TAB_ANNUAIRE_CHP_ID).' '.
'AND EDP_ID_DROIT = 1)';
$result_auth = mysql_query($query_auth) or die (BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_auth));
if (mysql_num_rows($result_auth) != 0) {
$estEditeur = true;
} else {
$req_administrer = 'SELECT HA_ID_ANNUAIRE '.
'FROM HERBIERS_ADMINISTRER '.
'WHERE HA_ID_ANNUAIRE = '.$GLOBALS['_HERBIER_']['auth']->getAuthData(HB_BDD_TAB_ANNUAIRE_CHP_ID);
$res_administrer = mysql_query($req_administrer) or die (BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_auth));
if (mysql_num_rows($res_administrer) != 0) {
$estEditeur = true;
} else {
$estEditeur = false;
}
}
mysql_free_result($result_auth);
} else {
$estEditeur = false;
}
 
 
// Création d'un objet H_organisation et récupération des informations afférentes
$herb = new H_organisation($id_org);
$herb->getFromSQL($id_org);
 
// Entete
$sortie .= '<h1>'.$herb->INSTITUTION_NAME.'</h1>'."\n";
 
// Affichage de la source des données cad soit IH soit le nom de la personne qui a saisi.
$sortie .= '<p class="hb_source_donnee">'.'Source des données : ';
if ($herb->SOURCE_DES_DONNEES != '') {
$sortie .= $herb->SOURCE_DES_DONNEES ;
} else {
$sortie .= $herb->U_NAME.' '.$herb->U_SURNAME;
}
$sortie .= '</p>'."\n";
 
// 1. les renseignements administratifs
$sortie .= '<p class="hb_menu">'.'</p>'."\n";
$sortie .= '<h2>'.'Renseignements Administratifs';
if ($estEditeur) {
$sortie .= ' <a class="hb_edition_rapide" href="'.sprintf(HB_URL_COURANTE_ADMIN_ACTION_ORGANISATION, MOD_ADM, $id_org).'">'.
'(Édition rapide)'.
'</a></h2>'."\n";
} else {
$sortie .= '</h2>'."\n";
}
 
$sortie .= '<dl class="hb_affichage_tabulaire">'."\n".
'<dt>'.'Nom : '.'</dt>'.
'<dd>'.$herb->INSTITUTION_NAME.'</dd>'."\n";
$sortie .= '<dt>'.'Index herbariorum : '.'</dt>'."\n";
if ($herb->EMAIL) {
$sortie .= '<dd>'.$herb->INDEX_HERB.'</dd>'."\n";
} else {
$sortie .= '<dd>&nbsp;</dd>'."\n";
}
$sortie .= '<dt>'.'Adresse : '.'</dt>'."\n".
'<dd>'.$herb->ADRESS_LINE.'</dd>'."\n".
'<dt>'.'Code postal : '.'</dt>'."\n".
'<dd>'.$herb->ZIP.'</dd>'."\n".
'<dt>'.'Ville : '.'</dt>'."\n".
'<dd>'.$herb->TOWN.'</dd>'."\n".
'<dt>'.'Pays : '.'</dt>'."\n".
'<dd>'.$herb->pays.'</dd>'."\n";
if ($herb->EMAIL) {
$sortie .= '<dt>'.'E-mail : '.'</dt>'.
'<dd>'.'<a href="mailto:'.$herb->EMAIL.'">'.$herb->EMAIL.'</a></dd>'."\n";
}
$sortie .= '<dt>'.'Téléphone : '.'</dt>'.
'<dd>'.$herb->TEL.'</dd>'."\n".
'<dt>'.'Fax : '.'</dt>'.
'<dd>'.$herb->FAX.'</dd>'."\n";
$sortie .= '</dl>'."\n";
$sortie .= '<div class="espace">&nbsp;</div>'."\n";
 
// 3. Le contact de l'institution
if (is_array($herb->equipe_liste)) {
$sortie .= '<h2>'.'Contacter l\'herbier'.'</h2>'."\n";
$sortie .= '<p>'.'Personne(s) à contacter :'.'</p>'."\n";
for ($i = 0 ; $i < count($herb->equipe_liste) ; $i++) {
if ($herb->equipe_liste[$i]->CONTACT == 'oui') {
$sortie .= '<div id="elcontact'.$i.'Parent" class="parent">'."\n".
'<a href="#" onclick="expandBase(\'elcontact'.$i.'\', true); return false;">'."\n".
'<img name="imEx" id="elcontact'.$i.'Img" class="'.HB_CLASS_IMG_ICONE.'" src="'.HB_IMG_OUVRIR.'" alt="+"/>'."\n".
'</a>'."\n".
'<h3 class="hb_titre_en_ligne">'.$herb->equipe_liste[$i]->NOM.' '.$herb->equipe_liste[$i]->PRENOM;
if ($estEditeur) {
$sortie .= ' <a class="hb_edition_rapide" href="'.
sprintf(HB_URL_COURANTE_ADMIN_ACTION_ORG_EQUIPE, MOD_STAFF, $id_org, $herb->equipe_liste[$i]->ID_STAFF).
'">'.
'(Édition rapide)'.
'</a></h3>'."\n";
} else {
$sortie .= '</h3>'."\n";
}
$sortie .= '</div>'."\n";
$sortie .= '<div id="elcontact'.$i.'Child" class="child">'."\n";
$sortie .= '<dl class="hb_affichage_tabulaire">'."\n";
if ($herb->equipe_liste[$i]->MAIL) {
$sortie .= '<dt>'.'Mail : '.'</dt>'."\n".
'<dd><a href="mailto:'.$herb->equipe_liste[$i]->MAIL.'">'.$herb->equipe_liste[$i]->MAIL.'</a></dd>'."\n";
}
if ($herb->equipe_liste[$i]->TEL) {
$sortie .= '<dt>'.'Téléphone : '.'</dt>'.
'<dd>'.$herb->equipe_liste[$i]->TEL.'</dd>'."\n";
}
if ($herb->equipe_liste[$i]->FAX) {
$sortie .= '<dt>'.'Fax : '.'</dt>'.
'<dd>'.$herb->equipe_liste[$i]->FAX.'</dd>'."\n";
}
if ($herb->equipe_liste[$i]->FONCTION) {
$sortie .= '<dt>'.'Fonction : '.'</dt>'.
'<dd>'.$herb->equipe_liste[$i]->FONCTION.'</dd>'."\n";
}
$sortie .= '</dl>'."\n";
$sortie .= '</div>'."\n";
}
}
}
 
// 4. l'équipe
if (is_array($herb->equipe_liste) && count($herb->equipe_liste) != 0) {
$sortie .= '<h2>'.'L\'équipe'.'</h2>'."\n";
for ($i = 0 ; $i < count($herb->equipe_liste) ; $i++) {
$sortie .= '<div id="el1'.$i.'Parent" class="parent">'."\n".
'<a href="#" onclick="expandBase(\'el1'.$i.'\', true); return false;">'."\n".
'<img name="imEx" id="el1'.$i.'Img" class="'.HB_CLASS_IMG_ICONE.'" src="'.HB_IMG_OUVRIR.'" alt="+"/>'."\n".
'</a>'."\n".
'<h3 class="hb_titre_en_ligne">'.$herb->equipe_liste[$i]->NOM.' '.$herb->equipe_liste[$i]->PRENOM;
if ($estEditeur) {
$sortie .= ' <a class="hb_edition_rapide" href="'.
sprintf(HB_URL_COURANTE_ADMIN_ACTION_ORG_EQUIPE, MOD_STAFF, $id_org, $herb->equipe_liste[$i]->ID_STAFF).
'">'.
'(Édition rapide)'.
'</a></h3>'."\n";
} else {
$sortie .= '</h3>'."\n";
}
$sortie .= '</div>'."\n";
$sortie .= '<div id="el1'.$i.'Child" class="child">'."\n";
$sortie .= '<dl class="hb_affichage_tabulaire">'."\n";
if ($herb->equipe_liste[$i]->ADRESSE1 != '' && $herb->equipe_liste[$i]->ADRESSE2 != '') {
$sortie .= '<dt>'.'Adresse : '.'</dt>'.
'<dd>'.$herb->equipe_liste[$i]->ADRESSE1.'<br />'.
$herb->equipe_liste[$i]->ADRESSE2.'</dd>'."\n";
} elseif ($herb->equipe_liste[$i]->ADRESSE1 != '' && $herb->equipe_liste[$i]->ADRESSE2 == '') {
$sortie .= '<dt>'.'Adresse : '.'</dt>'.
'<dd>'.$herb->equipe_liste[$i]->ADRESSE1.'</dd>'."\n";
} elseif ($herb->equipe_liste[$i]->ADRESSE1 == '' && $herb->equipe_liste[$i]->ADRESSE2 != '') {
$sortie .= '<dt>'.'Adresse : '.'</dt>'.
'<dd>'.$herb->equipe_liste[$i]->ADRESSE2.'</dd>'."\n";
}
if ($herb->equipe_liste[$i]->CP != '') {
$sortie .= '<dt>'.'Code Postal : '.'</dt>'.
'<dd>'.$herb->equipe_liste[$i]->CP.'</dd>'."\n";
}
if ($herb->equipe_liste[$i]->VILLE != '') {
$sortie .= '<dt>'.'Ville : '.'</dt>'.
'<dd>'.$herb->equipe_liste[$i]->VILLE.'</dd>'."\n";
}
if ($herb->equipe_liste[$i]->MAIL != '') {
$sortie .= '<dt>'.'Mail : '.'</dt>'.
'<dd><a href="mailto:'.$herb->equipe_liste[$i]->MAIL.'">'.$herb->equipe_liste[$i]->MAIL.'</a></dd>'."\n";
}
if ($herb->equipe_liste[$i]->FONCTION != '') {
$sortie .= '<dt>'.'Fonction : '.'</dt>'.
'<dd>'.$herb->equipe_liste[$i]->FONCTION.'</dd>'."\n";
}
$sortie .= '</dl>'."\n";
$sortie .= '</div>'."\n";
}
}
$sortie .= '<div class="hb_espace">&nbsp;</div>'."\n";
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.4 2005/04/06 13:29:41 jpm
* Correction du nom d'un attribut de la classe organisation.
*
* Revision 1.3 2005/03/30 09:48:58 jpm
* Début gestion des raccourcis vers l'administration.
*
* Revision 1.2 2005/03/09 15:55:02 jpm
* Correction bogue d'affichage quand donnée vide.
*
* Revision 1.1 2005/03/08 13:49:17 jpm
* Ajout de l'application de consultation sous forme de moteur de recherche.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/applications/hb_consultation/configuration/hbc_config.inc.php
New file
0,0 → 1,70
<?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 Herbier - Consultation. |
// | |
// | 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: hbc_config.inc.php,v 1.1 2005-11-23 10:32:32 jp_milcent Exp $
/**
* Configuration de l'application Herbier - Consultation
*
* Fichier de configuration de l'application Herbier - Consultation.
*
*@package Herbier-Consultation
*@subpackage Configuration
//Auteur original :
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@clapas.org>
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:32:32 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/** Constante stockant le chemin du dossier contenant l'application Herbier - Consultation.*/
define('HBC_CHEMIN_RACINE', HB_CHEMIN_APPLI.'hb_consultation/');
/** Constante stockant le chemin du dossier contenant les traductions.*/
define('HBC_CHEMIN_LANGUES', HBC_CHEMIN_RACINE.'langues/');
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2005/03/09 15:54:39 jpm
* Changement du nom de l'appli dans les constantes.
*
* Revision 1.1 2005/03/08 13:49:17 jpm
* Ajout de l'application de consultation sous forme de moteur de recherche.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>