74 |
* erronees, on retourne 'BAD_DATA'. En cas d'echec on retourne 'KO'. |
* erronees, on retourne 'BAD_DATA'. En cas d'echec on retourne 'KO'. |
75 |
* |
* |
76 |
*/ |
*/ |
77 |
public function generic(&$data, $type, $contenu_val_verif) { |
public function generique(&$data, $type, $contenu_val_verif) { |
78 |
// check that the type of the message is good |
// check that the type of the message is good |
79 |
if ($data['type'] != $type) { |
if ($data['type'] != $type) { |
80 |
$this->setMessage('Le type de message n\'est pas correct.'); |
$this->setMessage('Le type de message n\'est pas correct.'); |
86 |
logger::instance()->log("REST request class ".get_class($this). |
logger::instance()->log("REST request class ".get_class($this). |
87 |
" - : db->query(.".$sql.")"); |
" - : db->query(.".$sql.")"); |
88 |
$res = $this->db->query($sql); |
$res = $this->db->query($sql); |
89 |
if ($this->checkDBError($res, 'Erreur lors de recuperation des dossiers')) { |
if ($this->verifieResultatBD($res, 'Erreur lors de recuperation des dossiers')) { |
90 |
logger::instance()->log("REST request class ". |
logger::instance()->log("REST request class ". |
91 |
get_class($this)." - ".$this->getMessage(), $type); |
get_class($this)." - ".$this->getMessage(), $type); |
92 |
return $this->KO; |
return $this->KO; |
111 |
|
|
112 |
// verifier que la date est correcte |
// verifier que la date est correcte |
113 |
$date_db = null; |
$date_db = null; |
114 |
if (!$this->timestampValid($data['date'], $date_db, true)) { |
if (!$this->timestampValide($data['date'], $date_db, true)) { |
115 |
$this->setMessage('Le date n\'est pas correct.'); |
$this->setMessage('Le date n\'est pas correct.'); |
116 |
return $this->BAD_DATA; |
return $this->BAD_DATA; |
117 |
} |
} |
161 |
|
|
162 |
$key_val_pairs = array('Complétude ERP ACC' => array('oui', 'non'), |
$key_val_pairs = array('Complétude ERP ACC' => array('oui', 'non'), |
163 |
'Motivation Complétude ERP ACC' => null); |
'Motivation Complétude ERP ACC' => null); |
164 |
$ret = $this->generic($data, |
$ret = $this->generique($data, |
165 |
$this->TYPE_COMPLETUDE_ACC, |
$this->TYPE_COMPLETUDE_ACC, |
166 |
$key_val_pairs); |
$key_val_pairs); |
167 |
|
|
186 |
|
|
187 |
$key_val_pairs = array('Complétude ERP SECU' => array('oui', 'non'), |
$key_val_pairs = array('Complétude ERP SECU' => array('oui', 'non'), |
188 |
'Motivation Complétude ERP SECU' => null); |
'Motivation Complétude ERP SECU' => null); |
189 |
$ret = $this->generic($data, |
$ret = $this->generique($data, |
190 |
$this->TYPE_COMPLETUDE_SECU, |
$this->TYPE_COMPLETUDE_SECU, |
191 |
$key_val_pairs); |
$key_val_pairs); |
192 |
|
|
210 |
$key_val_pairs = array('Confirmation ERP' => array('oui', 'non'), |
$key_val_pairs = array('Confirmation ERP' => array('oui', 'non'), |
211 |
'Type de dossier ERP' => null, |
'Type de dossier ERP' => null, |
212 |
'Catégorie de dossier ERP' => null); |
'Catégorie de dossier ERP' => null); |
213 |
$ret = $this->generic($data, |
$ret = $this->generique($data, |
214 |
$this->TYPE_QUALIFICATION_ERP, |
$this->TYPE_QUALIFICATION_ERP, |
215 |
$key_val_pairs); |
$key_val_pairs); |
216 |
|
|
233 |
*/ |
*/ |
234 |
public function dossier_enjeux($data) { |
public function dossier_enjeux($data) { |
235 |
$key_val_pairs = array('Dossier à enjeux ERP' => array('oui', 'non')); |
$key_val_pairs = array('Dossier à enjeux ERP' => array('oui', 'non')); |
236 |
$ret = $this->generic($data, |
$ret = $this->generique($data, |
237 |
$this->TYPE_DOSSIER_ENJEUX, |
$this->TYPE_DOSSIER_ENJEUX, |
238 |
$key_val_pairs); |
$key_val_pairs); |
239 |
|
|