/trunk/jrest/services/Inventory.php |
---|
41,7 → 41,7 |
$parametres_recherche = array(array('ce_utilisateur',$uid[0]),array('ordre',$uid[1])); |
$chercheur_observations = new RechercheObservation($this->config); |
$retour_recherche = $chercheur_observations->rechercherObservations($uid[0], $parametres_recherche, 0, 1); |
$retour_recherche = $chercheur_observations->rechercherObservations($uid[0], $parametres_recherche, 0, 1)->get(); |
$observation = array(); |
if(is_array($retour_recherche) && count($retour_recherche) > 0) { |
/trunk/jrest/services/CelObs.php |
---|
31,7 → 31,7 |
if (isset($idObs) && preg_match('/^[0-9]+$/', $idObs)) { |
$criteres = array('id_observation' => $idObs, 'transmission' => 1); |
$obsTrouvee = $this->rechercheObs->rechercherObservations(null, $criteres, 0, 1); |
$obsTrouvee = $this->rechercheObs->rechercherObservations(null, $criteres, 0, 1)->get(); |
$observation = array(); |
if (is_array($obsTrouvee) && count($obsTrouvee) > 0) { |
/trunk/jrest/services/CelWidgetExport.php |
---|
168,7 → 168,7 |
unset($criteres['debut']); |
unset($criteres['format']); |
$observations = $chercheur_observations->rechercherObservations(null, $criteres, $debut, $limite); |
$observations = $chercheur_observations->rechercherObservations(null, $criteres, $debut, $limite)->get(); |
switch($this->format) { |
case 'csv': |
$csv = $this->convertirEnCsv($observations); |
/trunk/jrest/services/InventoryExport.php |
---|
81,7 → 81,7 |
$numero_page = isset($criteres['numero_page']) ? $criteres['numero_page'] : 0; |
$limite = isset($criteres['limite']) ? $criteres['limite'] : 0; |
$observations = $chercheur_observations->rechercherObservations($uid[0], $criteres, $numero_page, $limite); |
$observations = $chercheur_observations->rechercherObservations($uid[0], $criteres, $numero_page, $limite)->get(); |
$ids_obs = array(); |
$indices_lignes_obs = array(); |
/trunk/jrest/services/InventoryObservationList.php |
---|
60,7 → 60,7 |
$debut = $taille_page*$numero_page ; |
$retour = $chercheur_observations->rechercherObservations($uid[0], $criteres, $debut, $taille_page); |
$retour = $chercheur_observations->rechercherObservations($uid[0], $criteres, $debut, $taille_page)->get(); |
$retour_formate = $chercheur_observations->formaterPourEnvoiCel($retour); |
$this->envoyerJson($retour_formate); |
/trunk/jrest/lib/RechercheObservation.php |
---|
14,6 → 14,8 |
*/ |
class RechercheObservation extends Cel { |
public $requete_selection_observations; |
public function obtenirIdObservationsPourOrdre($id_utilisateur, $ordre) { |
$requete_selection_id = 'SELECT id_observation FROM cel_obs WHERE ordre '; |
55,10 → 57,13 |
$requete_selection_observations .= $id_utilisateur == null ? ' ORDER BY id_observation, ordre ' : ' ORDER BY ordre '; |
$requete_selection_observations .= ($debut == 0 && $limite == 0) ? '' : ' LIMIT '.$debut.','.$limite ; |
$resultats_observations = array(); |
$resultats_observations = $this->executerRequete($requete_selection_observations); |
$this->requete_selection_observations = $requete_selection_observations; |
return $this; |
} |
return $resultats_observations; |
public function get() { |
if(!$this->requete_selection_observations) return FALSE; |
return $this->executerRequete($this->requete_selection_observations); |
} |
public function compterObservations($id_utilisateur = null, $criteres = array()) { |