Subversion Repositories Applications.projet

Rev

Rev 342 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 342 Rev 397
Line 73... Line 73...
73
    function projetTemplate(&$objetDB) {
73
    function projetTemplate(&$objetDB) {
74
    		$this->_db = $objetDB ;
74
    		$this->_db = $objetDB ;
75
    }
75
    }
Line 76... Line 76...
76
    
76
    
77
    function getTemplate ($id_template, $lang='fr-FR', $argument = 0) {
77
    function getTemplate ($id_template, $lang='fr-FR', $argument = 0) {
78
    		$requete = 'select pt_template from projet_template where pt_id_template='.$id_template.
78
    		$requete = 'select pt_template from projet_template where pt_id_template='.$this->_db->escapeSimple($id_template).
79
    					' and pt_i18n like "'.$lang.'%"' ;
79
    					' and pt_i18n like "'.$lang.'%"' ;
80
    		if ($argument != 0) $requete .= ' and pt_argument='.$argument ;
80
    		if ($argument != 0) $requete .= ' and pt_argument='.$this->_db->escapeSimple($argument) ;
81
    		$resultat = $GLOBALS['projet_db']->query($requete) ;
81
    		$resultat = $GLOBALS['projet_db']->query($requete) ;
82
    		if (DB::isError($resultat)) return $this->raiseError ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
82
    		if (DB::isError($resultat)) return $this->raiseError ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
83
    		if ($resultat->numRows() == 0) return $this->raiseError ('Aucun template avec l\'identifiant: '.$id_template.
83
    		if ($resultat->numRows() == 0) return $this->raiseError ('Aucun template avec l\'identifiant: '.$id_template.
84
				', la langue: '.$lang. ' et l argument '.$argument) ;
84
				', la langue: '.$lang. ' et l argument '.$argument) ;