Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1764 → Rev 1765

/trunk/jrest/services/CoelCollection.php
51,7 → 51,7
* Méthode par défaut pour garder la compatibilité avec Coel.
* Appelée avec les paramêtres d'url suivant :
* /CoelCollection/_/_/_
* ou les _ représentent dans l'ordre : id_projet, id_collection ou nom
* ou les _ représentent dans l'ordre : id_collection ou nom
* Si un des paramêtres est abscent, il prendre la valeur *
*/
public function getElementParDefaut($param) {
59,7 → 59,7
$info = array();
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_projet', 'id_collection', 'recherche'), $param);
$p = $this->traiterParametresUrl(array('id_collection', 'recherche'), $param);
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' c.*, cb.*, '.
72,7 → 72,6
' LEFT JOIN coel_collection AS ccm ON (c.cc_ce_mere = ccm.cc_id_collection) '.
' LEFT JOIN coel_collection_botanique AS cb ON (c.cc_id_collection = ccb_id_collection) '.
((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['recherche']) ? $this->construireWhereRecherche($p['recherche']) : '').
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'c.cc_nom ASC').' ';
323,11 → 322,11
$this->envoyer();
}
private function ajouterGuid($abr_projet, $id_collection) {
private function ajouterGuid($id_collection) {
if ($id_collection !== false) {
$table_guid = $this->tables[101];
$table_guid['champs_valeurs_id']['cc_id_collection'] = $id_collection;
$table_guid['champs_valeurs_protege']['cc_guid'] = $this->bdd->quote(sprintf($this->config['coel']['guid'], $abr_projet, 'coll'.$id_collection));
$table_guid['champs_valeurs_protege']['cc_guid'] = $this->bdd->quote(sprintf($this->config['coel']['guid'], 'coll'.$id_collection));
$this->modifier($table_guid);
}
}