1 |
<?php |
2 |
//$Id$ |
3 |
//gen openMairie le 14/04/2020 14:11 |
4 |
|
5 |
require_once "../gen/obj/task.class.php"; |
6 |
|
7 |
class task extends task_gen { |
8 |
|
9 |
/** |
10 |
* Définition des actions disponibles sur la classe. |
11 |
* |
12 |
* @return void |
13 |
*/ |
14 |
public function init_class_actions() { |
15 |
parent::init_class_actions(); |
16 |
// |
17 |
$this->class_actions[998] = array( |
18 |
"identifier" => "json_data", |
19 |
"view" => "view_json_data", |
20 |
"permission_suffix" => "consulter", |
21 |
); |
22 |
} |
23 |
|
24 |
protected function task_exists(string $type, string $object_id) { |
25 |
$query = sprintf(' |
26 |
SELECT task |
27 |
FROM %1$stask |
28 |
WHERE state != \'%2$s\' |
29 |
AND type = \'%3$s\' |
30 |
AND object_id = \'%4$s\' |
31 |
', |
32 |
DB_PREFIXE, |
33 |
'done', |
34 |
$type, |
35 |
$object_id |
36 |
); |
37 |
$res = $this->f->get_one_result_from_db_query($query); |
38 |
if ($res['result'] !== null && $res['result'] !== '') { |
39 |
return $res['result']; |
40 |
} |
41 |
return false; |
42 |
} |
43 |
|
44 |
/** |
45 |
* TREATMENT - add_task |
46 |
* Ajoute un enregistrement. |
47 |
* |
48 |
* @param array $params Tableau des paramètres |
49 |
* @return boolean |
50 |
*/ |
51 |
public function add_task($params = array()) { |
52 |
$this->begin_treatment(__METHOD__); |
53 |
$timestamp_log = json_encode(array( |
54 |
'creation_date' => date('Y-m-d H:i:s'), |
55 |
)); |
56 |
// Mise à jour du DI |
57 |
$valF = array( |
58 |
'task' => '', |
59 |
'type' => $params['val']['type'], |
60 |
'timestamp_log' => $timestamp_log, |
61 |
'state' => isset($params['val']['state']) === true ? $params['val']['state'] : 'new', |
62 |
'object_id' => $params['val']['object_id'], |
63 |
); |
64 |
$task_exists = $this->task_exists($valF['type'], $valF['object_id']); |
65 |
if ($task_exists !== false) { |
66 |
$inst_task = $this->f->get_inst__om_dbform(array( |
67 |
"obj" => "task", |
68 |
"idx" => $task_exists, |
69 |
)); |
70 |
$update_params = array( |
71 |
'val' => array( |
72 |
'state' => $inst_task->getVal('state'), |
73 |
), |
74 |
); |
75 |
return $inst_task->update_task($update_params); |
76 |
} |
77 |
$add = $this->ajouter($valF); |
78 |
if ($add === false) { |
79 |
$this->addToLog($this->msg, DEBUG_MODE); |
80 |
return $this->end_treatment(__METHOD__, false); |
81 |
} |
82 |
return $this->end_treatment(__METHOD__, true); |
83 |
} |
84 |
|
85 |
/** |
86 |
* TREATMENT - update_task |
87 |
* Met à jour l'enregistrement instancié. |
88 |
* |
89 |
* @param array $params Tableau des paramètres |
90 |
* @return boolean |
91 |
*/ |
92 |
public function update_task($params = array()) { |
93 |
$this->begin_treatment(__METHOD__); |
94 |
$timestamp_log = $this->get_timestamp_log(); |
95 |
if ($timestamp_log === false) { |
96 |
$this->addToLog(__('XXX'), DEBUG_MODE); |
97 |
return $this->end_treatment(__METHOD__, false); |
98 |
} |
99 |
array_push($timestamp_log, array( |
100 |
'modification_date' => date('Y-m-d H:i:s'), |
101 |
'state' => $params['val']['state'], |
102 |
'prev_state' => $this->getVal('state'), |
103 |
)); |
104 |
$timestamp_log = json_encode($timestamp_log); |
105 |
$valF = array( |
106 |
'task' => $this->getVal($this->clePrimaire), |
107 |
'type' => $this->getVal('type'), |
108 |
'timestamp_log' => $timestamp_log, |
109 |
'state' => $params['val']['state'], |
110 |
'object_id' => $this->getVal('object_id'), |
111 |
); |
112 |
$update = $this->modifier($valF); |
113 |
if ($update === false) { |
114 |
$this->addToLog($this->msg, DEBUG_MODE); |
115 |
return $this->end_treatment(__METHOD__, false); |
116 |
} |
117 |
return $this->end_treatment(__METHOD__, true); |
118 |
} |
119 |
|
120 |
/** |
121 |
* Récupère le journal d'horodatage dans le champ timestamp_log de |
122 |
* l'enregistrement instancié. |
123 |
* |
124 |
* @param array $params Tableau des paramètres |
125 |
* @return array sinon false en cas d'erreur |
126 |
*/ |
127 |
protected function get_timestamp_log($params = array()) { |
128 |
$val = $this->getVal('timestamp_log'); |
129 |
if ($val === '') { |
130 |
$val = json_encode(array()); |
131 |
} |
132 |
if($this->isJson($val) === false) { |
133 |
return false; |
134 |
} |
135 |
return json_decode($val, true); |
136 |
} |
137 |
|
138 |
/** |
139 |
* VIEW - view_json_data |
140 |
* Affiche l'enregistrement dans le format JSON. |
141 |
* |
142 |
* @return void |
143 |
*/ |
144 |
public function view_json_data() { |
145 |
$this->checkAccessibility(); |
146 |
$this->f->disableLog(); |
147 |
if ($this->getParameter('idx') !== ']' |
148 |
&& $this->getParameter('idx') !== '0') { |
149 |
// |
150 |
$this->view_form_json(); |
151 |
} |
152 |
else { |
153 |
$this->view_tab_json(); |
154 |
} |
155 |
} |
156 |
|
157 |
protected function view_tab_json() { |
158 |
$where = ''; |
159 |
if ($this->f->get_submitted_get_value('state') !== null |
160 |
&& $this->f->get_submitted_get_value('state') !== '') { |
161 |
// |
162 |
$where = sprintf(' WHERE state = \'%s\' ', $this->f->get_submitted_get_value('state')); |
163 |
} |
164 |
$query = sprintf(' |
165 |
SELECT |
166 |
* |
167 |
FROM %1$stask |
168 |
%2$s |
169 |
', |
170 |
DB_PREFIXE, |
171 |
$where |
172 |
); |
173 |
$res = $this->f->get_all_results_from_db_query($query, true); |
174 |
if ($res['code'] === 'KO') { |
175 |
return false; |
176 |
} |
177 |
$list_tasks = array(); |
178 |
foreach ($res['result'] as $task) { |
179 |
$task['timestamp_log'] = json_decode($task['timestamp_log'], true); |
180 |
$list_tasks[$task['task']] = $task; |
181 |
} |
182 |
printf(json_encode($list_tasks)); |
183 |
} |
184 |
|
185 |
protected function get_dossier_data(string $dossier) { |
186 |
$val_di = array(); |
187 |
$inst_di = $this->f->get_inst__om_dbform(array( |
188 |
"obj" => "dossier", |
189 |
"idx" => $dossier, |
190 |
)); |
191 |
$val_di = $inst_di->get_json_data(); |
192 |
if ($val_di['dossier_instruction_type_code'] === 'T') { |
193 |
$val_di['date_decision_transfert'] = $val_di['date_decision']; |
194 |
} |
195 |
unset($val_di['initial_dt']); |
196 |
unset($val_di['log_instructions']); |
197 |
return $val_di; |
198 |
} |
199 |
|
200 |
protected function get_dossier_autorisation_data(string $da) { |
201 |
$val_da = array(); |
202 |
$inst_da = $this->f->get_inst__om_dbform(array( |
203 |
"obj" => "dossier_autorisation", |
204 |
"idx" => $da, |
205 |
)); |
206 |
$val_da = $inst_da->get_json_data(); |
207 |
return $val_da; |
208 |
} |
209 |
|
210 |
protected function get_donnees_techniques_data(string $fk_idx, string $fk_field) { |
211 |
$val_dt = array(); |
212 |
$inst_dt = $this->f->get_inst__by_other_idx(array( |
213 |
"obj" => "donnees_techniques", |
214 |
"fk_field" => $fk_field, |
215 |
"fk_idx" => $fk_idx, |
216 |
)); |
217 |
$val_dt = array( |
218 |
'donnees_techniques' => $inst_dt->getVal($inst_dt->clePrimaire), |
219 |
'cerfa' => $inst_dt->getVal('cerfa'), |
220 |
); |
221 |
$val_dt = array_merge($val_dt, $inst_dt->get_donnees_techniques_applicables()); |
222 |
if (isset($val_dt['am_exist_date']) === true) { |
223 |
$val_dt['am_exist_date_num'] = ''; |
224 |
if (is_numeric($val_dt['am_exist_date']) === true) { |
225 |
$val_dt['am_exist_date_num'] = $val_dt['am_exist_date']; |
226 |
} |
227 |
} |
228 |
// Correspond à la nomenclature de Plat'AU STATUT_INFO |
229 |
$val_dt['tax_statut_info'] = 'Déclaré'; |
230 |
// |
231 |
if ($inst_dt->is_tab_surf_ssdest_enabled() === true) { |
232 |
$fields_tab_surf_dest = $inst_dt->get_fields_tab_surf_dest(); |
233 |
foreach ($fields_tab_surf_dest as $field) { |
234 |
if (isset($val_dt[$field]) === true) { |
235 |
unset($val_dt[$field]); |
236 |
} |
237 |
} |
238 |
} else { |
239 |
$fields_tab_surf_ssdest = $inst_dt->get_fields_tab_surf_ssdest(); |
240 |
foreach ($fields_tab_surf_ssdest as $field) { |
241 |
if (isset($val_dt[$field]) === true) { |
242 |
unset($val_dt[$field]); |
243 |
} |
244 |
} |
245 |
} |
246 |
// Correspond à la nouvelle ligne CERFA v7 dans le DENSI imposition 1.2.3 |
247 |
if (isset($val_dt['tax_su_non_habit_surf2']) === true |
248 |
&& isset($val_dt['tax_su_non_habit_surf3']) === true) { |
249 |
// |
250 |
$val_dt['tax_su_non_habit_surf8'] = intval($val_dt['tax_su_non_habit_surf2']) + intval($val_dt['tax_su_non_habit_surf3']); |
251 |
} |
252 |
if (isset($val_dt['tax_su_non_habit_surf_stat2']) === true |
253 |
&& isset($val_dt['tax_su_non_habit_surf_stat3']) === true) { |
254 |
// |
255 |
$val_dt['tax_su_non_habit_surf_stat8'] = intval($val_dt['tax_su_non_habit_surf_stat2']) + intval($val_dt['tax_su_non_habit_surf_stat3']); |
256 |
} |
257 |
// Cas particulier d'un projet réduit à l'extension d'une habitation existante |
258 |
$particular_case = false; |
259 |
$fields_tab_crea_loc_hab = $inst_dt->get_fields_tab_crea_loc_hab(); |
260 |
foreach ($fields_tab_crea_loc_hab as $field) { |
261 |
if (isset($field) === false |
262 |
|| (isset($field) === true |
263 |
&& $field !== null |
264 |
&& $field !== '')) { |
265 |
// |
266 |
$particular_case = true; |
267 |
} |
268 |
} |
269 |
if ($particular_case === true) { |
270 |
if (isset($val_dt['tax_ext_pret']) === true |
271 |
&& $val_dt['tax_ext_pret'] === 'f') { |
272 |
// |
273 |
$val_dt['tax_su_princ_surf1'] = $val_dt['tax_surf_tot_cstr']; |
274 |
$val_dt['tax_su_princ_surf_stat1'] = $val_dt['tax_surf_loc_stat']; |
275 |
} |
276 |
if (isset($val_dt['tax_ext_pret']) === true |
277 |
&& $val_dt['tax_ext_pret'] === 't') { |
278 |
// |
279 |
if (isset($val_dt['tax_ext_desc']) === true) { |
280 |
if (preg_match('/[pP].*[lL].*[aA].*[iI]/', $val_dt['tax_ext_desc']) === 1 |
281 |
|| preg_match('/[lL].*[lL].*[tT].*[sS]/', $val_dt['tax_ext_desc']) === 1) { |
282 |
// |
283 |
$val_dt['tax_su_princ_surf2'] = $val_dt['tax_surf_tot_cstr']; |
284 |
$val_dt['tax_su_princ_surf_stat2'] = $val_dt['tax_surf_loc_stat']; |
285 |
} |
286 |
// if (preg_match('/[pP].*[tT].*[zZ]/', $val_dt['tax_ext_desc']) === 1) { |
287 |
// $val_dt['tax_su_princ_surf4'] = $val_dt['tax_surf_tot_cstr']; |
288 |
// $val_dt['tax_su_princ_surf_stat4'] = $val_dt['tax_surf_loc_stat']; |
289 |
// } |
290 |
// if (preg_match('/[pP].*[lL].*[uU].*[sS]/', $val_dt['tax_ext_desc']) === 1 |
291 |
// || preg_match('/[lL].*[eE].*[sS]/', $val_dt['tax_ext_desc']) === 1 |
292 |
// || preg_match('/[pP].*[sS].*[lL].*[aA]/', $val_dt['tax_ext_desc']) === 1 |
293 |
// || preg_match('/[pP].*[lL].*[sS]/', $val_dt['tax_ext_desc']) === 1 |
294 |
// || preg_match('/[lL].*[lL].*[sS]/', $val_dt['tax_ext_desc']) === 1) { |
295 |
// // |
296 |
// $val_dt['tax_su_princ_surf3'] = $val_dt['tax_surf_tot_cstr']; |
297 |
// $val_dt['tax_su_princ_surf_stat3'] = $val_dt['tax_surf_loc_stat']; |
298 |
// } |
299 |
} |
300 |
} |
301 |
} |
302 |
// Cas particulier de la surface taxable démolie |
303 |
if (isset($val_dt['tax_surf_tot_demo']) === true |
304 |
&& isset($val_dt['tax_surf_tax_demo']) === true |
305 |
&& ($val_dt['tax_surf_tot_demo'] === null |
306 |
|| $val_dt['tax_surf_tot_demo'] === '')) { |
307 |
// |
308 |
$val_dt['tax_surf_tot_demo'] = $val_dt['tax_surf_tax_demo']; |
309 |
} |
310 |
return $val_dt; |
311 |
} |
312 |
|
313 |
protected function get_external_uid($fk_idx, string $fk_idx_2) { |
314 |
$inst_external_uid = $this->f->get_inst__by_other_idx(array( |
315 |
"obj" => "lien_id_interne_uid_externe", |
316 |
"fk_field" => 'object_id', |
317 |
"fk_idx" => $fk_idx, |
318 |
"fk_field_2" => 'object', |
319 |
"fk_idx_2" => $fk_idx_2, |
320 |
)); |
321 |
return $inst_external_uid->getVal('external_uid'); |
322 |
} |
323 |
|
324 |
protected function get_demandeurs_data(string $dossier) { |
325 |
$val_demandeur = array(); |
326 |
$inst_di = $this->f->get_inst__om_dbform(array( |
327 |
"obj" => "dossier", |
328 |
"idx" => $dossier, |
329 |
)); |
330 |
$list_demandeurs = $inst_di->get_demandeurs(); |
331 |
foreach ($list_demandeurs as $demandeur) { |
332 |
$inst_demandeur = $this->f->get_inst__om_dbform(array( |
333 |
"obj" => "demandeur", |
334 |
"idx" => $demandeur['demandeur'], |
335 |
)); |
336 |
$val_demandeur[$demandeur['demandeur']] = $inst_demandeur->get_json_data(); |
337 |
$val_demandeur[$demandeur['demandeur']]['petitionnaire_principal'] = $demandeur['petitionnaire_principal']; |
338 |
// Valeur par défaut pour expériementation sequence 1 |
339 |
$val_demandeur[$demandeur['demandeur']]['commerciale'] = 'f'; |
340 |
} |
341 |
return $val_demandeur; |
342 |
} |
343 |
|
344 |
protected function get_architecte_data($architecte = null) { |
345 |
$val_architecte = null; |
346 |
if ($architecte !== null |
347 |
&& $architecte !== '') { |
348 |
// |
349 |
$inst_architecte = $this->f->get_inst__om_dbform(array( |
350 |
"obj" => "architecte", |
351 |
"idx" => $architecte, |
352 |
)); |
353 |
$val_architecte = $inst_architecte->get_json_data(); |
354 |
} |
355 |
return $val_architecte; |
356 |
} |
357 |
|
358 |
protected function get_instruction_data(string $dossier) { |
359 |
$val_instruction = array(); |
360 |
$inst_di = $this->f->get_inst__om_dbform(array( |
361 |
"obj" => "dossier", |
362 |
"idx" => $dossier, |
363 |
)); |
364 |
$inst_instruction = $this->f->get_inst__om_dbform(array( |
365 |
"obj" => "instruction", |
366 |
"idx" => $inst_di->get_last_instruction_decision(), |
367 |
)); |
368 |
if (count($inst_instruction->val) > 0) { |
369 |
$val_instruction = $inst_instruction->get_json_data(); |
370 |
} |
371 |
return $val_instruction; |
372 |
} |
373 |
|
374 |
protected function get_document_numerise_data(string $dn) { |
375 |
$val_dn = array(); |
376 |
$inst_dn = $this->f->get_inst__om_dbform(array( |
377 |
"obj" => "document_numerise", |
378 |
"idx" => $dn, |
379 |
)); |
380 |
$val_dn = $inst_dn->get_json_data(); |
381 |
$val_dn['path'] = sprintf('%s/%s&snippet=%s&obj=%s&champ=%s&id=%s', $_SERVER['HTTP_HOST'], 'openads/app/index.php?module=form', 'file', 'document_numerise', 'uid', $this->getVal('object_id')); |
382 |
// Correspond à la nomenclature Plat'AU NATURE_PIECE |
383 |
$val_dn['nature'] = 'Initiale'; |
384 |
return $val_dn; |
385 |
} |
386 |
|
387 |
protected function get_parcelles_data(string $object, string $idx) { |
388 |
$val_dp = array(); |
389 |
$inst_di = $this->f->get_inst__om_dbform(array( |
390 |
"obj" => $object, |
391 |
"idx" => $idx, |
392 |
)); |
393 |
$list_parcelles = $inst_di->get_parcelles(); |
394 |
$no_ordre = 1; |
395 |
foreach ($list_parcelles as $parcelle) { |
396 |
$val_dp[$parcelle[$object.'_parcelle']] = array( |
397 |
$object.'_parcelle' => $parcelle[$object.'_parcelle'], |
398 |
'libelle' => $parcelle['libelle'], |
399 |
'no_ordre' => $no_ordre, |
400 |
); |
401 |
$no_ordre++; |
402 |
} |
403 |
return $val_dp; |
404 |
} |
405 |
|
406 |
protected function view_form_json() { |
407 |
// Mise à jour des valeurs |
408 |
if ($this->f->get_submitted_post_value('valid') === 'true' |
409 |
&& $this->f->get_submitted_post_value('state') !== null) { |
410 |
// |
411 |
$params = array( |
412 |
'val' => array( |
413 |
'state' => $this->f->get_submitted_post_value('state') |
414 |
), |
415 |
); |
416 |
$update = $this->update_task($params); |
417 |
$message_class = "valid"; |
418 |
$message = $this->msg; |
419 |
if ($update === false) { |
420 |
$this->addToLog($this->msg, DEBUG_MODE); |
421 |
$message_class = "error"; |
422 |
$message = sprintf( |
423 |
'%s %s', |
424 |
__('Impossible de mettre à jour la tâche.'), |
425 |
__('Veuillez contacter votre administrateur.') |
426 |
); |
427 |
} |
428 |
$this->f->displayMessage($message_class, $message); |
429 |
} |
430 |
// |
431 |
if ($this->f->get_submitted_post_value('valid') === 'true' |
432 |
&& $this->f->get_submitted_post_value('external_uid') !== null) { |
433 |
// |
434 |
$inst_lien = $this->f->get_inst__om_dbform(array( |
435 |
"obj" => "lien_id_interne_uid_externe", |
436 |
"idx" => ']', |
437 |
)); |
438 |
$valF = array( |
439 |
'lien_id_interne_uid_externe' => '', |
440 |
'object' => $this->get_lien_objet_by_type($this->getVal('type')), |
441 |
'object_id' => $this->getVal('object_id'), |
442 |
'external_uid' => $this->f->get_submitted_post_value('external_uid'), |
443 |
); |
444 |
$add = $inst_lien->ajouter($valF); |
445 |
$message_class = "valid"; |
446 |
$message = $inst_lien->msg; |
447 |
if ($add === false) { |
448 |
$this->addToLog($inst_lien->msg, DEBUG_MODE); |
449 |
$message_class = "error"; |
450 |
$message = sprintf( |
451 |
'%s %s', |
452 |
__("Impossible de mettre à jour le lien entre l'identifiant interne et l'identifiant de l'application externe."), |
453 |
__('Veuillez contacter votre administrateur.') |
454 |
); |
455 |
} |
456 |
$this->f->displayMessage($message_class, $message); |
457 |
} |
458 |
|
459 |
// |
460 |
if ($this->f->get_submitted_post_value('valid') === null) { |
461 |
// Liste des valeurs à afficher |
462 |
$val = array(); |
463 |
// |
464 |
$val_task = array_combine($this->champs, $this->val); |
465 |
foreach ($val_task as $key => $value) { |
466 |
$val_task[$key] = strip_tags($value); |
467 |
} |
468 |
$val_task['timestamp_log'] = json_decode($val_task['timestamp_log'], true); |
469 |
$val['task'] = $val_task; |
470 |
// |
471 |
if ($this->getVal('type') === 'creation_DA') { |
472 |
$val['dossier_autorisation'] = $this->get_dossier_autorisation_data($this->getVal('object_id')); |
473 |
$val['donnees_techniques'] = $this->get_donnees_techniques_data($this->getVal('object_id'), 'dossier_autorisation'); |
474 |
$val['dossier_autorisation_parcelle'] = $this->get_parcelles_data('dossier_autorisation', $val['dossier_autorisation']['dossier_autorisation']); |
475 |
$val_external_uid = array(); |
476 |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier_autorisation']['dossier_autorisation'], 'dossier_autorisation'); |
477 |
$val['external_uid'] = $val_external_uid; |
478 |
} |
479 |
// |
480 |
if ($this->getVal('type') === 'creation_DI' |
481 |
|| $this->getVal('type') === 'modification_DI') { |
482 |
// |
483 |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
484 |
$val['donnees_techniques'] = $this->get_donnees_techniques_data($this->getVal('object_id'), 'dossier_instruction'); |
485 |
$val['demandeur'] = $this->get_demandeurs_data($val['dossier']['dossier']); |
486 |
$architecte = isset($val['donnees_techniques']['architecte']) === true ? $val['donnees_techniques']['architecte'] : null; |
487 |
$val['architecte'] = $this->get_architecte_data($architecte); |
488 |
$val['dossier_parcelle'] = $this->get_parcelles_data('dossier', $val['dossier']['dossier']); |
489 |
$val_external_uid = array(); |
490 |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
491 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
492 |
$val['external_uid'] = $val_external_uid; |
493 |
} |
494 |
// |
495 |
if ($this->getVal('type') === 'qualification_DI') { |
496 |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
497 |
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier']); |
498 |
$val_external_uid = array(); |
499 |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
500 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
501 |
$val['external_uid'] = $val_external_uid; |
502 |
} |
503 |
// |
504 |
if ($this->getVal('type') === 'ajout_piece') { |
505 |
$val['document_numerise'] = $this->get_document_numerise_data($this->getVal('object_id')); |
506 |
$val['dossier'] = $this->get_dossier_data($val['document_numerise']['dossier']); |
507 |
$val_external_uid = array(); |
508 |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
509 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
510 |
$val_external_uid['document_numerise'] = $this->get_external_uid($val['document_numerise']['document_numerise'], 'document_numerise'); |
511 |
$val['external_uid'] = $val_external_uid; |
512 |
} |
513 |
|
514 |
// Liste des valeurs affichée en JSON |
515 |
printf(json_encode($val)); |
516 |
} |
517 |
} |
518 |
|
519 |
protected function get_lien_objet_by_type($type) { |
520 |
// |
521 |
$objet = ''; |
522 |
if ($type === 'creation_DA') { |
523 |
$objet = 'dossier_autorisation'; |
524 |
} |
525 |
if ($type === 'creation_DI' || $type === 'modification_DI') { |
526 |
$objet = 'dossier'; |
527 |
} |
528 |
if ($type === 'ajout_piece') { |
529 |
$objet = 'document_numerise'; |
530 |
} |
531 |
return $objet; |
532 |
} |
533 |
} |