/trunk/jrest/services/CoelPersonne.php |
---|
29,7 → 29,7 |
$info = array(); |
// Pré traitement des paramêtres |
$p = $this->traiterParametresUrl(array('id_personne', 'ce_projet', 'nom'), $param); |
$p = $this->traiterParametresUrl(array('id_personne', 'ce_projet', 'recherche'), $param); |
// Construction de la requête |
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' cp.*, '. |
39,7 → 39,7 |
((count($p) != 0) ? 'WHERE ' : ''). |
(isset($p['id_personne']) ? "AND cp_id_personne = {$p['id_personne']} " : ''). |
(isset($p['ce_projet']) ? "AND cp_ce_projet = {$p['ce_projet']} " : ''). |
(isset($p['nom']) ? "AND cp_nom LIKE {$p['nom']} " : ''). |
(isset($p['recherche']) ? $this->construireWhereRecherche($p['recherche']) : ''). |
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cp_fmt_nom_complet ASC').' '; |
$requete = str_replace('WHERE AND', 'WHERE', $requete); |
66,6 → 66,17 |
$this->envoyer($info); |
} |
private function construireWhereRecherche($recherche) { |
$recherche = "AND ". |
"(". |
"cp_fmt_nom_complet LIKE {$recherche} OR ". |
"cp_code_postal LIKE {$recherche} OR ". |
"cp_ville LIKE {$recherche} OR ". |
"cp_truk_courriel LIKE {$recherche} ". |
")"; |
return $recherche; |
} |
/** |
* Méthode appelée pour ajouter un élément. |
*/ |
/trunk/jrest/services/CoelCollection.php |
---|
59,7 → 59,7 |
$info = array(); |
// Pré traitement des paramêtres |
$p = $this->traiterParametresUrl(array('id_projet', 'id_collection', 'nom'), $param); |
$p = $this->traiterParametresUrl(array('id_projet', 'id_collection', 'recherche'), $param); |
// Construction de la requête |
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' c.*, cb.*, '. |
74,7 → 74,7 |
((count($p) != 0) ? 'WHERE ' : ''). |
((isset($p['id_projet'])) ? "AND c.cc_ce_projet = {$p['id_projet']} " : ''). |
((isset($p['id_collection'])) ? "AND c.cc_id_collection = {$p['id_collection']} " : ''). |
((isset($p['nom'])) ? "AND c.cc_nom LIKE {$p['nom']} " : ''). |
(isset($p['recherche']) ? $this->construireWhereRecherche($p['recherche']) : ''). |
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'c.cc_nom ASC').' '; |
$requete = str_replace('WHERE AND', 'WHERE', $requete); |
102,6 → 102,15 |
return $info; |
} |
private function construireWhereRecherche($recherche) { |
$recherche = "AND ". |
"(". |
"c.cc_nom LIKE {$recherche} OR ". |
"cs_ville LIKE {$recherche} ". |
")"; |
return $recherche; |
} |
/* Méthode pour récupérer une liste de collection en fonction d'un id structure. |
* Appelée avec les paramêtres d'url suivant : |
* /CoelCollection/ParIdStructure/_ |
/trunk/jrest/services/CoelStructure.php |
---|
64,7 → 64,7 |
$info = array(); |
// Pré traitement des paramêtres |
$p = $this->traiterParametresUrl(array('id_projet', 'id_structure', 'nom'), $param); |
$p = $this->traiterParametresUrl(array('id_projet', 'id_structure', 'recherche'), $param); |
// Construction de la requête |
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' cs.*, csc.*, csv.*, '. |
76,7 → 76,7 |
((count($p) != 0) ? 'WHERE ' : ''). |
((isset($p['id_projet'])) ? "AND cs_ce_projet = {$p['id_projet']} " : ''). |
((isset($p['id_structure'])) ? "AND cs_id_structure = {$p['id_structure']} " : ''). |
((isset($p['nom'])) ? "AND cs_nom LIKE {$p['nom']} " : ''). |
(isset($p['recherche']) ? $this->construireWhereRecherche($p['recherche']) : ''). |
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cs.cs_nom ASC').' '; |
$requete = str_replace('WHERE AND', 'WHERE', $requete); |
102,6 → 102,15 |
return $info; |
} |
private function construireWhereRecherche($recherche) { |
$recherche = "AND ". |
"(". |
"cs_nom LIKE {$recherche} OR ". |
"cs_ville LIKE {$recherche} ". |
")"; |
return $recherche; |
} |
/* Méthode pour récupérer le nombre de structure par zone géographique. |
* Appelée avec les paramêtres d'url suivant : |
* /CoelStructure/ParZoneGeo/_ |
/trunk/jrest/services/CoelProjet.php |
---|
26,16 → 26,16 |
$info = array(); |
// Pré traitement des paramêtres |
$p = $this->traiterParametresUrl(array('id_projet', 'cpr_nom'), $param); |
$p = $this->traiterParametresUrl(array('id_projet', 'recherche'), $param); |
// Nous avons un identifiant de projet, nous récupérons seulement les informations du projet donné |
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' * '. |
'FROM coel_projet '. |
((count($p) != 0) ? 'WHERE ' : ''). |
((isset($p['cpr_nom'])) ? "AND cpr_nom LIKE {$p['cpr_nom']} " : ''). |
((isset($p['recherche'])) ? $this->construireWhereRecherche($p['recherche']) : ''). |
((isset($p['id_projet'])) ? "AND cpr_id_projet = {$p['id_projet']} " : ''). |
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cpr_id_projet ASC').' '; |
$requete = str_replace('WHERE AND', 'WHERE', $requete); |
$requeteCount = $requete; |
$requete .= "LIMIT $this->start, $this->limit "; |
61,6 → 61,18 |
$this->envoyer($info); |
} |
private function construireWhereRecherche($recherche) { |
$recherche = "AND ". |
"(". |
"cpr_nom LIKE {$recherche} OR ". |
"cpr_abreviation LIKE {$recherche} OR ". |
"cpr_resume LIKE {$recherche} OR ". |
"cpr_url LIKE {$recherche} OR ". |
"cpr_mot_cles LIKE {$recherche} ". |
")"; |
return $recherche; |
} |
/** |
* Méthode appelée pour ajouter un élément. |
/trunk/jrest/services/CoelCommentaire.php |
---|
23,7 → 23,7 |
$info = array(); |
// Pré traitement des paramêtres |
$p = $this->traiterParametresUrl(array('id_projet', 'id_commentaire', 'titre'), $param); |
$p = $this->traiterParametresUrl(array('id_projet', 'id_commentaire', 'recherche'), $param); |
// Construction de la requête |
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' ccm.*, '. |
36,7 → 36,7 |
((count($p) != 0) ? 'WHERE ' : ''). |
(isset($p['id_projet']) ? "AND ccm_ce_projet = {$p['id_projet']} " : ''). |
(isset($p['id_commentaire']) ? "AND ccm_id_commentaire = {$p['id_commentaire']} " : ''). |
(isset($p['titre']) ? "AND ccm_titre LIKE {$p['titre']} " : ''). |
(isset($p['recherche']) ? $this->construireWhereRecherche($p['recherche']) : ''). |
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'ccm_id_commentaire ASC').' '; |
$requete = str_replace('WHERE AND', 'WHERE', $requete); |
$requeteCount = $requete; |
63,7 → 63,36 |
// Envoie sur la sortie standard |
$this->envoyer($info); |
} |
private function construireWhereRecherche($recherche) { |
$recherche_public = null; |
if(strstr(strtolower($recherche),'public')) { |
$recherche_public = 1; |
} |
if(strstr(strtolower($recherche),'prive') || strstr(strtolower($recherche),'privé')) { |
$recherche_public = 0; |
} |
$sous_requete_type = 'SELECT cmlv_id_valeur '. |
'FROM coel_meta_liste_valeur '. |
'WHERE cmlv_nom LIKE '.$recherche.' '. |
'AND cmlv_ce_parent = 1068'; |
$types = $this->bdd->query($sous_requete_type)->fetchAll(PDO::FETCH_ASSOC); |
$str_types = ""; |
foreach($types as $type) { |
$str_types .= "ccac_truk_type LIKE ".$this->bdd->quote("%".$type['cmlv_id_valeur'].'%')." OR "; |
} |
$recherche = "AND ". |
"(". |
$str_types. |
"ccm_titre LIKE {$recherche} OR ". |
"ccm_ponderation LIKE {$recherche} ". |
($recherche_public !== null ? ("OR ccm_mark_public LIKE {$recherche_public} ") : ""). |
")"; |
return $recherche; |
} |
/** |
* Méthode appelée pour ajouter un élément. |
*/ |
/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. |