New file |
0,0 → 1,89 |
<?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 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 | |
// | General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU 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: projetTemplate.class.php,v 1.3 2008-08-25 15:04:38 alexandre_tb Exp $ |
|
/** |
* Application projet |
* |
* La classe controleur projet |
* |
*@package projet |
//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 | |
// +------------------------------------------------------------------------------------------------------+ |
|
include_once 'PEAR.php' ; |
|
/** Constante des templates */ |
// Pour le coordinateur dans la cas de projets moderes |
define ('PROJET_TEMPLATE_DEMANDE_INSCRIPTION_SUJET', 1); |
define ('PROJET_TEMPLATE_DEMANDE_INSCRIPTION_CORPS', 2); |
|
// Pour le coordinateur lors d une nouvelle inscription (projets non moderes) |
define ('PROJET_TEMPLATE_INSCRIPTION_NOUVELLE_SUJET', 3); |
define ('PROJET_TEMPLATE_INSCRIPTION_NOUVELLE_CORPS', 4); |
|
// pour le coodinateur lors des desinscription |
define ('PROJET_TEMPLATE_DESINSCRIPTION_SUJET', 5); |
define ('PROJET_TEMPLATE_DESINSCRIPTION_CORPS', 6); |
|
// Pour le coordinateur lors du depot d un nouveau document |
define ('PROJET_TEMPLATE_NOUVEAU_DOC_SUJET', 7); |
define ('PROJET_TEMPLATE_NOUVEAU_DOC_CORPS', 8); |
|
// Pour les administrateur lorsque le dernier coordinateur |
// d un projet se desinscrit |
define ('PROJET_TEMPLATE_DESINSCRIPTION_DERNIER_COORD_SUJET', 9); |
define ('PROJET_TEMPLATE_DESINSCRIPTION_DERNIER_COORD_CORPS', 10); |
|
class projetTemplate extends PEAR { |
|
|
var $_db ; |
|
function projetTemplate(&$objetDB) { |
$this->_db = $objetDB ; |
} |
|
function getTemplate ($id_template, $lang='fr-FR', $argument = 0) { |
$requete = 'select pt_template from projet_template where pt_id_template='.$this->_db->escapeSimple($id_template). |
' and pt_i18n like "'.$lang.'%"' ; |
if ($argument != 0) $requete .= ' and pt_argument='.$this->_db->escapeSimple($argument) ; |
$resultat = $GLOBALS['projet_db']->query($requete) ; |
if (DB::isError($resultat)) return $this->raiseError ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
if ($resultat->numRows() == 0) return $this->raiseError ('Aucun template avec l\'identifiant: '.$id_template. |
', la langue: '.$lang. ' et l argument '.$argument) ; |
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ; |
return $ligne->pt_template ; |
} |
} |
?> |