Line 21... |
Line 21... |
21 |
public function getElement($param = array()) {
|
21 |
public function getElement($param = array()) {
|
22 |
// Initialisation des variables
|
22 |
// Initialisation des variables
|
23 |
$info = array();
|
23 |
$info = array();
|
Line 24... |
Line 24... |
24 |
|
24 |
|
25 |
// Pré traitement des paramêtres
|
25 |
// Pré traitement des paramêtres
|
Line 26... |
Line 26... |
26 |
$p = $this->traiterParametresUrl(array('id_projet', 'id_commentaire', 'recherche'), $param);
|
26 |
$p = $this->traiterParametresUrl(array('id_commentaire', 'recherche'), $param);
|
27 |
|
27 |
|
28 |
// Construction de la requête
|
28 |
// Construction de la requête
|
29 |
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' ccm.*, '.
|
29 |
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' ccm.*, '.
|
30 |
' ccac.*, '.
|
30 |
' ccac.*, '.
|
31 |
' cc_id_collection, cc_nom '.
|
31 |
' cc_id_collection, cc_nom '.
|
32 |
'FROM coel_commentaire AS ccm'.
|
32 |
'FROM coel_commentaire AS ccm'.
|
33 |
' LEFT JOIN coel_meta_historique_ligne ON (ccm_ce_meta = cmhl_id_historique_ligne) '.
|
33 |
' LEFT JOIN coel_meta_historique_ligne ON (ccm_ce_meta = cmhl_id_historique_ligne) '.
|
34 |
' LEFT JOIN coel_collection_a_commentaire AS ccac ON (ccm_id_commentaire = ccac_id_commentaire) '.
|
34 |
' LEFT JOIN coel_collection_a_commentaire AS ccac ON (ccm_id_commentaire = ccac_id_commentaire) '.
|
35 |
' LEFT JOIN coel_collection ON (ccac_id_collection = cc_id_collection) '.
|
- |
|
36 |
((count($p) != 0) ? 'WHERE ' : '').
|
35 |
' LEFT JOIN coel_collection ON (ccac_id_collection = cc_id_collection) '.
|
37 |
(isset($p['id_projet']) ? "AND ccm_ce_projet = {$p['id_projet']} " : '').
|
36 |
((count($p) != 0) ? 'WHERE ' : '').
|
38 |
(isset($p['id_commentaire']) ? "AND ccm_id_commentaire = {$p['id_commentaire']} " : '').
|
37 |
(isset($p['id_commentaire']) ? "AND ccm_id_commentaire = {$p['id_commentaire']} " : '').
|
39 |
(isset($p['recherche']) ? $this->construireWhereRecherche($p['recherche']) : '').
|
38 |
(isset($p['recherche']) ? $this->construireWhereRecherche($p['recherche']) : '').
|
40 |
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'ccm_id_commentaire ASC').' ';
|
39 |
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'ccm_id_commentaire ASC').' ';
|