Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1635 → Rev 1636

/trunk/jrest/services/CoelPublication.php
24,7 → 24,7
$info = array();
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_publication', 'id_projet', 'fmt_nom_complet'), $param);
$p = $this->traiterParametresUrl(array('id_publication', 'id_projet', 'recherche'), $param);
 
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' cp.*, cmhl.*, cs_nom '.
34,7 → 34,7
((count($p) != 0) ? 'WHERE ' : '').
(isset($p['id_projet']) ? "AND cpu_ce_projet = {$p['id_projet']} " : '').
(isset($p['id_publication']) ? "AND cpu_id_publication = {$p['id_publication']} " : '').
(isset($p['fmt_nom_complet']) ? "AND cpu_fmt_nom_complet LIKE {$p['fmt_nom_complet']} " : '').
(isset($p['recherche']) ? $this->construireWhereRecherche($p['recherche']) : '').
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cpu_id_publication ASC').' ';
$requete = str_replace('WHERE AND', 'WHERE', $requete);
$requeteCount = $requete;
61,6 → 61,17
// Envoie sur la sortie standard
$this->envoyer($info);
}
private function construireWhereRecherche($recherche) {
$recherche = "AND ".
"(".
"cpu_fmt_nom_complet LIKE {$recherche} OR ".
"cpu_date_parution LIKE {$recherche} OR ".
"cpu_fascicule LIKE {$recherche} OR ".
"cpu_truk_pages LIKE {$recherche} ".
")";
return $recherche;
}
 
/**
* Méthode appelée pour ajouter un élément.