1,23 → 1,17 |
<?php |
// ATTENTION ! Classe compatible uniquement avec nouveau format de bdd du cel // |
/** |
* PHP Version 5 |
* PHP Version 5.2 |
* |
* @category PHP |
* @package jrest |
* @author Raphaël Droz <raphael@tela-botanica.org> |
* @author Aurelien Peronnet <aurelien@tela-botanica.org> |
* @copyright 2010 Tela-Botanica |
* @copyright 2010, 2013 Tela-Botanica |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL |
* @version SVN: <svn_id> |
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt> |
* @link /doc/jrest/ |
*/ |
|
/** |
* |
* InventoryObservationList.php |
* |
* in=utf8 |
* out=utf8 |
* |
* Cas d'utilisation : |
* 1: Service recherche d'observations a partir de divers critères |
* a: Le service recherche les observations correspondant aux critères demandés |
84,14 → 78,33 |
return; |
} |
|
$uid[1] = rtrim($uid[1],','); |
$obs = array_filter(array_map('intval', explode(',', $uid[1]))); |
if(count($obs) == 0) { |
return; |
} |
|
$gestionnaire_observation = new GestionObservation($this->config); |
$modification_observation = $gestionnaire_observation->modifierObservation($uid[0],$uid[1],$pairs); |
if(count($obs) == 1) { |
return $gestionnaire_observation->modifierObservation($uid[0], $obs[0], $pairs); |
} |
|
return true; |
// cas de mise à jour de multiples observations: |
$ret = GestionObservation::modifierMultiplesObservation($uid[0], $obs, $pairs); |
if($ret === FALSE) return FALSE; // JRest::badRequest(); |
if($ret === 0) { |
header('HTTP/1.0 304 Not Modified'); |
die; |
} |
|
header('HTTP/1.0 200 OK'); // et non pas une 201 ! |
// die(); // non, car incompatible avec PHPUnit |
// throw(new Exception()); // non, lance une 400 (cf JRest::updateElement()) |
// return TRUE; // non, lance une 201 |
// return FALSE; // non, lance une 400 |
|
die; // tant pis |
} |
|
/** |
* Supprime une liste d'observations |
* |