Subversion Repositories eFlore/Applications.coel

Rev

Rev 1636 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1636 Rev 1765
Line 22... Line 22...
22
	public function getElement($param = array()) {
22
	public function getElement($param = array()) {
23
		// Initialisation des variables
23
		// Initialisation des variables
24
		$info = array();
24
		$info = array();
Line 25... Line 25...
25
		
25
		
26
		// Pré traitement des paramêtres
26
		// Pré traitement des paramêtres
Line 27... Line 27...
27
		$p = $this->traiterParametresUrl(array('id_publication', 'id_projet', 'recherche'), $param);
27
		$p = $this->traiterParametresUrl(array('id_publication', 'recherche'), $param);
28
 
28
 
29
		// Construction de la requête
29
		// Construction de la requête
30
		$requete = 	(($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' cp.*, cmhl.*, cs_nom '.
30
		$requete = 	(($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' cp.*, cmhl.*, cs_nom '.
31
					'FROM coel_publication AS cp '.
31
					'FROM coel_publication AS cp '.
32
					'	LEFT JOIN coel_meta_historique_ligne AS cmhl ON (cpu_ce_meta = cmhl_id_historique_ligne) '.
32
					'	LEFT JOIN coel_meta_historique_ligne AS cmhl ON (cpu_ce_meta = cmhl_id_historique_ligne) '.
33
					'	LEFT JOIN coel_structure ON (cpu_ce_truk_editeur = cs_id_structure) '.
-
 
34
					((count($p) != 0) ? 'WHERE ' : '').
33
					'	LEFT JOIN coel_structure ON (cpu_ce_truk_editeur = cs_id_structure) '.
35
					(isset($p['id_projet']) 		? "AND cpu_ce_projet = {$p['id_projet']} " : '').
34
					((count($p) != 0) ? 'WHERE ' : '').
36
					(isset($p['id_publication'])	? "AND cpu_id_publication = {$p['id_publication']} " : '').
35
					(isset($p['id_publication'])	? "AND cpu_id_publication = {$p['id_publication']} " : '').
37
					(isset($p['recherche']) ? $this->construireWhereRecherche($p['recherche']) : '').
36
					(isset($p['recherche']) ? $this->construireWhereRecherche($p['recherche']) : '').
38
					'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby  : 'cpu_id_publication ASC').' ';
37
					'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby  : 'cpu_id_publication ASC').' ';