Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?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 à trueif ($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> </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"> </div>'."\n";// 3. Le contact de l'institutionif (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'équipeif (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"> </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 ----------------------------------------------------------------------------------------+*/?>