/trunk/client/biblio_bota/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 2004/09/14 11:12:27 jpm 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: 2004/09/14 11:12:27 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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: bba_droit_mail.fonct.php,v $ |
* 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/client/biblio_bota/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.4 2005/05/30 09:10:26 jpm 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.4 $ $Date: 2005/05/30 09:10:26 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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, '>', '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: bb_organisme_carto.php,v $ |
* 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/client/biblio_bota/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.2 2005/05/30 09:14:04 jpm 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.2 $ $Date: 2005/05/30 09:14:04 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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.'&historique_cartes='.$chemin.'">'. |
' > '.$tabnom[$key]. |
'</a>'; |
} else if ($key == (count($tabonglet) - 1)) { |
$res .= '<a class="lien_non_souligne">'. |
' > '.$pays. |
'</a>'; |
} else { |
$chemin .= '*'.$value; |
$res .= '<a class="lien_non_souligne" href="'.$monde->url.'&historique_cartes='.$chemin.'">'. |
' > '.$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.'&str='.$get_idstr.'&arg_0=str%3D'.$get_idstr. |
'&arg_1=coll%3D'.$get_idstr.'&arg_2=book%3D'.$get_idstr.'&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.'&historique_cartes='.$chemin.'">'. |
' > '.$tabnom[$key]. |
'</a>'; |
} else if ($key == (count($tabonglet) - 1)) { |
$res .= '<a class="lien_non_souligne">'. |
' > '.$nom. |
'</a>'; |
} else { |
$chemin .= '*'.$value; |
$res .= '<a class="lien_non_souligne" href="'.$monde->url.'&historique_cartes='.$chemin.'">'. |
' > '.$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.'&str='.$get_idstr.'&arg_0=str%3D'.$get_idstr. |
'&arg_1=coll%3D'.$get_idstr.'&arg_2=book%3D'.$get_idstr.'&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: bboc_organisme_liste.inc.php,v $ |
* 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/client/biblio_bota/applications/bb_organisme_carto/bibliotheque/bboc_information.fonct.php |
---|
New file |
0,0 → 1,112 |
<?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.2 2005/04/13 10:12:34 jpm 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.2 $ $Date: 2005/04/13 10:12:34 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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: bboc_information.fonct.php,v $ |
* 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/client/biblio_bota/applications/bb_organisme_carto/langues/bboc_langue_fr.inc.php |
---|
New file |
0,0 → 1,61 |
<?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$ |
/** |
* 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$ $Date$ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log$ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/applications/bb_lien_favoris/bb_lien_favoris.php |
---|
New file |
0,0 → 1,209 |
<?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/02/28 14:23:51 jpm 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/02/28 14:23:51 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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'; |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
global $GS_GLOBAL; |
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 |
// Initialisation de la variable à retourner |
$var_to_ret = ''; |
if ($tableau['selecteur'] == 'ref') { |
$add_to_query = 'B_L_REFERENCE'; |
$le_titre = ' de référence'; |
$le_texte = ' '; |
} else if ($tableau['selecteur'] == 'part') { |
$add_to_query = 'B_L_PARTENAIRE'; |
$le_titre = ' des partenaires de Tela Botanica'; |
$le_texte = ' '; |
} else { |
$le_titre = ''; |
$le_texte = ''; |
} |
$var_to_ret .= '<!-- BiblioBota - Partenaire : DEBUT -->'; |
// 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"; |
} |
$var_to_ret .= '<!-- BiblioBota - Partenaire : FIN -->'; |
$sortie .= $var_to_ret; |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: bb_lien_favoris.php,v $ |
* Revision 1.1 2005/02/28 14:23:51 jpm |
* Ajout des fichiers de l'application Lien Favoris. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/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/02/28 14:23:51 jpm 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/02/28 14:23:51 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: bblf_langue_fr.inc.php,v $ |
* Revision 1.1 2005/02/28 14:23:51 jpm |
* Ajout des fichiers de l'application Lien Favoris. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/applications/bb_lien_favoris/configuration/bblf_config.inc.php |
---|
New file |
0,0 → 1,79 |
<?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/02/28 14:23:51 jpm 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/02/28 14:23:51 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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: bblf_config.inc.php,v $ |
* Revision 1.1 2005/02/28 14:23:51 jpm |
* Ajout des fichiers de l'application Lien Favoris. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/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 2004/09/10 09:45:47 jpm 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: 2004/09/10 09:45:47 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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/client/biblio_bota/applications/bb_consultation/bbc_info_collection.inc.php |
---|
New file |
0,0 → 1,287 |
<?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 2004/09/16 12:06:31 jpm 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: 2004/09/16 12:06:31 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// DEBUT COLLECTION |
$tableau['args'] = '&arg_0=str%3D'.$tableau['coll'].'&arg_1=coll%3D'.$tableau['coll']. |
'&arg_2=book%3D'.$tableau['coll'].'&arg_3=media%3D'.$tableau['coll']; |
// Proposition d'édition |
/* TODO NAVIGBIBLIO */ |
/* |
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: bbc_info_collection.inc.php,v $ |
* Revision 1.1 2004/09/16 12:06:31 jpm |
* Décomposition du fichier information en plusieurs fichiers. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/applications/bb_consultation/bb_consultation.php |
---|
New file |
0,0 → 1,134 |
<?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.6 2005/02/24 18:32:40 jpm 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.6 $ $Date: 2005/02/24 18:32:40 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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: bb_consultation.php,v $ |
* 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/client/biblio_bota/applications/bb_consultation/bbc_recherche.inc.php |
---|
New file |
0,0 → 1,370 |
<?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.6 2005/02/24 18:32:40 jpm 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.6 $ $Date: 2005/02/24 18:32:40 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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'] = '&arg_0=plugin%3D'.$TabFinder['plugin'].'&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('Élargir votre recherche : ', 3); |
// Aide : liste complète |
$sortie .= '<p>'."\n"; |
$sortie .= 'Si vous souhaitez élargir votre recherhe à l\'ensemble des ressources documentaires de l\'enseignement supérieur et de la recherche de la région Languedoc-Roussillon, allez sur le <a href="http://www.bomlr.info/askonce.jsp?locale=FR" class="lien_ext">site de la Bibliothèque Ouverte Montpellier Languedoc-Roussillon </a> '."\n"; |
$sortie .= '</p>'."\n"; |
$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"; |
} |
} |
// 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: bbc_recherche.inc.php,v $ |
* 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/client/biblio_bota/applications/bb_consultation/bibliotheque/bbc_statistique.fonct.php |
---|
New file |
0,0 → 1,102 |
<?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 2004/09/10 18:43:31 jpm 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: 2004/09/10 18:43:31 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/*Mettre ici les inclusions de fichiers*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
/*Mettre ici la 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; |
global $REMOTE_ADDR; |
global $TabFinder, $TransTab; |
if (isset($TransTab)) { |
$TabFinder = UnstoreTransTab($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"; |
$query = "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($query) or die("<B>Erreur de stockage dans BiblioCheck :</B> $query"); |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: bbc_statistique.fonct.php,v $ |
* 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/client/biblio_bota/applications/bb_consultation/bibliotheque/bbc_moteur_lien.fonct.php |
---|
New file |
0,0 → 1,200 |
<?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.3 2005/03/03 08:25:38 jpm 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.3 $ $Date: 2005/03/03 08:25:38 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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.'&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: bbc_moteur_lien.fonct.php,v $ |
* Revision 1.3 2005/03/03 08:25:38 jpm |
* Remplacement d'un & par & |
* |
* Revision 1.2 2004/09/14 11:49:52 jpm |
* Ajout de l'entête au fichier. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/applications/bb_consultation/bibliotheque/bbc_affichage_lien.fonct.php |
---|
New file |
0,0 → 1,156 |
<?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.3 2004/09/15 15:47:36 jpm 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.3 $ $Date: 2004/09/15 15:47:36 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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.'&str='.$get_lkstr.'&arg_0=str%3D'.$get_lkstr. |
'&arg_1=coll%3D'.$get_lkstr.'&arg_2=book%3D'.$get_lkstr.'&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.'&action=edit&ensemble=link&ref='.$get_idlink.'">'.'éditer'.'</a>'; |
$retour .= ' - '; |
$retour .= '<a class="texte_inactif" href="'.BB_URL_COURANTE_ADMIN.'&action=supp&ensemble=link&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.'&action=new&ensemble=link">'.'Proposer un nouveau lien'.'</a>'."\n". |
'<hr size="1" />'."\n". |
'</p>'."\n"; |
} |
return $retour; |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: bbc_affichage_lien.fonct.php,v $ |
* 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/client/biblio_bota/applications/bb_consultation/bibliotheque/bbc_requete_media.fonct.php |
---|
New file |
0,0 → 1,374 |
<?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.3 2004/09/15 10:32:30 jpm 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.3 $ $Date: 2004/09/15 10:32:30 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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: bbc_requete_media.fonct.php,v $ |
* 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/client/biblio_bota/applications/bb_consultation/bibliotheque/bbc_moteur_media.fonct.php |
---|
New file |
0,0 → 1,458 |
<?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.4 2005/03/03 08:32:26 jpm 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.4 $ $Date: 2005/03/03 08:32:26 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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."&arg_0=$arg_0&arg_1=$arg_1&arg_2=$arg_2&arg_3=$arg_3&arg_4=$arg_4&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.'&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.'&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: bbc_moteur_media.fonct.php,v $ |
* 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 ----------------------------------------------------------------------------------------+ |
*/ |
?> |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/applications/bb_consultation/bibliotheque/bbc_requete_structure.fonct.php |
---|
New file |
0,0 → 1,255 |
<?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.3 2004/09/16 11:05:54 jpm 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.3 $ $Date: 2004/09/16 11:05:54 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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: bbc_requete_structure.fonct.php,v $ |
* 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/client/biblio_bota/applications/bb_consultation/bibliotheque/bbc_moteur_structure.fonct.php |
---|
New file |
0,0 → 1,205 |
<?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.2 2004/09/15 11:21:07 jpm 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.2 $ $Date: 2004/09/15 11:21:07 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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.'&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: bbc_moteur_structure.fonct.php,v $ |
* 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 ----------------------------------------------------------------------------------------+ |
*/ |
?> |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/applications/bb_consultation/bibliotheque/bbc_affichage_media.fonct.php |
---|
New file |
0,0 → 1,359 |
<?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.4 2005/05/17 10:10:08 jpm 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.4 $ $Date: 2005/05/17 10:10:08 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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')) { |
// TODO : affichage du type de média |
$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.'&art='.$get_idcoll.'-'.$get_seriecoll.'-'.$get_idfasc. |
'&arg_0=str%3D'.$get_idstr.'&arg_1=coll%3D'.$get_idstr. |
'&arg_2=book%3D'.$get_idstr.'&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.'&page='.$tmp_page.'&'. |
$tmp_word.'='.$get_idstr.'&arg_0=str%3D'.$get_idstr.'&arg_1=coll%3D'.$get_idstr.'&arg_2=book%3D'.$get_idstr. |
'&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.'&str='.$get_idstr. |
'&arg_0=str%3D'.$get_idstr.'&arg_1=coll%3D'.$get_idstr. |
'&arg_2=book%3D'.$get_idstr.'&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).' €)'; |
} |
} |
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.'&str='.$get_idstr.'&page=0&arg_0=str%3D'.$get_idstr.'&arg_1=coll%3D'. |
$get_idstr.'&arg_2=book%3D'.$get_idstr.'&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: bbc_affichage_media.fonct.php,v $ |
* 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 ----------------------------------------------------------------------------------------+ |
*/ |
?> |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/applications/bb_consultation/bibliotheque/bbc_affichage.fonct.php |
---|
New file |
0,0 → 1,483 |
<?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.5 2005/01/04 16:23:47 jpm 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.5 $ $Date: 2005/01/04 16:23:47 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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 = '&arg_0='.$arg_0.'&arg_1='.$arg_1.'&arg_2='.$arg_2.'&arg_3='.$arg_3.'&arg_4='.$arg_4.'&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(). |
'&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.'"> </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.'&consultation=avancee&page=1&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.'&consultation=avancee&page=1&fasc='.$tableau['back'].$tableau['args']. |
'&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.'&consultation=avancee&page=1&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.'&consultation=avancee&page=1&art='.$tableau['pass'].$tableau['args']. |
'&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: bbc_affichage.fonct.php,v $ |
* 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/client/biblio_bota/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.2 2004/09/15 11:21:07 jpm 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.2 $ $Date: 2004/09/15 11:21:07 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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 "structure". |
* |
* @return string les résultats à afficher. |
*/ |
function mkresu() |
{ |
global $result_final; |
global $nbr_final; |
global $tbl; |
global $TabFinder; |
global $var_biblio; |
global $GS_GLOBAL; |
$ret = ''; |
$ret .= '<ul id="bb_liste_resultat_structure">'."\n"; |
$i = 1; |
while ($row = mysql_fetch_object($result_final)) { |
$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_pays = $row->GC_NAME; |
$get_date = $row->B_S_MAJFICHE; |
$get_categ = $row->B_S_TYPESTR; |
$get_categ_nom = $row->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("<B>Erreur lors de la recherche du département :</B> $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 { |
die('<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.'&str='.$get_idstr.'&arg_0=str%3D'.$get_idstr.'&arg_1=coll%3D'. |
$get_idstr.'&arg_2=book%3D'.$get_idstr.'&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.'&action=new&ensemble=str">'.'Proposer un nouvel organisme'.'</a>'. |
'<hr size="1" />'. |
'</p>'."\n"; |
} |
return $ret; |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: bbc_affichage_structure.fonct.php,v $ |
* 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/client/biblio_bota/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$ |
/** |
* 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$ $Date$ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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'] = '&arg_0=str%3D'.$le_numero.'&arg_1=coll%3D'.$le_numero. |
'&arg_2=book%3D'.$le_numero.'&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.'&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$ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/applications/bb_consultation/bbc_info_media.inc.php |
---|
New file |
0,0 → 1,291 |
<?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$ |
/** |
* 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$ $Date$ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
if ($tableau['pstart']== '') { |
$tableau['pstart'] = 0; |
} |
$tableau['args'] = '&arg_0=str%3D'.$tableau['media'].'&arg_1=coll%3D'.$tableau['media'].'&arg_2=book%3D'.$tableau['media'].'&arg_3=media%3D'.$tableau['media']; |
// Proposition d'édition |
/* TODO NAVIGBIBLIO */ |
/* |
$sortie .= '<p>'."\n"; |
if ($var_biblio['open_proposer_media'] == 1) { |
$sortie .= CreateNavigBiblio('add', 'media', 'Proposer un nouveau media', $tableau['media'], 1, $tableau); |
} else { |
$sortie .= ' '; |
} |
$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).' €)'; |
} |
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$ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/applications/bb_consultation/bbc_info_livre.inc.php |
---|
New file |
0,0 → 1,275 |
<?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$ |
/** |
* 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$ $Date$ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
if ($tableau['pstart']== '') { |
$tableau['pstart'] = 0; |
} |
// Ligne de proposition d'édition |
/* TODO NAVIGBIBLIO |
if ($var_biblio['open_proposer_media'] == 1) { |
$sortie .= CreateNavigBiblio('add', 'book', 'Proposer un nouveau livre', $tableau['book'], 1, $tableau); |
} else { |
$sortie .= ' '; |
} |
*/ |
// 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'] = '&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).' €)'; |
} |
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$ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/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$ |
/** |
* 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$ $Date$ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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'] = '&art='.$tableau['art'].'&arg_0=str%3D'.$le_numero.'&arg_1=coll%3D'.$le_numero.'&arg_2=book%3D'.$le_numero.'&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$ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/applications/bb_synthese/configuration/bbsy_config.inc.php |
---|
New file |
0,0 → 1,86 |
<?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$ |
/** |
* 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$ $Date$ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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'); |
// +------------------------------------------------------------------------------------------------------+ |
// 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$ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/applications/bb_synthese/bb_synthese.php |
---|
New file |
0,0 → 1,283 |
<?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.2 2005/03/01 15:18:48 jpm 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.2 $ $Date: 2005/03/01 15:18:48 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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: bb_synthese.php,v $ |
* 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/client/biblio_bota/applications/bb_synthese/langues/bbsy_langue_fr.inc.php |
---|
New file |
0,0 → 1,95 |
<?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/02/24 18:35:03 jpm 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/02/24 18:35:03 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | 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: bbsy_langue_fr.inc.php,v $ |
* Revision 1.1 2005/02/24 18:35:03 jpm |
* Ajout du fichier de traduction de l'application synthèse. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/applications/bb_synthese/presentations/images/bbsy_synthese.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/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/client/biblio_bota/biblio_bota_organisme_carto.php |
---|
New file |
0,0 → 1,68 |
<?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$ |
/** |
* Redirection vers BiblioBota - Organisme Carto. |
* |
* Fichier permettant d'ajouter l'application Organisme Carto dans le gestionnaire |
* d'application de Papyrus. |
* L'utilisation de ce fichier évite de devoir passer des arguments à l'application Biblio Bota dans le gestionnaire |
* de menu de Papyrus. |
* |
*@package BiblioBota-OrganismeCarto |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@clapas.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision$ $Date$ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// Nous spécifions l'application à appeler. |
if (!isset($_REQUEST['appli'])) { |
$_REQUEST['appli'] = 'bb_organisme_carto'; |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Inclusion du fichier principal de Biblio Bota.*/ |
require_once 'biblio_bota.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log$ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/configuration/bb_config_url.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 Biblio Bota. | |
// | | |
// | 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_config_url.inc.php,v 1.1 2005/03/01 16:25:57 jpm Exp $ |
/** |
* Configuration générale des url des applications de Biblio Bota |
* |
* Ce fichier permet de stocker les valeurs concernant les url communes aux différentes applications |
* constituant Biblio Bota. |
* |
*@package BiblioBota |
*@subpackage Configuration |
//Auteur original : |
*@author Jean-Pascal MILENT <jpm@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision: 1.1 $ $Date: 2005/03/01 16:25:57 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// Définition des URL |
// Redéfini le séparateur utilisé lorsque PHP génère des URLs pour séparer les arguments. |
//ini_set('arg_separator.output', '&');// Déjà défini dans Papyrus |
/** Constante stockant l'url de base de l'application.*/ |
define('BB_URL_COURANTE', $GLOBALS['_GEN_commun']['url']->getUrl()); |
/** Constante stockant l'url de base et un argument appelant l'application bb_admin de Biblio Bota.*/ |
define('BB_URL_COURANTE_ADMIN', $GLOBALS['_GEN_commun']['url']->getUrl().'&appli=bb_admin'); |
/** Constante stockant l'url de base et un argument appelant l'application bb_consultation de Biblio Bota.*/ |
define('BB_URL_COURANTE_CONSULTATION', $GLOBALS['_GEN_commun']['url']->getUrl().'&appli=bb_consultation'); |
/** Constante stockant l'url de base et un argument appelant l'application bb_consultation en mode avancé de Biblio Bota.*/ |
define('BB_URL_COURANTE_CONSULTATION_AVANCEE', $GLOBALS['_GEN_commun']['url']->getUrl().'&appli=bb_consultation&consultation=avancee'); |
/** Constante stockant la valeur i18n fournie par Papyrus et pouvant être passée dans l'url.*/ |
define('BB_URL_I18N', $GLOBALS['_GEN_commun']['i18n']); |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: bb_config_url.inc.php,v $ |
* Revision 1.1 2005/03/01 16:25:57 jpm |
* Mise dans un fichier distinct des constantes d'url utilisant Net_URL de Pear. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/configuration/bb_config_bdd.inc.php |
---|
New file |
0,0 → 1,85 |
<?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 Biblio-Bota. | |
// | | |
// | 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_config_bdd.inc.php,v 1.2 2005/02/28 16:56:07 jpm Exp $ |
/** |
* Configuration de la base de données |
* |
* Fichier contenant les constantes permettant de se connecter à la base de données de Biblio Bota. |
* |
*@package BiblioBota |
*@subpackage configuration |
//Auteur original : |
*@author Jean-Pascal MILENT <jpm@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.2 $ $Date: 2005/02/28 16:56:07 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// Paramétrage de la base de données. |
/** Constante stockant le protocole de la base de données.*/ |
define('BB_BDD_PROTOCOLE', 'mysql'); |
/** Constante stockant le nom du serveur de bases de données.*/ |
define('BB_BDD_SERVEUR', 'localhost'); |
/** Constante stockant le nom de l'utilisateur de la base de données de Biblio Bota.*/ |
define('BB_BDD_UTILISATEUR', 'telabotap'); |
/** Constante stockant le mot de passse de l'utilisateur de la base de données de Biblio Bota.*/ |
define('BB_BDD_MOT_DE_PASSE', ''); |
/** Constante stockant le nom de la base de données par défaut de Biblio Bota.*/ |
define('BB_BDD_NOM', 'tela_prod_bibliobota'); |
/** Constante stockant le nom de la base de données où se trouvent les tables pour la Cartographie.*/ |
define('BB_BDD_NOM_CARTO', 'tela_prod_v4'); |
// +------------------------------------------------------------------------------------------------------+ |
// Paramétrage de la valeur du DSN pour Pear DB. |
/** Constante stockant le DSN permetant de se connecter à la base de données de Biblio Bota.*/ |
define('BB_DSN', BB_BDD_PROTOCOLE.'://'.BB_BDD_UTILISATEUR.':'.BB_BDD_MOT_DE_PASSE.'@'.BB_BDD_SERVEUR.'/'.BB_BDD_NOM); |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: bb_config_bdd.inc.php,v $ |
* Revision 1.2 2005/02/28 16:56:07 jpm |
* Ajout d'une constante de définition du nom d'une base de données. |
* |
* Revision 1.1 2005/02/24 11:14:37 jpm |
* Ajout du fichier de configuration de la base de données. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/biblio_bota_reference.php |
---|
New file |
0,0 → 1,74 |
<?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: biblio_bota_reference.php,v 1.1 2005/02/28 14:27:56 jpm Exp $ |
/** |
* Redirection vers BiblioBota - Lien Favoris variante : Référence. |
* |
* Fichier permettant d'ajouter la variante Référence de l'application Lien Favoris dans le gestionnaire d'application |
* de Papyrus. |
* L'utilisation de ce fichier évite de devoir passer des arguments à l'application Biblio Bota dans |
* le gestionnaire de menu de Papyrus. |
* |
*@package BiblioBota-Partenaire |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@clapas.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2005/02/28 14:27:56 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// Nous spécifions l'application à appeler. |
if (!isset($_REQUEST['appli'])) { |
$_REQUEST['appli'] = 'bb_lien_favoris'; |
} |
/** Nous spécifions le paramêtre selecteur de l'application.*/ |
$GLOBALS['_GEN_commun']['info_application']->selecteur = 'ref'; |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Inclusion du fichier principal de Biblio Bota.*/ |
require_once 'biblio_bota.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: biblio_bota_reference.php,v $ |
* Revision 1.1 2005/02/28 14:27:56 jpm |
* Changement du nom de l'appli en Lien Favoris. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/bibliotheque/cartographie/carto_historique.class.php |
---|
New file |
0,0 → 1,132 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.3 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of Cartographie. | |
// | | |
// | 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: carto_historique.class.php,v 1.1 2005/02/28 15:03:49 jpm Exp $ |
/** |
* Classe Carto_Historique. |
* |
* Classe permettant de réaliser des cartes. |
* |
*@package Cartographie |
//Auteur original : |
*@author Nicolas MATHIEU |
//Autres auteurs : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision: 1.1 $ $Date: 2005/02/28 15:03:49 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** |
* Classe Carto_Historique() - Affiche les liens avec les carte précédentes. |
* |
* La classe Carto_Historique sert à pouvoir afficher les liens avec les carte précédentes |
* On accède à cette fonctionnalité grâce à la méthode afficherHistoriqueCarte() |
* L'objet Carto_HistoriqueCarte recoit en parametres : |
* - la généalogie du niveau ou on en est (du type monde*europe*france ) |
* - l'url du document |
* - en option : - le caractere de separation (par defaut c'est >) |
* - la classe css des liens |
*/ |
class Carto_Historique |
{ |
// +--------------------------------------------------------------------------------------------------+ |
// LES ATTRIBUTS DE LA CLASSE |
var $historique; |
var $url; |
var $caractere_separation; |
var $class_css; |
var $nom; |
// +--------------------------------------------------------------------------------------------------+ |
// LE CONSTRUCTEUR DE LA CLASSE |
/** |
* Constructeur Carto_Historique() |
* |
* Constructeur initialisant les attributs de la classe Carto_Historique(). |
*/ |
function Carto_Historique($objet_carte, $caractere = '>', $class = '') |
{ |
$this->historique = $objet_carte->historique; |
$this->url = $objet_carte->url; |
$this->nom = $objet_carte->nom; |
unset ($objet_carte); |
$this->caractere_separation = $caractere; |
$this->class_css = $class; |
}//Fin du constructeur Carto_Historique(). |
// +--------------------------------------------------------------------------------------------------+ |
// LES METHODES PUBLIQUES |
function afficherHistoriqueCarte() |
{ |
$res=''; |
$tabonglet = explode ('*', $this->historique); |
$tabnom = explode ('*', $this->nom); |
foreach ($tabonglet as $key=>$value) { |
if ($key == 0) { |
$chemin = $value; |
} |
else { |
$chemin .= '*'.$value; |
} |
$res.= '<a '; |
if (!empty($this->class_css)) { |
$res.='class="'.$this->class_css.'" '; |
} |
$res.='href="'.$this->url.'&historique_cartes='.$chemin.'"> '.$this->caractere_separation.' '.$tabnom[$key].'</a>'; |
} |
return $res; |
}//Fin de la méthode afficherHistoriqueCarte(). |
}//Fin de la classe Carto_Historique. |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: carto_historique.class.php,v $ |
* Revision 1.1 2005/02/28 15:03:49 jpm |
* Ajout des fichiers de la bibliothèque cartographique. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/bibliotheque/cartographie/carto_action.class.php |
---|
New file |
0,0 → 1,218 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.3 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of Cartographie. | |
// | | |
// | 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: carto_action.class.php,v 1.2 2005/03/01 15:20:34 jpm Exp $ |
/** |
* Classe ActionCarte. |
* |
* Calsse permettant de connaître les actions à réaliser sur une carte. |
* |
*@package Cartographie |
//Auteur original : |
*@author Nicolas MATHIEU |
//Autres auteurs : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision: 1.2 $ $Date: 2005/03/01 15:20:34 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** |
* Classe Carto_Action() - Recueille les infos sur l'action à réaliser pour une zone géo donnée. |
* |
* La classe Carto_Action sert a definir les paramètres nécessaires pour recueillir l'action a réaliser en |
* fonction des coordonnées du point, du masque et du niveau. |
* Elle remplace la fonction get_cartoAction() que l'on peut trouver dans le fichier carto_commun.php |
* des différentes application utilisant la carto. |
* Les champs a renseigner sont les suivants : |
* -le nom de la table ($nom_table_carto_action) où sont stokée les actions à réalisées |
* en fonction des couleurs |
* -les 5 champs principaux de la table : |
* -l'identifiant de la zone géographique (un nom, un numéro ou une abréviation) -> $nom_champ_cle |
* -les couleurs -> $nom_champ_rouge, $nom_champ_vert, $nom_champ_bleu |
* -l'action -> $nom_champ_action |
* Elle possède une seule méthode : get_cartoAction(). |
*/ |
class Carto_Action |
{ |
// +--------------------------------------------------------------------------------------------------+ |
// LES ATTRIBUTS DE LA CLASSE |
var $_table_zone_geo; |
var $_id_zone_geo_zone; |
var $_rouge; |
var $_vert; |
var $_bleu; |
var $_table_action; |
var $_id_carte_action; |
var $_id_zone_geo_action; |
var $_type_zone_geo_action; |
var $_action; |
var $_id_carte_destination; |
// +--------------------------------------------------------------------------------------------------+ |
// LE CONSTRUCTEUR DE LA CLASSE |
/** |
* Constructeur Carto_Action() |
* |
* Constructeur initialisant les attributs de la classe Carto_Action(). |
*/ |
function Carto_Action($info_table_zone_geo, $info_table_action) |
{ |
$this->_table_zone_geo = $info_table_zone_geo['nom_table_zone']; |
$this->_id_zone_geo_zone = $info_table_zone_geo['nom_chp_id_zone']; |
$this->_rouge = $info_table_zone_geo['nom_chp_rouge']; |
$this->_vert = $info_table_zone_geo['nom_chp_vert']; |
$this->_bleu = $info_table_zone_geo['nom_chp_bleu']; |
$this->_table_action = $info_table_action['nom_table_action']; |
$this->_id_carte_action = $info_table_action['nom_chp_id_carte']; |
$this->_id_zone_geo_action = $info_table_action['nom_chp_id_zg_action']; |
$this->_type_zone_geo_action = $info_table_action['nom_chp_type_zg']; |
$this->_action = $info_table_action['nom_chp_action']; |
$this->_id_carte_destination = $info_table_action['nom_chp_id_carte_destination']; |
} |
// +--------------------------------------------------------------------------------------------------+ |
// LES METHODES PRIVÉES |
/** |
* Méthode _consulterActionImage($imageX, $imageY, $masque, $id_carte) |
* |
* Elle renvoit l'action a réaliser. |
* Nous passons les paramètres suivant : |
* -les coordonnees du point ($imageX et $imageY) |
* -le masque pour recuperer la couleur ($masque) |
* -l'identifiant de la carte où nous nous trouvons ($id_carte) |
*/ |
function _consulterActionImage($imageX, $imageY, $masque, $id_carte) |
{ |
// Nous récuperons les valeurs RVB de la couleur sur laquelle l'utilisateur a cliqué. |
// Les valeurs RVB sont stockées dans le tableau associatif $valeurs_RVB. |
$masque_courant = imagecreatefrompng($masque); |
$index_couleur = imagecolorat($masque_courant, $imageX, $imageY); |
$valeurs_RVB = imagecolorsforindex($masque_courant, $index_couleur); |
// Nous effectuons une requete dans la table carto_ACTION pour récupérer la valeur |
// du champ "action", afin de savoir quoi faire. |
$requete = |
'SELECT '.$this->_action.', '.$this->_id_carte_destination.', '.$this->_id_zone_geo_action. |
' FROM '.$this->_table_action.', '.$this->_table_zone_geo. |
' WHERE '.$this->_table_zone_geo.'.'.$this->_rouge.' = '.$valeurs_RVB['red']. |
' AND '.$this->_table_zone_geo.'.'.$this->_vert.' = '.$valeurs_RVB['green']. |
' AND '.$this->_table_zone_geo.'.'.$this->_bleu.' = '.$valeurs_RVB['blue']. |
' AND '.$this->_table_action.'.'.$this->_id_zone_geo_action.' = '.$this->_table_zone_geo.'.'.$this->_id_zone_geo_zone. |
' AND '.$this->_table_action.'.'.$this->_id_carte_action.' = "'.$id_carte.'"'; |
$resultat=mysql_query($requete) or die(' |
<h2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</h2>'. |
'<b>Fichier : </b>'.__FILE__.'<br />'. |
'<b>Ligne : </b>'.__LINE__.'<br />'. |
'<b>Requete : </b>'.$requete.'<br />'. |
'<b>Erreur : </b>'.mysql_error()); |
$ligne = mysql_fetch_object ($resultat); |
if (mysql_num_rows ($resultat) != 0) { |
$chp_id_zone_geo = $this->_id_zone_geo_action; |
$chp_action = $this->_action; |
$chp_id_carte_destination = $this->_id_carte_destination; |
$action['id_zone_geo'] = $ligne->$chp_id_zone_geo; |
$action['type_action'] = $ligne->$chp_action; |
$action['id_carte_destination'] = $ligne->$chp_id_carte_destination; |
return $action; |
} |
}//Fin de la méthode _consulterActionImage(). |
/** |
* Méthode _consulterActionListe($id_zone_carte, $id_carte) |
* |
* Elle renvoit l'action a réaliser. |
* Nous passons les paramètres suivant : |
* -l'identifiant de la zone que l'on veut afficher |
* -l'identifiant de la carte où nous nous trouvons ($id_carte) |
*/ |
function _consulterActionListe($id_zone_carte, $id_carte) |
{ |
// Nous effectuons une requete dans la table carto_ACTION pour récupérer la valeur |
// du champ "action", afin de savoir quoi faire. |
$requete = |
'SELECT '.$this->_action.', '.$this->_id_carte_destination.', '.$this->_id_zone_geo_action. |
' FROM '.$this->_table_action.', '.$this->_table_zone_geo. |
' WHERE '.$this->_table_action.'.'.$this->_id_zone_geo_action.' = '.$this->_table_zone_geo.'.'.$this->_id_zone_geo_zone. |
' AND '.$this->_table_zone_geo.'.'.$this->_id_zone_geo_zone.' = "'.$id_zone_carte.'"'. |
' AND '.$this->_table_action.'.'.$this->_id_carte_action.' = "'.$id_carte.'"'; |
$resultat=mysql_query($requete) or die(' |
<h2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</h2>'. |
'<b>Fichier : </b>'.__FILE__.'<br />'. |
'<b>Ligne : </b>'.__LINE__.'<br />'. |
'<b>Requete : </b>'.$requete.'<br />'. |
'<b>Erreur : </b>'.mysql_error()); |
$ligne = mysql_fetch_object ($resultat); |
if (mysql_num_rows ($resultat) != 0) { |
$chp_id_zone_geo = $this->_id_zone_geo_action; |
$chp_action = $this->_action; |
$chp_id_carte_destination = $this->_id_carte_destination; |
$action['id_zone_geo'] = $ligne->$chp_id_zone_geo; |
$action['type_action'] = $ligne->$chp_action; |
$action['id_carte_destination'] = $ligne->$chp_id_carte_destination; |
return $action; |
} |
}//Fin de la méthode get_cartoAction(). |
}//Fin de la classe Carto_Action. |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: carto_action.class.php,v $ |
* Revision 1.2 2005/03/01 15:20:34 jpm |
* Modification des fichiers au niveau des infos d'erreur de requete sql. |
* |
* Revision 1.1 2005/02/28 15:03:49 jpm |
* Ajout des fichiers de la bibliothèque cartographique. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/bibliotheque/cartographie/carto_carte.class.php |
---|
New file |
0,0 → 1,825 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.3 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of Cartographie. | |
// | | |
// | 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: carto_carte.class.php,v 1.3 2005/03/03 08:58:11 jpm Exp $ |
/** |
* Classe Carto_Carte. |
* |
* Calsse permettant de réaliser des cartes. |
* |
*@package Cartographie |
//Auteur original : |
*@author Nicolas MATHIEU |
//Autres auteurs : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision: 1.3 $ $Date: 2005/03/03 08:58:11 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
require 'carto_action.class.php'; |
require 'carto_couleur.class.php'; |
require 'carto_historique.class.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** |
* Classe Carto_Carte() - Classe principale de la cartographie. |
* |
* La classe Carto_Carte permet de travailler les fichiers images des cartes. |
*/ |
class Carto_Carte |
{ |
// +--------------------------------------------------------------------------------------------------+ |
// LES ATTRIBUTS DE LA CLASSE |
var $id; |
var $_id_zone_geo_carte; |
var $nom; |
var $masque; |
var $fond; |
var $chemin; |
var $image; |
var $fils; |
var $url; |
var $_info_table_zg; |
var $filiation; |
var $image_x; |
var $image_y; |
var $historique_cartes; |
var $liste_zone_carte; |
var $historique; |
// La couleur dominante ( $maxiRVB ), la couleur la plus claire ($miniRVB) et la couleur |
// intermédiaire précédant le maximum ( $mediumRVB ) au cas ou il y aurait un trop grand |
//ecart entre les deux plus grandes valeurs. |
var $_zeroR; |
var $_zeroV; |
var $_zeroB; |
var $_miniR; |
var $_miniV; |
var $_miniB; |
var $_mediumR; |
var $_mediumV; |
var $_mediumB; |
var $_maxiR; |
var $_maxiV; |
var $_maxiB; |
//Le type de formule mathématique permettant de colorier la carte |
var $_formule_coloriage; |
//L'action à réaliser |
var $_action; |
// +--------------------------------------------------------------------------------------------------+ |
// LE CONSTRUCTEUR DE LA CLASSE |
function Carto_Carte($id, $id_zone_geo_carte, $nom, $masque, $fond, $chemin, $info_table_zg, $info_table_action) |
{ |
$this->id = $id; |
$this->_id_zone_geo_carte = $id_zone_geo_carte; |
$this->nom = $nom; |
$this->masque = $chemin.$masque; |
$this->fond = $chemin.$fond; |
$this->chemin = $chemin; |
$this->_info_table_zg = $info_table_zg; |
$this->_action = new Carto_Action($info_table_zg, $info_table_action); |
$this->fils = array(); |
$this->filiation = $id; |
$this->historique_cartes = ''; |
$this->liste_zone_carte = ''; |
$this->definirCouleurs(); |
$this->definirFormuleColoriage(); |
} |
// +--------------------------------------------------------------------------------------------------+ |
// LES METHODES PUBLIQUES |
function definirCouleurs ( |
$couleur_zero_R = '255', $couleur_zero_V = '255', $couleur_zero_B = '255', |
$couleur_mini_R = '210', $couleur_mini_V = '230', $couleur_mini_B = '210', |
$couleur_medium_R = '92', $couleur_medium_V = '181', $couleur_medium_B = '92', |
$couleur_maxi_R = '0', $couleur_maxi_V = '127', $couleur_maxi_B = '0') |
{ |
$this->_zeroR = $couleur_zero_R; |
$this->_zeroV = $couleur_zero_V; |
$this->_zeroB = $couleur_zero_B; |
$this->_miniR = $couleur_mini_R; |
$this->_miniV = $couleur_mini_V; |
$this->_miniB = $couleur_mini_B; |
$this->_mediumR = $couleur_medium_R; |
$this->_mediumV = $couleur_medium_V; |
$this->_mediumB = $couleur_medium_B; |
$this->_maxiR = $couleur_maxi_R; |
$this->_maxiV = $couleur_maxi_V; |
$this->_maxiB = $couleur_maxi_B; |
} |
function definirFormuleColoriage ($nomFormuleColoriage = 'defaut') |
{ |
$this->_formule_coloriage = $nomFormuleColoriage; |
} |
/** |
* Méthode donnerImageSimple() - Fournit image non cliquable. |
* |
* La méthode donnerImageSimple ($objet) permet de récupérer une image non cliquable. |
* |
*@param object un objet carto. |
*@return string le code XHTML de l'image non cliquable. |
*/ |
function donnerImageSimple($objet) |
{ |
$nom_fichier_image = $this->_donnerIdUnique(); |
$objet->_lancerColoriage('', $nom_fichier_image); |
$retour = '<img src="cartographie/bibliotheque/lib.carto.extractimg.php?fichier='.$nom_fichier_image.'" alt="Carte" />'; |
return $retour; |
} |
/** |
* Méthode ajouterFils() - Ajoute une sous-carte. |
* |
* La methode ajouterFils() est essentielle. Elle permet d'ajouter toutes les sous cartes voulues. |
* Il faut lui indiquer, comme a la carte du niveau du dessus, son nom, le masque, le fond et info_table_couleur. |
* On a ainsi une inclusion d'objets les uns dans les autres. |
* |
*@return null l'objet carte fils est ajouté.; |
*/ |
function ajouterFils($id, $id_zone_geo_carte, $nom, $masque, $fond, $info_table_zg, $info_table_action) |
{ |
$this->fils[$id] = new Carto_Carte($id, $id_zone_geo_carte, $nom, $masque, $fond, $this->chemin, $info_table_zg, $info_table_action); |
//Si on ajoute à la carte du monde comme fils celle de l'europe, alors |
//on aura comme valeur pour $this->filiation de la carte d'europe : monde*europe |
$this->fils[$id]->filiation = $this->filiation.'*'.$id; |
$this->fils[$id]->url = $this->url; |
//Si on ajoute à la carte du monde dont le nom est 'Monde' comme fils celle de l'europe, |
//dont le nom est 'Europe', alors on aura comme valeur pour $this->nom de la carte d'europe : Monde*Europe |
$this->fils[$id]->nom = $this->nom.'*'.$nom; |
$this->fils[$id]->historique_cartes = $this->historique_cartes; |
} |
//********************************************************************************************************* |
// La methode donnerFormulaireImage() est la methode principale de la carto. C'est elle qui gere ce qu'il y a faire en |
// fonction de l'action de l'utilisateur. |
// Trois cas se distinguent : |
// -soit l'utilisateur a clique sur un point de la carte. |
// -soit il a clique sur un des liens que l'on a afficher avec la méthode afficherHistoriqueCarte de l'objet Carto_HistoriqueCarte. |
// -soit il a sélectionné une zone géographique dans la liste déroulante. |
// Elle renvoit a la fin: |
// -soit une nouvelle carte coloriée |
// -soit false. |
//********************************************************************************************************** |
function donnerFormulaireImage () |
{ |
//global $GS_GLOBAL; |
$res = ''; |
// Nous commençons par tester tout d'abords si nous venons d'une autre carte. Pour cela nous vérifions, |
// si les attributs $this->image_x et $this->image_y de la classe Carte existe ou ne sont pas null. |
// La carte est une image appelée par une balise <input type="image"> et non par une balise classique <img>. |
// Ansi, lorsqu'on clique sur la carte le formulaire appelle (via l'url du formulaire) l'application |
// utilisant la classe carte et lui renvoit deux variables contenant les coordonnées x et y du clic. |
// L'application instancie à nouveau les objets cartes mais cette fois ci la carte affichée dépendra des |
// informations founit par une table de la base de données. |
// La classe carto_action instanciée dans l'application utilisant la classe carte fournit les noms |
// des champs et celui de la table contenant les valeur RVB de chaque zone des cartes, l'identifiant |
// de la zone et l'action à entreprendre pour la zone conssidérée. |
// La méthode imgform() utilise la méthode get_cartoAction() de l'objet Carto_Action pour connaître |
// en fonction des coordonnées du clic l'action à entreprendre. |
// Quoi qu'il arrive, on ouvre la balise formulaire |
$res = '<form id="cartographie" action="'.$this->url.'" method="post">'."\n"; |
$res .= '<p>'; |
if (isset ($this->image_x) && ($this->image_x != '') && isset ($this->image_y) && ($this->image_y != '')) { |
// on regarde ici si l'on a pas un objet de plus bas niveau présent dans la variable de session carte |
//a charger a la place de l'objet de plus haut niveau |
$var_session_retour = $_SESSION['carte']; |
if ($var_session_retour) { |
$image_x = $this->image_x; |
$image_y = $this->image_y; |
$liste_zone_carte = $this->liste_zone_carte; |
// Nous chargons alors l'ojet approprié en descendant grâce a la généalogie |
$historique_cartes = explode('*',$this->historique_cartes); |
foreach ($historique_cartes as $key => $value) { |
if ($key != 0) { |
//$this = $this->fils[$value]; |
foreach (get_object_vars($this->fils[$value]) as $key => $value) { |
$this->$key = $value; |
} |
} |
} |
$this->image_x = $image_x; |
$this->image_y = $image_y; |
$this->liste_zone_carte = $liste_zone_carte; |
unset($_SESSION['carte']) ; |
} |
// on regarde qu'est-ce qu'on doit faire grace a la methode _consulterAction() de l'objet Carto_Action |
$action = $this->_action->_consulterActionImage($this->image_x, $this->image_y, $this->masque, $this->id); |
// Nous distinguons 2 cas : |
//le cas ou il faut afficher une nouvelle carte ... : |
if ($action['type_action'] == 'Aller_a') { |
$id_carte_destination = $action['id_carte_destination'] ; |
$this->fils[$id_carte_destination]->liste_zone_carte = $this->liste_zone_carte; |
$res .= ''.$this->fils[$id_carte_destination]->_donnerListeZoneCarte()."<br />\n"; |
$res .= '<input type="image" src="'; |
$id_image = $this->_donnerIdUnique(); |
$this->fils[$id_carte_destination]->_lancerColoriage($id_image); |
$obj = serialize($this->fils[$id_carte_destination]); |
$_SESSION['carte'] = $obj; |
$this->historique = $this->fils[$id_carte_destination]->filiation; |
$this->id = $this->fils[$id_carte_destination]->id; |
$this->nom = $this->fils[$id_carte_destination]->nom; |
} |
//Dans le cas où l'on veut rappeler une nouvelle carte, il se peut que la nouvelle carte à rappeler |
//soit la même que précédement. |
//Cette possibilité peut se présenter quand on clique sur un zone blanche d'une carte (càd dans la mer) |
//Là, on recharge la carte précédente : |
elseif ($action['type_action'] == 'Recharger') { |
$res .= ''.$this->_donnerListeZoneCarte()."<br />\n"; |
$res .= '<input type="image" src="'; |
$id_image = $this->_donnerIdUnique(); |
$this->_lancerColoriage($id_image); |
$obj = serialize($this); |
$_SESSION['carte'] = $obj ; |
$this->historique = $this->filiation; |
} |
// ... et le cas ou il faut lancer le dernier niveau |
else if ($action['type_action'] == 'Stop') { |
unset ($_SESSION['carte']) ; |
$this->historique = $this->filiation.'*'.$action['id_zone_geo']; |
$obj = serialize($this); |
$_SESSION['carte'] = $obj ; |
return false; |
} |
} |
elseif ($this->liste_zone_carte != '') { |
$liste_zone_carte = $this->liste_zone_carte; |
$historique_cartes = explode('*',$this->historique_cartes); |
foreach ($historique_cartes as $key => $value) { |
if ($key != 0) { |
//$this = $this->fils[$value]; |
foreach (get_object_vars($this->fils[$value]) as $key => $value) { |
$this->$key = $value; |
} |
} |
} |
$this->liste_zone_carte = $liste_zone_carte; |
$res .= ''.$this->_donnerListeZoneCarte($this->liste_zone_carte)."<br />\n"; |
$res .= '<input type="image" src="'; |
$id_image = $this->_donnerIdUnique(); |
$this->_lancerColoriage($id_image, '', $this->liste_zone_carte); |
$this->historique = $this->historique_cartes; |
$obj = serialize($this); |
$_SESSION['carte'] = $obj ; |
} |
// On teste maintenant si l'on vient d'un lien. Si c'est le cas on a recu un argument |
// qui nous donne la "genealogie" de la carte que l'on doit afficher |
else if ($this->historique_cartes) { |
// Nous chargons alors l'ojet approprié en descendant grâce a la généalogie |
$historique_cartes = explode('*',$this->historique_cartes); |
foreach ($historique_cartes as $key => $value) { |
if ($key != 0) { |
//$this = $this->fils[$value]; |
foreach (get_object_vars($this->fils[$value]) as $key => $value) { |
$this->$key = $value; |
} |
} |
} |
// une foit que l'on a charge le bon objet nous le colorions |
$res .= ''.$this->_donnerListeZoneCarte()."<br />\n"; |
$res .= '<input type="image" src="'; |
$id_image = $this->_donnerIdUnique(); |
$this->_lancerColoriage($id_image); |
$this->historique = $this->historique_cartes; |
$obj = serialize($this); |
$_SESSION['carte'] = $obj ; |
} |
// Enfin si on ne vient pas d'une carte ou d'un lien c'est que l'on vient de l'onglet carto du menu |
// et on affiche alors la premiere carte |
else { |
unset ($_SESSION['carte']) ; |
$res .= ''.$this->_donnerListeZoneCarte()."<br />\n"; |
$res .= '<input type="image" src="'; |
$id_image = $this->_donnerIdUnique(); |
$this->_lancerColoriage($id_image); |
$this->historique = $this->id; |
$obj = serialize($this); |
$_SESSION['carte'] = $obj; |
} |
$_SESSION['chemin'] = CAR_CHEMIN_TMP; |
$_SESSION['fichier'] = $this->id.$id_image; |
$res .= CAR_CHEMIN_CARTE.'"'; |
$res .= ' name="image" onmouseover="javascript:show(\'d\');" onmouseout="javascript:show(\'d\');" />'."\n"; |
$res .= '<input type="hidden" name="historique_cartes" value="'.$this->historique.'" />'."\n"; |
$res .= '</p>'."\n"; |
$res .= '</form>'."\n"; |
return $res; |
} |
// +--------------------------------------------------------------------------------------------------+ |
// LES METHODES PRIVÉES |
function _donnerListeZoneCarte($zone_par_defaut = '') |
{ |
$retour = ''; |
$requete = 'SELECT '.$this->_info_table_zg['nom_chp_id_zone'].', '.$this->_info_table_zg['nom_chp_nom_zone'].' '. |
'FROM '.$this->_info_table_zg['nom_table_zone'].' '; |
// Nous éliminons la zone blanche ne correspondant à rien |
if (ereg('[a-z]+', $this->_info_table_zg['nom_chp_id_zone'])) { |
$requete .= 'WHERE '.$this->_info_table_zg['nom_chp_id_zone'].' != "0" '; |
} else { |
$requete .= 'WHERE '.$this->_info_table_zg['nom_chp_id_zone'].' != 0 '; |
} |
// Nous sélectionnons en fonction de la zone géo supérieure. |
if ($this->_info_table_zg['nom_chp_zone_sup'] != '') { |
if (ereg('[a-z]+', $this->_id_zone_geo_carte)) { |
$requete .= 'AND '.$this->_info_table_zg['nom_chp_zone_sup'].' = "'.$this->_id_zone_geo_carte.'" '; |
} else{ |
$requete .= 'AND '.$this->_info_table_zg['nom_chp_zone_sup'].' = '.$this->_id_zone_geo_carte.' '; |
} |
} |
// Nous trions par ordre alphabétique |
$requete .= 'ORDER BY '.$this->_info_table_zg['nom_chp_nom_zone'].' ASC'; |
$resultat = mysql_query ($requete) or die(' |
<h2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</h2>'. |
'<b>Fichier : </b>'. __FILE__ . |
'<b>Ligne : </b>'. __LINE__ . |
'<b>Requete : </b>'.$requete. |
'<br/><br/><b>Erreur : </b>'.mysql_error()); |
$i=0; |
$retour = '<select id="liste_zone_carte" name="liste_zone_carte" onchange="javascript:this.form.submit();">'."\n"; |
$retour .= '<option value="">Visualiser une zone :</option>'."\n"; |
$nom_chp_nom_zone = $this->_info_table_zg['nom_chp_nom_zone']; |
$nom_chp_id_zone = $this->_info_table_zg['nom_chp_id_zone']; |
while ($ligne = mysql_fetch_object ($resultat)) { |
if ($zone_par_defaut == $ligne->$nom_chp_id_zone) { |
$retour .= '<option value="'.$ligne->$nom_chp_id_zone.'" selected="selected">'.$ligne->$nom_chp_nom_zone.'</option>'."\n"; |
} else { |
$retour .= '<option value="'.$ligne->$nom_chp_id_zone.'">'.$ligne->$nom_chp_nom_zone.'</option>'."\n"; |
} |
$i++; |
} |
$retour .= '</select>'."\n"; |
return $retour; |
} |
//============================================================================== |
// METHODE _lancerColoriage() |
// |
// Elle lance le coloriage de l'image. |
// Elle est lancée toute seule par la méthode donnerFormulaireImage(). |
// Les informations qui lui sont necessaires sont déjà données à l'objet carte (fond, info_table_couleur). |
//============================================================================== |
function _lancerColoriage($id_image = '_00', $nom_fichier = '', $id_zone_a_reperer = '') |
{ |
$this->image = imagecreatefrompng($this->fond); |
$this->_colorierImage ($this->image, $this->_info_table_zg['nom_table_zone'], $this->_info_table_zg['nom_chp_id_zone'], $this->_info_table_zg['nom_chp_rouge'], |
$this->_info_table_zg['nom_chp_vert'], $this->_info_table_zg['nom_chp_bleu'], $this->_info_table_zg['nom_chp_zone_sup'], |
$this->_info_table_zg['tableau_valeurs_zone'], $id_zone_a_reperer) ; |
if ($nom_fichier != '') { |
imagepng(&$this->image, CAR_CHEMIN_TMP.$nom_fichier.'.png'); |
//$this->image = imagepng(&$this->image); |
} |
else { |
imagepng(&$this->image, CAR_CHEMIN_TMP.$this->id.$id_image.'.png'); |
//imagepng(&$this->image); |
} |
} |
//============================================================================== |
// METHODE _colorierImage() |
// |
// Elle réalise le coloriage de l'image. |
//============================================================================== |
function _colorierImage(&$image_fond, $table_zone_geo, $chp_id_zone_couleur, $chp_rouge, $chp_vert, $chp_bleu, $chp_zone_sup, $tableau_valeurs_zone, $id_zone_a_reperer) |
{ |
//---------------------------------------------------------------------------- |
// Cherche les valeurs RVB de la couleur de chaque zone géographique et les rentre dans |
//un tableau d'objets Carto_InformationCouleur (voir la description de la classe ci-dessus. |
$requete_01 = |
'SELECT *'. |
' FROM '.$table_zone_geo; |
if ($chp_zone_sup != ''){ |
if(ereg("[a-z]+",$this->_id_zone_geo_carte)){ |
$requete_01 .= |
' WHERE '.$chp_zone_sup.' = "'.$this->_id_zone_geo_carte.'"'; |
} |
else{ |
$requete_01 .= |
' WHERE '.$chp_zone_sup.' = '.$this->_id_zone_geo_carte; |
} |
} |
$resultat_01 = mysql_query ($requete_01) or die(' |
<H2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</H2>'. |
'<b>Fichier : </b>'.__FILE__. |
'<b>Ligne : </b>'.__LINE__. |
'<b>Requete : </b>'.$requete_01. |
'<br/><br/><b>Erreur : </b>'.mysql_error()); |
$i=0; |
$attachments = array(); |
while ($ligne_01 = mysql_fetch_object($resultat_01)) { |
$attachments[$i] = new Carto_Couleur($ligne_01->$chp_id_zone_couleur, $ligne_01->$chp_rouge, $ligne_01->$chp_vert, $ligne_01->$chp_bleu); |
$i++; |
} |
//Nous libérons toute la mémoire associée à l'identifiant de résultat. |
mysql_free_result ($resultat_01); |
//---------------------------------------------------------------------------- |
// On realide l'association entre l'index des couleurs et la zone de meme couleur |
$attachments = $this->_construireAssociationIndexZone ($image_fond, $attachments); |
//---------------------------------------------------------------------------- |
//Dans l'application qui utilise la classe carte, nous avons instancié un tableau |
//associatif qui contient en clé l'identifiant d'une zone géographique et en valeur |
//un nombre (qui peut-être un nombre d'inscrit, d'institutions, de taxons...). |
// Nous récupérons ci-dessous la valeur minimum autre que 0 présente dans ce tableau |
//puis une valeur conscidérée comme maximum |
if (!is_array($tableau_valeurs_zone)) { |
$mini = 0; |
$medium = 0; |
$maxi = 0; |
$nbre_valeurs = 0; |
} |
else { |
if (count($tableau_valeurs_zone) == 0) { |
$mini=0; |
$medium = 0; |
$maxi=0; |
} |
else { |
$i=0; |
foreach ($tableau_valeurs_zone as $cle => $valeur) { |
//Nous recherchons le minimum, le maximum et le la valeur médium juste au dessous du maximum. |
if ($valeur != 0) { |
$tablo_valeurs[$i] = $valeur; |
$i++; |
} |
} |
//Nombre d'entrées dans le tableau de valeurs non nulles : |
$nbre_valeurs = count($tablo_valeurs); |
$somme_valeurs = array_sum($tablo_valeurs); |
$tablo_frequences = array_count_values($tablo_valeurs); |
$nbre_frequences = count($tablo_frequences); |
if ($nbre_valeurs > 0){ |
//Nous trions le tableau dans l'ordre croissant : |
sort($tablo_valeurs); |
//Nous récupérons la valeur la plus petite : |
$mini = $tablo_valeurs[0]; |
$maxi = $tablo_valeurs[$nbre_valeurs-1]; |
isset($tablo_valeurs[$nbre_valeurs-2]) ? $medium = $tablo_valeurs[$nbre_valeurs-2] : $medium = 0; |
$moyenne = $somme_valeurs/$nbre_valeurs; |
$ecart_au_carre_moyen = 0; |
for ($i = 0; $i < $nbre_valeurs; $i++) { |
$ecart_au_carre_moyen += pow(($tablo_valeurs[$i] - $moyenne), 2); |
} |
$variance = $ecart_au_carre_moyen/$nbre_valeurs; |
$ecart_type = sqrt($variance); |
$moyenne = round($moyenne, 0); |
$variance = round($variance, 0); |
$ecart_type = round($ecart_type, 0); |
/*echo 'Nombre de valeurs : '.$nbre_valeurs.'<br>'; |
echo 'Nombre de frequences : '.$nbre_frequences.'<br>'; |
echo 'Moyenne : '.$moyenne.'<br>'; |
echo 'Variance : '.$variance.'<br>'; |
echo 'Ecart-type : '.$ecart_type.'<br>'; |
echo 'Formule de coloriage : '.$this->_formule_coloriage.'<br>'; |
echo "mini : $mini medium : $medium maxi : $maxi<br/>"; |
*/ |
} |
} |
} |
//---------------------------------------------------------------------------- |
// Nous réalisons le coloriage de toutes les zones : |
$requete_03 = 'SELECT '.$chp_id_zone_couleur.' '. |
'FROM '.$table_zone_geo; |
$resultat_03 = mysql_query ($requete_03) or die(' |
<h2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</h2>'. |
'<b>Fichier : </b>'.__FILE__. |
'<b>Ligne : </b>'.__LINE__. |
'<b>Requete : </b>'.$requete_03. |
'<br/><br/><b>Erreur : </b>'.mysql_error()); |
while ($ligne_03 = mysql_fetch_object ($resultat_03)) { |
$id_zone_geo = $ligne_03->$chp_id_zone_couleur; |
if (!isset ($tableau_valeurs_zone[$id_zone_geo])) { |
$tableau_valeurs_zone[$id_zone_geo] = 0; |
} |
//Nous cherchons la couleur a afficher pour chaque zone. |
if ($tableau_valeurs_zone[$id_zone_geo] != 0) { |
//echo 'ZONE:'.$id_zone_geo."<br/>"; |
//echo $tableau_valeurs_zone[$id_zone_geo]."<br/>"; |
$theColor = $this->_donnerCouleur ( |
$this->_miniR, $this->_miniV, $this->_miniB, |
$this->_mediumR , $this->_mediumV , $this->_mediumB , |
$this->_maxiR , $this->_maxiV , $this->_maxiB , |
$mini, $medium, $maxi, $nbre_valeurs, $ecart_type, $moyenne, $tablo_valeurs, |
$tablo_frequences, $nbre_frequences, |
$tableau_valeurs_zone[$id_zone_geo], |
$this->_formule_coloriage); |
//echo $theColor['R'].'<br>'; |
//echo $theColor['V'].'<br>'; |
//echo $theColor['B'].'<br>'; |
} |
else { |
$theColor['R'] = $this->_zeroR; |
$theColor['V'] = $this->_zeroV; |
$theColor['B'] = $this->_zeroB; |
} |
//Nous réalisons le coloriage de toutes les zones de l'image avec la couleur obtenue. |
$this->_remplacerCouleur ($image_fond, $attachments, $id_zone_geo, $theColor['R'], $theColor['V'], $theColor['B'], $id_zone_a_reperer); |
} |
//Nous libérons toute la mémoire associée à l'identifiant de résultat de la requête. |
mysql_free_result ($resultat_03); |
} |
//============================================================================== |
// METHODE _construireAssociationIndexZone ($image, &$att) |
// |
// Le tableau $att est passé par référence. La méthode modifie donc directement |
// le tableau et ne renvoit donc rien. |
// Attache dans un tableau $att, contenant sous forme d'objet (Carto_ColorInfo) |
// les valeurs RVB des zones d'une image, la valeur de l'index correspondant |
// à la couleur de la zone. |
// Note : les images en question sont constituées de zones distincte possédant |
// chacune une couleur unique et unie. |
//============================================================================== |
function _construireAssociationIndexZone(&$image_fond, &$att) |
{ |
// Nous récupérons le nombre de couleur différentes contenues dans l'image. |
//echo $this->fond.'<BR>'; |
$image_fond = imagecreatefrompng($this->fond); |
$taille_palette = imagecolorstotal ($image_fond); |
//echo $taille_palette.'<br>'; |
// Pour chaque couleur contenue dans l'image, nous cherchons l'objet correspondant |
// dans le tableau $att, qui contient des informations sur chaque zone de l'image, |
// et nous attribuons à l'objet la valeur de l'index de sa couleur dans l'image. |
for ($i = 0; $i < $taille_palette; $i++) { |
$valeurs_RVB = array(); |
$valeurs_RVB = imagecolorsforindex ($image_fond, $i); |
for ($j = 0; $j < count ($att); $j++) { |
if (($att[$j]->rouge == $valeurs_RVB['red']) && ($att[$j]->vert == $valeurs_RVB['green']) && ($att[$j]->bleu == $valeurs_RVB['blue'])) { |
$att[$j]->index = $i; |
//echo 'ICI'.$att[$j]->id_zone.$att[$j]->index.'<br>'; |
break; |
} |
} |
} |
return $att; |
}//Fin méthode _construireAssociationIndexZone() |
//============================================================================== |
// METHODE _donnerCouleur() |
//------------------------------------------------------------------------------ |
// Renvoie pour une valeur donnee la couleur a mettre |
//------------------------------------------------------------------------------ |
// ENTREE |
// $miniR : valeur rouge du minimum |
// $miniV : valeur vert du minimum |
// $miniB : valeur blue du minimum |
// $maxiR : valeur rouge du maximum |
// $maxiV : valeur vert du maximum |
// $maxiB : valeur bleu du maximum |
// $mediumR : valeur rouge du deuxieme maximum |
// $mediumV : valeur vert du deuxieme maximum |
// $mediumB : valeur bleu du deuxieme maximum |
// $mini : valeur mini sur l'echelle |
// $medium : valeur juste au dessous du maximum sur l'echelle |
// $maxi : valeur maxi sur l'echelle |
// $val : valeur dont on cherche la couleur |
//------------------------------------------------------------------------------ |
// SORTIE |
// $couleur array donne la couleur pour la valeur demande ($val) |
//------------------------------------------------------------------------------ |
function _donnerCouleur($miniR, $miniV, $miniB, $mediumR, $mediumV, $mediumB, $maxiR, |
$maxiV, $maxiB, $mini, $medium, $maxi, $nbre_valeurs, $ecart_type, $moyenne, $tablo_valeurs, $tablo_frequences, $nbre_frequences, $val, $formuleColoriage) |
{ |
if ($formuleColoriage == 'defaut'){ |
if ($val == $maxi) { |
$couleur['R'] = $maxiR; |
$couleur['V'] = $maxiV; |
$couleur['B'] = $maxiB; |
} |
if ($val == $mini && $val != $maxi) { |
$couleur['R'] = $miniR; |
$couleur['V'] = $miniV; |
$couleur['B'] = $miniB; |
} |
if ($maxi/10 > $medium && $maxi/40 < $medium) { |
$diff = $medium - $mini; |
if ($diff > 0 && $val != $medium && $val != $maxi) { |
$diffR = $mediumR - $miniR; |
$diffV = $mediumV - $miniV; |
$diffB = $mediumB - $miniB; |
$variationR = round ( ($diffR/$diff ), 0 ); |
$variationV = round ( ($diffV/$diff ), 0 ); |
$variationB = round ( ($diffB/$diff ), 0 ); |
$couleur['R'] = Carto_Couleur::couleur_bornerNbre(($miniR + ($val * $variationR)), 0, 255); |
$couleur['V'] = Carto_Couleur::couleur_bornerNbre(($miniV + ($val * $variationV)), 0, 255); |
$couleur['B'] = Carto_Couleur::couleur_bornerNbre(($miniB + ($val * $variationB)), 0, 255); |
} |
else if ($val == $medium) { |
$couleur['R'] = $mediumR; |
$couleur['V'] = $mediumV; |
$couleur['B'] = $mediumB; |
} |
} |
else { |
$diff = $maxi - $mini; |
if ($diff > 0 && $val != $maxi && $val != $mini) { |
$diffR = $maxiR - $miniR; |
$diffV = $maxiV - $miniV; |
$diffB = $maxiB - $miniB; |
$variationR = round ( ($diffR/$diff ), 0 ); |
$variationV = round ( ($diffV/$diff ), 0 ); |
$variationB = round ( ($diffB/$diff ), 0 ); |
$couleur['R'] = Carto_Couleur::couleur_bornerNbre(($miniR + ($val * $variationR)), 0, 255); |
$couleur['V'] = Carto_Couleur::couleur_bornerNbre(($miniV + ($val * $variationV)), 0, 255); |
$couleur['B'] = Carto_Couleur::couleur_bornerNbre(($miniB + ($val * $variationB)), 0, 255); |
} |
else if ($diff == 0){ |
$couleur['R'] = $mediumR; |
$couleur['V'] = $mediumV; |
$couleur['B'] = $mediumB; |
} |
} |
} |
elseif ($formuleColoriage == 'ecart_type') { |
if ($ecart_type == 0) { |
$couleur['R'] = $maxiR; |
$couleur['V'] = $maxiV; |
$couleur['B'] = $maxiB; |
} |
elseif ($ecart_type >= 1 && $ecart_type <= 15) { |
if ($val == $mini) { |
$couleur['R'] = $miniR; |
$couleur['V'] = $miniV; |
$couleur['B'] = $miniB; |
} |
elseif ($val == $medium) { |
$couleur['R'] = $mediumR; |
$couleur['V'] = $mediumV; |
$couleur['B'] = $mediumB; |
} |
elseif ($val == $maxi) { |
$couleur['R'] = $maxiR; |
$couleur['V'] = $maxiV; |
$couleur['B'] = $maxiB; |
} |
else { |
$dif_valeur_maxi_mini = $maxi - $mini; |
$diffR = $maxiR - $miniR; |
$diffV = $maxiV - $miniV; |
$diffB = $maxiB - $miniB; |
$variationR = round ( ($diffR/$dif_valeur_maxi_mini ), 0 ); |
$variationV = round ( ($diffV/$dif_valeur_maxi_mini ), 0 ); |
$variationB = round ( ($diffB/$dif_valeur_maxi_mini ), 0 ); |
$couleur['R']=$miniR + ($val * $variationR); |
$couleur['V']=$miniV + ($val * $variationV); |
$couleur['B']=$miniB + ($val * $variationB); |
} |
} |
elseif ($ecart_type > 15) { |
//Le tableau est trié de la plus petite à la plus grande clé. |
ksort($tablo_frequences); |
$i = 0; |
foreach ($tablo_frequences as $cle => $valeur){ |
//Nous cherchons la correspondance entre la valeur et la clé. |
if ($cle == $val) { |
//Pour faire le Rouge, Vert, Bleu |
$couleur['R'] = $miniR + ($i/$nbre_frequences) * ($maxiR - $miniR); |
$couleur['V'] = $miniV + ($i/$nbre_frequences) * ($maxiV - $miniV); |
$couleur['B'] = $miniB + ($i/$nbre_frequences) * ($maxiB - $miniB); |
} |
$i++; |
} |
} |
} |
return $couleur; |
}//Fin méthode _donnerCouleur() |
//============================================================================== |
// METHODE _remplacerCouleur ($img, $att, $id_zone_geo, $r, $g, $b) |
// |
// $img is the image, $att an array of carto_colorinfo objects, $id_zone_geo the name |
// of an object of $att, ($r, $g, $b) the new color. |
// |
// In the palette of $img, the color matching with $id_zone_geo is modified. |
//============================================================================== |
function _remplacerCouleur (&$image, &$atta, $id_zone_geo, $rouge, $vert, $bleu, $id_zone_a_reperer) |
{ |
// Nous recherchons la valeur de l'index. |
$index = -1; |
for ($i = 0; $i < count ($atta); $i++) { |
if ($atta[$i]->id_zone == $id_zone_geo) { |
$index = $atta[$i]->index; |
//Dans le cas où nous voulons repérer une zone sur la carte : |
if($id_zone_geo == $id_zone_a_reperer) { |
$rouge = 255; |
$vert = 0; |
$bleu = 0; |
} |
break; |
} |
} |
// Nous mettons à jour l'image de la carte avec la valeur de l'index. |
if ($index >= 0) { |
imagecolorset (&$image, $index, $rouge, $vert, $bleu); |
} |
}//Fin de la méthode _remplacerCouleur |
//============================================================================== |
// METHODE _donnerIdUnique () |
// |
// Cette méthode privée retourne un identifiant de 32 caractères unique. |
// |
//============================================================================== |
function _donnerIdUnique () |
{ |
$id = ''; |
$id = md5 (uniqid (rand())); |
return $id; |
}//Fin de la méthode _donnerIdUnique() |
}//Fin de la classe Carto_Carte() |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: carto_carte.class.php,v $ |
* Revision 1.3 2005/03/03 08:58:11 jpm |
* Correction erreur dans requête sélection des zones de la carte. |
* |
* Revision 1.2 2005/03/01 15:20:34 jpm |
* Modification des fichiers au niveau des infos d'erreur de requete sql. |
* |
* Revision 1.1 2005/02/28 15:03:49 jpm |
* Ajout des fichiers de la bibliothèque cartographique. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/bibliotheque/cartographie/carto_couleur.class.php |
---|
New file |
0,0 → 1,190 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.3 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of Cartographie. | |
// | | |
// | 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: carto_couleur.class.php,v 1.1 2005/02/28 15:03:49 jpm Exp $ |
/** |
* Classe Carto_Couleur. |
* |
* Classe permettant de réaliser des cartes. |
* |
*@package Cartographie |
//Auteur original : |
*@author Nicolas MATHIEU |
//Autres auteurs : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision: 1.1 $ $Date: 2005/02/28 15:03:49 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** |
* Classe Carto_Couleur() - Info sur les couleurs. |
* |
* La classe Carto_Couleur n'est utilisée que par la classe carte. |
* C'est une classe privée. |
* Elle sert à stocker les informations (RVB et index) sur la couleur d'une |
* zone d'une image. |
*/ |
class Carto_Couleur |
{ |
// +--------------------------------------------------------------------------------------------------+ |
// LES ATTRIBUTS DE LA CLASSE |
var $id_zone; |
var $rouge; |
var $vert; |
var $bleu; |
var $index; |
// +--------------------------------------------------------------------------------------------------+ |
// LE CONSTRUCTEUR DE LA CLASSE |
/** |
* Constructeur Carto_Couleur() |
* |
* Constructeur initialisant les attributs de la classe Carto_Couleur(). |
*/ |
function Carto_Couleur($id_zone, $rouge, $vert, $bleu) |
{ |
$this->id_zone = $id_zone; |
$this->rouge = $rouge; |
$this->vert = $vert; |
$this->bleu = $bleu; |
$this->index = -1; |
} |
// +--------------------------------------------------------------------------------------------------+ |
// LES METHODES PUBLIQUES |
/** |
* La fonction array couleur_hexadecimalAuRgb(string color) renvoie des valeurs de couleur en RGB. |
* |
*Cette fonction prend une valeur de couleur codée en hexadécimal et retourne |
*les valeurs RGB correspondantes sous forme de tableau. |
*Exemple d'utilisation: |
*$rgb = couleur_hexadecimalAuRgb("fffc49"); |
*echo "<br>couleur_hexadecimalAuRgb de 'fffc49' : ".$rgb['R']." ".$rgb['V']." ".$rgb['B']; |
* |
*@author iubito <sylvain_machefert@yahoo.fr> |
*@copyright iubito - http://iubito.free.fr/ - 2003 |
* |
*@param string $couleur représente une couleur codée en héxadécimal. |
* |
*@return array tableau associatif contenant les 3 valeurs RGB, avec clé du rouge 'R', |
* du vert 'V' et enfin du bleu 'B'. |
*/ |
function couleur_hexadecimalAuRgb($couleur_html) |
{ |
//gestion du #... |
if (substr($couleur_html, 0, 1) == "#") { |
$couleur_html = substr($couleur_html, 1, 6); |
} |
$tablo_rgb['R'] = hexdec(substr($couleur_html, 0, 2)); |
$tablo_rgb['V'] = hexdec(substr($couleur_html, 2, 2)); |
$tablo_rgb['B'] = hexdec(substr($couleur_html, 4, 2)); |
return $tablo_rgb; |
} |
/** |
* La fonction string couleur_rgbAuHexadecimal(array tablo) renvoie la valeur d'une |
*couleur en héxadécimal. |
* |
*Cette fonction prend un tableau de valeurs d'une couleur codées en RGB et retourne |
*la valeur hexadécimal correspondante sous forme de chaîne. |
*C'est la réciproque exacte de la fonction couleur_hexadecimalAuRgb. |
* |
*@author iubito <sylvain_machefert@yahoo.fr> |
*@copyright iubito - http://iubito.free.fr/ - 2003 |
* |
*@param array $tablo_RGB représente un tableau associatif avec les valeurs RGB |
*d'une couleur.Les trois clés du tableau sont : R pour rouge, V pour vert et B pour bleu. |
* |
*@return string chaîne contenant la valeur de la couleur sous forme héxadécimale. |
*/ |
function couleur_rgbAuHexadecimal($tablo_rgb) |
{ |
//Vérification des bornes... |
foreach($tablo_rgb as $cle => $valeur) { |
$tablo_rgb[$cle] = bornes($tablo_rgb[$cle],0,255); |
} |
//Le str_pad permet de remplir avec des 0 |
//parce que sinon couleur_rgbAuHexadecimal(array(0,255,255)) retournerai #0ffff<=manque un 0 ! |
return "#".str_pad(dechex(($tablo_rgb['R']<<16)|($tablo_rgb['V']<<8)|$tablo_rgb['B']),6,"0",STR_PAD_LEFT); |
} |
/** |
* La fonction int couleur_bornerNbre(int nb, int min, int max) borne des nombres. |
* |
*Cette fonction permet de borner la valeur d'un nombre entre un minimum $mini et |
*un maximum $maxi. |
* |
*@author iubito <sylvain_machefert@yahoo.fr> |
*@copyright iubito - http://iubito.free.fr/ - 2003 |
* |
*@param integer $nbre le nombre à borner. |
*@param integer $mini la borne minimum. |
*@param integer $maxi la borne maximum. |
* |
*@return integer le nombre limité aux bornes si nécessaire. |
*/ |
function couleur_bornerNbre($nbre, $mini, $maxi) |
{ |
if ($nbre < $mini) { |
$nbre = $mini; |
} |
if ($nbre > $maxi) { |
$nbre = $maxi; |
} |
return $nbre; |
} |
}//Fin de la classe Carto_Couleur |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: carto_couleur.class.php,v $ |
* Revision 1.1 2005/02/28 15:03:49 jpm |
* Ajout des fichiers de la bibliothèque cartographique. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/moyenorient_masque.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/moyenorient_masque.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/oceanie.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/oceanie.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/monde_masque5c.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/monde_masque5c.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/namerique.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/namerique.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/samerique_masque.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/samerique_masque.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/afrique_masque.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/afrique_masque.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/france_masque.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/france_masque.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/europe_masque.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/europe_masque.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/monde5c.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/monde5c.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/samerique.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/samerique.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/asie_masque.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/asie_masque.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/oceanie_masque.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/oceanie_masque.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/asie.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/asie.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/namerique_masque.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/bibliotheque/cartographie/cartes/namerique_masque.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/biblio_bota/bibliotheque/bb_commun.fonct.php |
---|
New file |
0,0 → 1,99 |
<?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_commun.fonct.php,v 1.1 2004/09/14 11:12:50 jpm Exp $ |
/** |
* Fonctions communes aux applications de Biblio Bota. |
* |
* Contient des fonctions communes aux applications de Biblio Bota. |
* |
*@package BiblioBota |
*@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: 2004/09/14 11:12:50 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
// string check_if_modif($table) |
// vérifie dans la table des modifications si une donnée |
// est sujette à modifications |
// entrées : |
// - string $table : nom de la table des modifs |
// - string $field_src : nom du champ source |
// - string $fiche_id : identifiant de la fiche |
// sortie : |
function check_if_modif($table, $tbl_src, $fiche_id) |
{ |
$query = 'SELECT * '. |
'FROM '.$table.' '. |
'WHERE B_MOD_TABLESRC = "'.$tbl_src.'" '. |
'AND B_MOD_FICHESRC = "'.$fiche_id.'"'; |
$resu = mysql_query($query) or die ("<B>Erreur !!!</B> : la vérification des modifications a échoué... $query"); |
$nb_resu = mysql_num_rows($resu); |
mysql_free_result($resu); |
return $nb_resu; |
} |
/** |
* La fonction remplaceEntiteHTLM() remplace des caractères par les entités html. |
* |
* Cette fonction retourne un texte dans lequel touts les caractères correspondant |
* à des entités html sont remplacés par la valeur de l'entité, à l'exception |
* des caractères <, >, & et ". |
* Cela permet de remplacer toutes les entités dans une chaine contenant du html. |
* |
*@param string la chaîne html à parsser. |
*@return string contient la chaîne html avec les entités intégrées. |
*/ |
function remplaceEntiteHTLM($texte) |
{ |
$texte_retour = ''; |
$tab_entites = get_html_translation_table(HTML_ENTITIES); |
unset($tab_entites['"']); |
unset($tab_entites['<']); |
unset($tab_entites['>']); |
unset($tab_entites['&']); |
$tab_entites[' & '] = ' & '; |
return strtr($texte, $tab_entites); |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: bb_commun.fonct.php,v $ |
* Revision 1.1 2004/09/14 11:12:50 jpm |
* Ajout des fonctions communes aux applications de BiblioBota. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/biblio_bota_synthese.php |
---|
New file |
0,0 → 1,71 |
<?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: biblio_bota_synthese.php,v 1.1 2005/02/24 19:47:29 jpm Exp $ |
/** |
* Redirection vers BiblioBota - Synthèse. |
* |
* Fichier permettant d'ajouter l'application Synthèse dans le gestionnaire d'application de Papyrus. |
* L'utilisation de ce fichier évite de devoir passer des arguments à l'application Biblio Bota dans le gestionnaire |
* de menu de Papyrus. |
* |
*@package BiblioBota-Synthese |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@clapas.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2005/02/24 19:47:29 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// Nous spécifions l'application à appeler. |
if (!isset($_REQUEST['appli'])) { |
$_REQUEST['appli'] = 'bb_synthese'; |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Inclusion du fichier principal de Biblio Bota.*/ |
require_once 'biblio_bota.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: biblio_bota_synthese.php,v $ |
* Revision 1.1 2005/02/24 19:47:29 jpm |
* Ajout de fichier de redirection vers les sous-applications. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/biblio_bota_article.php |
---|
New file |
0,0 → 1,75 |
<?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 - 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: biblio_bota_article.php,v 1.1 2005/03/01 17:36:53 jpm Exp $ |
/** |
* Redirection vers BiblioBota - Consultation variante : article. |
* |
* Fichier permettant d'ajouter la variante article de l'application Consultation dans le gestionnaire |
* d'application de Papyrus. |
* L'utilisation de ce fichier évite de devoir passer des arguments à l'application Biblio Bota dans le gestionnaire |
* de menu de Papyrus. |
* |
*@package BiblioBota-Consultation |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@clapas.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision: 1.1 $ $Date: 2005/03/01 17:36:53 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// Nous spécifions l'application à appeler. |
if (!isset($_REQUEST['appli'])) { |
$_REQUEST['appli'] = 'bb_consultation'; |
} |
$GLOBALS['_GEN_commun']['info_application']->objet = 'media'; |
$GLOBALS['_GEN_commun']['info_application']->regroupement = 'article'; |
$GLOBALS['_GEN_commun']['info_application']->titre = 'articles'; |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Inclusion du fichier principal de Biblio Bota.*/ |
require_once 'biblio_bota.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: biblio_bota_article.php,v $ |
* Revision 1.1 2005/03/01 17:36:53 jpm |
* Ajout des fichiers de parametrage rapide d'application pour Papyrus. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/langues/bb_langue_fr.inc.php |
---|
New file |
0,0 → 1,56 |
<?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$ |
/** |
* Définition des valeurs des constantes contenant les textes de l'application |
* |
* Ce fichier permet de stocker les traductions en français des textes des applications de |
* Biblio Bota. |
* |
*@package BiblioBota |
*@subpackage Langues |
//Auteur original : |
*@author Jean-Pascal MILENT <jpm@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision$ $Date$ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// Définition des Labels Moteurs Biblio Botanica : à transformer en constante ! |
$label_bbota['bool_separe'] = 'mots séparés'; /* terme label des moteurs de recherche */ |
$label_bbota['bool_exacte'] = 'expression exacte'; /* terme label des moteurs de recherche */ |
$label_bbota['all_typstr'] = 'tous'; /* terme label des moteurs de recherche */ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log$ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/presentations/images/type_physique/bb_livre.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/type_physique/bb_livre.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/images/type_physique/bb_cd.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/type_physique/bb_cd.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/images/type_physique/bb_periodique.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/type_physique/bb_periodique.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/images/type_physique/bb_disquette.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/type_physique/bb_disquette.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/images/bb_supprimer.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/bb_supprimer.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/images/bb_ajouter.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/bb_ajouter.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/images/navigation/bb_dernier.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/navigation/bb_dernier.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/images/navigation/bb_precedent.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/navigation/bb_precedent.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/images/statistique/graph_biblio_ouvrage.php |
---|
New file |
0,0 → 1,183 |
<?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 Biblio Bota. | |
// | | |
// | 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$ |
/** |
* Image créée en php sur les statistiques de BiblioBota. |
* |
* Réalise un graphique correspondant au nombre d'intérogation de livres. |
* |
*@package BiblioBota |
*@package Statistique |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision$ $Date$ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTÊTE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Inclusion du fichier de configuration spécifique à l'installation de Papyrus.*/ |
require_once '../../../../../papyrus/configuration/pap_config_avancee.inc.php'; |
/** Inclusion du fichier de configuration de Papyrus.*/ |
require_once '../../../../../papyrus/configuration/pap_config.inc.php'; |
/** Inclusion du fichier de configuration de la base de données de BiblioBota.*/ |
require_once '../../../configuration/bb_config_bdd.inc.php'; |
/** Inclusion du fichier de configuration général de BiblioBota.*/ |
require_once '../../../configuration/bb_config.inc.php'; |
/** Inclusion d'un fichier de l'API JPGraph. */ |
include_once PAP_CHEMIN_RACINE.BB_CHEMIN_API_JPGRAPH.'jpgraph.php'; |
/** Inclusion d'un fichier de l'API JPGraph. */ |
include_once PAP_CHEMIN_RACINE.BB_CHEMIN_API_JPGRAPH.'jpgraph_line.php'; |
/** Inclusion d'un fichier de l'API JPGraph. */ |
include_once PAP_CHEMIN_RACINE.BB_CHEMIN_API_JPGRAPH.'jpgraph_bar.php'; |
/** Inclusion de la classe PEAR d'abstraction de base de donnée. */ |
include_once 'DB.php'; |
/** Inclusion de l'API Débogage du sql */ |
require_once PAP_CHEMIN_RACINE.BB_CHEMIN_API_DEBOGAGE.'BOG_sql.fonct.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
$tab_mois_fr = array('Jan','Fev','Mar','Avr','Mai','Juin','Juil','Aout','Sep','Oct','Nov','Déc'); |
// +------------------------------------------------------------------------------------------------------+ |
// Connexion à la base de données. |
$GLOBALS['db'] = DB::connect(BB_DSN) ; |
if (DB::isError($GLOBALS['db'])) { |
$msg_erreur_connection = 'Impossible de se connecter à la base de données.'; |
die(BOG_afficherErreurSql(__FILE__, __LINE__, $GLOBALS['db']->getMessage(), 'connexion à la base de données',$msg_erreur_connection)); |
} |
$graph_donnees_livre = array(); |
$graph_donnees_total = array(); |
$graph_etiquette_axeX = array(); |
$requete = 'SELECT min(B_SPY_DATE) as min, max(B_SPY_DATE) as max '. |
'FROM biblio_spy'; |
$resultat =& $GLOBALS['db']->query($requete); |
if (DB::isError($resultat)) { |
die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)); |
} |
while ($ligne =& $resultat->fetchRow(DB_FETCHMODE_OBJECT)) { |
$tps_unix_fin = $ligne->max; |
$tps_unix_debut = $ligne->min; |
} |
$resultat->free(); |
$i = 0; |
//Recherche du nombre d'intérogation par mois |
while ($tps_unix_debut <= $tps_unix_fin) { |
$nbre_recherche_livre = 0; |
$nbre_recherche_autre = 0; |
$annee_debut = date('Y', $tps_unix_debut); |
//echo $annee_debut; |
$mois_debut = date('n', $tps_unix_debut); |
//echo $mois_debut; |
if($mois_debut == 12) { |
$annee_fin_mois = $annee_debut+1; |
$mois_fin_mois = 1; |
} else { |
$annee_fin_mois = $annee_debut; |
$mois_fin_mois = $mois_debut+1; |
} |
$tps_unix_fin_mois = mktime(0, 0, 0, $mois_fin_mois, 0, $annee_fin_mois); |
$requete = 'SELECT b_spy_doc, b_spy_moteur '. |
'FROM biblio_spy '. |
'WHERE b_spy_date >= "'.$tps_unix_debut.'" '. |
'AND b_spy_date <= "'.$tps_unix_fin_mois.'"'; |
$resultat =& $GLOBALS['db']->query($requete); |
//echo $requete; |
if (DB::isError($resultat)) { |
die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)); |
} |
while ($ligne =& $resultat->fetchRow(DB_FETCHMODE_OBJECT)) { |
if ($ligne->b_spy_moteur == 'media' && $ligne->b_spy_doc == 'bibliographie_livres') { |
$nbre_recherche_livre++; |
} else { |
$nbre_recherche_autre++; |
} |
} |
$graph_donnees_total[$i] = $nbre_recherche_livre + $nbre_recherche_autre; |
$graph_donnees_livre[$i] = $nbre_recherche_livre; |
$graph_etiquette_axeX[$i] = $tab_mois_fr[($mois_debut-1)].' '.$annee_debut; |
$i++; |
$resultat->free(); |
$tps_unix_debut = mktime(0, 0, 0, $mois_fin_mois, 1, $annee_fin_mois); |
} |
$donnees_livre = array_values($graph_donnees_livre); |
$donnees_total = array_values($graph_donnees_total); |
// Création de la structure du graph |
$graph = new Graph(500,400,'auto'); |
$graph->SetMarginColor('white'); |
$graph->img->SetMargin(50,30,30,70); |
$graph->SetScale('textint'); |
$graph->SetShadow();//Ombre du graph |
// Définition du titre du graph |
$graph->title->Set('Evolution du nombre de recherche de livres'); |
$graph->title->SetFont(FF_FONT1,FS_BOLD); |
// Définition de l'axe X |
// Un angle autre que 0 ou 90° ne marche pas car les polices TTF ne sont pas supportée par Sequoia |
$graph->xaxis->SetTickLabels($graph_etiquette_axeX); |
$graph->xaxis->SetFont(FF_FONT1,FS_NORMAL,11); |
$graph->xaxis->SetLabelAngle(90); |
// Affichage du tracé numéro 1 : organisme |
$trace_01 = new LinePlot($donnees_livre); |
$trace_01->SetColor('brown'); |
//$trace_01->mark->SetType(MARK_DIAMOND); |
//$trace_01->mark->SetColor('brown'); |
//$trace_01->value->Show(); |
//$trace_01->value->SetFormat('%u'); |
$graph->Add($trace_01); |
// Définition de la légende |
$trace_01->SetLegend ('nombre recherches livres'); |
$graph ->legend->Pos(0.15, 0.15, 'left', 'center'); |
// Envoi du graph au navigateur sous forme d'image. |
$graph->Stroke(); |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log$ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/presentations/images/statistique/graph_biblio_article.php |
---|
New file |
0,0 → 1,189 |
<?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 Biblio Bota. | |
// | | |
// | 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$ |
/** |
* Image créée en php sur les statistiques de BiblioBota. |
* |
* Réalise un graphique correspondant au nombre d'intérogation d'articles. |
* |
*@package BiblioBota |
*@package Statistique |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision$ $Date$ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTÊTE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Inclusion du fichier de configuration spécifique à l'installation de Papyrus.*/ |
require_once '../../../../../papyrus/configuration/pap_config_avancee.inc.php'; |
/** Inclusion du fichier de configuration de Papyrus.*/ |
require_once '../../../../../papyrus/configuration/pap_config.inc.php'; |
/** Inclusion du fichier de configuration de la base de données de BiblioBota.*/ |
require_once '../../../configuration/bb_config_bdd.inc.php'; |
/** Inclusion du fichier de configuration général de BiblioBota.*/ |
require_once '../../../configuration/bb_config.inc.php'; |
/** Inclusion d'un fichier de l'API JPGraph. */ |
include_once PAP_CHEMIN_RACINE.BB_CHEMIN_API_JPGRAPH.'jpgraph.php'; |
/** Inclusion d'un fichier de l'API JPGraph. */ |
include_once PAP_CHEMIN_RACINE.BB_CHEMIN_API_JPGRAPH.'jpgraph_line.php'; |
/** Inclusion d'un fichier de l'API JPGraph. */ |
include_once PAP_CHEMIN_RACINE.BB_CHEMIN_API_JPGRAPH.'jpgraph_bar.php'; |
/** Inclusion de la classe PEAR d'abstraction de base de donnée. */ |
include_once 'DB.php'; |
/** Inclusion de l'API Débogage du sql */ |
require_once PAP_CHEMIN_RACINE.BB_CHEMIN_API_DEBOGAGE.'BOG_sql.fonct.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
$tab_mois_fr = array('Jan','Fev','Mar','Avr','Mai','Juin','Juil','Aout','Sep','Oct','Nov','Déc'); |
// +------------------------------------------------------------------------------------------------------+ |
// Connexion à la base de données. |
$GLOBALS['db'] = DB::connect(BB_DSN) ; |
if (DB::isError($GLOBALS['db'])) { |
$msg_erreur_connection = 'Impossible de se connecter à la base de données.'; |
die(BOG_afficherErreurSql(__FILE__, __LINE__, $GLOBALS['db']->getMessage(), 'connexion à la base de données',$msg_erreur_connection)); |
} |
$graph_donnees_article = array(); |
$graph_donnees_total = array(); |
$graph_etiquette_axeX = array(); |
$requete = 'SELECT min(B_SPY_DATE) as min, max(B_SPY_DATE) as max '. |
'FROM biblio_spy'; |
$resultat =& $GLOBALS['db']->query($requete); |
if (DB::isError($resultat)) { |
die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)); |
} |
while ($ligne =& $resultat->fetchRow(DB_FETCHMODE_OBJECT)) { |
$tps_unix_fin = $ligne->max; |
$tps_unix_debut = $ligne->min; |
} |
$resultat->free(); |
$i = 0; |
//Recherche du nombre d'intérogation par mois |
while ($tps_unix_debut <= $tps_unix_fin) { |
$nbre_recherche_article = 0; |
$nbre_recherche_article_plugin = 0; |
$nbre_recherche_total = 0; |
$annee_debut = date('Y', $tps_unix_debut); |
//echo $annee_debut; |
$mois_debut = date('n', $tps_unix_debut); |
//echo $mois_debut; |
if($mois_debut == 12) { |
$annee_fin_mois = $annee_debut+1; |
$mois_fin_mois = 1; |
} else { |
$annee_fin_mois = $annee_debut; |
$mois_fin_mois = $mois_debut+1; |
} |
$tps_unix_fin_mois = mktime(0, 0, 0, $mois_fin_mois, 0, $annee_fin_mois); |
$requete = 'SELECT b_spy_doc, b_spy_moteur '. |
'FROM biblio_spy '. |
'WHERE b_spy_date >= "'.$tps_unix_debut.'" '. |
'AND b_spy_date <= "'.$tps_unix_fin_mois.'"'; |
$resultat =& $GLOBALS['db']->query($requete); |
//echo $requete; |
if (DB::isError($resultat)) { |
die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)); |
} |
while ($ligne =& $resultat->fetchRow(DB_FETCHMODE_OBJECT)) { |
if ($ligne->b_spy_moteur == 'media' && $ligne->b_spy_doc == 'bibliographie_article') { |
$nbre_recherche_article++; |
} elseif ($ligne->b_spy_moteur == 'media' && strstr($ligne->b_spy_doc, 'biblio-plug')) { |
$nbre_recherche_article_plugin++; |
} |
else { |
$nbre_recherche_total++; |
} |
} |
$nbre_recherche_total = $nbre_recherche_article + $nbre_recherche_article_plugin + $nbre_recherche_total; |
$graph_donnees_total[$i] = $nbre_recherche_total; |
$graph_donnees_article[$i] = $nbre_recherche_article + $nbre_recherche_article_plugin; |
$graph_etiquette_axeX[$i] = $tab_mois_fr[($mois_debut-1)].' '.$annee_debut; |
$i++; |
$resultat->free(); |
$tps_unix_debut = mktime(0, 0, 0, $mois_fin_mois, 1, $annee_fin_mois); |
} |
$donnees_article = array_values($graph_donnees_article); |
$donnees_total = array_values($graph_donnees_total); |
// Création de la structure du graph |
$graph = new Graph(500,400,'auto'); |
$graph->SetMarginColor('white'); |
$graph->img->SetMargin(50,30,30,70); |
$graph->SetScale('textint'); |
$graph->SetShadow();//Ombre du graph |
// Définition du titre du graph |
$graph->title->Set('Evolution du nombre de recherche d\'articles'); |
$graph->title->SetFont(FF_FONT1,FS_BOLD); |
// Définition de l'axe X |
// Un angle autre que 0 ou 90° ne marche pas car les polices TTF ne sont pas supportée par Sequoia |
$graph->xaxis->SetTickLabels($graph_etiquette_axeX); |
$graph->xaxis->SetFont(FF_FONT1,FS_NORMAL,11); |
$graph->xaxis->SetLabelAngle(90); |
// Affichage du tracé numéro 1 : organisme |
$trace_01 = new LinePlot($donnees_article); |
$trace_01->SetColor('brown'); |
//$trace_01->mark->SetType(MARK_DIAMOND); |
//$trace_01->mark->SetColor('brown'); |
//$trace_01->value->Show(); |
//$trace_01->value->SetFormat('%u'); |
$graph->Add($trace_01); |
// Définition de la légende |
$trace_01->SetLegend ('nombre recherches articles'); |
$graph ->legend->Pos(0.15, 0.15, 'left', 'center'); |
// Envoi du graph au navigateur sous forme d'image. |
$graph->Stroke(); |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log$ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/presentations/images/bb_epuise.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/bb_epuise.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/images/bb_fascicule.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/bb_fascicule.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/images/bb_modifier.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/bb_modifier.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/images/bb_reference.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/bb_reference.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/images/bb_retour.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/bb_retour.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/images/type_logique/bb_multimedia.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/type_logique/bb_multimedia.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/images/type_logique/bb_sgbd.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/type_logique/bb_sgbd.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/images/type_logique/bb_son.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/type_logique/bb_son.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/images/type_logique/bb_logiciel.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/type_logique/bb_logiciel.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/images/type_logique/bb_texte.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/images/type_logique/bb_texte.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/documents/cartes_tmp/continent94f059da936030a702251f7b389ef55f.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/documents/cartes_tmp/continent94f059da936030a702251f7b389ef55f.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/documents/cartes_tmp/continentf1ff1f52892e69a662060c6013733bc5.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/biblio_bota/presentations/documents/cartes_tmp/continentf1ff1f52892e69a662060c6013733bc5.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/biblio_bota/presentations/styles/bb_standard.css |
---|
New file |
0,0 → 1,148 |
/* Positionnement du contenu de l'application Biblio Bota*/ |
/* ------------------------------------------------------------------------------------------------------------ */ |
/* Décoration générale devant être intégré dans Papyrus */ |
/* Styles du fragmenteur */ |
#frag_nbre_resultat, #frag_navigation { |
text-align: center; |
} |
/* Message d'erreur */ |
.erreur { |
color: red; |
} |
/* Texte d'un champ d'une fichie */ |
.champ_cle { |
font-weight: bold; |
} |
/* Texte d'une valeur d'un champ d'une fichie*/ |
.champ_valeur { |
font-weight: normal; |
} |
/* Le texte moins voyant */ |
.texte_inactif { |
font-family: Arial; |
font-size: 10px; |
text-decoration: none; |
color: gray; |
} |
/* ------------------------------------------------------------------------------------------------------------ */ |
/* Nouveaux styles de Biblio Bota */ |
/* L'image precedent de la navigation avancée */ |
.bb_img_precedent { |
border: 0px; |
width: 18px; |
height: 15px; |
} |
/* L'image représentant un icone pour les liens web */ |
.bb_img_web { |
border: 0px; |
width: 16px; |
height: 16px; |
} |
/* Les images représentant un icone de 16px par 16px */ |
.bb_img_icone { |
border: 0px; |
width: 16px; |
height: 16px; |
vertical-align: top; |
} |
/* Les images représentant un icone de 18px par 15px */ |
.bb_img_icone_large { |
border: 0px; |
width: 18px; |
height: 15px; |
vertical-align: top; |
} |
/* L'image représentant un site partenaire */ |
.bb_img_partenaire { |
border: 0px; |
width: 84px; |
height: 12px; |
vertical-align: middle; |
} |
/* L'image représentant un site reference */ |
.bb_img_reference { |
border: 0px; |
width: 84px; |
height: 12px; |
vertical-align: middle; |
} |
/* L'image représentant un document epuisé */ |
.bb_img_epuise { |
border: 0px; |
width: 40px; |
height: 12px; |
vertical-align: middle; |
} |
/* Image illustrant les structures, périodiques... */ |
.bb_img_structure, .bb_img_periodique, .bb_img_fascicule, .bb_img_article, .bb_img_livre, .bb_img_media { |
border: 0px; |
margin: 1em; |
float: right; |
} |
#bb_liste_article li, #bb_liste_livre li, #bb_liste_media li { |
clear:both; |
} |
/* Contient la navigation avancée */ |
.bb_navigation { |
background-color: #D7F2D7; |
text-align: left; |
vertical-align: middle; |
} |
/* Texte normal */ |
.bb_txt_normal { |
font-weight: normal; |
} |
/* Texte centré */ |
.bb_txt_centre { |
text-align: center; |
} |
/* Texte trouvé par le moteur de recherche */ |
.bb_txt_trouve { |
background-color: yellow; |
} |
/* Pour aligner à droite un contenu */ |
.bb_aligner_droite { |
text-align: right; |
width: 65%; |
} |
/* Suppression des puces devant les listes des moteurs de recherche */ |
#bb_moteur_media ul, #bb_moteur_lien ul, #bb_moteur_structure ul { |
list-style-type: none; |
} |
/* Identifiant du moteur de recherche des médias (livres et articles)*/ |
#bb_moteur_media ul li { |
padding: 3px; |
} |
/* Identifiant du moteur de recherche des liens (sites web)*/ |
#bb_moteur_lien ul li { |
padding: 3px; |
} |
/* Identifiant du moteur de recherche des structures (organismes)*/ |
#bb_moteur_structure ul li { |
padding: 3px; |
} |
/* Affichage de la navigation avancée à côté du titre du périodique dans la liste des périodiques en consultation avancée */ |
#bb_liste_periodique h3 { |
display: inline; |
} |
#bb_liste_periodique .bb_navigation { |
display: inline; |
} |
/* Séparateur horizontal */ |
.bb_separateur_horizontal { |
height: 1px; |
width: 100%; |
color: gray; |
} |
#bb_liste_resultat_structure, #bb_liste_resultat_media{ |
line-height:0.8em;} |
#bb_liste_resultat_structure li, #bb_liste_resultat_media li{ |
line-height:1em;} |
/trunk/client/biblio_bota/biblio_bota_organisme.php |
---|
New file |
0,0 → 1,71 |
<?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 - 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$ |
/** |
* Redirection vers BiblioBota - Consultatuib variante : organisme. |
* |
* Fichier permettant d'ajouter la variante organisme de l'application Consultation dans le gestionnaire |
* d'application de Papyrus. |
* L'utilisation de ce fichier évite de devoir passer des arguments à l'application Biblio Bota dans le gestionnaire |
* de menu de Papyrus. |
* |
*@package BiblioBota-Consultation |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@clapas.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision$ $Date$ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// Nous spécifions l'application à appeler. |
if (!isset($_REQUEST['appli'])) { |
$_REQUEST['appli'] = 'bb_consultation'; |
} |
$GLOBALS['_GEN_commun']['info_application']->objet = 'structure'; |
$GLOBALS['_GEN_commun']['info_application']->titre = 'des_structures'; |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Inclusion du fichier principal de Biblio Bota.*/ |
require_once 'biblio_bota.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log$ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/biblio_bota_site.php |
---|
New file |
0,0 → 1,74 |
<?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 - 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: biblio_bota_site.php,v 1.1 2005/03/01 17:36:53 jpm Exp $ |
/** |
* Redirection vers BiblioBota - Consultation variante : site. |
* |
* Fichier permettant d'ajouter la variante site de l'application Consultation dans le gestionnaire |
* d'application de Papyrus. |
* L'utilisation de ce fichier évite de devoir passer des arguments à l'application Biblio Bota dans le gestionnaire |
* de menu de Papyrus. |
* |
*@package BiblioBota-Consultation |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@clapas.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision: 1.1 $ $Date: 2005/03/01 17:36:53 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// Nous spécifions l'application à appeler. |
if (!isset($_REQUEST['appli'])) { |
$_REQUEST['appli'] = 'bb_consultation'; |
} |
$GLOBALS['_GEN_commun']['info_application']->objet = 'lien'; |
$GLOBALS['_GEN_commun']['info_application']->titre = 'des_sites_web'; |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Inclusion du fichier principal de Biblio Bota.*/ |
require_once 'biblio_bota.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: biblio_bota_site.php,v $ |
* Revision 1.1 2005/03/01 17:36:53 jpm |
* Ajout des fichiers de parametrage rapide d'application pour Papyrus. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/biblio_bota_ouvrage.php |
---|
New file |
0,0 → 1,75 |
<?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 - 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: biblio_bota_ouvrage.php,v 1.1 2005/03/01 17:36:53 jpm Exp $ |
/** |
* Redirection vers BiblioBota - Consultation variante : ouvrage. |
* |
* Fichier permettant d'ajouter la variante ouvrage de l'application Consultation dans le gestionnaire |
* d'application de Papyrus. |
* L'utilisation de ce fichier évite de devoir passer des arguments à l'application Biblio Bota dans le gestionnaire |
* de menu de Papyrus. |
* |
*@package BiblioBota-Consultation |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@clapas.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision: 1.1 $ $Date: 2005/03/01 17:36:53 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// Nous spécifions l'application à appeler. |
if (!isset($_REQUEST['appli'])) { |
$_REQUEST['appli'] = 'bb_consultation'; |
} |
$GLOBALS['_GEN_commun']['info_application']->objet = 'media'; |
$GLOBALS['_GEN_commun']['info_application']->regroupement = 'media'; |
$GLOBALS['_GEN_commun']['info_application']->titre = 'ouvrages'; |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Inclusion du fichier principal de Biblio Bota.*/ |
require_once 'biblio_bota.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: biblio_bota_ouvrage.php,v $ |
* Revision 1.1 2005/03/01 17:36:53 jpm |
* Ajout des fichiers de parametrage rapide d'application pour Papyrus. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/biblio_bota/biblio_bota_partenaire.php |
---|
New file |
0,0 → 1,79 |
<?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: biblio_bota_partenaire.php,v 1.3 2005/02/28 14:27:56 jpm Exp $ |
/** |
* Redirection vers BiblioBota - Lien Favoris variante : Partenaire. |
* |
* Fichier permettant d'ajouter la variante Partenaire l'application Lien Favoris dans le gestionnaire d'application de Papyrus. |
* L'utilisation de ce fichier évite de devoir passer des arguments à l'application Biblio Bota dans le gestionnaire |
* de menu de Papyrus. |
* |
*@package BiblioBota-Partenaire |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@clapas.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.3 $ $Date: 2005/02/28 14:27:56 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// Nous spécifions l'application à appeler. |
if (!isset($_REQUEST['appli'])) { |
$_REQUEST['appli'] = 'bb_lien_favoris'; |
} |
/** Nous spécifions le paramêtre selecteur de l'application.*/ |
$GLOBALS['_GEN_commun']['info_application']->selecteur = 'part'; |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Inclusion du fichier principal de Biblio Bota.*/ |
require_once 'biblio_bota.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: biblio_bota_partenaire.php,v $ |
* Revision 1.3 2005/02/28 14:27:56 jpm |
* Changement du nom de l'appli en Lien Favoris. |
* |
* Revision 1.2 2005/02/28 14:24:49 jpm |
* Correction erreur. |
* |
* Revision 1.1 2005/02/24 19:47:29 jpm |
* Ajout de fichier de redirection vers les sous-applications. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/inscription/configuration/ins_config.inc.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: ins_config.inc.php,v 1.3 2005/05/13 13:49:15 alex Exp $ |
/** |
* Fichier de configuration de l'inscription |
* |
* A éditer de façon spécifique à chaque déploiement |
* |
*@package inscription |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.3 $ $Date: 2005/05/13 13:49:15 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
/** |
//=========================DEFINITION DE VARIABLES ================================= |
* Définition des variables globales |
//================================================================================== |
*/ |
$GLOBALS['AUTH'] = &$_GEN_commun['pear_auth'] ; |
/** |
//==================================== LES URLS ================================== |
* Constantes liées à l'utilisation des url |
//================================================================================== |
*/ |
$GLOBALS['ins_url'] = & $_GEN_commun['url'] ; |
$GLOBALS['ins_db'] = & $_GEN_commun['pear_db'] ; |
define ("INS_CHEMIN_FICHIER", "client/inscription/") ; |
/** |
//==================================== CONSTANTES ================================== |
* Constantes des noms de tables et de champs dans l'annuaire |
//================================================================================== |
*/ |
define ("INS_ANNUAIRE", "annuaire_tela") ; |
define ("INS_CHAMPS_ID", "U_ID") ; // Nom du champs nom |
define ("INS_CHAMPS_MAIL", "U_MAIL") ; // Nom du champs mail |
define ("INS_CHAMPS_LOGIN", "at_nom_wiki") ; |
define ("INS_CHAMPS_NOM", "U_NAME") ; |
define ("INS_CHAMPS_PRENOM", "U_SURNAME") ; |
define ("INS_CHAMPS_PASSE", "U_PASSWD") ; |
define ("INS_CHAMPS_PAYS", "U_COUNTRY") ; |
define ("PROJET_PRENOM", "U_SURNAME") ; // Nom du champs prénom |
define ("PROJET_DPT", "gen_FRENCH_DPT") ; // Nom de la table département |
define ("INS_TABLE_PAYS", "gen_COUNTRY") ; // Nom de la table pays |
define ("INS_CHAMPS_ID_PAYS", "GC_ID") ; |
define ("INS_CHAMPS_LABEL_PAYS", "GC_NAME") ; |
define ("INS_CHAMPS_CODE_POSTAL", "U_ZIP_CODE") ; |
define ("INS_CHAMPS_VILLE", "U_CITY") ; |
define ("INS_CHAMPS_ADRESSE_1", "U_ADDR1") ; |
define ("INS_CHAMPS_ADRESSE_2", "U_ADDR2") ; |
define ("INS_CHAMPS_REGION", "U_STATE") ; |
define ("INS_CHAMPS_SITE_WEB", "U_WEB") ; |
define ("INS_CHAMPS_TELEPHONE", "U_PHONE") ; |
define ("INS_CHAMPS_FAX", "U_FAX") ; |
define ("INS_CHAMPS_STRUCTURE", "U_TITLE") ; |
define ("INS_CHAMPS_DATE", "U_DATE") ; |
define ("INS_CHAMPS_LETTRE", "U_LETTRE") ; // Le champs qui indique si l'usager est inscrit à la lettre d'inscription |
/** |
//==================================== PARAMETRAGE ================================= |
* Pour régler certaines fonctionnalité de l'application |
//================================================================================== |
*/ |
define ("INS_MAIL_ADMIN_APRES_INSCRIPTION", "Reseau Tela Botanica <accueil@tela-botanica.org>") ; |
define ("INS_MAIL_ADMIN_APRES_INSCRIPTION_SUJET", "[Tela Botanica]Inscription") ; |
define ("INS_MAIL_INSCRIPTION_LISTE", 'actu-subscribe@tela-botanica.org') ; |
define ("INS_MAIL_DESINSCRIPTION_LISTE", 'actu-unsubscribe@tela-botanica.org') ; |
$GLOBALS['mail_admin'] = array ('accueil@tela-botanica.org', 'dmathieu@tela-botanica.org') ; // Liste des personne recevant le mail |
// après inscription |
define ("INS_UTILISE_SPIP", 1) ; |
define ("INS_UTILISE_WIKINI", 1) ; |
if (INS_UTILISE_WIKINI) { |
define ('INS_CHAMPS_WIKINI', 'at_nom_wiki') ; |
define ('INS_DSN_WIKINI', 'mysql://telabotap:@localhost/tela_prod_wikini') ; |
} |
if (INS_UTILISE_SPIP) { |
define ('INS_DSN_SPIP', 'mysql://telabotap:@localhost/tela_prod_spip_actu') ; |
} |
/** |
//==================================== PARAMETRAGE ================================= |
* Pour gérer la réécriture d'url de l'inscription |
* Cela nécessite une ligne dans le fichier .htaccess, par exemple |
* RewriteRule ^ins([0-9a-z]*)$ papyrus.php?menu=22&id=$1 [L] |
* Cela sert à racourcir l'URL de confirmation d'inscription |
//================================================================================== |
*/ |
define ('INS_UTILISE_REECRITURE_URL', 1) ; // mettre à 1 si on souhaite utiliser la réécriture |
if (INS_UTILISE_REECRITURE_URL) { |
define ('INS_URL_PREFIXE', '_ins_') ; // Indique le préfixe de l'url http://www.mondomaine.org/prefix____ |
} |
define ('INS_TABLE_STATISTIQUE', 'ins_STATS') ; |
define ('INS_STATS_CHAMPS_DATE', 'IS_DATE') ; |
define ('INS_STATS_CHAMPS_ACTION', 'IS_ACTION') ; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: ins_config.inc.php,v $ |
* Revision 1.3 2005/05/13 13:49:15 alex |
* ajout de la réécriture d'url et des statistiques |
* |
* Revision 1.2 2005/03/21 16:50:31 alex |
* mille et une corrction |
* |
* Revision 1.1 2005/03/04 10:39:41 tam |
* installation |
* |
* Revision 1.1 2004/07/06 15:42:17 alex |
* en cours |
* |
* Revision 1.4 2004/07/06 15:31:33 alex |
* en cours |
* |
* Revision 1.3 2004/06/30 10:00:53 alex |
* ajout de champs pour gérer les pays |
* |
* Revision 1.2 2004/06/18 09:20:54 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/inscription/inscription.php |
---|
New file |
0,0 → 1,262 |
<?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: inscription.php,v 1.3 2005/03/21 16:50:21 alex Exp $ |
/** |
* Inscription |
* |
* Un module d'inscription, en général ce code est spécifique à |
* un site web |
* |
*@package inscription |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.3 $ $Date: 2005/03/21 16:50:21 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
if (isset($lang)) { |
include_once "client/inscription/langues/ins_langue_$lang.inc.php" ; |
} else { |
include_once ("client/inscription/langues/ins_langue_fr.inc.php") ; |
} |
include_once ("client/inscription/configuration/ins_config.inc.php"); |
include_once ("client/inscription/bibliotheque/inscription.fonct.php") ; |
include_once INS_CHEMIN_FICHIER."bibliotheque/inscription.class.php" ; |
include_once 'Mail.php' ; |
// Ajout d'une feuille de style externe |
GEN_stockerStyleExterne ('inscription', 'client/inscription/inscription.css') ; |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
function afficherContenuTete() { |
$retour = '<h1 class="titre1_inscription">Inscription au Réseau Tela Botanica</h1>'; |
return ; |
} |
// ================ Note ======================= |
// La variable action sert à définir ce qui est demandé (inscription, modification d'inscription, suppression ... |
// Elle est appelé avec $_REQUEST car elle peut aussi bien venir d'un formulaire que d'un lien. |
// ============================================== |
/** |
* |
* @global AUTH Un pointeur vers un objet PEAR::Auth |
* @global ins_url Un pointeur vers un objet PEAR::Net_URL |
* @return string Le contenu de l'application inscription |
*/ |
function afficherContenuCorps() { |
$url = preg_replace ("/&/", "&", $GLOBALS['ins_url']->getURL()) ; |
if (!isset ($_REQUEST['action'])) $_REQUEST['action'] = "" ; |
$res = '' ; |
$est_loggue = true ; |
if (isset ($_GET['logout']) && $_GET['logout'] == 1) { |
$GLOBALS['AUTH']->logout() ; |
$_POST['username'] = "" ; |
$_POST['password'] = "" ; |
return AUTH_formulaire_login() ; |
} |
// L'utilisateur a-t-il cliqué sur Supprimer inscription |
if (isset ($_POST['supprimer'])) { |
$mail_utilisateur = $GLOBALS['AUTH']->getUsername() ; |
$id_utilisateur = $GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID) ; |
if (INS_UTILISE_WIKINI) { |
desinscription_interwikini_users ($GLOBALS['AUTH']->getAuthData(INS_CHAMPS_WIKINI)) ; |
} |
$resultat = $GLOBALS['AUTH']->removeUser($mail_utilisateur) ; |
if (PEAR::isError($resultat)) { |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
// Suppression dans SPIP |
if (INS_UTILISE_SPIP) { |
desinscription_spip($id_utilisateur) ; |
} |
// désinscription de la lettre d'info |
inscription_lettre (INS_MAIL_DESINSCRIPTION_LISTE) ; |
$GLOBALS['AUTH']->logout() ; |
// Ajout d'une ligne dans les statistiques |
$requete = 'insert into '.INS_TABLE_STATISTIQUE.' set '.INS_STATS_CHAMPS_DATE.'=NOW(), '.INS_STATS_CHAMPS_ACTION.'="del"' ; |
$resultat = $GLOBALS['ins_db']->query ($requete) ; |
if (DB::isError ($resultat)) { |
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ; |
} |
return AUTH_formulaire_login() ; |
} |
if ($_REQUEST['action'] == 'sendpasswd') { |
return AUTH_formulaire_login(envoie_passe()) ; |
} |
// L'utilisateur a cliqué sur Inscription ou Inscription structure ou |
if ($_REQUEST['action'] != '' || isset($_POST['modifier'])) { |
$res .= '<h1 class="titre1_inscription">'.INS_ACCUEIL_INSCRIPTION.'</h1>' ; |
$action = preg_replace ("/&/", "&", $GLOBALS['ins_url']->getURL()) ; |
$formulaire = new HTML_formulaireInscription('formulaire_inscription', 'post', $action) ; |
// Construction de la liste des pays |
$liste_pays = new ListeDePays($GLOBALS['ins_db']) ; |
$formulaire->construitFormulaire($action, $liste_pays->getListePays('fr')) ; |
if (isset($_POST['structure'])) { |
$formulaire->formulaireStructure() ; |
} |
if (isset($_POST['modifier'])) { |
$formulaire->addElement ('hidden', 'action', 'modifier_v') ; |
$formulaire->setDefaults(formulaire_defaults()) ; |
if ($GLOBALS['AUTH']->getAuthData(INS_CHAMPS_LETTRE) == 1) { |
$lettre = & $formulaire->getElement('lettre') ; |
$lettre->setChecked(true) ; |
} |
} |
if ($_REQUEST['action'] == 'inscription') { |
$formulaire->addElement ('hidden', 'action', 'inscription_v') ; |
$formulaire->setDefaults (array ('pays' => 'fr', 'asso' => 3, 'activite' => 3, 'niveau' => 4, 'lettre' => 1)) ; |
$lettre = & $formulaire->getElement('lettre') ; |
$lettre->setChecked(true) ; |
} |
if ($_REQUEST['action'] == 'inscription_v') { |
if ($formulaire->validate()) { |
$formulaire->process('demande_inscription', false) ; |
return message_inscription() ; |
} |
} |
if ($_REQUEST['action'] == 'modifier_v') { |
if ($formulaire->validate()) { |
$valeur_lettre = $GLOBALS['AUTH']->getAuthData(INS_CHAMPS_LETTRE) ; |
$formulaire->process('mise_a_jour', false) ; |
} |
if (isset($_POST['lettre'])) { |
if ($valeur_lettre == '') { |
inscription_lettre (INS_MAIL_INSCRIPTION_LISTE) ; |
} |
} else { |
if ($valeur_lettre == 1) { |
inscription_lettre (INS_MAIL_DESINSCRIPTION_LISTE) ; |
} |
} |
return info ($GLOBALS['AUTH']->getAuthData (INS_CHAMPS_ID)).bouton ($url) ; |
} |
return $res.$formulaire->toHTML() ; |
} |
// L'inscription dans la base si l'utilisateur clique sur le lien du mail |
if (isset($_GET['id'])) { |
$requete = 'select id_donnees from inscription_demande where id_identifiant_session="'.$_GET['id'].'"' ; |
$resultat = $GLOBALS['ins_db']->query ($requete) ; |
if (DB::isError ($resultat)) { |
die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ; |
} |
if ($resultat->numRows() == 0) { |
return INS_MESSAGE_EXPIRATION; |
} |
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ; |
$donnees = unserialize (stripslashes($ligne->id_donnees)) ; |
insertion ($donnees) ; |
$GLOBALS['AUTH']->username = $donnees['email'] ; |
$GLOBALS['AUTH']->password = $donnees['mot_de_passe'] ; |
// On loggue l'utilisateur |
$GLOBALS['AUTH']->login() ; |
// inscription à la lettre d'information |
if (isset ($donnees['lettre'])) { |
inscription_lettre (INS_MAIL_INSCRIPTION_LISTE) ; |
} |
// On supprime la demande d'inscription |
$requete = 'delete from inscription_demande where id_identifiant_session="'.$_GET['id'].'"' ; |
$resultat = $GLOBALS['ins_db']->query ($requete) ; |
if (DB::isError ($resultat)) { |
die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ; |
} |
envoie_mail() ; |
} |
if (!$GLOBALS['AUTH']->getAuth() && $_REQUEST['action'] != "inscription" && $_REQUEST['action'] != 'inscription_v') { |
if (isset($_POST['username']) && $_POST['username'] != '') { |
$res .= message_erreur() ; |
} else { |
$res .= AUTH_formulaire_login() ; |
} |
} |
if ($GLOBALS['AUTH']->getAuth () && !isset($_POST['modifier'])) { |
return info () |
.bouton ($url); |
} |
return $res ; |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: inscription.php,v $ |
* Revision 1.3 2005/03/21 16:50:21 alex |
* mille et une corrction |
* |
* Revision 1.2 2005/03/11 16:55:01 alex |
* modification html |
* |
* Revision 1.3 2004/09/14 12:20:28 alex |
* déplacement de la fonction suppression vers inscription.fonct.php |
* et nettoyage du code. |
* |
* Revision 1.2 2004/09/01 16:36:37 alex |
* changement du chemin pour les include |
* |
* Revision 1.1 2004/07/06 15:42:28 alex |
* en cours |
* |
* Revision 1.5 2004/07/06 15:28:56 alex |
* en cours |
* |
* Revision 1.4 2004/06/25 14:26:03 alex |
* modification de la suppression |
* |
* Revision 1.3 2004/06/23 12:41:44 alex |
* amélioration de la gestion de la perte de mot de passe |
* |
* Revision 1.2 2004/06/18 09:18:23 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/inscription/inscription.css |
---|
New file |
0,0 → 1,54 |
/* Feuille de style inscription*/ |
/************************************ |
Presentation de la fiche des inscrits |
************************************/ |
dt { |
float:left; |
width:10em; |
text-align:right; |
font-weight:bold; |
padding-right : 10px;} |
.inscription_titre2 { |
clear:both; |
color:#996F18;;} |
/*************************************** |
Presentation du formulaire d'inscription |
***************************************/ |
#formulaire_inscription fieldset { |
border: 0; |
margin: 0; |
margin-top:10px; |
padding: 0;} |
#formulaire_inscription legend { |
line-height:1.3em; |
margin:8px 0 4px 0; |
font-size:15px; |
color: #996F18; |
font-weight:bold;} |
#formulaire_inscription ul { |
list-style:none; |
margin:0; |
padding:0;} |
#formulaire_inscription li { |
font-weight:bold; |
margin:5px 0px; |
clear:both;} |
.symbole_obligatoire { |
color:#F00; |
font-size:14pt;} |
.liste_inscription .inscription_label { |
float:left; |
width:10em; |
text-align:right; |
padding-right:10px;} |
.liste_inscription select { |
margin-top:5px;} |
.groupe_formulaire .inscription_label1 { |
float:left; |
width:10em; |
text-align:right; |
padding-right:10px;} |
.inscription_label2 { |
margin-left:10px;} |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/inscription/wikini_cookie.php |
---|
New file |
0,0 → 1,69 |
<?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: wikini_cookie.php,v 1.1 2004/07/06 15:42:28 alex Exp $ |
/** |
* Envoie de cookie pour wikini à partir d'une inscription |
* |
* Envoie de cookie pour wikini à partir d'une inscription |
* |
*@package inscription |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2004/07/06 15:42:28 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// Wikini envoie 3 cookies |
// name avec pour valeur le nom wiki de l'utilisateur |
// password avec pour valeur le mot de passe crypté de l'utilisateur |
// remember la durée du cookie |
// On fait la même chose |
if ($userid != "") { |
// 1. name |
// On recherche le nom |
$nomwikini = $AUTH->getAuthData('ga_login') ; |
setcookie ("name", $nomwikini, time () + 3600 * 24 * 30, "/" ) ; // 1 mois |
//2. password |
// on recherche le mot de passe crypté |
$requete = "select ga_mot_de_passe from gen_annuaire where ga_id_administrateur=$userid" ; |
$resultat = $db->query ($requete) ; |
if (DB::isError($resultat)) { |
die ("Erreur") ; |
} |
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ; |
$mot_de_passe = $ligne->ga_mot_de_passe ; |
setcookie ("password", $mot_de_passe, time () + 3600 * 24 * 30, "/") ; |
// 3. remember |
setcookie ("remember", 1, time () + 3600 * 24 * 30, "/") ; |
} |
?> |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/inscription/spip_cookie.php |
---|
New file |
0,0 → 1,86 |
<?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: spip_cookie.php,v 1.1 2004/07/06 15:42:28 alex Exp $ |
/** |
* Envoie de cookie pour SPIP à partir d'une inscription |
* |
* Envoie de cookie pour SPIP à partir d'une inscription |
* |
*@package inscription |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2004/07/06 15:42:28 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// Ce fichier doit être placé à la racine de SPIP |
// Il doit être appellé dans chaque squelette |
// après l'ouverture d'une session, si on ouvre une session |
// Il faut récupérer une valeur userid, c'est à dire |
// loggué l'utilisateur par exemple avec PEAR |
if ($userid != 0) { |
setcookie("spip_admin", "@$login", time()+3600*24*30, "/vecam/") ; |
include ("ecrire/inc_version.php3"); |
include_ecrire ("inc_meta.php3"); |
include_ecrire ("inc_session.php3"); |
$query = "SELECT * FROM spip_auteurs WHERE id_auteur=$userid"; |
$result = mysql_query($query); |
$GLOBALS['auteur_session'] = mysql_fetch_array($result) ; |
$GLOBALS['auteur_session']['statut'] = "1comite" ; |
$GLOBALS['auteur_session']['lang'] = "en" ; |
if (!$HTTP_COOKIE_VARS["spip_session"]) { |
$id_session = $userid."_".(md5 (uniqid (rand ()))); |
setcookie("spip_session", $id_session, time()+3600*24*30, "/vecam/") ; |
} else { |
$id_session = preg_replace("/[0-9]+_/", $userid."_", $HTTP_COOKIE_VARS["spip_session"]) ; |
setcookie("spip_session", $id_session, time()+3600*24*30, "/vecam/") ; |
} |
ajouter_session($GLOBALS['auteur_session'], $id_session) ; |
} |
?> |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/inscription/bibliotheque/inscription.fonct.php |
---|
New file |
0,0 → 1,714 |
<?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: inscription.fonct.php,v 1.2 2005/03/21 16:50:27 alex Exp $ |
// CVS : $Id: inscription.fonct.php,v 1.2 2005/03/21 16:50:27 alex Exp $ |
/** |
* Fonctions du module inscription |
* |
* Fonctions du module inscription |
* |
*@package inscription |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.2 $ $Date: 2005/03/21 16:50:27 $ |
*@version $Revision: 1.2 $ $Date: 2005/03/21 16:50:27 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
include_once INS_CHEMIN_FICHIER.'bibliotheque/ins_wiki.fonct.php' ; |
include_once INS_CHEMIN_FICHIER.'bibliotheque/ins_spip.fonct.php' ; |
require_once 'HTML/QuickForm.php' ; |
require_once 'HTML/QuickForm/checkbox.php' ; |
require_once 'HTML/QuickForm/password.php' ; |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
/** |
* |
* @param array les valeurs renvoyés par le formulaire |
* @return |
*/ |
function demande_inscription ($valeurs) { |
// On stocke les informations dans un variable de session |
// On coupe l'identifiant de session pour ne prendre que les 8 premiers caractères |
// afin d'éviter d'obtenir une url trop longue |
$chaine = substr (session_id(), 0, 8) ; |
$requete_verif = 'select * from inscription_demande where id_identifiant_session="'.$chaine.'"' ; |
$resultat_verif = $GLOBALS['ins_db']->query ($requete_verif) ; |
if ($resultat_verif->numRows() != 0) { |
$requete_suppression = 'delete from inscription_demande where id_identifiant_session="'.$chaine.'"' ; |
$GLOBALS['ins_db']->query ($requete_suppression) ; |
} |
$requete = 'insert into inscription_demande set id_identifiant_session="'.$chaine.'", id_donnees="'. |
addslashes(serialize($valeurs)).'", id_date=NOW()' ; |
$resultat = $GLOBALS['ins_db']->query ($requete) ; |
if (DB::isError ($resultat)) { |
echo ("Echec de la requete : $requete<br />".$resultat->getMessage()) ; |
} |
// On envoie un email de confirmation pour l'utilisateur |
$GLOBALS['ins_url']->addQueryString ('id', $chaine) ; |
$corps = INS_MESSAGE_DEBUT_MAIL_INSCRIPTION ; |
if (INS_UTILISE_REECRITURE_URL) { |
$corps .= 'http://'.$GLOBALS['ins_url']->host.'/'.INS_URL_PREFIXE.$chaine ; |
} else { |
$corps .= str_replace ('&', '&', $GLOBALS['ins_url']->getURL()) ; |
} |
$corps .= INS_MESSAGE_FIN_MAIL_INSCRIPTION ; |
mail ($GLOBALS['email'], 'Inscription', $corps, 'From: '.INS_MAIL_ADMIN_APRES_INSCRIPTION) ; |
} |
function AUTH_formulaire_login ($msg = '') { |
//-------------------------------------------------------------------------- |
// Le formulaire |
//-------------------------------------------------------------------------- |
$url = preg_replace ('/&/', '&', $GLOBALS['ins_url']->getURL()) ; |
$form = new HTML_QuickForm ('inscription', 'post', $url."&action=inscription") ; |
$form->addElement ('submit', 'Inscription', INS_INSCRIPTION) ; |
$res = '<h1 class="titre1_inscription">'.INS_ACCUEIL_INSCRIPTION.'</h1>'; |
$res .= $msg ; |
$res .= "<h2 class=\"titre2_inscription\">".INS_LAIUS_INSCRIPTION."</h2>\n" ; |
$res .= "<div>".INS_LAIUS_INSCRIPTION_2."</div>\n" ; |
$res .= $form->toHTML() ; |
$res .= '<h2 class="titre2_inscription">'.INS_DEJA_INSCRIT.'</h2>' ; |
$form = new HTML_QuickForm ('inscription', 'post', $url) ; |
$form->addElement ('text', 'username', INS_EMAIL) ; |
$form->addElement ('password', 'password', INS_MOT_DE_PASSE) ; |
$form->addElement('submit', 'valider', INS_VALIDER); |
$res .= $form->toHTML() ; |
$res .= "<div>".INS_TEXTE_PERDU."</div>\n" ; |
return $res; |
} |
/** message_erreur () - Renvoie le code HTML d'un message d'erreur |
* |
* @return string HTML |
*/ |
function message_erreur () { |
$res = ''; |
$url = preg_replace ('/&/', '&', $GLOBALS['ins_url']->getURL()) ; |
$res .= '<h1 class="titre1_inscription">'.INS_ACCUEIL_INSCRIPTION.'</h1>' ; |
$res .= "<div class=\"inscription_erreur\">".INS_ERREUR_LOGIN."</div>\n" ; |
$res .= "<div>".INS_SI_PASSE_PERDU."</div>\n" ; |
$res .= '<div>' ; |
$res .= '<form action="'.$url.'&action=sendpasswd" method="post">'."\n" ; |
$res .= INS_EMAIL.' ' ; |
$res .= '<input type="text" value="'.$_POST['username'].'" name="nom_d_utilisateur" size="32" /></li></ul>'."\n" ; |
$res .= '<div>'.INS_INDIQUE_ADRESSE.'</div>'."\n" ; |
$res .= "<input type=\"submit\" value=\"".INS_ENVOIE_PASSE."\" />" ; |
$res .= "</form></div>\n" ; |
// On remet le formulaire d'inscription mais un peu réduit |
$res .= '<h2 class="titre2_inscription">'.INS_DEJA_INSCRIT.'</h2>' ; |
$form = new HTML_QuickForm ('inscription', 'post', $url) ; |
$form->addElement ('text', 'username', INS_EMAIL) ; |
$form->addElement ('password', 'password', INS_MOT_DE_PASSE) ; |
$form->addElement('submit', 'valider', INS_VALIDER); |
$res .= $form->toHTML() ; |
return $res; |
} |
function insertion($valeur) { |
// =========== Insertion dans l'annuaire gen_annuaire =================== |
// Génération du nom wikini à partir du nom et du prénom |
if (INS_UTILISE_WIKINI) { |
$valeur['nom_wiki'] = genere_nom_wiki ($valeur['nom'], $valeur['prenom']) ; |
$autres_valeurs[INS_CHAMPS_WIKINI] = $valeur['nom_wiki'] ; |
$autres_valeurs['email'] = $valeur['email'] ; |
} |
$autres_valeurs = info_annuaire($valeur) ; |
$resultat = $GLOBALS['AUTH']->addUser($valeur['email'], $valeur['mot_de_passe'], $autres_valeurs) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
// récupération de l'identifiant de l'inscription |
$requete = 'select '.INS_CHAMPS_ID.' from '.INS_ANNUAIRE.' where '.INS_CHAMPS_MAIL.'="'.$valeur['email'].'"' ; |
$resultat = $GLOBALS['ins_db']->query ($requete) ; |
if (DB::isError ($resultat)) { |
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ; |
$id = $ligne[INS_CHAMPS_ID] ; |
// ================ Insertion dans SPIP ========================================= |
if (INS_UTILISE_SPIP) inscription_spip($id, $valeur) ; |
if (INS_UTILISE_WIKINI) inscription_interwikini_users($valeur['nom_wiki'], $valeur) ; |
// Insertion dans les statistiques |
$requete = 'insert into '.INS_TABLE_STATISTIQUE.' set '.INS_STATS_CHAMPS_DATE.'=NOW(), '.INS_STATS_CHAMPS_ACTION.'="add"' ; |
$resultat = $GLOBALS['ins_db']->query ($requete) ; |
if (DB::isError ($resultat)) { |
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ; |
} |
} |
/** |
* Effectue une mise à jour dans la base de donnée |
* |
* @global AUTH un objet PEAR:Auth |
* @global ins_db un objet PEAR::DB |
* @return |
*/ |
function mise_a_jour($valeur) { |
// ====================Mise à jour dans l'annuaire ==================== |
$requete = 'update '.INS_ANNUAIRE.' set '. |
requete_annuaire ($valeur). |
'where '.INS_CHAMPS_ID.'="'.$GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID).'"'; |
$resultat = $GLOBALS['ins_db']->query ($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
if (isset($valeur['lettre'])) $GLOBALS['AUTH']->setAuthData (INS_CHAMPS_LETTRE, $valeur['lettre'], true) ; // On appelle cette fonction pour mettre à jour |
// la valeur de session (récupéré par getAuthData() |
unset ($resultat) ; |
// ========================= Mise à jour dans SPIP ================================ |
if (INS_UTILISE_SPIP) mod_inscription_spip($GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID)) ; |
if (INS_UTILISE_WIKINI) mod_inscription_interwikini_users($GLOBALS['AUTH']->getAuthData(INS_CHAMPS_WIKINI), $valeur) ; |
} |
/** requete_annuaire () - Renvoie une chaine contenant les champs de l'annuaire avec leur valeur suite à le fonction process de QuickForm |
* |
* @return string une requete du type champs="valeur",... |
*/ |
function requete_annuaire (&$valeur) { |
if (!isset($valeur['lettre'])) $valeur['lettre'] = 0 ; |
if (preg_match ('/([0-9][0-9])[0-9][0-9][0-9]/', $valeur['cp'], $match)) { |
$valeur['dpt'] = $match[1] ; |
if (preg_match ('/(97[0-9])[0-9][0-9]/', $valeur['cp'], $match2)) { |
$valeur['dpt'] = $match2[1] ; |
} |
} |
$req = INS_CHAMPS_NOM.'="'.$valeur['nom'].'",'. |
INS_CHAMPS_PRENOM.'="'.$valeur['prenom'].'",'. |
INS_CHAMPS_MAIL.'="'.$valeur['email'].'",'. |
INS_CHAMPS_PASSE.'="'.md5 ($valeur['mot_de_passe']).'",'. |
INS_CHAMPS_PAYS.'="'.$valeur['pays'].'", '. |
INS_CHAMPS_CODE_POSTAL.'="'.$valeur['cp'].'", '. |
INS_CHAMPS_VILLE.'="'.$valeur['ville'].'", '. |
INS_CHAMPS_ADRESSE_1.'="'.$valeur['adresse_1'].'", '. |
INS_CHAMPS_ADRESSE_2.'="'.$valeur['adresse_2'].'", '. |
INS_CHAMPS_REGION.'="'.$valeur['region'].'", '. |
INS_CHAMPS_STRUCTURE.'="'.$valeur['organisme'].'", '. |
INS_CHAMPS_SITE_WEB.'="'.$valeur['site'].'", '. |
INS_CHAMPS_LETTRE.'="'.$valeur['lettre'].'", '. |
'U_FONCTION="'.$valeur['fonction'].'", '. |
'U_NIV="'.$valeur['niveau'].'", '. |
'U_ACT="'.$valeur['activite'].'", '. |
'U_ASS="'.$valeur['asso'].'", '. |
'U_SPE="'.$valeur['specialite'].'", '. |
'U_GEO="'.$valeur['specialite_geo'].'" '; |
if (isset($valeur['dpt'])) { |
$req .= ',U_FRENCH_DPT="'.$valeur['dpt'].'"' ; |
} |
return $req ; |
} |
/** |
* renvoie un tableau avec en clé les champs de la base et en valeur les valeurs saisies dans le formulaire |
* |
* @return array renvoie un tableau avec en clé les champs de la base et en valeur les valeurs saisies dans le formulaire |
*/ |
function info_annuaire ($valeur) { |
$tableau = array ( |
INS_CHAMPS_ID => nextId(INS_ANNUAIRE, INS_CHAMPS_ID, $GLOBALS['ins_db']), |
INS_CHAMPS_NOM => $valeur['nom'], |
INS_CHAMPS_PRENOM => $valeur['prenom'], |
INS_CHAMPS_PAYS => $valeur['pays'], |
INS_CHAMPS_CODE_POSTAL => $valeur['cp'], |
INS_CHAMPS_VILLE => $valeur['ville'], |
INS_CHAMPS_ADRESSE_1 => $valeur['adresse_1'], |
INS_CHAMPS_ADRESSE_2 => $valeur['adresse_2'], |
INS_CHAMPS_REGION => $valeur['region'], |
INS_CHAMPS_STRUCTURE => $valeur['organisme'], |
INS_CHAMPS_SITE_WEB => $valeur['site'], |
INS_CHAMPS_LETTRE => $valeur['lettre'], |
'U_FONCTION' => $valeur['fonction'], |
'U_NIV' => $valeur['niveau'], |
'U_ACT' => $valeur['activite'], |
'U_ASS' => $valeur['asso'], |
'U_SPE' => $valeur['specialite'], |
'U_GEO' => $valeur['specialite_geo'] |
) ; |
return $tableau ; |
} |
/** formulaire_defaults () - Renvoie un tableau avec les valeurs par défaut du formulaire d'inscription |
* |
* @return array Valeurs par défaut du formulaire d'inscription |
*/ |
function formulaire_defaults () { |
$requete = 'select '.INS_ANNUAIRE.'.* '. |
'from '.INS_ANNUAIRE.' '. |
'where '.INS_ANNUAIRE.'.'.INS_CHAMPS_ID.'= "'.$GLOBALS['AUTH']->getAuthData (INS_CHAMPS_ID).'"' ; |
$resultat = $GLOBALS['ins_db']->query ($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ; |
$valeurs_par_defaut = array() ; |
$valeurs_par_defaut['email'] = $ligne[INS_CHAMPS_MAIL]; |
$valeurs_par_defaut['nom'] = $ligne[INS_CHAMPS_NOM]; |
$valeurs_par_defaut['prenom'] = $ligne[INS_CHAMPS_PRENOM] ; |
$valeurs_par_defaut['pays'] = $ligne[INS_CHAMPS_PAYS] ; |
$valeurs_par_defaut['nomwiki'] = $ligne[INS_CHAMPS_LOGIN] ; |
$valeurs_par_defaut['cp'] = $ligne[INS_CHAMPS_CODE_POSTAL] ; |
$valeurs_par_defaut['ville'] = $ligne[INS_CHAMPS_VILLE] ; |
$valeurs_par_defaut['adresse_1'] = $ligne[INS_CHAMPS_ADRESSE_1] ; |
$valeurs_par_defaut['adresse_2'] = $ligne[INS_CHAMPS_ADRESSE_2] ; |
$valeurs_par_defaut['region'] = $ligne[INS_CHAMPS_REGION] ; |
$valeurs_par_defaut['structure'] = $ligne[INS_CHAMPS_STRUCTURE] ; |
$valeurs_par_defaut['site'] = $ligne['U_WEB'] ; |
$valeurs_par_defaut['organisme'] = $ligne['U_TITLE'] ; |
$valeurs_par_defaut['fonction'] = $ligne['U_FONCTION'] ; |
$valeurs_par_defaut['niveau'] = $ligne['U_NIV'] ; |
$valeurs_par_defaut['activite'] = $ligne['U_ACT'] ; |
$valeurs_par_defaut['asso'] = $ligne['U_ASS'] ; |
$valeurs_par_defaut['specialite'] = $ligne['U_SPE'] ; |
$valeurs_par_defaut['specialite_geo'] = $ligne['U_GEO'] ; |
$valeurs_par_defaut['lettre'] = $ligne[INS_CHAMPS_LETTRE] ; |
return $valeurs_par_defaut ; |
} |
function info() { |
$requete = 'select * from '.INS_ANNUAIRE.', '.INS_TABLE_PAYS.', annuaire_LABEL_ACT, annuaire_LABEL_NIV, annuaire_LABEL_ASS'. |
' where '.INS_ANNUAIRE.'.'.INS_CHAMPS_ID.'="'.$GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID).'"'. |
' and '.INS_CHAMPS_PAYS.'='.INS_CHAMPS_ID_PAYS. |
' and U_ACT=ID_LABEL_ACT and U_NIV=ID_LABEL_NIV and U_ASS=ID_LABEL_ASS' ; |
$resultat = $GLOBALS['ins_db'] -> query ($requete) ; |
if (DB::isError ($resultat)) { |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
$ligne = $resultat->fetchRow (DB_FETCHMODE_ASSOC) ; |
$res = '<h1 class="inscription_titre1">'.INS_MESSAGE_BIENVENU."</h1>\n" ; |
$res .= "<h2 class=\"inscription_titre2\">".INS_FICHE_PERSONNELLE."</h2>\n" ; |
$res .= '<dl>' ; |
$res .= ligne_inscription (INS_EMAIL, $ligne[INS_CHAMPS_MAIL]) ; |
$res .= ligne_inscription (INS_NOM, $ligne[INS_CHAMPS_NOM]) ; |
$res .= ligne_inscription (INS_PRENOM, $ligne[INS_CHAMPS_PRENOM]) ; |
$res .= ligne_inscription (INS_ADRESSE_1, $ligne[INS_CHAMPS_ADRESSE_1]) ; |
$res .= ligne_inscription (INS_ADRESSE_2, $ligne[INS_CHAMPS_ADRESSE_2]) ; |
$res .= ligne_inscription (INS_REGION, $ligne[INS_CHAMPS_REGION]) ; |
$res .= ligne_inscription (INS_CODE_POSTAL, $ligne[INS_CHAMPS_CODE_POSTAL]) ; |
$res .= ligne_inscription (INS_VILLE, $ligne[INS_CHAMPS_VILLE]) ; |
$res .= ligne_inscription (INS_PAYS, $ligne[INS_CHAMPS_LABEL_PAYS]) ; |
$res .= ligne_inscription (INS_SITE_INTERNET, $ligne[INS_CHAMPS_SITE_WEB]) ; |
$res .= '</dl>' ; |
//$res .= "<div>".INS_NOM_WIKI." : ".$ligne[INS_CHAMPS_LOGIN]."</div>\n" ; |
$res .= '<h2 class="inscription_titre2">'.INS_ADHERENT.'</h2>' ; |
$res .= '<dl>' ; |
$res .= ligne_inscription (INS_ORGANISME, $ligne['U_TITLE']) ; |
$res .= ligne_inscription (INS_FONCTION, $ligne['U_FONCTION']) ; |
$res .= '</dl>' ; |
$res .= '<h2 class="inscription_titre2">'.INS_ETES_BOTANISTE.'</h2>' ; |
$res .= '<div>'.$ligne['LABEL_NIV'].'</div>'."\n" ; |
$res .= '<h2 class="inscription_titre2">'.INS_ACTIVITE_PROFESSIONNELLE.'</h2>' ; |
$res .= '<div>'.$ligne['LABEL_ACT'].'</div>'."\n" ; |
$res .= '<h2 class="inscription_titre2">'.INS_MEMBRE_ASSO.'</h2>' ; |
$res .= '<div>'.$ligne['LABEL_ASS'].'</div>'."\n" ; |
$res .= '<h2 class="inscription_titre2">'.INS_SPECIALISTE.'</h2>' ; |
$res .= '<div>'.$ligne['U_SPE'].'</div>'."\n" ; |
$res .= '<h2 class="inscription_titre2">'.INS_SPE_ZONE.'</h2>' ; |
$res .= '<div>'.$ligne['U_GEO'].'</div>'."\n" ; |
return $res ; |
} |
/** |
* |
* |
* @return |
*/ |
function ligne_inscription ($label, $valeur) { |
if ($valeur == '') { |
$valeur = ' ' ; |
} |
return '<dt>'.$label.' : </dt><dd>'.$valeur.'</dd>' ; |
} |
function bouton($url) { |
$boutons = new HTML_QuickForm('inscription', 'post', $url) ; ; |
//confirmation() ; |
$buttons[] = &HTML_QuickForm::createElement('submit', 'modifier', INS_MODIFIER_INSCRIPTION); |
$buttons[] = &HTML_QuickForm::createElement('submit', 'supprimer', INS_SUPPRIMER_INSCRIPTION, |
array ("onclick" => "javascript:return confirm('".INS_SUPPRIMER_INSCRIPTION." ?');")); |
$boutons->addGroup($buttons, null, null, ' '); |
$boutons->addElement('hidden', 'id_utilisateur', $GLOBALS['AUTH']->getAuthData (INS_CHAMPS_ID)) ; |
return $boutons->toHTML() ; |
} |
/** |
* Renvoie un lien pour se déconnex=cter |
* |
* @return string |
*/ |
function deconnexion ($url) { |
// Un champs logout |
return "<div><a href=\"$url&logout=1\">".INS_DECONNEXION."</a></div>" ; |
} |
function verif_doublonMail($mail) { |
if (isset ($GLOBALS['AUTH']) && $GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID) != '') { |
$requete_mail = "select ".INS_CHAMPS_MAIL." from ".INS_ANNUAIRE." where ".INS_CHAMPS_ID."=".$GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID) ; |
$resultat_mail = $GLOBALS['ins_db']->query ($requete_mail) ; |
if (DB::isError ($resultat_mail)) { |
die ("Echec de la requete : $requete_mail<br />".$resultat_mail->getMessage()) ; |
} |
$ligne_mail = $resultat_mail->fetchRow(DB_FETCHMODE_ASSOC) ; |
if ($mail == $ligne_mail[INS_CHAMPS_MAIL]) { |
return true ; |
} |
} |
$requete = "select ".INS_CHAMPS_MAIL." from ".INS_ANNUAIRE." where ".INS_CHAMPS_MAIL."= \"$mail\"" ; |
$resultat = $GLOBALS['ins_db']->query ($requete) ; |
if (DB::isError ($resultat)) { |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows() == 0) return true ; |
return false ; |
} |
function envoie_passe() |
{ |
$headers['From'] = INS_MAIL_ADMIN_APRES_INSCRIPTION ; |
$headers['Subject'] = INS_NOUVEAU_MOT_DE_PASSE; |
$nouveau_passe = create_new_random(6) ; |
$body = INS_NOUVEAU_MOT_DE_PASSE_2.$nouveau_passe ; |
$body .= INS_NOUVEAU_MOT_DE_PASSE_LAIUS ; |
// modification du mot de passe dans la base |
$requete = "update ".INS_ANNUAIRE." set ".INS_CHAMPS_PASSE."=MD5(\"$nouveau_passe\") where ".INS_CHAMPS_MAIL."=\"".$_POST['nom_d_utilisateur']."\"" ; |
$resultat = $GLOBALS['ins_db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
// On teste si l'email est présent dans la base |
if ($GLOBALS['ins_db']->affectedRows() == 0) { |
return '<div class="erreur">Il n\'y a pas d\'inscrit avec cet email</div>'."\n" ; |
} |
// création du mail |
if (!mail ($_POST['nom_d_utilisateur'], $headers['Subject'], $body)) { |
return 'erreur lors de l\'envoie de mail' ; |
} |
return "<div class=\"titre1_inscription\">".INS_MOT_DE_PASSE_ENVOYE_1." ".$_POST['nom_d_utilisateur']."</div>\n". |
"<div><br>".INS_MOT_DE_PASSE_ENVOYE_2."</div>\n"; |
} |
/** |
* |
* @global ins_db Un pointeur vers un objet PEAR::DB connecté |
* @return |
*/ |
function envoie_mail() |
{ |
include_once 'Mail/mime.php' ; |
$crlf="\n"; |
$headers ['From'] = INS_MAIL_ADMIN_APRES_INSCRIPTION ; |
$headers ['Subject'] = INS_MAIL_COORD_SUJET ; |
$headers ['Reply-To'] = INS_MAIL_ADMIN_APRES_INSCRIPTION ; |
$mime = new Mail_mime($crlf); |
$requete = 'select *, '.INS_CHAMPS_LABEL_PAYS.' from '.INS_ANNUAIRE.','.INS_TABLE_PAYS.', annuaire_LABEL_ACT, annuaire_LABEL_NIV, annuaire_LABEL_ASS'. |
' where '.INS_CHAMPS_MAIL.'="'.$GLOBALS['AUTH']->getUsername().'"'. |
' and '.INS_CHAMPS_ID_PAYS.'='.INS_CHAMPS_PAYS. |
' and U_ACT=ID_LABEL_ACT and U_NIV=ID_LABEL_NIV and U_ASS=ID_LABEL_ASS' ; |
$resultat = $GLOBALS['ins_db']->query($requete) ; |
if (DB::isError ($resultat)) { |
die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ; |
$body = INS_MAIL_COORD_CORPS."\n" ; |
$body .= "------------------------------------------\n"; |
$body .= INS_EMAIL.": ".unhtmlentities($ligne[INS_CHAMPS_MAIL])." \n" ; |
$body .= INS_NOM.": ".unhtmlentities($ligne[INS_CHAMPS_NOM])." \n" ; |
$body .= unhtmlentities(INS_PRENOM).' : '.unhtmlentities($ligne[INS_CHAMPS_PRENOM])." \n" ; |
$body .= INS_PAYS." : ".unhtmlentities($ligne[INS_CHAMPS_LABEL_PAYS])." \n" ; |
$body .= INS_ADRESSE_1." : ".unhtmlentities($ligne[INS_CHAMPS_ADRESSE_1])." \n" ; |
$body .= INS_ADRESSE_2." : ".unhtmlentities($ligne[INS_CHAMPS_ADRESSE_2])." \n" ; |
$body .= unhtmlentities(INS_REGION)." : ".unhtmlentities($ligne[INS_CHAMPS_REGION])." \n" ; |
$body .= INS_CODE_POSTAL." : ".unhtmlentities($ligne[INS_CHAMPS_CODE_POSTAL])." \n" ; |
$body .= INS_VILLE." : ".unhtmlentities($ligne[INS_CHAMPS_VILLE])." \n" ; |
$body .= INS_SITE_INTERNET." : ".unhtmlentities($ligne[INS_CHAMPS_SITE_WEB])." \n" ; |
$body .= INS_ORGANISME." : ".unhtmlentities($ligne['U_TITLE'])." \n" ; |
$body .= INS_FONCTION." : ".unhtmlentities($ligne['U_FONCTION'])." \n" ; |
$body .= unhtmlentities(INS_ETES_BOTANISTE)." : ".unhtmlentities($ligne['LABEL_NIV'])." \n" ; |
$body .= unhtmlentities(INS_ACTIVITE_PROFESSIONNELLE)." : ".unhtmlentities($ligne['LABEL_ACT'])." \n" ; |
$body .= unhtmlentities(INS_MEMBRE_ASSO)." : ".unhtmlentities($ligne['LABEL_ASS'])." \n" ; |
$body .= unhtmlentities(INS_SPECIALISTE)." : ".unhtmlentities($ligne['U_SPE'])." \n" ; |
$body .= unhtmlentities(INS_SPE_ZONE)." : ".unhtmlentities($ligne['U_GEO'])." \n" ; |
$body .= "-------------------------------------------\n" ; |
$mime->setTXTBody($body); |
$body = $mime->get(); |
$headers = $mime->headers($headers); |
$mail = & Mail::factory ('mail') ; |
$mail -> send ($ligne[INS_CHAMPS_MAIL], $headers, $body) ; |
// Envoi du mail aux administrateur du site |
foreach ($GLOBALS['mail_admin'] as $administrateur) { |
$mail -> send ($administrateur, $headers, $body) ; |
} |
if (PEAR::isError ($mail)) { |
echo 'erreur d\'envoi' ; |
return false ; |
} |
return true ; |
} |
/** |
* |
* |
* @return |
*/ |
function message_inscription () { |
return '<div>'.INS_MESSAGE_INSCRIPTION.'</div>' ; |
} |
/** |
* Inscrit un adhérent à la lettre d'actualité par l'envoie d'un email subscribe / unsubscribe |
* à la liste |
* |
* @global AUTH Un objet PEAR::Auth |
* @return boolean true en cas de succès |
*/ |
function inscription_lettre ($action) { |
$mail = & Mail::factory ('smtp') ; |
$email = $GLOBALS['AUTH']->getUsername() ; |
$headers ['Return-Path'] = $email ; |
$headers ['From'] = "<".$email.">" ; |
$headers ['Subject'] = $action ; |
$headers ['Reply-To'] = $email ; |
$mail -> send ($action, $headers, "") ; |
if (PEAR::isError ($mail)) { |
echo '<div class="erreur">Le mail n\'est pas partie...</div>' ; |
return false ; |
} |
return true ; |
} |
/** |
* Génère un nom wiki valide à partir des données saisies par l'utilisateur |
* fait une requete dans la base |
* |
* @return string un nom wiki valide |
*/ |
function genere_nom_wiki ($nom, $prenom) { |
// 1. suppression des espaces |
$nom = trim ($nom) ; |
$prenom = trim ($prenom) ; |
// 2. suppression des caractères non ascii et ajout de la première lettre en majuscule |
$nom = trim_non_ascii ($nom) ; |
$prenom = trim_non_ascii ($prenom) ; |
// Vérification |
$nom_wiki = $nom.$prenom ; |
if (!preg_match('/^[A-Z][a-z]+[A-Z,0-9][A-Z,a-z,0-9]*$/', $nom_wiki)) { |
$nom_wiki = chr(rand(65, 90)).$nom_wiki.chr(rand(65, 90)) ; |
} |
return $nom_wiki ; |
} |
/** |
* |
* |
* @return |
*/ |
function trim_non_ascii ($nom) { |
$premiere_lettre = true ; |
for ($i = 0; $i < strlen ($nom); $i++) { |
if (!preg_match ('/[a-zA-Z0-9]/', $nom[$i])) { |
// str_replace ($nom[$i], '_', $nom, 1) ; |
} |
// remplacement de la première lettre en majuscule |
if (preg_match ('/[a-zA-Z]/', $nom[$i]) && $premiere_lettre) { |
$nom[$i] = strtoupper ($nom[$i]) ; |
$premiere_lettre = false ; |
} else { |
if (preg_match ('/[a-zA-Z]/', $nom[$i])) { |
$nom[$i] = strtolower ($nom[$i]) ; |
} |
} |
} |
$nom = trim ($nom, '_') ; |
return $nom ; |
} |
// For users prior to PHP 4.3.0 you may do this: |
function unhtmlentities ($string) |
{ |
$trans_tbl = get_html_translation_table (HTML_ENTITIES); |
$trans_tbl = array_flip ($trans_tbl); |
return strtr ($string, $trans_tbl); |
} |
/* *********************************** |
create_new_random($n,$type) permet de générer un nombre de caractères aléatoires. |
ENTREE : |
- $n : créer un 'mot' de $n caractères |
- $type : permet de définir la liste des caractères disponibles |
SORTIE : chaine de $n caractères pris dans une liste $type |
*********************************** */ |
function create_new_random($n,$type="") |
{ |
$str = ""; |
switch ($type){ |
//liste des caractères possibles en virant ceux qui se ressemblent (ijl1oO0) |
// case "": |
// { |
// } |
// break; |
default:{ |
$chaine = "abcdefghkmnpqrstuvwxyzABCDEFGHKLMNPQRSTUVWXYZ23456789"; |
} |
break; |
} |
srand((double)microtime()*1000000); |
for($i = 0; $i < $n; $i++){ |
$str .= $chaine[rand()%strlen($chaine)]; |
} |
return "$str"; |
} |
//============================================================================== |
/** function nextId () Renvoie le prochain identifiant numérique libre d'une table |
* |
* On passe en paramètre le nom de la table et l'identifiant de la base selon PEAR DB |
* |
* @param mixed handler de connexion |
* @param string Nom de la table |
* return interger l'identifiant |
*/ |
function nextId ($table, $colonne_identifiant, $db) |
{ |
$requete = "select MAX($colonne_identifiant) as maxi from $table" ; |
$resultat = $db->query($requete) ; |
if (DB::isError($resultat)) { |
die (__FILE__ . __LINE__ . $resultat->getMessage() . $requete); |
return $db->raiseError($resultat) ; |
} |
if ($resultat->numRows() > 1) { |
return $db->raiseError("<br/>La table $table a un identifiant non unique<br/>") ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ; |
return $ligne->maxi + 1 ; |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: inscription.fonct.php,v $ |
* Revision 1.2 2005/03/21 16:50:27 alex |
* mille et une corrction |
* |
* Revision 1.1 2005/03/04 10:39:30 tam |
* installation |
* |
* Revision 1.1 2004/07/06 15:42:17 alex |
* en cours |
* |
* Revision 1.7 2004/07/06 15:28:41 alex |
* en cours |
* |
* Revision 1.5 2004/07/06 15:22:19 alex |
* en cours |
* |
======= |
* Revision 1.4 2004/06/30 10:00:26 alex |
* modification de l'envoie de mail |
* |
* Revision 1.2 2004/06/23 12:41:51 alex |
* amélioration de la gestion de la perte de mot de passe |
* |
* Revision 1.1 2004/06/18 09:20:47 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/inscription/langues/ins_langue_en.inc.php |
---|
New file |
0,0 → 1,114 |
<?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: ins_langue_en.inc.php,v 1.1 2004/07/06 15:42:17 alex Exp $ |
/** |
* Fichier de traduction en anglais de l'application inscription |
* |
* Fichier de traduction en anglais de l'application inscription |
* |
*@package inscription |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2004/07/06 15:42:17 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
define ("INS_NOM", "Name :") ; |
define ("INS_PRENOM", "First name") ; |
define ("INS_PAYS", "Country:") ; |
define ("INS_LANGUES_PARLES", "Languages spoken :") ; |
define ("INS_EMAIL", "E-mail :") ; |
define ("INS_MOT_DE_PASSE", "Password:") ; |
define ("INS_REPETE_MOT_DE_PASSE", "Repeat the password :") ; |
define ("INS_ANNULER", "Cancel") ; |
define ("INS_RETABLIR", "Restore") ; |
define ("INS_VALIDER", "Validate") ; |
define ("INS_MOTS_DE_PASSE_DIFFERENTS", "The two passwords are different !") ; |
define ("INS_EMAIL_REQUIS", "You must enter your e-mail.") ; |
define ("INS_MOT_DE_PASSE_REQUIS", "You must enter your password.") ; |
define ("INS_MAIL_INCORRECT", "E-mail addresses must be in the following format, user@domain.ext") ; |
define ("INS_MAIL_DOUBLE", "This e-mail has already been used") ; |
define ("INS_NOTE_REQUIS", "Indicate the required fields") ; |
define ("INS_MODIFIER_INSCRIPTION", "Modify your registration") ; |
define ("INS_SUPPRIMER_INSCRIPTION", "Cancel your registration") ; |
define ("INS_MESSAGE_BIENVENU", "You are registered to i-twinning ") ; |
define ("INS_FICHE_PERSONNELLE", "Personal form") ; |
define ("INS_DECONNEXION", "Logout") ; |
define ("INS_INSCRIPTION", "Registration") ; |
define ("INS_TEXTE_PERDU", "If you forgot your password, enter your e-mail address in the Login ". |
"field below and click on Validate") ; |
define ("INS_NOM_WIKI", "Wiki name") ; |
define ("INS_MAUVAIS_NOM_WIKI", "The wiki name is not valid (ex : NameFirstname)") ; |
define ("INS_DEJA_INSCRIT", "If you are already registered :") ; |
define ("INS_ERREUR_LOGIN", "Unknown user or invalid password") ; |
define ("INS_SI_PASSE_PERDU", "If you forgot your password") ; |
define ("INS_INDIQUE_ADRESSE", "Enter your e-mail address in the field below.<br>\n". |
"A new password will be sent to you ") ; |
define ("INS_ENVOIE_PASSE", "Password e-mailing") ; |
define ("INS_LAIUS_INSCRIPTION", "Click here for registration") ; |
//============= L'envoie du mot de passe perdu par mail ============================= |
define ("INS_NOUVEAU_MOT_DE_PASSE", "Your new i-twinning password") ; |
define ("INS_NOUVEAU_MOT_DE_PASSE_2", "Your new password : ") ; |
define ("INS_NOUVEAU_MOT_DE_PASSE_LAIUS", "\n\n This password allows you to modify your personnal informations\n". |
"in the i-t website\n.". |
"http://www.vecam.org/i-j/\n\n") ; |
define ("INS_MOT_DE_PASSE_ENVOYE_1", "Your new password has been sent to the address ") ; |
define ("INS_MOT_DE_PASSE_ENVOYE_2", "Check your mail, remember your password and register again. Don't ". |
"hesitate to change this password and replace it by an easier one.") ; |
//============= L'envoie d'un mail de confirmation =================================== |
// Ne pas utiliser d'entités HTML |
define ("INS_MAIL_INSCRIPTION_1", "Votre inscription a bien été prise en compte.\n". |
"Voici les informations que nous avons enregistré :\n") ; |
define ("INS_MAIL_INSCRIPTION_2", "\nVous pouvez modifier votre inscription sur \nhttp://www.vecam.org/i-j/\n". |
"rubrique Inscription.\n\n". |
"L'équipe I-Jumelage.") ; |
// Envoir d'un mail à la coordination |
define ("INS_MAIL_COORD_SUJET", "A new registration on the I-Twinning") ; |
define ("INS_MAIL_COORD_CORPS", "A new registration on the I-Twinning") ; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: ins_langue_en.inc.php,v $ |
* Revision 1.1 2004/07/06 15:42:17 alex |
* en cours |
* |
* Revision 1.3 2004/06/25 14:25:40 alex |
* ajout de labels |
* |
* Revision 1.2 2004/06/24 07:43:55 alex |
* traduction |
* |
* Revision 1.1 2004/06/18 09:21:15 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/inscription/langues/ins_langue_es.inc.php |
---|
New file |
0,0 → 1,110 |
<?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: ins_langue_es.inc.php,v 1.1 2004/07/06 15:42:17 alex Exp $ |
/** |
* Fichier de traduction en français de l'application inscription |
* |
* Fichier de traduction en français de l'application inscription |
* |
*@package inscription |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2004/07/06 15:42:17 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
define ("INS_NOM", "Apellido") ; |
define ("INS_PRENOM", "Nombre") ; |
define ("INS_PAYS", "Pais") ; |
define ("INS_LANGUES_PARLES", "Idiomas hablados") ; |
define ("INS_EMAIL", "Correo electronico") ; |
define ("INS_MOT_DE_PASSE", "Contraseña") ; |
define ("INS_REPETE_MOT_DE_PASSE", "Repetir la contraseña") ; |
define ("INS_ANNULER", "Cancelar") ; |
define ("INS_RETABLIR", "Restablecer") ; |
define ("INS_VALIDER", "Ingresar") ; |
define ("INS_MOTS_DE_PASSE_DIFFERENTS", "Las contraseñas son diferentes!") ; |
define ("INS_EMAIL_REQUIS", "Debe ingresar un correo electronico") ; |
define ("INS_MOT_DE_PASSE_REQUIS", "Debe ingresar una contraseña.") ; |
define ("INS_MAIL_INCORRECT", "El correo electronico debe tener una forma correcta, utilizador@domaine.ext") ; |
define ("INS_MAIL_DOUBLE", "Este correo electronico ya es utilizado por otra persona") ; |
define ("INS_NOTE_REQUIS", "Indicar los espacios requeridos") ; |
define ("INS_MODIFIER_INSCRIPTION", "Modificar su inscripccion") ; |
define ("INS_SUPPRIMER_INSCRIPTION", "Cancelar su inscripcion") ; |
define ("INS_MESSAGE_BIENVENU", "Esta inscrito en I-Enlace") ; |
define ("INS_FICHE_PERSONNELLE", "Ficha personal") ; |
define ("INS_DECONNEXION", "Desconectar") ; |
define ("INS_INSCRIPTION", "Inscripcion") ; |
define ("INS_TEXTE_PERDU", "Si ha perdido su contraseña, indique su correo electronico en el espaciologin y haga clic en Ingresar") ; |
define ("INS_NOM_WIKI", "Nombre wiki") ; |
define ("INS_MAUVAIS_NOM_WIKI", "El nombre wiki no es valido (ex: NomPrenom)") ; |
define ("INS_DEJA_INSCRIT", "Si ya esta inscrito") ; |
define ("INS_ERREUR_LOGIN", "Utilizador desconocido o contraseña incorrecta") ; |
define ("INS_SI_PASSE_PERDU", "Si ha perdido su contraseña ") ; |
define ("INS_INDIQUE_ADRESSE", "indique su correo electronico en el espacio que sigue. Una nueva contraseñale sera enviada.") ; |
define ("INS_LAIUS_INSCRIPTION", "Si no està inscrito, haga clic en inscripción") ; |
define ("INS_ENVOIE_PASSE", "Envio de la contraseña por correo electronico") ; |
//=================== Envio de la contraseña perdida por correo electronico======================== |
define ("INS_NOUVEAU_MOT_DE_PASSE", "Su nueva contraseña I-Enlaces") ; |
define ("INS_NOUVEAU_MOT_DE_PASSE_2", "Su nueva contraseña:") ; |
define ("INS_NOUVEAU_MOT_DE_PASSE_LAIUS", "Esta contraseña le permite modificar las informaciones que le conciernen enel sitio de I-Enlace.Su nueva contraseña es enviada a la direccion") ; |
define ("INS_MOT_DE_PASSE_ENVOYE_1", "Rebice su correo electronico, anote su nueva contraseña e idenfiquedirigiendose de nuevo a la inscripcion.No dude en cambiar esta contraseña para poner una mas simple y mas facil aretener. ") ; |
//============= L'envoie d'un mail de confirmation =================================== |
// Ne pas utiliser d'entités HTML |
define ("INS_MAIL_INSCRIPTION_1", "Votre inscription a bien été prise en compte.\n". |
"Voici les informations que nous avons enregistré :\n") ; |
define ("INS_MAIL_INSCRIPTION_2", "\nVous pouvez modifier votre inscription sur \nhttp://www.vecam.org/i-j/\n". |
"rubrique Inscription.\n\n". |
"L'équipe I-Jumelage.") ; |
// Envoir d'un mail à la coordination |
define ("INS_MAIL_COORD_SUJET", "Un nouvel inscrit à I-Twinning") ; |
define ("INS_MAIL_COORD_CORPS", "Un nouvel inscrit à I-Twinning") ; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: ins_langue_es.inc.php,v $ |
* Revision 1.1 2004/07/06 15:42:17 alex |
* en cours |
* |
* Revision 1.4 2004/06/30 10:00:59 alex |
* traduction |
* |
* Revision 1.3 2004/06/25 14:25:40 alex |
* ajout de labels |
* |
* Revision 1.2 2004/06/24 07:43:55 alex |
* traduction |
* |
* Revision 1.1 2004/06/18 09:21:15 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/inscription/langues/ins_langue_fr.inc.php |
---|
New file |
0,0 → 1,162 |
<?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: ins_langue_fr.inc.php,v 1.3 2005/03/21 16:50:45 alex Exp $ |
/** |
* Fichier de traduction en français de l'application inscription |
* |
* Fichier de traduction en français de l'application inscription |
* |
*@package inscription |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.3 $ $Date: 2005/03/21 16:50:45 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
define ("INS_AJOUT_MEMBRE", "Ajout d'un nouveau membre") ; |
define ("INS_NOM", "Nom") ; |
define ("INS_NOM_REQUIS", "Indiquez votre nom.") ; |
define ("INS_PRENOM", "Prénom") ; |
define ("INS_PRENOM_REQUIS", "Veuillez indiquer votre prénom.") ; |
define ("INS_PAYS", "Pays") ; |
define ("INS_LANGUES_PARLES", "Langues parlés") ; |
define ("INS_EMAIL", "Adresse mail") ; |
define ("INS_MOT_DE_PASSE", "Mot de passe :") ; |
define ("INS_REPETE_MOT_DE_PASSE", "Répéter le mot de passe :") ; |
define ("INS_ADRESSE_1", "Adresse ") ; |
define ("INS_ADRESSE_2", "Adresse (suite)") ; |
define ("INS_REGION", "Région / province") ; |
define ("INS_CODE_POSTAL", "Code postal") ; |
define ("INS_CODE_POSTAL_REQUIS", "Indiquez votre code postal.") ; |
define ("INS_VILLE", "Ville") ; |
define ("INS_VILLE_REQUIS", "Indiquez votre ville.") ; |
define ("INS_SITE_INTERNET", "Site web personnel") ; |
define ("INS_LETTRE", "Je souhaite recevoir la lettre d'actualité de Tela Botanica") ; |
define ("INS_ADHERENT", "Vous êtes adhérents de personnes morales (associations, institutions, entreprise... )") ; |
define ("INS_ORGANISME", "Organisme") ; |
define ("INS_FONCTION", "Fonction") ; |
define ("INS_ETES_BOTANISTE", "Vous êtes botaniste :") ; |
define ("INS_ACTIVITE_PROFESSIONNELLE", " Votre activité professionnelle (ou celle que vous aviez)") ; |
define ("INS_MEMBRE_ASSO", "Vous êtes membre d'une association botanique, naturaliste, ou autre... :") ; |
define ("INS_SPECIALISTE", " Vous êtes spécialiste d'une discipline ou d'un groupe de plantes particulier, lequel :") ; |
define ("INS_SPE_ZONE", "Vous ètes spécialiste d'une zone géographique, laquelle :") ; |
define ("INS_ANNULER", "Annuler") ; |
define ("INS_RETABLIR", "Rétablir") ; |
define ("INS_VALIDER", "Valider") ; |
define ("INS_MOTS_DE_PASSE_DIFFERENTS", "Les mots de passe sont différents !") ; |
define ("INS_EMAIL_REQUIS", "Vous devez saisir un email.") ; |
define ("INS_MOT_DE_PASSE_REQUIS", "Vous devez saisir un mot de passe.") ; |
define ("INS_MAIL_INCORRECT", "L'email doit avoir une forme correcte, utilisateur@domaine.ext") ; |
define ("INS_MAIL_DOUBLE", "Cet email est déjà utilisé par quelqu'un d'autre") ; |
define ("INS_NOTE_REQUIS", "Indique les champs requis") ; |
define ("INS_ACCUEIL_INSCRIPTION", "Inscription au réseau Tela Botanica") ; |
define ("INS_MODIFIER_INSCRIPTION", "Modifier votre inscription") ; |
define ("INS_SUPPRIMER_INSCRIPTION", "Supprimer votre inscription") ; |
define ("INS_MESSAGE_BIENVENU", "Vous êtes inscrit à Tela Botanica") ; |
define ('INS_MESSAGE_EXPIRATION', 'Votre demande a expiré, veuillez ressaisir le formulaire d\'inscription.') ; |
define ("INS_FICHE_PERSONNELLE", "Fiche personnelle") ; |
define ("INS_DECONNEXION", 'Déconnexion') ; |
define ("INS_INSCRIPTION", 'Inscription') ; |
define ("INS_TEXTE_PERDU", "Si vous avez perdu votre mot de passe, indiquez ". |
"votre adresse email dans le champs login ci-dessus et cliquez sur \"Valider\"") ; |
define ("INS_NOM_WIKI", "Nom wiki") ; |
define ("INS_MAUVAIS_NOM_WIKI", "Le nom wiki n'est pas valide (ex : NomPrenom)") ; |
define ("INS_DEJA_INSCRIT", "Déjà inscrit, identifiez-vous pour accéder à votre fiche personnelle :") ; |
define ("INS_ERREUR_LOGIN", "Utilisateur inconnu ou mot de passe erronné") ; |
define ("INS_SI_PASSE_PERDU", "Si vous avez perdu votre mot de passe") ; |
define ("INS_INDIQUE_ADRESSE", "Indiquez votre adresse email dans le champs ci-dessus.<br>\n". |
"Un nouveau mot de passe vous sera envoyé.") ; |
define ("INS_ENVOIE_PASSE", "Envoi du mot de passe par mail") ; |
define ("INS_LAIUS_INSCRIPTION", "L'inscription au réseau Tela Botanica est libre et gratuite !") ; |
define ("INS_LAIUS_INSCRIPTION_2", "Elle vous permet de :<br /> |
- consulter l'annuaire des personnes inscrites au Réseau et pouvoir ainsi échanger des informations ;<br /> |
- accéder à certaines informations diffusées sur le site ;<br /> |
- vous inscrire à des projets botaniques ;<br /> |
- recevoir un bulletin électronique d'informations.") ; |
//============= L'envoie du mot de passe perdu par mail ============================= |
define ("INS_NOUVEAU_MOT_DE_PASSE", "Votre nouveau mot de passe Tela Botanica") ; |
define ("INS_NOUVEAU_MOT_DE_PASSE_2", "Votre nouveau mot de passe : ") ; |
define ("INS_NOUVEAU_MOT_DE_PASSE_LAIUS", "\n\nCe mot de passe vous permet de modifier les informations\n". |
"vous concernant dans le site de Tela Botanica.\n". |
"http://www.tela-botanica.org/\n\n") ; |
define ("INS_MOT_DE_PASSE_ENVOYE_1", "Votre nouveau mot de passe a été ". |
"envoyé à l'adresse") ; |
define ("INS_MOT_DE_PASSE_ENVOYE_2", "Relevez votre messagerie, notez votre nouveau mot de passe et identifiez vous à ". |
"nouveau en allant à l'inscription. N'hésitez pas à changer ce mot de passe ". |
"pour en mettre un plus simple, très facile à retenir." ); |
//============= L'envoie d'un mail de confirmation =================================== |
// Ne pas utiliser d'entités HTML |
define ("INS_MAIL_INSCRIPTION_1", "Votre inscription a bien été prise en compte.\n". |
"Voici les informations que nous avons enregistré :\n") ; |
define ("INS_MAIL_INSCRIPTION_2", "\nVous pouvez modifier votre inscription sur \nhttp://www.tela-botanica.org\n". |
"rubrique Inscription.\n\n". |
"L'équipe de Tela Botanica.") ; |
// Envoir d'un mail à la coordination |
define ("INS_MAIL_COORD_SUJET", "Un nouvel inscrit à Tela Botanica") ; |
define ("INS_MAIL_COORD_CORPS", "Un nouvel inscrit à Tela Botanica") ; |
define ("INS_MESSAGE_INSCRIPTION", "<h1 class=\"titre1_inscription\">Inscription au réseau Tela Botanica</h1>\n". |
"<p>Votre inscription a bien été prise en compte.</p>\n". |
"<h2>Pour terminer votre inscription :</h2>\n". |
"<p>Un message de confirmation vous a été envoyé à l'adresse e-mail que vous avez fournie.". |
" Veuillez lire ce mail et en suivre les instructions pour activer complètement votre inscription.</p>") ; |
define ('INS_MESSAGE_DEBUT_MAIL_INSCRIPTION', 'Bonjour,'."\n\n". |
'Nous avons reçu une demande d\'inscription pour cette adresse mail.'."\n". |
'Pour confirmer, cliquer sur le lien ci-dessous.'."\n\n" ) ; |
define ('INS_MESSAGE_FIN_MAIL_INSCRIPTION', "\n\n".'L\'équipe de Tela Botanica') ; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: ins_langue_fr.inc.php,v $ |
* Revision 1.3 2005/03/21 16:50:45 alex |
* labels |
* |
* Revision 1.2 2005/03/10 09:40:39 tam |
* modifs labels |
* |
* Revision 1.1 2005/03/04 10:39:54 tam |
* installation |
* |
* Revision 1.1 2004/07/06 15:42:17 alex |
* en cours |
* |
* Revision 1.4 2004/07/06 15:31:43 alex |
* en cours |
* |
* Revision 1.3 2004/06/25 14:25:40 alex |
* ajout de labels |
* |
* Revision 1.2 2004/06/24 07:43:55 alex |
* traduction |
* |
* Revision 1.1 2004/06/18 09:21:15 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/trunk/client/annuaire/annuaire_moteur_fonction.php |
---|
New file |
0,0 → 1,375 |
<?php |
// +--------------------------------------------------------------------------------+ |
// | annuaire_moteur_fonction.php | |
// +--------------------------------------------------------------------------------+ |
// | Copyright (c) 2000 - 2003 Tela Botanica | |
// +--------------------------------------------------------------------------------+ |
// | Les fonctions de annuaire_moteur.php | |
// +--------------------------------------------------------------------------------+ |
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org> | |
// +--------------------------------------------------------------------------------+ |
// |
// $Id: annuaire_moteur_fonction.php,v 1.1 2005/03/24 08:47:31 alex Exp $ |
/** function mkengine () |
* |
* |
* |
* @return |
*/ |
function mkengine() |
{ |
global $label_bbota; |
global $nbr_total; |
global $bouton, $HTTP_POST_VARS ; |
$mon_frag = new fragmenteur_session() ; |
$mes_vars = array ("recherche", "nom", "ville", "mail" ,"dept", "prenom", "cotisant", "pays", "sort", "T_REPONSE", "lettre","statut") ; |
// Deux cas , soit on a cliqué sur rechercher, soit on a cliqué sur un lien |
foreach ($mes_vars as $key=>$value) { |
if (!$bouton) { // on a cliqué sur un lien |
if (empty($HTTP_POST_VARS[$value])) { |
$$value = $mon_frag->getVariable($value); |
} |
} else { |
// Si on clique sur le bouton rechercher |
if (empty ($HTTP_POST_VARS[$value])) { |
$$value = "" ; |
} else { |
$$value = $HTTP_POST_VARS[$value] ; |
} |
} |
} |
// Comptage du nombre total de données dans la table (hors CACHER = 1) |
$query = "select count(*) as CPT from ".ANN_ANNUAIRE; |
$result = mysql_query($query) or die("<B>Erreur !</B> $query a échoué..."); |
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 données"; |
else die("<B>Erreur</B> lors du comptage des structures ($nbr_total trouvées) : $query"); |
} |
else die("<B>Erreur</B> lors du comptage des structures : $query"); |
mysql_free_result($result); |
// fin comptage |
$ret = ""; |
// construction du moteur de str |
$ret .= "<form action=\"".$GLOBALS['ann_url']->getURL()."\" method=\"post\">\n"; |
$ret .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" summary=\"\">\n"; |
$ret .= "<tr class=\"titlePage\"><td colspan=\"2\">".AM_L_TITRE."</td></tr>\n" ; |
$ret .= "<tr class=\"insTitle1\"><td colspan=\"2\">".AM_L_TITRE." $chaine :</td></tr>\n" ; |
// ligne de recherche |
$ret .= "<tr><td colspan=\"2\">\n"; |
$ret .= "<table border=\"0\"><tr>\n" ; |
$ret .= "<td class=\"insLabel\">".AM_L_RECHERCHER." :\n</td>\n<td>"; |
$ret .= form_mk_chaineI(stripslashes($recherche), "recherche")." "; |
$ret .= "</td><td class=\"insLabel\" colspan=\"4\">".AM_L_PAYS." : \n" ; |
$ret .= "" ; |
// formulaire contenant les pays, avec par défaut soit le pays en cours |
// soit "tous les pays" |
$query_pays = "select GC_ID, GC_NAME from gen_COUNTRY where GC_LOCALE='fr'" ; |
$result_pays = mysql_query($query_pays) or die ("Echec de la requete sur gen_COUNTRY") ; |
$ret .= "<select name=\"pays\" class=\"insInputForm\">\n" ; |
$ret .= "<option value=\"tous\">Tous les pays</option>\n" ; |
while ($row_pays = mysql_fetch_object($result_pays)) { |
$ret .= "<option value=\"$row_pays->GC_ID\"" ; |
if (!empty($pays)) { |
if ($pays == $row_pays->GC_ID) $ret .= " selected" ; |
} |
$ret .= ">$row_pays->GC_NAME</option>\n" ; |
} |
$ret .= "</select>\n" ; |
$ret .= "</td>\n" ; |
$ret .= "<tr>\n"; |
$ret .= "<td class=\"insLabel\">".AM_L_NOM." :\n</td><td>"; |
$ret .= form_mk_chaineI(stripslashes($nom), "nom")." </td>\n<td class=\"insLabel\">" ; |
$ret .= AM_L_PRENOM." :</td>\n<td>".form_mk_chaineI(stripslashes($prenom), "prenom")." </td>\n<td class=\"insLabel\">" ; |
$ret .= AM_L_VILLE." :</td>\n<td>".form_mk_chaineI(stripslashes($ville), "ville")." </td>" ; |
$ret .= "</tr><tr>\n" ; |
$ret .= "<td class=\"insLabel\">".AM_L_DEPARTEMENT." : </td>\n<td>" ; |
// Construction du <select> des départements |
$requete_dpt = "select GFD_ID, GFD_NAME from gen_FRENCH_DPT" ; |
$resultat_dpt = mysql_query($requete_dpt) or die ("Echec de la requete sur gen_FRENCH_DPT<br>".mysql_error()) ; |
$ret .= "<select name=\"dept\" class=\"insInputForm\">\n" ; |
$ret .= "<option value=\"tous\">tous</option>\n" ; |
while ($ligne_dpt = mysql_fetch_object($resultat_dpt)) { |
$ret .= "<option value=\"$ligne_dpt->GFD_ID\"" ; |
if ($dept == $ligne_dpt->GFD_ID) $ret .= " selected" ; |
$ret .= ">$ligne_dpt->GFD_ID - $ligne_dpt->GFD_NAME</option>\n" ; |
} |
$ret .= "</select></td>\n" ; |
$ret .= "<td class=\"insLabel\">".AM_L_MAIL." : </td>\n<td>".form_mk_chaineI(stripslashes($mail), "mail")."</td>\n" ; |
$ret .= "<td class=\"insLabel\">".AM_L_COTISANTS." : </td>\n" ; |
$ret .= "<td>".form_mk_select(stripslashes($cotisant), "cotisant")."</td>\n"; |
$ret .= "</tr></table>\n"; |
$ret .= "</td></tr>\n"; |
$ret .= "<tr><td><table>\n" ; |
$ret .= "<tr>\n"; |
$ret .= "<td class=\"insLabel\" width=\"60%\">\n"; |
$ret .= AM_L_GRP_RES." : </td>" ; |
$grp = array(20, 50, 100) ; |
$ret .= "<td><select name=\"T_REPONSE\" class=\"insInputForm\">\n" ; |
for ($i = 0; $i < count($grp); $i++) { |
$ret .= "<option value=\"".$grp[$i]."\">".$grp[$i]."</option>\n" ; |
} |
$ret .= "</select></td>" ; |
$ret .= "<td class=\"texte_tb\" align=\"right\" width=\"40%\">\n"; |
$ret .= "<input type=\"submit\" class=\"texte_tb\" value=\"".AM_L_RECHERCHER."\" name =\"bouton\">\n"; |
$ret .= "</td></tr></table>\n</td></tr>\n"; |
$ret .= "</table></form>\n"; |
return $ret; |
} |
/** function form_mk_chaineI () Renvoie une balise de type <input> |
* |
* @param string l'attribut value de la balise |
* @param string l'attibut name de la balise |
* @param string la classe CSS |
* @return string HTML |
*/ |
function form_mk_chaineI($value="", $name, $class="insInputForm") |
{ |
return "<input type=\"text\" size=\"15\" value=\"$value\" name=\"$name\" class=\"$class\">"; |
} |
function form_mk_select($value="", $name="", $class="insInputForm") { |
$res = "<select name=\"$name\" class=\"$class\">\n" ; |
$res .= "<option value=\"1\"" ; |
if ($value == 1) $res .= " selected" ; |
$res .= ">Cotisants</option>\n" ; |
$res .= "<option value=\"2\"" ; |
if ($value == 2) $res .= " selected" ; |
$res .= ">Non cotisants</option>\n" ; |
$res .= "<option value=\"3\"" ; |
if ($value == 3 || $value == "") $res .= " selected" ; |
$res .= ">Tous</option>\n" ; |
$res .= "</select>\n" ; |
return $res ; |
} |
function mkquery() |
{ |
// définition des variables globales |
global $lettre ; |
global $bouton, $HTTP_POST_VARS ; |
$mon_frag = new fragmenteur_session() ; |
// Requete sur l'annuaire pour extraire le nom, prénom, ville, nom du département (jointure), |
// l'état de la cotisation (jointure) |
// le tableau suivant contient tous les champs de la table annuaire_tela sur lesquels on peut effectuer une recherche |
$fields_annu = array("nom" => "U_NAME", "prenom" => "U_SURNAME" , "mail" => "U_MAIL" , "ville" => "U_CITY", |
"dept" => "U_FRENCH_DPT", "pays" => "U_COUNTRY" ) ; |
$mes_vars = array ("recherche", "nom", "ville", "mail" ,"dept", "prenom", "cotisant", "pays", "sort", "T_REPONSE", "lettre","statut") ; |
foreach ($mes_vars as $key=>$value) { |
if (!$bouton) { |
if (empty($HTTP_POST_VARS[$value])) { |
$$value = $mon_frag->getVariable($value); |
} |
} else { |
$lettre = "" ; |
$mon_frag->setVariable("lettre", "") ; |
$mon_frag->fixerLeDebut(0) ; |
if (empty ($HTTP_POST_VARS[$value])) { |
$$value = "" ; |
} else { |
$$value = $HTTP_POST_VARS[$value] ; |
} |
} |
} |
if ($bouton) $sort = $mon_frag->getVariable("sort") ; |
$queries = "select ".ANN_ANNUAIRE.".*" ; |
$queries .= ", ".ANN_TABLE_PAYS.".GC_NAME "; |
$queries .= "from ".ANN_ANNUAIRE ; |
$queries .= ",".ANN_TABLE_PAYS ; |
// Construction en fonction des champs saisies |
// juste le champs "rechercher", on regarde partout |
$queries .= " where (" ; |
if ($lettre == "") { |
if ($recherche != "") { |
$queries .= "(U_NAME like '%$recherche%'" ; // le premier |
foreach($fields_annu as $key=>$value) { |
if ($key == "nom") continue ; |
$queries .= ($key == "pays" ? |
$pays == "tous" ? ")" : |
") and $value = '$pays'" : " or $value like '%$recherche%'") ; // les autres |
} |
} else { |
// si un ou plusieurs autres champs ont été indiqué, on les rajoute ici |
$or_flag = false ; |
foreach($fields_annu as $key=>$valeur) { |
if ($key != "") { |
if ($key == "pays") { |
if ($$key == "tous") $queries .= ") and U_COUNTRY like '%'"; |
else $queries .= ") and $valeur like \"%".$$key."%\"" ; |
} else { |
if ($key == "dept") { |
if ($$key != "tous" && isset($HTTP_POST_VARS[$key])) { |
$queries .= " and U_FRENCH_DPT=".$$key ; |
if ($fields_annu["pays"] != "fr") $queries .= " and U_COUNTRY=\"fr\"" ; |
} |
} else { |
if ($or_flag) $queries .= "$valeur like \"%".$$key."%\"" ; |
else $queries .= "($valeur like \"%".$$key."%\"" ; |
if ($key != "ville") $queries .= " and " ; |
} |
} |
$or_flag = true ; |
} |
} |
// ici le cas ou rien n'a été saisie du tout, on affiche tout |
if (!$or_flag) { |
$queries .= "U_NAME like '%')" ; |
} |
} |
} else { |
if ($lettre == "tous") $lettre = "" ; |
$queries .="U_NAME like '$lettre%'" ; |
} |
$queries .= ")" ; |
$queries .= " and ".ANN_ANNUAIRE.".U_COUNTRY=".ANN_TABLE_PAYS.".GC_ID" ; |
if (isset($cotisant) && $cotisant != 3) if ($cotisant == 1) { |
$queries .= " and ".ANN_ANNUAIRE.".U_COT=$cotisant" ; |
} else { |
$queries .= " and ".ANN_ANNUAIRE.".U_COT=0" ; |
} |
if (isset($nom) && $nom != "") $queries .= " and U_NAME like \"%$nom%\"" ; |
if (isset($prenom) && $prenom != "") $queries .= " and U_SURNAME like \"%$prenom%\"" ; |
if (isset($ville) && $ville != "") $queries .= " and U_CITY like \"%$ville%\"" ; |
if (isset($mail) && $mail != "") $queries .= " and U_MAIL like \"%$mail%\"" ; |
if (isset($sort) && $sort != "") $queries .= " order by $sort" ; |
return $queries; |
} |
function mkresu() |
{ |
global $HTTP_HOST, $SCRIPT_URL, $SCRIPT_NAME, $bouton ; |
$mon_frag = new fragmenteur_session() ; |
$mon_frag->setURL($GLOBALS['ann_url']->getURL()) ; |
if ($bouton) $mon_frag->fixerLeDebut(0) ; |
$requete = mkquery() ; |
// Deux requetes, une avec tous les resultats, l'autre avec les résultats affichés |
$result_total = mysql_query($requete) or print ("Echec de la requete <br>$requete<br>".mysql_error()) ; |
// Affichage de la requete |
$ret_req = "<tr class=\"texte_tb\"><td><br><b>La requete : </b><br>$requete". |
" limit ".$mon_frag->lireLeDebut().",".$mon_frag->lireLePas()."</td></tr>\n" ; |
$result_final = mysql_query($requete." limit ".$mon_frag->lireLeDebut().",".$mon_frag->lireLePas()) or print (mysql_error()); |
$nbr_final = mysql_num_rows($result_total) ; |
mysql_free_result($result_total) ; |
// cxt_addVariable(AM_BD_BOTA, AM_BD_LINK, "requete_mail_tous", $requete) ; |
$_SESSION['requete_mail_tous'] = $requete ; |
$ret = "<div><table><tr>" ; |
for ($i = 65 ; $i <91 ; $i++) { |
$ret .= "\t<td><a href=\"".$GLOBALS['ann_url']->getURL()."&lettre="; |
$ret .= chr($i)."\">"; |
$ret .= chr($i) ; |
$ret .= "</a></td>\n"; |
} |
$ret .= "<td> <a href=\"".$GLOBALS['ann_url']->getURL()."&lettre=tous\">".AM_L_TOUS."</a></td>\n" ; |
$ret .= "<tr></table></div>\n" ; |
$ret .= "<div>".$mon_frag->affNbRes($nbr_final).'</div>' ; |
$ret .= "<div>".$mon_frag->fragmente($nbr_final)."</div>\n" ; |
if ($nbr_final != 0) { |
$ret .= "<div><table>\n"; |
$ret .= "<tr class=\"insTitle1\"><td nowrap><a href=\"".$GLOBALS['ann_url']->getURL()."&sort=U_NAME\">Identité</a></td>\n"; |
$ret .= "<td><a href=\"".$GLOBALS['ann_url']->getURL()."&sort=U_MAIL\">Adresse mail</a></td>\n" ; |
$ret .= "<td><a href=\"".$GLOBALS['ann_url']->getURL()."&sort=U_CITY\">".AM_L_VILLE."</a></td>\n" ; |
$ret .= "<td>Pays ou Dpt (fr)</td>\n" ; |
$ret .= "<td><a href=\"".$GLOBALS['ann_url']->getURL()."&sort=U_COT\">".AM_L_COTISANTS."</a></td></tr>\n" ; |
$cotisant = array( "non", "oui") ; |
$pair = true ; // pour afficher une ligne de résultat coloré, l'autre non |
while ($row = mysql_fetch_object($result_final)) |
{ |
$ret .= "<tr class=\"texte_tb2\""; |
if ($pair) { |
$ret .= " bgcolor=\"\"" ; |
$pair = false ; |
} else { |
$pair = true ; |
} |
$ret .= ">" ; |
$ret .= "\n<td nowrap>"; |
$urlPop = $GLOBALS['ann_url']->getURL()."&u_id=$row->U_ID"; |
$ret .= "<a href=\"$urlPop\">" ; |
$ret .= $row->U_NAME." ".$row->U_SURNAME ; |
$ret .= "</a></td>\n "; |
$ret .= "<td><a href=\"mailto:$row->U_MAIL\">$row->U_MAIL</a></td>\n" ; |
$ret .= "<td>$row->U_CITY</td>" ; |
if ($row->U_COUNTRY != 'fr') { |
$ret .= "<td>$row->GC_NAME</td>" ; |
} else { |
$req_dpt = "select GFD_NAME from ".ANN_TABLE_DEPARTEMENT.",".ANN_ANNUAIRE." where ".ANN_ANNUAIRE.".U_ID=$row->U_ID" ; |
$req_dpt .= " and ".ANN_ANNUAIRE.".U_FRENCH_DPT=".ANN_TABLE_DEPARTEMENT.".GFD_ID" ; |
$resultat_dpt = mysql_query($req_dpt) or die ("Echec de la requete sur ".ANN_TABLE_DEPARTEMENT."<br>".mysql_error()) ; |
$ligne_dpt = mysql_fetch_object($resultat_dpt) ; |
$ret .= "<td>$ligne_dpt->GFD_NAME</td>" ; |
} |
$ret .= "<td>".$cotisant[$row->U_COT]."</td></tr>\n" ; |
} |
$ret .= "</table></div>\n" ; |
$ret .= "<div>".$mon_frag->fragmente($nbr_final)."</div>\n" ; |
$ret .= "<div><a href=\"".$GLOBALS['ann_url']->getURL()."&action=".ANN_MAIL_TOUS."\">".AM_L_MAIL_SELECTION."</a></div>\n" ; |
} |
// $ret .= $ret_req ; |
return $ret; |
} |
/** function presa_mk_blkline () insere des lignes vides du type <tr><td> </td></tr> |
* |
* |
* @param integer nombre de ligne à insérer |
* @return string HTML |
*/ |
function presa_mk_blkline ($nombre) { |
$res = "" ; |
for ($i = 0; $i < $nombre; $i++) { |
$res .= "<tr><td> </td></tr>\n" ; |
} |
return $res ; |
} |
?> |
/trunk/client/annuaire/mail_tous.php |
---|
New file |
0,0 → 1,105 |
<?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: annuaire.php,v 1.3 2005/01/06 15:44:33 alex Exp $ |
/** |
* Permet d'envoie un mail à une sélection dans l'annuaire |
* |
* |
*@package annuaire |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.3 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
function putFrame() { |
// configuration |
global $objet, $corps, $annuaire_LABEL_STATUT, $SERVER_ADMIN ; |
global $action ; |
$url = $GLOBALS['ann_url']->getURL() ; |
$annu_table = "annuaire_tela" ; |
$champs_mail = "U_MAIL" ; |
// Entete |
$corps_debut = "RESEAU TELA BOTANICA - Le ".date("j/m/Y"). |
"\n\nBonjour,\n"."\n\nCordialement,\n-------------------\nTela Botanica le réseau des botanistes francophones\naccueil@tela-botanica.org\nhttp://www.tela-botanica.org\n"; |
$res = "<h1>Envoi d'un mail à tous les membres</h1>\n" ; |
if ($_GET['action'] == ANN_MAIL_TOUS_ENVOIE) $res .= envoie_mail_selection() ; |
// formulaire |
$res .= "<div><form action=\"$url&action=".ANN_MAIL_TOUS_ENVOIE."\" method=\"post\"><table>\n" ; |
$res .= "<tr><td class=\"insLabel\">" ; |
$res .= "Objet : </td><td><input size=\"91\" name=\"objet\" type=\"text\" class=\"insInputForm\"></td></tr>\n" ; |
$res .= "<tr><td class=\"insLabel\">Corps : </td><td><textarea name=\"corps\" cols=\"90\" rows=\"30\" class=\"insInputForm\">$corps_debut</textarea></td></tr>\n" ; |
$res .= "<tr><td></td><td><input type=\"submit\" class=\"texte_tb\" value=\"envoyer\"" ; |
$res .= " onclick=\"javascript:return confirm('Etes-vous sur de vouloir envoyer ce message !!');\"" ; |
$res .= "></td></tr>\n" ; |
$res .= "</table></form></div>\n" ; |
return $res ; |
} |
include_once ("Mail.php"); |
// envoie le mail à tous |
function envoie_mail_selection() |
{ |
global $objet, $corps, $annuaire_LABEL_STATUT, $SERVER_ADMIN, $GS_GLOBAL ; |
$annuaire = "annuaire_tela" ; |
$champs_mail = "U_MAIL" ; |
$headers['From'] = "accueil@tela-botanica.org" ; |
$headers['Subject'] = stripslashes($objet) ; |
$corps = stripslashes($corps) ; |
$requete = $_SESSION['requete_mail_tous'] ; |
unset ($_SESSION['requete_mail_tous']) ; |
$resultat = mysql_query($requete) or die ("echec") ; |
while ($ligne = mysql_fetch_object($resultat)) { |
if (!mail($ligne->U_MAIL, $headers['Subject'], $corps, "From: ".$headers['From'])) { |
return "<tr><td>Une erreur s'est produite:<br>".$mail_object->getMessage()."</td></tr>\n" ; |
} |
} |
return "<div>Le mail est parti !</div>\n"; |
} |
?> |
/trunk/client/annuaire/annuaire_moteur.php |
---|
New file |
0,0 → 1,81 |
<?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: annuaire_moteur.php,v 1.2 2005/03/24 08:24:39 alex Exp $ |
/** |
* programme principal du module annuaire_moteur |
* |
* programme principal du module annuaire_moteur |
* |
*@package annuaire |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.2 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
include_once 'client/annuaire/configuration/ann_config.inc.php' ; |
include_once 'api/fragmenteur/FRAG_Fragmenteur_Session.class.php' ; |
//include_once (ANN_CHEMIN_LIBRAIRIE."pack.lib.gen.php") ; |
include_once (ANN_CHEMIN_APPLI."annuaire_moteur_fonction.php"); |
include_once (ANN_CHEMIN_LIBRAIRIE."annuaire.fonct.php") ; |
if (isset($lang)) { |
include_once ANN_CHEMIN_APPLI."/langues/ann_langue_$lang.inc.php" ; |
} else { |
include_once ANN_CHEMIN_APPLI.'/langues/ann_langue_fr.inc.php' ; |
} |
define ("ANN_MAIL_TOUS", 1) ; |
define ("ANN_MAIL_TOUS_ENVOIE", 2) ; |
function afficherContenuCorps () { |
global $statut ; |
if (!$GLOBALS['AUTH']->getAuth()) { |
$res = AUTH_formulaire_login() ; |
} else { |
if (isset($_GET['u_id'])) { |
include_once (ANN_CHEMIN_APPLI.'admin_annu.php'); |
$GLOBALS['ann_url']->addQueryString ('u_id', $_GET['u_id']) ; |
return putFrame() ; |
} |
if (isset ($_GET['action'])) { |
include_once (ANN_CHEMIN_APPLI.'mail_tous.php') ; |
return putFrame() ; |
} |
$res = "<div>".mkengine()."</div>\n" ; |
//mkquery() ; |
$res .= "<div>".mkresu()."</div>\n" ; |
} |
return $res ; |
} |
?> |
/trunk/client/annuaire/recu_pdf_corps.php |
---|
New file |
0,0 → 1,166 |
<?php |
// +----------------------------------------------------------------------------+ |
// |pdf_recu_et_mail.php | |
// +----------------------------------------------------------------------------+ |
// | Copyright (c) 2003 Tela Botanica | |
// +----------------------------------------------------------------------------+ |
// | Ce fichier génère un fichier PDF | |
// | contenant le recu pour une cotisation à Tela Botanica | |
// | Il utilise la librairie FPDF | |
// | http://www.fpdf.org/ | |
// | Il envoie également un email à l'adhérent concerné | |
// +----------------------------------------------------------------------------+ |
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org> | |
// +----------------------------------------------------------------------------+ |
// |
// $Id: recu_pdf_corps.php,v 1.1.1.1 2005/01/03 17:27:49 alex Exp $ |
// Recherche des informations sur un utilisateur |
$requete = "select * from annuaire_COTISATION, annuaire_tela, MODE_COTISATION |
where IC_ID=$cotisation_id |
and IC_ANNU_ID=U_ID |
and IC_MC_ID=MC_ID" ; |
$resultat = $db->query($requete) ; |
if (DB::isError ($resultat)) { |
die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ; |
$resultat->free() ; |
/* |
// On regarde si le reçu a déjà été envoyé |
$requete = "select IC_RECU from annuaire_COTISATION where IC_ID=$cotisation_id" ; |
$resultat = mysql_query ($requete) or die ($requete."<br>".mysql_error()) ; |
$ligne = mysql_fetch_object($resultat) ; |
mysql_free_result($resultat) ; |
*/ |
if ($ligne->IC_RECU != 0) { |
$num_recu = $ligne->IC_RECU ; |
// $deja_envoye permettra au programme admin_annu.php de ne pas incrementé |
// le compteur de recu |
$deja_envoye = true ; |
} else { |
$res_compteur = $db->query("select COMPTEUR from COMPTEUR_COTISATION") ; |
$ligne_compteur = $res_compteur->fetchRow(DB_FETCHMODE_OBJECT) ; |
$num_recu = $ligne_compteur->COMPTEUR ; |
$deja_envoye = false ; |
} |
@include_once "api/fpdf/fpdf.php"; |
if (!isset($envoie)) $chemin = "client/annuaire/" ; |
// Constante nécessaire à fpdf.php |
define('FPDF_FONTPATH','font/'); |
// Création de l'objet pdf |
$pdf = new FPDF(); |
$pdf->Open(); |
$pdf->AddPage("P"); |
// La ligne du haut |
$pdf->Line(10, 10, 200, 10) ; |
// Contenu du document |
$pdf->SetFont('Arial', '', 8) ; |
$pdf->Cell(150, 10, "", 0, 0) ; |
$pdf->MultiCell(40, 10, "Numéro d'ordre : $num_recu", 1,1, "C") ; |
$pdf->SetY($pdf->GetY() - 10) ; |
$pdf->SetFont('Arial','B',14); |
$pdf->Cell(0,10,'Reçu dons aux uvres', 0, 1, "C"); |
$pdf->SetFont('Arial', '', 10) ; |
$pdf->Cell(0, 0, '(Article 200-5 et 238 bis du Code Général des impôts)', 0, 1, "C") ; |
$pdf->Cell(0, 10, 'REÇU A CONSERVER ET A JOINDRE A VOTRE DECLARATION DE REVENUS 2004', 0, 1, "L") ; |
// On met le logo de Tela |
$pdf->Image($chemin."logotb.png", 12, 35, "29", "", "PNG", "http://www.tela-botanica.org/") ; |
// On écrie Les titres du cadre |
$pdf->SetFontSize(12) ; |
$pdf->Cell(100, 10, 'Bénéficiaire du don', 0, 0, "C") ; |
$pdf->Cell(100, 10, 'Donateur', 0, 1, "C") ; |
$pdf->SetFont('Arial', 'B', 10) ; |
$pdf->Cell(38, 5, '', 0, 0) ; |
$pdf->Cell(62, 5, 'Association Tela Botanica', 0, 0, "L") ; |
$pdf->SetFont('Arial', 'B', 10) ; |
$pdf->Cell(100, 5, "$ligne->U_NAME $ligne->U_SURNAME", 0, 1, "L") ; |
$pdf->SetFont('Arial', '', 10) ; |
$pdf->Cell(38, 5, '', 0, 0) ; |
$pdf->Cell(62, 5, 'Institut de Botanique', 0, 1, "L") ; |
$pdf->Cell(38, 5, '', 0, 0) ; |
$pdf->Cell(62, 5, '163, rue A. Broussonnet', 0, 0, "L") ; |
$pdf->Cell(100, 5, "$ligne->U_ADDR1", 0, 1, "L") ; |
$pdf->Cell(38, 5, '', 0, 0) ; |
$pdf->Cell(62, 5, '34090 Montpellier', 0, 0, "L") ; |
$pdf->Cell(100, 8, "$ligne->U_ADDR2", 0, 1, "L") ; |
$pdf->Cell(100, 5, 'Objet :', 0,1, "L") ; |
$pdf->SetFontSize(8) ; |
$pdf->MultiCell(100, 4, 'Contribuer au rapprochement de tous les botanistes de langue française. Favoriser l\'échange d\'information'. |
' et animer des projets botaniques grâce aux nouvelles technologies de la communication.', 0, 1, "") ; |
$pdf->SetFontSize(10) ; |
$pdf->Text(111, 58 + 8, "$ligne->U_ZIP_CODE $ligne->U_CITY") ; |
$pdf->SetFontSize(8) ; |
$pdf->MultiCell(100,4, 'Organisme d\'intérêt général à caractère scientifique concourant à la diffusion de la langue et des connaissances scientifiques françaises.', 0,1, "R") ; |
// On remonte le curseur de 52 |
$pdf->SetY($pdf->GetY() - 58) ; |
// Le cadre central |
$pdf->Cell(100, 60, '', 1) ; |
$pdf->Cell(90, 60, '', 1) ; |
$pdf->Ln() ; |
$pdf->SetFontSize(10) ; |
$pdf->Cell(0,10, 'L\'Association reconnaît avoir reçu, à titre de don, la somme de :', 0, 1, "L") ; |
$pdf->SetFont('Arial', 'B', 11) ; |
$pdf->Cell(0,10, "*** $ligne->IC_MONTANT euros ***", 0, 1, "C") ; |
$pdf->SetFont('Arial', '', 10) ; |
$pdf->Ln() ; |
$pdf->Cell(100,10, "Date du paiement : ".date ("d/m/Y", $ligne->IC_DATE), 0, 0, "L") ; |
$pdf->Cell(100, 10, 'Montpellier, le '.date("d/m/Y"), 0, 1, "L") ; |
// La signature de Daniel |
$pdf->Image($chemin."signature_Daniel.png", 110, $pdf->GetY(),28.22, "") ; |
$pdf->Ln() ; |
$pdf->Cell(0, 10, "Mode de versement : $ligne->MC_LABEL", 0, 1, "L") ; |
$pdf->Cell(100, 10, '', 0, 0) ; |
$pdf->Cell (100, 10, 'Daniel MATHIEU, Président', 0, 1, "L") ; |
$pdf->Ln(5) ; |
$pdf->SetFontSize(10) ; |
$pdf->Cell(0, 7, '60 % de votre don à Tela Botanica est déductible de vos impôts dans la limite de 20 % de votre revenu imposable.', 1, 1, "C") ; |
?> |
/trunk/client/annuaire/configuration/ann_config.inc.php |
---|
New file |
0,0 → 1,111 |
<?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: ann_config.inc.php,v 1.2 2005/03/08 09:43:34 alex Exp $ |
/** |
* Fichier de configuration de l'annuaire |
* |
* A éditer de façon spécifique à chaque déploiement |
* |
*@package inscription |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.2 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
/** |
//=========================DEFINITION DE VARIABLES ================================= |
* Définition des variables globales |
//================================================================================== |
*/ |
$GLOBALS['AUTH'] = &$_GEN_commun['pear_auth'] ; |
$GLOBALS['ann_db'] = &$_GEN_commun['pear_db'] ; |
/** |
//==================================== LES URLS ================================== |
* Constantes liées à l'utilisation des url |
//================================================================================== |
*/ |
$GLOBALS['ann_url'] = &$_GEN_commun['url']; //l'url de base de l'application, un objet Net_URL |
// Créer cet objet par $GLOBALS['ins_url'] = new Net_URL('http://....') ; |
/** |
//=========================DEFINITION DE VARIABLES ================================= |
* Définition des variables globales |
//================================================================================== |
*/ |
/** |
//==================================== LES CHEMINS ================================= |
* Constantes définissant les chemins d'accé au différents fichiers inclus dans les |
* applications. |
//================================================================================== |
*/ |
define("ANN_CHEMIN_APPLI",'client/annuaire/');//le chemin vers l'application courrante |
define("ANN_CHEMIN_LIBRAIRIE", ANN_CHEMIN_APPLI.'bibliotheque/');//le chemin de la librairie de fichier php |
/** |
//==================================== CONSTANTES ================================== |
* Constantes des noms de tables et de champs dans l'annuaire |
//================================================================================== |
*/ |
define ("ANN_ANNUAIRE", "annuaire_tela") ; |
define ("ANN_CHAMPS_NOM", "U_NAME") ; // Nom du champs nom |
define ("ANN_CHAMPS_MAIL", "U_MAIL") ; // Nom du champs mail |
define ("ANN_CHAMPS_PRENOM", "U_SURNAME") ; // Nom du champs prénom |
define ("ANN_CHAMPS_ID", "U_ID") ; // Nom du champs id |
define ("ANN_CHAMPS_DATE_INS", "U_DATE") ; |
define ("ANN_CHAMPS_VILLE", "U_CITY") ; |
define ("ANN_CHAMPS_PAYS", "U_COUNTRY") ; |
define ("ANN_TABLE_PAYS", "gen_COUNTRY") ; |
define ("ANN_TABLE_DEPARTEMENT", "gen_FRENCH_DPT") ; |
/** |
//==================================== CONSTANTES================================== |
* Constantes contenant des mails |
//================================================================================== |
*/ |
define ("ANN_MAIL_ADMIN", "") ; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: ann_config.inc.php,v $ |
* Revision 1.2 2005/03/08 09:43:34 alex |
* -- |
* |
* Revision 1.1.1.1 2005/01/03 17:27:49 alex |
* Import initial |
* |
* Revision 1.1 2005/01/03 17:19:20 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/annuaire/annuaire.php |
---|
New file |
0,0 → 1,156 |
<? |
/*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: annuaire.php,v 1.4 2005/03/24 08:24:39 alex Exp $ |
/** |
* programme principal du module annuaire |
* |
* programme principal du module annuaire |
* |
*@package annuaire |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.4 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
include_once 'client/annuaire/configuration/ann_config.inc.php' ; |
include_once ANN_CHEMIN_LIBRAIRIE.'annuaire.fonct.php' ; |
if (isset($lang)) { |
include_once ANN_CHEMIN_APPLI."/langues/ann_langue_$lang.inc.php" ; |
} else { |
include_once ANN_CHEMIN_APPLI.'/langues/ann_langue_fr.inc.php' ; |
} |
include_once 'HTML/QuickForm.php' ; |
/** |
* Renvoie le code HTML de l'application |
* |
* @return string HTML |
*/ |
function afficherContenuCorps () { |
$res = "<h1 class=\"annuaire_titre1\">".ANN_TITRE."</h1>\n" ; |
if (!$GLOBALS['AUTH']->getAuth()) { |
$res .= AUTH_formulaire_login() ; |
} else { |
// Le code javascript des cases à cocher |
$java = |
"function setCheckboxes(the_form) |
{ |
var do_check=document.forms[the_form].elements['selecttotal'].checked; |
var elts = document.forms[the_form].elements['select[]']; |
var elts_cnt = (typeof(elts.length) != 'undefined') |
? elts.length |
: 0; |
if (elts_cnt) { |
for (var i = 0; i < elts_cnt; i++) { |
elts[i].checked = do_check; |
} // Fin for |
} else { |
elts.checked = do_check; |
} // Fin if... else |
return true; |
} // Fin de la fonction 'setCheckboxes()'"; |
GEN_stockerCodeScript($java) ; |
$res .= "<h2 class=\"annuaire_titre2\">".ANN_CLIQUEZ_LETTRE."</h2>\n"; |
// S'il y a un mail a envoyé, on l'envoie |
if (isset($_POST['select']) && is_array ($_POST['select'])) $res .= envoie_mail () ; |
$res .= parcourrirAnnu("") ; |
} |
return $res; |
} |
//============================================================================== |
// FUNCTION putFooter () |
// |
// Generation of footer. |
//============================================================================== |
function putFooter () { |
return ' '; |
} |
/* |
function envoie_mail () { |
global $titre, $corps, $HTTP_POST_VARS, $select, $AUTH, $db ; |
// On vérifie qu'un email aie été sélectionné |
if (!is_array($select)) { |
$res ="<div class=\"annuaire_erreur\">".ANN_VERIF_MAIL_COCHE."</divr>"; |
return $res ; |
} |
if ($titre == "" || $corps == "") { |
$res = "<div class=\"annuaire_erreur\">".ANN_VERIF_TITRE."</div>\n" ; |
return $res ; |
} |
// On récupère le mail de l'expéditeur |
$req_exp = "select ".ANN_CHAMPS_MAIL." from ".ANN_ANNUAIRE." where ".ANN_CHAMPS_ID."=".$AUTH->getAuthData(ANN_CHAMPS_ID) ; |
$res_exp = $db->query($req_exp) ; |
if (DB::isError($res_exp)) { |
die ("Echec de la requete sur annuaire_tela <br>".$res_exp->getMessage()) ; |
} |
$ligne_exp = $res_exp->fetchRow(DB_FETCHMODE_ASSOC) ; |
$expediteur = $ligne_exp[ANN_CHAMPS_MAIL] ; |
$corps .= ANN_PIED_MESSAGE ; |
$liste = "" ; |
if (!is_array($select)) { |
$res.= CAR_NO_DESTINATAIRE; |
} else { |
$res .= "<div class=\"$classe_titre\">".CAR_MESSAGE_ENVOYE."</div>\n" ; |
envoie_mail() ; |
} |
}*/ |
/**------------------------------------------------------------------------------ |
* $Log: annuaire.php,v $ |
* Revision 1.4 2005/03/24 08:24:39 alex |
* -- |
* |
* Revision 1.3 2005/01/06 15:44:33 alex |
* correction du javascript |
* |
* Revision 1.2 2005/01/06 15:17:39 alex |
* ajout de commentaires |
* |
* Revision 1.1.1.1 2005/01/03 17:27:49 alex |
* Import initial |
* |
* Revision 1.1 2005/01/03 17:18:43 alex |
* retour vers la liste des participants après un ajout. |
* |
* |
*-- End of source ------------------------------------------------------------*/ |
?> |
/trunk/client/annuaire/logotb.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/annuaire/logotb.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/annuaire/bibliotheque/annuaire.fonct.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: annuaire.fonct.php,v 1.1 2005/03/24 08:46:07 alex Exp $ |
/** |
* Fonctions du module annuaire |
* |
* Fonctions du module annuaire |
* |
*@package annuaire |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
include_once "HTML/QuickForm.php" ; |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
function AUTH_formulaire_login() { |
$res = ''; |
$url = preg_replace ('/&/', '&', $GLOBALS['ann_url']->getURL()) ; |
$form = new HTML_QuickForm ('inscription', 'post', $url) ; |
$form->addElement ('text', 'username', ANN_EMAIL) ; |
$form->addElement ('password', 'password', ANN_MOT_DE_PASSE) ; |
$form->addElement('submit', 'valider', ANN_VALIDER); |
$res .= $form->toHTML() ; |
$res .= "<div>".ANN_TEXTE_PERDU."</div>\n" ; |
return $res; |
} |
/** function parcourrirAnnu () Affiche l'annuaire à partir d'une lettre |
* |
* |
* |
* @return string HTML |
*/ |
function parcourrirAnnu($event) { |
$res = '<div><table><tr>'; |
// ecrire toutes les lettres avec un lien |
for ($i = 65 ; $i <91 ; $i++) { |
$res .= '<td><a style="font-size:15px;" href="'.$GLOBALS['ann_url']->getURL().'&lettre='; |
$res .= chr($i) ; |
$res .= '">'; |
$res .= chr($i) ; |
$res .= "</a></td>\n"; |
} |
$res .= "</tr></table></div>\n"; |
// si une lettre est selectionne |
if (!empty($_REQUEST['lettre'])) { |
$requete = "SELECT ".ANN_ANNUAIRE.".* from ".ANN_ANNUAIRE." WHERE"; |
if ($_REQUEST['lettre'] != "tous") $requete .= " ".ANN_CHAMPS_NOM." LIKE \"".$_REQUEST['lettre']."%\"" ; |
$requete .= " ORDER BY ".ANN_CHAMPS_NOM ; |
$res .= listes_inscrit ($requete, $GLOBALS['ann_url']->getURL(), $select, '', $GLOBALS['ann_db'], $niveau = 'pays').carto_texte_cocher(). |
carto_formulaire($_POST['titre'], $_POST['corps']) ; |
} |
return $res ; |
} |
/** |
* Renvoie le code HTML de la liste des inscrits |
* en fonction de la requete passé en parametre |
* |
* @return Renvoie le code HTML de la liste des inscrits |
*/ |
function listes_inscrit ($requete, $url, $select, $argument, &$db, $niveau = 'pays') { |
$res = "<div>"; |
$res .= "<form action=\"$url&mailer=1"."&select=$select&lettre=".$_REQUEST['lettre']."\" method=\"post\" name=\"formmail\">\n |
<table id=\"table_inscrit\" class=\"table_cadre\">\n |
<colgroup> |
<col /> |
<col /> |
<col /> |
<col /> |
<col /> |
<col /> |
</colgroup> |
<thead>\n |
<th> </th> |
<th>".ANN_NOM."</th> |
<th>".ANN_PRENOM."</th> |
<th>".ANN_DATE_INS."</th> |
<th>".ANN_VILLE."</th> |
</thead>"; |
$resultat= $GLOBALS['ann_db']->query($requete); |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
$indic=0; |
$i=1; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
if ($indic==0) { |
$res.="<tr class=\"ligne_impaire\">\n"; |
$indic=1; |
} |
else { |
$res.="<tr class=\"ligne_paire\">\n"; |
$indic=0; |
} |
$res.="<td><input type=\"checkbox\" name=\"select[]\" value=\"".$ligne[ANN_CHAMPS_MAIL]."\"></td>\n |
<td>".$ligne[ANN_CHAMPS_NOM]." </td>\n |
<td>".$ligne[ANN_CHAMPS_PRENOM]." </td>\n |
<td>".date("d m Y", strtotime($ligne[ANN_CHAMPS_DATE_INS]))." </td>\n |
<td>".$ligne[ANN_CHAMPS_VILLE]." </td>\n" ; |
$res .= "</tr>\n"; |
} |
$res .= "</table></div>\n"; |
return $res ; |
} |
function carto_formulaire ($titre_mail="", $corps = "") { |
global $HTTP_USER_AGENT ; |
$res .= "<div class=\"chapo\">".ANN_ENVOYER_MAIL."</div>\n"; |
$res .= "<div>\n<table border=\"0\">\n" |
.'<tr><td class="texte">'.ANN_SUJET.' :</td>'."\n" |
.'<td><input class="forml" type="text" name="titre_mail" size="60" value="'.$GLOBALS['titre_mail'].'"></td>'."\n" |
.'</tr><tr><td class="texte" valign="top">'.ANN_MESSAGE.' : </td>'."\n" |
.'<td><textarea class="forml" name="corps" rows="5" cols="60">'.$GLOBALS['corps'].'</textarea></td>'."\n" |
.'</tr><tr><td></td><td align="center">'; |
if (ereg ("Gecko",$HTTP_USER_AGENT)) { |
$res.='<input class="spip_bouton" type="submit" value="'.ANN_ENVOYER.'">'; |
} else { |
$res.='<input class="spip_bouton" type="submit" onclick="javascript:confirmer();" value="'.ANN_ENVOYER.'">'; |
} |
$res.="</td>\n</tr>\n</table>\n</div></form>\n"; |
return $res ; |
} |
/** function carto_texte_cocher () |
* |
* |
* @return string HTML |
*/ |
function carto_texte_cocher () { |
$res .= '<div class="texte">'.ANN_CHECK_UNCHECK ; |
$res .= " <input type=\"checkbox\" name=\"selecttotal\" onclick=\"javascript:setCheckboxes('formmail');\"></div>"; |
return $res ; |
} |
/** envoie_mail() |
* |
* |
* @return envoie l'email |
*/ |
function envoie_mail () { |
$requete = "select ".ANN_CHAMPS_MAIL." from ".ANN_ANNUAIRE. |
" where ".ANN_CHAMPS_ID."='".$GLOBALS['AUTH']->getAuthData (ANN_CHAMPS_ID)."'"; |
$resultat = $GLOBALS['ann_db']->query($requete); |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()); |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC); |
$entete = "From: <".$ligne[ANN_CHAMPS_MAIL].">\n"; |
$_POST['corps'] .= ANN_PIED_MESSAGE; |
$_POST['corps'] = stripslashes($_POST['corps']) ; |
$liste = "" ; |
foreach ($_POST['select'] as $key => $value) { |
mail ($value, stripslashes($_POST['titre_mail']), $_POST['corps'] , $entete) ; |
$liste .= $value."\n" ; |
} |
$_POST['corps'] .= "\n----------------------------------------------------------------------------"; |
$_POST['corps'] .= "\n".ANN_MESSAGE_ENVOYE_A." :\n $liste" ; |
mail (CAR_MAIL_ADMIN, stripslashes($_POST['titre_mail']), $_POST['corps'], $entete); |
$_POST['corps'] = ''; |
$_POST['titre_mail'] = ''; |
return '<div>'.ANN_MAIL_ENVOYER.'</div>' ; |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: annuaire.fonct.php,v $ |
* Revision 1.1 2005/03/24 08:46:07 alex |
* version initiale |
* |
* Revision 1.2 2005/01/06 15:18:31 alex |
* modification de la fonction de formulaire d'authentification |
* |
* Revision 1.1.1.1 2005/01/03 17:27:49 alex |
* Import initial |
* |
* Revision 1.1 2005/01/03 17:18:49 alex |
* retour vers la liste des participants après un ajout. |
* |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/annuaire/voir_recu_pdf.php |
---|
New file |
0,0 → 1,39 |
<?php |
// +----------------------------------------------------------------------------+ |
// |recu_pdf.php | |
// +----------------------------------------------------------------------------+ |
// | Copyright (c) 2003 Tela Botanica | |
// +----------------------------------------------------------------------------+ |
// | Ce fichier génère un fichier PDF | |
// | contenant le recu pour une cotisation à Tela Botanica | |
// | Il utilise la librairie FPDF | |
// | http://www.fpdf.org/ | |
// | | |
// | Recoie $cotisation_id en parametre | |
// +----------------------------------------------------------------------------+ |
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org> | |
// +----------------------------------------------------------------------------+ |
// |
// $Id: voir_recu_pdf.php,v 1.1.1.1 2005/01/03 17:27:49 alex Exp $ |
// Inclusion des fichiers nécessaire à une connection |
include_once ("../../papyrus/configuration/pap_config.inc.php") ; |
include_once 'DB.php' ; |
$db = DB::connect (PAP_DSN) ; |
include_once "../../api/fpdf/fpdf.php"; |
$envoie = 1 ; |
include_once "recu_pdf_corps.php" ; |
// buffer est une propriété de la classe FPDF qui contient les données au format PDF. |
// habituellement on ne l'utilise pas, on appelle $pdf->Output() qui envoie les |
// entete HTTP du document généré |
$pdf->Output() ; |
?> |
/trunk/client/annuaire/langues/ann_langue_en.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 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: ann_langue_en.inc.php,v 1.1.1.1 2005/01/03 17:27:49 alex Exp $ |
/** |
* Fichier de traduction en français de l'application inscription |
* |
* Fichier de traduction en français de l'application inscription |
* |
*@package vecam |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1.1.1 $ $Date: 2005/01/03 17:27:49 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
define ("ANN_NOM", "Name :") ; |
define ("ANN_PRENOM", "First name") ; |
define ("ANN_PAYS", "Country:") ; |
define ("ANN_LANGUES_PARLES", "Languages spoken :") ; |
define ("ANN_EMAIL", "E-mail :") ; |
define ("ANN_MOT_DE_PASSE", "Password:") ; |
define ("ANN_REPETE_MOT_DE_PASSE", "Repeat the password :") ; |
define ("ANN_RETABLIR", "Restore") ; |
define ("ANN_VALIDER", "Validate") ; |
define ("ANN_MOTS_DE_PASSE_DIFFERENTS", "The two passwords are different !") ; |
define ("ANN_EMAIL_REQUIS", "You must enter your e-mail.") ; |
define ("ANN_MOT_DE_PASSE_REQUIS", "You must enter your password.") ; |
define ("ANN_MAIL_INCORRECT", "E-mail addresses must be in the following format, user@domain.ext") ; |
define ("ANN_NOTE_REQUIS", "Indicate the required fields") ; |
define ("ANN_MODIFIER_INSCRIPTION", "Modify your registration") ; |
define ("ANN_SUPPRIMER_INSCRIPTION", "Cancel your registration") ; |
define ("ANN_MESSAGE_BIENVENU", "You are registered at i-twinning ") ; |
define ("ANN_CLIQUEZ_LETTRE", "Click on a letter to see the members ") ; |
define ("ANN_LISTE_INSCRIT_LETTRE", "List of the newsletter's subscribers") ; |
define ("ANN_TITRE", "I-twinning repertory") ; |
define ("ANN_TEXTE_PERDU", "If you forgot your password, enter your e-mail address in the Login ". |
"field below and click on \Validate\ ") ; |
define ("ANN_CHECK_UNCHECK", "Tick the boxes to select your recipient or tick / untick all") ; |
define ("ANN_ENVOYER_MAIL", "Send an e-mail") ; |
define ("ANN_SUJET", "Subject") ; |
define ("ANN_MESSAGE", "Message") ; |
define ("ANN_ENVOYER", "Send") ; |
define ("ANN_CLIC_CONFIRMATION", "Click on OK to confirm") ; |
define ("ANN_PAS_D_INSCRIT", "No registered members") ; |
// ========================= Labels pour les mails ============================= |
define ("ANN_VERIF_MAIL_COCHE", "Please tick at least one recipient for your mail.") ; |
define ("ANN_VERIF_TITRE", "Your message must be composed of a title <i>et</i> and a content") ; |
define ("ANN_PIED_MESSAGE", "\n---------------------------------------------------------------------------". |
"\nThis message has been sent by". |
"\n(http://www.vecam.org) VECAM, ". |
"\nwhere you are currently registered.". |
"\nOther members may also have received this message.") ; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: ann_langue_en.inc.php,v $ |
* Revision 1.1.1.1 2005/01/03 17:27:49 alex |
* Import initial |
* |
* Revision 1.1 2005/01/03 17:19:32 alex |
* version initiale |
* |
* Revision 1.1 2004/06/30 08:50:01 alex |
* traduction |
* |
* Revision 1.1 2004/06/18 08:45:45 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/annuaire/langues/ann_langue_pt.inc.php |
---|
New file |
0,0 → 1,101 |
<?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: ann_langue_pt.inc.php,v 1.1.1.1 2005/01/03 17:27:49 alex Exp $ |
/** |
* Fichier de traduction en français de l'application inscription |
* |
* Fichier de traduction en français de l'application inscription |
* |
*@package vecam |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1.1.1 $ $Date: 2005/01/03 17:27:49 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
define ("ANN_NOM", "Name :") ; |
define ("ANN_PRENOM", "First name") ; |
define ("ANN_PAYS", "Country:") ; |
define ("ANN_LANGUES_PARLES", "Languages spoken :") ; |
define ("ANN_EMAIL", "E-mail :") ; |
define ("ANN_MOT_DE_PASSE", "Password:") ; |
define ("ANN_REPETE_MOT_DE_PASSE", "Repeat the password :") ; |
define ("ANN_RETABLIR", "Restore") ; |
define ("ANN_VALIDER", "Validate") ; |
define ("ANN_MOTS_DE_PASSE_DIFFERENTS", "The two passwords are different !") ; |
define ("ANN_EMAIL_REQUIS", "You must enter your e-mail.") ; |
define ("ANN_MOT_DE_PASSE_REQUIS", "You must enter your password.") ; |
define ("ANN_MAIL_INCORRECT", "E-mail addresses must be in the following format, user@domain.ext") ; |
define ("ANN_NOTE_REQUIS", "Indicate the required fields") ; |
define ("ANN_MODIFIER_INSCRIPTION", "Modify your registration") ; |
define ("ANN_SUPPRIMER_INSCRIPTION", "Cancel your registration") ; |
define ("ANN_MESSAGE_BIENVENU", "You are registered at i-twinning ") ; |
define ("ANN_CLIQUEZ_LETTRE", "Click on a letter to see the members ") ; |
define ("ANN_LISTE_INSCRIT_LETTRE", "List of the newsletter's subscribers") ; |
define ("ANN_TITRE", "I-twinning repertory") ; |
define ("ANN_TEXTE_PERDU", "If you forgot your password, enter your e-mail address in the Login ". |
"field below and click on \Validate\ ") ; |
define ("ANN_CHECK_UNCHECK", "Tick the boxes to select your recipient or tick / untick all") ; |
define ("ANN_ENVOYER_MAIL", "Send an e-mail") ; |
define ("ANN_SUJET", "Subject") ; |
define ("ANN_MESSAGE", "Message") ; |
define ("ANN_ENVOYER", "Send") ; |
define ("ANN_CLIC_CONFIRMATION", "Click on OK to confirm") ; |
define ("ANN_PAS_D_INSCRIT", "No registered members") ; |
// ========================= Labels pour les mails ============================= |
define ("ANN_VERIF_MAIL_COCHE", "Please tick at least one recipient for your mail.") ; |
define ("ANN_VERIF_TITRE", "Your message must be composed of a title <i>et</i> and a content") ; |
define ("ANN_PIED_MESSAGE", "\n---------------------------------------------------------------------------". |
"\nThis message has been sent by". |
"\n(http://www.vecam.org) VECAM, ". |
"\nwhere you are currently registered.". |
"\nOther members may also have received this message.") ; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: ann_langue_pt.inc.php,v $ |
* Revision 1.1.1.1 2005/01/03 17:27:49 alex |
* Import initial |
* |
* Revision 1.1 2005/01/03 17:19:32 alex |
* version initiale |
* |
* Revision 1.1 2004/09/14 11:54:49 alex |
* version initiale |
* |
* Revision 1.1 2004/06/30 08:50:01 alex |
* traduction |
* |
* Revision 1.1 2004/06/18 08:45:45 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/annuaire/langues/ann_langue_es.inc.php |
---|
New file |
0,0 → 1,77 |
<?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: ann_langue_es.inc.php,v 1.1.1.1 2005/01/03 17:27:49 alex Exp $ |
/** |
* Fichier de traduction en français de l'application inscription |
* |
* Fichier de traduction en français de l'application inscription |
* |
*@package vecam |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1.1.1 $ $Date: 2005/01/03 17:27:49 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
define ("ANN_NOM", "pellido") ; |
define ("ANN_PRENOM", "Nombre") ; |
define ("ANN_PAYS", "Pais") ; |
define ("ANN_LANGUES_PARLES", "Idiomas hablados") ; |
define ("ANN_EMAIL", "Correo electronico") ; |
define ("ANN_MOT_DE_PASSE", "Contraseña") ; |
define ("ANN_REPETE_MOT_DE_PASSE", "Repetir la contraseñas") ; |
define ("ANN_RETABLIR", "Restablecer") ; |
define ("ANN_VALIDER", "Ingresar") ; |
define ("ANN_MOTS_DE_PASSE_DIFFERENTS", "Las contraseñas son diferentes!") ; |
define ("ANN_EMAIL_REQUIS", "Debe ingresar un correo electronico") ; |
define ("ANN_MOT_DE_PASSE_REQUIS", "Debe ingresar una contraseña.") ; |
define ("ANN_MAIL_INCORRECT", "El correo electronico debe tener una forma correcta, utilisador@domaine.ext") ; |
define ("ANN_NOTE_REQUIS", "Indique los espacios requeridos") ; |
define ("ANN_MODIFIER_INSCRIPTION", "Modificar su inscripcion") ; |
define ("ANN_SUPPRIMER_INSCRIPTION", "Cancelar su inscripcion") ; |
define ("ANN_MESSAGE_BIENVENU", "Esta inscrito en I-Enlace") ; |
define ("ANN_CLIQUEZ_LETTRE", "Haga clic en una letra para ver los miembros.") ; |
define ("ANN_LISTE_INSCRIT_LETTRE", "Lista de los inscritos en la carta") ; |
define ("ANN_TITRE", "Guia de I-Enlace") ; |
define ("ANN_TEXTE_PERDU", "Si ha perdido su contraseña, indique su correo electronico en el espaciologin y haga clic en Ingresar") ; |
define ("ANN_CHECK_UNCHECK", "Marcar en la casilla para seleccionar su destinatario o marcar/quitar todo") ; |
define ("ANN_ENVOYER_MAIL", "Enviar un correo electronico") ; |
define ("ANN_SUJET", "Objet") ; |
define ("ANN_MESSAGE", "Mensaje") ; |
define ("ANN_ENVOYER", "Enviar") ; |
define ("ANN_CLIC_CONFIRMATION", "Haga clic en OK para confirmar") ; |
define ("ANN_PAS_D_INSCRIT", "Ninguninscrito") ; |
//======================== labels pour les mails=========================== |
define ("ANN_VERIF_MAIL_COCHE", "Marque al menos un destinatario para su correo electronico") ; |
define ("ANN_VERIF_TITRE", "Su mensaje debe tener un titulo y un cuerpo") ; |
define ("ANN_PIED_MESSAGE", "\n---------------------------------------------------------------------------". |
"\nCe message vous est envoyé par l'intermédiaire du site Internet". |
"\n(http://www.vecam.org) de VECAM, ". |
"\nauquel vous êtes inscrit.". |
"\nD'autres inscrits au réseau peuvent avoir reçu ce message.". |
"\nNe répondez que si vous êtes concerné, ou si vous avez des". |
"\ninformations utiles à transmettre au demandeur." ) ; |
?> |
/trunk/client/annuaire/langues/ann_langue_fr.inc.php |
---|
New file |
0,0 → 1,115 |
<?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: ann_langue_fr.inc.php,v 1.2 2005/03/08 09:43:55 alex Exp $ |
/** |
* Fichier de traduction en français de l'application inscription |
* |
* Fichier de traduction en français de l'application inscription |
* |
*@package vecam |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.2 $ $Date: 2005/03/08 09:43:55 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
define ("ANN_NOM", "Nom") ; |
define ("ANN_PRENOM", "Prénom") ; |
define ("ANN_PAYS", "Pays :") ; |
define ("ANN_LANGUES_PARLES", "Langues parlés :") ; |
define ("ANN_EMAIL", "E-mail :") ; |
define ("ANN_MOT_DE_PASSE", "Mot de passe :") ; |
define ("ANN_REPETE_MOT_DE_PASSE", "Répéter le mot de passe :") ; |
define ("ANN_RETABLIR", "Rétablir") ; |
define ("ANN_VALIDER", "Valider") ; |
define ("ANN_MOTS_DE_PASSE_DIFFERENTS", "Les mots de passe sont différents !") ; |
define ("ANN_EMAIL_REQUIS", "Vous devez saisir un email.") ; |
define ("ANN_MOT_DE_PASSE_REQUIS", "Vous devez saisir un mot de passe.") ; |
define ("ANN_MAIL_INCORRECT", "L'email doit avoir une forme correcte, utilisateur@domaine.ext") ; |
define ("ANN_NOTE_REQUIS", "Indique les champs requis") ; |
define ("ANN_MODIFIER_INSCRIPTION", "Modifier votre inscription") ; |
define ("ANN_SUPPRIMER_INSCRIPTION", "Supprimer votre inscription") ; |
define ("ANN_MESSAGE_BIENVENU", "Vous êtes inscrit à I-Jumelage") ; |
define ("ANN_CLIQUEZ_LETTRE", 'Cliquez sur une lettre pour voir les adhérents.') ; |
define ("ANN_LISTE_INSCRIT_LETTRE", "Liste des inscrits à la lettre") ; |
define ("ANN_TITRE", 'Annuaire du réseau') ; |
define ("ANN_TEXTE_PERDU", "Si vous avez perdu votre mot de passe, indiquer ". |
"votre adresse email dans le champs login ci-dessus et cliquez sur \"Valider\"") ; |
define ("ANN_CHECK_UNCHECK", "Cocher les cases pour sélectionner votre destinataire ou cocher / décocher tout") ; |
define ("ANN_ENVOYER_MAIL", "Envoyer un email") ; |
define ("ANN_SUJET", "Sujet") ; |
define ("ANN_MESSAGE", "Message") ; |
define ("ANN_ENVOYER", "Envoyer") ; |
define ("ANN_CLIC_CONFIRMATION", "Cliquez sur OK pour confirmer") ; |
define ("ANN_PAS_D_INSCRIT", "Pas d'inscrit") ; |
define ("ANN_MAIL_ENVOYER", "Votre mail a été envoyé") ; |
define ('ANN_DATE_INS', 'Date d\'inscription') ; |
define ('ANN_VILLE', 'Ville') ; |
// ========================= Labels pour les mails ============================ |
define ("ANN_VERIF_MAIL_COCHE", "Veuillez cocher au moins un destinataire pour votre mail" ); |
define ("ANN_VERIF_TITRE", "Votre message doit comporter un titre <i>et</i> un corps") ; |
define ("ANN_PIED_MESSAGE", "\n---------------------------------------------------------------------------". |
"\nCe message vous est envoyé par l'intermédiaire du site Internet". |
"\n(http://www.tela-botanica.org) de Tela Botanica, ". |
"\nauquel vous êtes inscrit.". |
"\nD'autres inscrits au réseau peuvent avoir reçu ce message.". |
"\nNe répondez que si vous êtes concerné, ou si vous avez des". |
"\ninformations utiles à transmettre au demandeur." ) ; |
// ============================ Label de lannuaire Back =========================== |
define ("AM_L_TITRE", "Chercher un adhérent") ; |
define ("AM_L_RECHERCHER", "Rechercher") ; |
define ("AM_L_PAYS", "Pays") ; |
define ("AM_L_NOM", "Nom") ; |
define ("AM_L_PRENOM", "Prénom") ; |
define ("AM_L_VILLE", "Ville") ; |
define ("AM_L_DEPARTEMENT", "Département") ; |
define ("AM_L_MAIL", "Mail") ; |
define ("AM_L_COTISANTS", "Cotisants") ; |
define ("AM_L_GRP_RES", "Grouper les résultats") ; |
define ("AM_L_TOUS", "Tous") ; |
define ("AM_L_MAIL_SELECTION", "Envoyer un mail à la sélection") ; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: ann_langue_fr.inc.php,v $ |
* Revision 1.2 2005/03/08 09:43:55 alex |
* changement de label |
* |
* Revision 1.1.1.1 2005/01/03 17:27:49 alex |
* Import initial |
* |
* Revision 1.1 2005/01/03 17:19:32 alex |
* version initiale |
* |
* Revision 1.1 2004/06/18 08:54:55 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/client/annuaire/admin_annu.php |
---|
New file |
0,0 → 1,500 |
<?php |
// +--------------------------------------------------------------------------------+ |
// | admin_annu.php | |
// +--------------------------------------------------------------------------------+ |
// | Copyright (c) 2002 | |
// +--------------------------------------------------------------------------------+ |
// | Administration des inscrits à un annuaire de type annuaire_tela | |
// | de Gsite, | |
// | Sont également mises en jeux les tables gen_COUNTRY, gen_FRENCH_DPT, | |
// | LABELS | |
// | Plus spécifique la fonction cotisation($id) en bas permet de | |
// | gérer les cotisations versées par les inscrits, avec la table | |
// | annuaire_COTISATION | |
// +--------------------------------------------------------------------------------+ |
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org> | |
// +--------------------------------------------------------------------------------+ |
// |
// $Id: admin_annu.php,v 1.1 2005/03/24 08:47:31 alex Exp $ |
global $HTTP_HOST ; |
define ("URL_RECU", $GLOBALS['ann_url']->protocol. '://'.$GLOBALS['ann_url']->host."/client/annuaire/voir_recu_pdf.php") ; |
include_once ("HTML/Table.php") ; |
include_once 'api/formulaire/FORM_formulaire.class.php' ; |
// admin_annu est une application cliente de gsite elle commence donc |
// dans une fonction putFrame() |
function putFrame() |
{ |
global $u_id, $cotisation_id ; |
global $action ; |
global $link ; |
if (empty($action)) $action = false ; |
$url = $GLOBALS['ann_url']->getURL() ; |
// mise à jour si il y lieu |
if ($action == "up") { |
upSQL() ; |
} |
// Requete de pour récupérer toutes les infos d'un usager |
$query = "select annuaire_tela.*,annuaire_LABEL_ACT.*,annuaire_LABEL_ASS.*,gen_COUNTRY.GC_NAME" ; |
$query .= ", annuaire_LABEL_NIV.*, annuaire_LABEL_STATUT.*" ; |
$query .= " from annuaire_tela,gen_COUNTRY,gen_FRENCH_DPT," ; |
$query .= " annuaire_LABEL_ACT,annuaire_LABEL_ASS, annuaire_LABEL_NIV, annuaire_LABEL_STATUT" ; |
$query .= " where U_ID=$u_id" ; |
//$query .= " and annuaire_tela.U_FRENCH_DPT=gen_FRENCH_DPT.GFD_ID" ; |
$query .= " and annuaire_tela.U_COUNTRY=gen_COUNTRY.GC_ID" ; |
$query .= " and annuaire_tela.U_ACT=annuaire_LABEL_ACT.ID_LABEL_ACT" ; |
$query .= " and annuaire_tela.U_ASS=annuaire_LABEL_ASS.ID_LABEL_ASS" ; |
$query .= " and annuaire_tela.U_NIV=annuaire_LABEL_NIV.ID_LABEL_NIV" ; |
$result = mysql_query($query) or die("Echec de la requete sur ".ANN_ANNUAIRE.":<br>".mysql_error().'<br>'.$query) ; |
$row = mysql_fetch_object($result) ; |
$res = "<h1>Edition d'un adhérent : $row->U_NAME $row->U_SURNAME</h1>\n" ; |
$res .= "<div>".form("Nom : ", "U_NAME", $row->U_NAME)."</div>\n" ; |
$res .= "<div>".form("Prénom : ", "U_SURNAME", $row->U_SURNAME)."</div>\n" ; |
$res .= "<div>".form("Adresse mail : ", "U_MAIL", $row->U_MAIL)."</div>\n" ; |
$res .= "<div>".form("Date d'inscription : ", "U_DATE", $row->U_DATE)."</div>\n" ; |
$res .= "<div>".form("Adresse 1 : ", "U_ADDR1", $row->U_ADDR1)."</div>\n" ; |
$res .= "<div>".form("Adresse 2 : ", "U_ADDR2", $row->U_ADDR2)."</div>\n" ; |
$res .= "<div>".form("Région : ", "U_STATE", $row->U_STATE)."</div>\n" ; |
$res .= "<div>".form("Code postal : ", "U_ZIP_CODE", $row->U_ZIP_CODE)."</div>\n" ; |
$res .= "<div>".form("Ville : ", "U_CITY", $row->U_CITY)."</div>\n" ; |
$res .= "<div>".form("Pays : ", "U_COUNTRY", $row->U_COUNTRY)."</div>\n" ; |
$res .= "<div>".form("Site web personnel : ", "U_WEB", $row->U_WEB)."</div>\n" ; |
$res .= "<div>".form("Organisme : ", "U_TITLE", $row->U_TITLE)."</div>\n" ; |
$res .= "<div>".form("Fonction : ", "U_FONCTION", $row->U_FONCTION)."</div>\n" ; |
$res .= "<div>".form("Niveau en botanique : ", "LABEL_NIV", $row->LABEL_NIV)."</div>\n" ; |
$res .= "<div>".form("Activité : ", "LABEL_ACT", $row->LABEL_ACT)."</div>\n" ; |
$res .= "<div>".form("Secteur associatif : ", "LABEL_ASS", $row->LABEL_ASS)."</div>\n" ; |
$res .= "<div>".form("Spécialité : ", "U_SPE", $row->U_SPE)."</div>\n" ; |
$res .= "<div>".form("Spécialité géographique : ", "U_GEO", $row->U_GEO)."</div>\n" ; |
$res .= "<div>".form("Statut : ", "LABEL_STATUT", $row->LABEL_STATUT)."</div>\n" ; |
if (isset($cotisation_id) && $cotisation_id != "") { |
$db = & $GLOBALS['ann_db']; |
include_once ANN_CHEMIN_APPLI."recu_pdf_corps.php" ; |
// buffer est une propriété de la classe FPDF qui contient les données au format PDF. |
// habituellement on ne l'utilise pas, on appelle $pdf->Output() qui envoie les |
// entete HTTP du document généré |
$pdf->Close() ; |
$buf = $pdf->buffer; |
// Inclusion des bibliothèques PEAR |
include_once ('Mail.php'); |
include_once ('Mail/mime.php'); |
$file = 'Recu_Fiscal_Tela_Botanica.pdf'; |
$crlf = "\r\n"; |
$hdrs = array( |
'From' => 'accueil@tela-botanica.org', |
'Subject' => 'Reçu pour don à Tela Botanica' |
); |
$mime = new Mail_mime($crlf); |
$text = "Bonjour !\n\n". |
"Le Réseau Tela Botanica vous remercie du soutien financier que vous lui avez apporté. Votre contribution permettra au réseau :\n\n". |
"- de continuer à encourager et accompagner des projets botaniques,\n". |
"- de maintenir et d'améliorer nos services Internet dédiés à la botanique.\n\n". |
"Vous trouverez en pièce jointe à ce message un document PDF contenant le reçu fiscal à imprimer". |
" et à joindre à votre déclaration d'impôts. Si vous n'arrivez pas à imprimer ce document, veuillez". |
" nous le signaler en répondant à ce mail et en indiquant votre nom et votre adresse postale. Nous vous". |
" ferons parvenir le reçu imprimé à cette adresse.\n\n". |
"Rappel : Votre contribution financière ne constitue pas une adhésion à l'Association Tela Botanica mais ". |
"bien un soutien aux actions menées par le Réseau Tela Botanica.\n\n". |
"Si ce n'est déjà fait, n'oubliez pas de vous inscrire au Réseau sur le site Internet, à l'adresse : ". |
"http://www.tela-botanica.org (menu « Inscription», onglet « Inscription»), afin que vous puissiez :\n\n". |
"- consulter l'annuaire des personnes inscrites au Réseau ;\n- localiser les membres du Réseau dans tous". |
" les pays;\n- accédez à certaines données diffusées sur le site ;\n- vous inscrire à des projets ". |
"botaniques ;\n- être informé personnellement des actualités du Réseau.\n\n". |
"Bien cordialement,\n\n". |
"Tela Botanica\nLe Réseau des Botanistes Francophones\n163, rue A. Broussonnet\n34090 Montpellier\n". |
"Tél. : 04-67-52-41-22\naccueil@tela-botanica.org\nhttp://www.tela-botanica.org\n" ; |
$mime->setTXTBody($text); |
// On attache le document PDF grace à $buf, et en indiquant son type MIME |
$mime->addAttachment($buf, 'application/pdf', $file, false) ; |
$body = $mime->get(); |
$hdrs = $mime->headers($hdrs); |
$mail =& Mail::factory('mail'); |
$mail->send($ligne->U_MAIL, $hdrs, $body); |
// On insere le numéro du reçu dans la table annuaire_COTISATION |
@mysql_query("update annuaire_COTISATION set IC_RECU=$num_recu, IC_DATE_ENVOIE_RECU=NOW() where IC_ID=$cotisation_id") ; |
// On incrémente le compteur de mail de 1 |
if (!$deja_envoye) { |
$num_recu++ ; |
mysql_query("update COMPTEUR_COTISATION set COMPTEUR=$num_recu ") ; |
} |
$res .= "<div>Le reçu a été envoyé</div>\n" ; |
} |
$res .= cotisation($u_id) ; |
$res .= suppression($u_id) ; |
return $res ; |
} |
// form construit soit un formulaire de type <input type="text" ...> et |
// de nom $field_ et place un $label devant |
// soit construit un lien vers un formulaire à partir du champs $field_ |
function form($label, $field_, $value) |
{ |
global $u_id, $GS_GLOBAL, $field ; |
$url = $GLOBALS['ann_url']->getURL() ; |
if ($field != $field_) { |
$res = "<b>$label</b>" ; |
$res .= "<a href=\"$url&field=$field_\">" ; |
if ($field_ == 'LABEL_NIV' || $field_ == 'LABEL_ACT' || $field_== 'LABEL_ASS') { |
$res .= $value ? $value : "(vide)"; |
} else if ($field_ == "U_COT") { |
if ($value == 0) { |
$res .= "non" ; |
} else { |
$res .= "oui" ; |
} |
} else { |
$res .= $value ? $value : "(vide)"; |
} |
$res .= "</a>\n" ; |
} |
if ($field == $field_) { |
$res = "\n<form action=\"$url&u_id=$u_id&action=up&field_=$field_\" method=\"post\">" ; |
$res .= "<b>$label</b>\n" ; |
switch ($field_) { |
case "U_COUNTRY" : |
$select_country = new form($GS_GLOBAL['link']) ; |
$res .= ereg_replace("gen_COUNTRY", "U_COUNTRY", $select_country->selectFromTable("gen_COUNTRY", $value, "GC_ID", "GC_NAME")) ; |
unset($select_country) ; |
break ; |
case "LABEL_NIV" : |
$res .= getFormInsInfo($field_, $value) ; |
break ; |
case "LABEL_ASS" : |
$res .= getFormInsInfo($field_, $value) ; |
break ; |
case "LABEL_ACT" : |
$res .= getFormInsInfo($field_, $value) ; |
break ; |
case "LABEL_STATUT" : |
$res .= getFormInsInfo($field_, $value) ; |
break ; |
case "U_COT" : |
$res .= "<select class=\"insInputForm\" name=\"II_COT\">\n" ; |
if ($value == 0) { |
$check0 = " selected" ; |
$check1 = "" ; |
} else { |
$check1 = " selected" ; |
$check0 = "" ; |
} |
$res .= "<option value=\"0\"$check0>non</option>\n" ; |
$res .= "<option value=\"1\"$check1>oui</option>\n" ; |
$res .= "</select>\n" ; |
break ; |
default : |
$res .= "<input type=\"text\" size=\"40\" name=\"$field_\" value=\"$value\">\n" ; |
} |
$res .= "<input type=\"submit\" value=\"valider\" class=\"texte_tb\">\n" ; |
$res .= "</form>" ; |
} |
return $res ; |
} |
// upSQL met à jour la table annuaire_tela |
function upSQL() |
{ |
global $field_ ; |
global $u_id ; |
global $HTTP_POST_VARS ; |
switch ($field_) { |
case "LABEL_NIV" : $field_ = "U_NIV" ; |
$id_field = "ID_LABEL_NIV"; |
break ; |
case "LABEL_ACT" : $field_ = "U_ACT" ; |
$id_field = "ID_LABEL_ACT"; |
break ; |
case "LABEL_ASS" : $field_ = "U_ACT" ; |
$id_field = "ID_LABEL_ASS"; |
break ; |
default :$id_field = $field_ ; |
} |
// Recherche de l'ancien mail |
$req_am = "select U_MAIL from annuaire_tela where U_ID = $u_id" ; |
$res_am = mysql_query ($req_am) or die ("Echec ".mysql_error()) ; |
$ligne_am = mysql_fetch_object ($res_am) ; |
$ancien_mail = $ligne_am->U_MAIL ; |
$query = "update annuaire_tela set $field_=\"".$HTTP_POST_VARS[$id_field]."\" where U_ID = $u_id" ; |
mysql_query($query) or die ("<br>Echec de la requete de mise à jour<br>\n") ; |
// Traitement du département |
if ($field_ == "U_ZIP_CODE") { |
if (preg_match("/^97|98[0-9]*/", $HTTP_POST_VARS['U_ZIP_CODE'])) { |
$n_dpt = substr($HTTP_POST_VARS['U_ZIP_CODE'], 0, 3) ; |
} else { |
$n_dpt = substr($HTTP_POST_VARS['U_ZIP_CODE'], 0, 2) ; |
} |
mysql_query ("update annuaire_tela set U_FRENCH_DPT='$n_dpt' where U_ID='$u_id'") ; |
} |
// Traitement de l'adresse mail |
if ($field_ == "U_MAIL") { |
$requete = "update ins_STATS set IS_MAIL=\"".$HTTP_POST_VARS['U_MAIL']."\" where IS_MAIL=\"$ancien_mail\"" ; |
mysql_query ($requete) ; |
} |
} |
function getFormInsInfo($field, $value) |
{ |
$query = "select * from annuaire_$field" ; |
$id_field = "ID_$field" ; |
$result = mysql_query($query) or die ("Echec de la requete sur ID_$field<br>".mysql_error()) ; |
$res = "<select name=\"$id_field\" class=\"insInputForm\">\n" ; |
$i = 0 ; |
while ($row = mysql_fetch_object($result)) { |
$res .= "<option value=\"".$row->$id_field."\"" ; |
if ($value == $row->$field) $res .= " selected"; |
$res .= ">" ; |
$res .= $row->$field ; |
$res .= "</option>\n" ; |
$i++ ; |
} |
$res .= "</select>\n" ; |
return $res ; |
} |
// Fonction pour gérer les cotisations d'un inscrit, en |
// fonction de son id ($u_id) |
function cotisation($u_id) |
{ |
global $GS_GLOBAL, $action, $IC_MONTANT, $IC_DATE, $id_cot, $IC_MC_ID ; |
$res = '' ; |
// un peu de javascript pour la confirmation en cas de destruction |
$outputText = "function confirmLink(theLink, theSqlQuery) |
{ |
var is_confirmed = confirm(theSqlQuery); |
return is_confirmed; |
} " ; |
// fonction gsite pour inclure la fonction Javascript |
// au code html |
GEN_stockerCodeScript($outputText) ; |
$url = $GLOBALS['ann_url']->getURL() ; |
// Ce qui suit sont le traitement des 3 actions ajouter, modifier, supprimer |
// qui agissent sur la table annuaire_COTISATION |
// l'action 'cu' consiste en l'insertion d'une ligne dans la table annuaire_COTISATION |
if ($action == "cu") { |
$date = preg_replace("/([0-9]+)-([0-9]+)-([0-9]+)/", "\\3\\2\\1", $IC_DATE) ; |
$query = "insert into annuaire_COTISATION values (\"\", $IC_MC_ID, $u_id, UNIX_TIMESTAMP($date),\"$IC_MONTANT\", 0, \"0000-00-00\")" ; |
mysql_query ($query) or die ("Echec de la requete d'insertion dans annuaire_COTISATION<br>$query<br>".mysql_error()) ; |
mysql_query("update annuaire_tela set U_COT=1 where U_ID=$u_id") ; |
} |
// l'action 'mu' permet de mettre à jour une ligne dans annuaire_COTISATION |
if ($action == "mu") { |
$date = preg_replace("/([0-9]+)-([0-9]+)-([0-9]+)/", "\\3\\2\\1", $IC_DATE) ; |
$query = "update annuaire_COTISATION set IC_DATE=UNIX_TIMESTAMP($date), IC_MONTANT=\"$IC_MONTANT\", |
IC_MC_ID=$IC_MC_ID where IC_ID=$id_cot" ; |
mysql_query ($query) or die ("Echec de la requete d'insertion dans annuaire_COTISATION<br>$query<br>".mysql_error()) ; |
} |
// l'action 'rm' retire une ligne de la table annuaire_COTISATION |
if ($action == "rm") { |
$query = "delete from annuaire_COTISATION where IC_ID=$id_cot" ; |
mysql_query ($query) or die ("Echec de la requete de suppression dans annuaire_COTISATION") ; |
mysql_query("update annuaire_tela set U_COT=0 where U_ID=$u_id") ; |
} |
// Quoi qu'il arrive, on récupère les informations concernant |
// les cotisations d'un inscrit et on les affiche sous forme de |
// table HTML |
$query = "select * from annuaire_COTISATION, MODE_COTISATION where IC_ANNU_ID=$u_id |
and IC_MC_ID=MC_ID" ; |
$result = mysql_query($query) or die ("Echec de la requete sur annuaire_COTISATION<br>".$query) ; |
$res = "<h1>Etat des cotisations : </h1>" ; |
// formatage de la date |
$date = date("d-m-Y") ; |
// l'action 'sc' correspond à l'édition d'une ligne de la table |
// annuaire_COTISATION. Si elle est présente on affiche un formulaire |
// de modification |
if ($action == "sc") { |
$res .= "<div><form action=\"$url&action=cu\" method=\"post\"><b>Date : </b>" ; |
$res .= "<input type=\"text\" size=\"9\" class=\"insInputForm\" name=\"IC_DATE\" value=\""; |
$res .= $date ; |
$res .= "\">\n" ; |
$res .= "<b>Montant : </b><input type=\"text\" class=\"insInputForm\" size=\"5\" name=\"IC_MONTANT\" value=\"30\"> €\n" ; |
$res .= mode_paiement(0) ; |
$res .= "<input type=\"submit\" value=\"Valider\" class=\"texte_tb\">\n" ; |
$res .= "<input type=\"button\" value=\"Annuler\" class=\"texte_tb\" onclick=\"javascript:window.location.href='$url';\"></form>\n" ; |
$res .= "</div>\n" ; |
// si l'action 'sc' n'est pas active on affiche toutes les lignes |
// de cotisation de l'inscrit |
} else { |
if (mysql_num_rows($result) != 0) { |
$res .= "<div>" ; |
$table = new HTML_Table(array("width" => "100%", "class" => "texte_tb2")) ; |
$table->addRow(array("Date", "Montant", "Mode", "modifier", "supprimer", "Voir le reçu", "Envoyer le reçu", |
"Date d'envoie du reçu"), |
array("class" => "insTitle1")) ; |
while ($row = mysql_fetch_object($result)) { |
// Le reçu a t il été envoyé ? |
if ($row->IC_RECU != 0) { |
$message_envoye = $row->IC_DATE_ENVOIE_RECU ; ; |
} else { |
$message_envoye = "Reçu non envoyé"; |
} |
if ($action != "mc" || $id_cot != $row->IC_ID) { |
$table->addRow(array (date ("j m Y", $row->IC_DATE), $row->IC_MONTANT." <b>€</b>", $row->MC_LABEL, |
"<a href=\"$url&action=mc&id_cot=$row->IC_ID\">modifier</a>", |
"<a href=\"$url&action=rm&id_cot=$row->IC_ID\"". |
" onclick=\"javascript:return confirmLink(this, 'êtes-vous". |
" sûr de vouloir supprimer cette entrée');\">supprimer</a>", |
"<a href=\"".URL_RECU."?cotisation_id=$row->IC_ID\">Voir le reçu</a>", |
"<a href=\"$url&cotisation_id=$row->IC_ID\">Envoyer le reçu</a>", |
$message_envoye)) ; |
} else { |
// Recherche du mode de paiement |
$table->addRow(array("<form action=\"$url&action=mu&id_cot=$row->IC_ID\" method=\"post\">\n". |
"<input type=\"text\" size=\"9\" class=\"insInputForm\" name=\"IC_DATE\" value=\"".date ("j-m-Y", $row->IC_DATE)."\">", |
"<input type=\"text\" size=\"5\" class=\"insInputForm\" name=\"IC_MONTANT\" value=\"$row->IC_MONTANT\"><b>€</b>", |
mode_paiement($row->IC_MC_ID), |
"<input type=\"submit\" class=\"texte_tb\" value=\"valider\">". |
"<input type=\"button\" value=\"Annuler\" class=\"texte_tb\" onclick=\"javascript:window.location.href='$url';\"></form>", |
" ")) ; |
} |
} |
$table->altRowAttributes(1, array("class" => "texte_tb2"), array("class" => "text2")) ; |
$res .= $table->toHTML()."</div>\n" ; |
unset($table) ; |
} else { |
$res .= "<div>non cotisant</div>\n" ; |
} |
$res .= "<div><input type=\"button\" class=\"texte_tb\" " ; |
$res .= "value=\"Saisir une cotisation\" onclick=\"javascript:window.location.href='$url&action=sc';\"></div>\n" ; |
} |
return $res ; |
} |
function suppression($u_id) { |
global $GS_GLOBAL, $action ; |
// un peu de javascript pour la confirmation en cas de destruction |
$outputText = "function confirmLink(theLink, theSqlQuery) |
{ |
var is_confirmed = confirm(theSqlQuery); |
return is_confirmed; |
} " ; |
// fonction gsite pour inclure la fonction Javascript |
// au code html |
GEN_stockerCodeScript($outputText) ; |
$url = $GLOBALS['ann_url']->getURL() ; |
$res = "<div>Supprimer l'inscription</div>\n" ; |
$res .="<div><form action=\"$url&action=suppr_adh\" method=\"post\">\n" ; |
$res .= "<input type=\"submit\" class=\"texte_tb\" value=\"Supprimer\" " ; |
$res .= "onclick=\"javascript:return confirmLink(this, 'êtes-vous sûr de vouloir supprimer cet adhérent');\">\n" ; |
$res .= "</form></div>\n" ; |
if ($action=="suppr_adh") { |
$queryLogin = "select U_MAIL from annuaire_tela where U_ID=$u_id" ; |
$resultLogin = mysql_query($queryLogin) or die ("Echec de la requete sur annu_USERS"); |
$rowLogin = mysql_fetch_object($resultLogin) ; |
$mail = $rowLogin->U_MAIL ; |
mysql_free_result($resultLogin) ; |
// vérifications |
// 1. annu_ADMIN |
$q_annu_ADMIN = "select AA_ID from annu_ADMIN where AA_ID=$u_id" ; |
$r_annu_ADMIN = mysql_query($q_annu_ADMIN) or die ("Echec ..." ); |
if (mysql_num_rows($r_annu_ADMIN) != 0) { |
$res .= "Une référence dans annu_ADMIN" ; |
} |
// 2. |
// suppression |
$query = "delete from annuaire_tela where U_ID=$u_id" ; |
} |
return $res ; |
} |
/** function mode_paiement () Produit un champs select avec le mode de paiement |
* |
* |
* @param integer mode de paiement par defaut |
* @return string HTML |
*/ |
function mode_paiement ($defaut) { |
$res = "<select name=\"IC_MC_ID\" class=\"insInputForm\">\n" ; |
$req_mode = "select * from MODE_COTISATION" ; |
$res_mode = mysql_query($req_mode) or die ($req_mode."<br>".mysql_error()) ; |
while ($ligne_mode = mysql_fetch_object($res_mode)) { |
$res .= "<option value=\"$ligne_mode->MC_ID\"" ; |
if ($ligne_mode ->MC_ID == $defaut) $res .= " selected" ; |
$res .= ">$ligne_mode->MC_LABEL</option>\n" ; |
} |
$res .= "</select>\n" ; |
return $res ; |
} |
?> |
/trunk/client/annuaire/signature_Daniel.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/annuaire/signature_Daniel.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |