Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 3 → Rev 4

/trunk/papyrus/bibliotheque/fonctions/pap_site.fonct.php
New file
0,0 → 1,125
<?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: pap_site.fonct.php,v 1.1 2004-06-15 15:13:37 jpm Exp $
/**
* Bibliothèque de fonctions concernant les sites.
*
* Bibliothèque de fonctions permettant de manipuler les tables :
* - gen_site,
* - gen_site_auth,
* - gen_site_auth_bdd,
* - gen_site_auth_ldap,
* - gen_site_categorie,
* - gen_site_categorie_valeur.
*
*@package Papyrus
*@subpackage Fonctions
//Auteur original :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
//Autres auteurs :
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $ $Date: 2004-06-15 15:13:37 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
/** Fonction GEN_lireInfoSitePrincipalCodeAlpha() - Renvoie un objet contenant une ligne de la table gen_site
*
* Retourne la ligne de la table gen_site concernant le site principal ayant pour code alphanumérique la valeur
* passée en paramètre.
* Ancien nom : getProjectInfos()
*
* @param mixed une instance de la classse Pear DB.
* @param string le code alphanumérique du site.
* @return mixed un objet résultat de Pear DB contenant une ligne de la table gen_site, ou false en cas d'erreur.
*/
 
function GEN_lireInfoSitePrincipalCodeAlpha($objet_pear_db, $code_alpha)
{
$requete = 'SELECT * '.
'FROM gen_site, gen_site_relation '.
'WHERE gs_code_alpha = "'.$code_alpha.'" '.
'AND gs_id_site = gsr_id_site_01 '.
'AND gsr_id_site_01 = gsr_id_site_02 '.
'AND gsr_id_valeur = 102 '; // 102 = site "principal"
$resultat = $objet_pear_db->query($requete);
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '';
if ($resultat->numRows() != 1) {
// Impossible de récupérer des informations sur le site principal ayant pour code alpha $code_alpha
return false;
}
$info_site_principal = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
$resultat->free();
return $info_site_principal;
}
 
/** Fonction getSiteI18nInfos() - Renvoie un objet contenant une ligne de la table gen_site
*
* Retourne la ligne de la table gen_site concernant un site ayant pour code alphanumérique et identifiant
* i18n les valeurs passées en paramètres.
* Ancien nom :getSiteI18nInfos():
*
* @param mixed une instance de la classse Pear DB.
* @param string le code alphanumérique du site recherché.
* @param string l'identifiant i18n possédé par le site recherché.
* @return mixed un objet résultat de Pear DB contenant une ligne de la table gen_site, ou false en cas d'erreur.
*/
function GEN_lireInfoSiteI18nCodeAlpha($objet_pear_db, $code_alpha, $i18n)
{
$requete = 'SELECT * '.
'FROM gen_site, gen_site_relation '.
'WHERE gs_code_alpha = "'.$code_alpha.'" '.
'AND gs_ce_i18n = "'.$i18n.'" ';
$resultat = $objet_pear_db->query($requete);
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '';
if ($resultat->numRows() != 1) {
return false;
}
$info_site = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
$resultat->free();
return $info_site;
}
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2004/05/03 16:26:07 jpm
* Ajout de la bibliothèque de fonctions permettant de manipuler les informations issues des tables "gen_site_..." de Génésia.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>