62 |
'object_id' => $params['val']['object_id'], |
'object_id' => $params['val']['object_id'], |
63 |
); |
); |
64 |
$task_exists = $this->task_exists($valF['type'], $valF['object_id']); |
$task_exists = $this->task_exists($valF['type'], $valF['object_id']); |
65 |
|
if ($valF['type'] === 'modification_DI' && $task_exists === false) { |
66 |
|
$task_exists = $this->task_exists('creation_DI', $valF['object_id']); |
67 |
|
} |
68 |
if ($task_exists !== false) { |
if ($task_exists !== false) { |
69 |
$inst_task = $this->f->get_inst__om_dbform(array( |
$inst_task = $this->f->get_inst__om_dbform(array( |
70 |
"obj" => "task", |
"obj" => "task", |
71 |
"idx" => $task_exists, |
"idx" => $task_exists, |
72 |
)); |
)); |
73 |
|
$update_state = $inst_task->getVal('state'); |
74 |
|
if (isset($params['update_val']['state']) === true) { |
75 |
|
$update_state = $params['update_val']['state']; |
76 |
|
} |
77 |
$update_params = array( |
$update_params = array( |
78 |
'val' => array( |
'val' => array( |
79 |
'state' => $inst_task->getVal('state'), |
'state' => $update_state, |
80 |
), |
), |
81 |
); |
); |
82 |
return $inst_task->update_task($update_params); |
return $inst_task->update_task($update_params); |
183 |
} |
} |
184 |
$list_tasks = array(); |
$list_tasks = array(); |
185 |
foreach ($res['result'] as $task) { |
foreach ($res['result'] as $task) { |
186 |
|
$task['timestamp_log'] = json_decode($task['timestamp_log'], true); |
187 |
$list_tasks[$task['task']] = $task; |
$list_tasks[$task['task']] = $task; |
188 |
} |
} |
189 |
printf(json_encode($list_tasks)); |
printf(json_encode($list_tasks)); |
195 |
"obj" => "dossier", |
"obj" => "dossier", |
196 |
"idx" => $dossier, |
"idx" => $dossier, |
197 |
)); |
)); |
198 |
$val_di = json_decode($inst_di->get_json_data(), true); |
$val_di = $inst_di->get_json_data(); |
199 |
if ($val_di['dossier_instruction_type_code'] === 'T') { |
if ($val_di['dossier_instruction_type_code'] === 'T') { |
200 |
$val_di['date_decision_transfert'] = $val_di['date_decision']; |
$val_di['date_decision_transfert'] = $val_di['date_decision']; |
201 |
} |
} |
210 |
"obj" => "dossier_autorisation", |
"obj" => "dossier_autorisation", |
211 |
"idx" => $da, |
"idx" => $da, |
212 |
)); |
)); |
213 |
$val_da = json_decode($inst_da->get_json_data(), true); |
$val_da = $inst_da->get_json_data(); |
214 |
return $val_da; |
return $val_da; |
215 |
} |
} |
216 |
|
|
232 |
$val_dt['am_exist_date_num'] = $val_dt['am_exist_date']; |
$val_dt['am_exist_date_num'] = $val_dt['am_exist_date']; |
233 |
} |
} |
234 |
} |
} |
235 |
|
// Correspond à la nomenclature de Plat'AU STATUT_INFO |
236 |
|
$val_dt['tax_statut_info'] = 'Déclaré'; |
237 |
|
// |
238 |
|
if ($inst_dt->is_tab_surf_ssdest_enabled() === true) { |
239 |
|
$fields_tab_surf_dest = $inst_dt->get_fields_tab_surf_dest(); |
240 |
|
foreach ($fields_tab_surf_dest as $field) { |
241 |
|
if (isset($val_dt[$field]) === true) { |
242 |
|
unset($val_dt[$field]); |
243 |
|
} |
244 |
|
} |
245 |
|
} else { |
246 |
|
$fields_tab_surf_ssdest = $inst_dt->get_fields_tab_surf_ssdest(); |
247 |
|
foreach ($fields_tab_surf_ssdest as $field) { |
248 |
|
if (isset($val_dt[$field]) === true) { |
249 |
|
unset($val_dt[$field]); |
250 |
|
} |
251 |
|
} |
252 |
|
} |
253 |
|
// Correspond à la nouvelle ligne CERFA v7 dans le DENSI imposition 1.2.3 |
254 |
|
if (isset($val_dt['tax_su_non_habit_surf2']) === true |
255 |
|
&& isset($val_dt['tax_su_non_habit_surf3']) === true |
256 |
|
&& (($val_dt['tax_su_non_habit_surf2'] !== null |
257 |
|
&& $val_dt['tax_su_non_habit_surf2'] !== '') |
258 |
|
|| ($val_dt['tax_su_non_habit_surf3'] !== null |
259 |
|
&& $val_dt['tax_su_non_habit_surf3'] !== ''))) { |
260 |
|
// |
261 |
|
$val_dt['tax_su_non_habit_surf8'] = intval($val_dt['tax_su_non_habit_surf2']) + intval($val_dt['tax_su_non_habit_surf3']); |
262 |
|
} |
263 |
|
if (isset($val_dt['tax_su_non_habit_surf_stat2']) === true |
264 |
|
&& isset($val_dt['tax_su_non_habit_surf_stat3']) === true |
265 |
|
&& (($val_dt['tax_su_non_habit_surf_stat2'] !== null |
266 |
|
&& $val_dt['tax_su_non_habit_surf_stat2'] !== '') |
267 |
|
|| ($val_dt['tax_su_non_habit_surf_stat3'] !== null |
268 |
|
&& $val_dt['tax_su_non_habit_surf_stat3'] !== ''))) { |
269 |
|
// |
270 |
|
$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']); |
271 |
|
} |
272 |
|
// Cas particulier d'un projet réduit à l'extension d'une habitation existante |
273 |
|
$particular_case = false; |
274 |
|
$fields_tab_crea_loc_hab = $inst_dt->get_fields_tab_crea_loc_hab(); |
275 |
|
foreach ($fields_tab_crea_loc_hab as $field) { |
276 |
|
if (isset($val_dt[$field]) === false |
277 |
|
|| (isset($val_dt[$field]) === true |
278 |
|
&& ($val_dt[$field] === null |
279 |
|
|| $val_dt[$field] === ''))) { |
280 |
|
// |
281 |
|
$particular_case = true; |
282 |
|
} |
283 |
|
} |
284 |
|
if ($particular_case === true) { |
285 |
|
if (isset($val_dt['tax_ext_pret']) === true |
286 |
|
&& $val_dt['tax_ext_pret'] === 'f') { |
287 |
|
// |
288 |
|
$val_dt['tax_su_princ_surf1'] = $val_dt['tax_surf_tot_cstr']; |
289 |
|
$val_dt['tax_su_princ_surf_stat1'] = $val_dt['tax_surf_loc_stat']; |
290 |
|
} |
291 |
|
if (isset($val_dt['tax_ext_pret']) === true |
292 |
|
&& $val_dt['tax_ext_pret'] === 't') { |
293 |
|
// |
294 |
|
if (isset($val_dt['tax_ext_desc']) === true) { |
295 |
|
if (preg_match('/[pP].*[lL].*[aA].*[iI]/', $val_dt['tax_ext_desc']) === 1 |
296 |
|
|| preg_match('/[lL].*[lL].*[tT].*[sS]/', $val_dt['tax_ext_desc']) === 1) { |
297 |
|
// |
298 |
|
$val_dt['tax_su_princ_surf2'] = $val_dt['tax_surf_tot_cstr']; |
299 |
|
$val_dt['tax_su_princ_surf_stat2'] = $val_dt['tax_surf_loc_stat']; |
300 |
|
} |
301 |
|
// if (preg_match('/[pP].*[tT].*[zZ]/', $val_dt['tax_ext_desc']) === 1) { |
302 |
|
// $val_dt['tax_su_princ_surf4'] = $val_dt['tax_surf_tot_cstr']; |
303 |
|
// $val_dt['tax_su_princ_surf_stat4'] = $val_dt['tax_surf_loc_stat']; |
304 |
|
// } |
305 |
|
// if (preg_match('/[pP].*[lL].*[uU].*[sS]/', $val_dt['tax_ext_desc']) === 1 |
306 |
|
// || preg_match('/[lL].*[eE].*[sS]/', $val_dt['tax_ext_desc']) === 1 |
307 |
|
// || preg_match('/[pP].*[sS].*[lL].*[aA]/', $val_dt['tax_ext_desc']) === 1 |
308 |
|
// || preg_match('/[pP].*[lL].*[sS]/', $val_dt['tax_ext_desc']) === 1 |
309 |
|
// || preg_match('/[lL].*[lL].*[sS]/', $val_dt['tax_ext_desc']) === 1) { |
310 |
|
// // |
311 |
|
// $val_dt['tax_su_princ_surf3'] = $val_dt['tax_surf_tot_cstr']; |
312 |
|
// $val_dt['tax_su_princ_surf_stat3'] = $val_dt['tax_surf_loc_stat']; |
313 |
|
// } |
314 |
|
} |
315 |
|
} |
316 |
|
} |
317 |
|
// Cas particulier de la surface taxable démolie |
318 |
|
if (isset($val_dt['tax_surf_tot_demo']) === true |
319 |
|
&& isset($val_dt['tax_surf_tax_demo']) === true |
320 |
|
&& ($val_dt['tax_surf_tot_demo'] === null |
321 |
|
|| $val_dt['tax_surf_tot_demo'] === '')) { |
322 |
|
// |
323 |
|
$val_dt['tax_surf_tot_demo'] = $val_dt['tax_surf_tax_demo']; |
324 |
|
} |
325 |
return $val_dt; |
return $val_dt; |
326 |
} |
} |
327 |
|
|
328 |
protected function get_external_uid($fk_idx, string $fk_idx_2) { |
protected function get_external_uid($fk_idx, string $fk_idx_2) { |
329 |
$inst_external_uid_da = $this->f->get_inst__by_other_idx(array( |
$inst_external_uid = $this->f->get_inst__by_other_idx(array( |
330 |
"obj" => "lien_id_interne_uid_externe", |
"obj" => "lien_id_interne_uid_externe", |
331 |
"fk_field" => 'object_id', |
"fk_field" => 'object_id', |
332 |
"fk_idx" => $fk_idx, |
"fk_idx" => $fk_idx, |
333 |
"fk_field_2" => 'object', |
"fk_field_2" => 'object', |
334 |
"fk_idx_2" => $fk_idx_2, |
"fk_idx_2" => $fk_idx_2, |
335 |
)); |
)); |
336 |
return $inst_external_uid_da->getVal('external_uid'); |
return $inst_external_uid->getVal('external_uid'); |
337 |
} |
} |
338 |
|
|
339 |
protected function get_demandeurs_data(string $dossier) { |
protected function get_demandeurs_data(string $dossier) { |
348 |
"obj" => "demandeur", |
"obj" => "demandeur", |
349 |
"idx" => $demandeur['demandeur'], |
"idx" => $demandeur['demandeur'], |
350 |
)); |
)); |
351 |
$val_demandeur[$demandeur['demandeur']] = json_decode($inst_demandeur->get_json_data(), true); |
$val_demandeur[$demandeur['demandeur']] = $inst_demandeur->get_json_data(); |
352 |
$val_demandeur[$demandeur['demandeur']]['petitionnaire_principal'] = $demandeur['petitionnaire_principal']; |
$val_demandeur[$demandeur['demandeur']]['petitionnaire_principal'] = $demandeur['petitionnaire_principal']; |
353 |
} |
} |
354 |
return $val_demandeur; |
return $val_demandeur; |
355 |
} |
} |
356 |
|
|
357 |
protected function get_architecte_data($architecte = null) { |
protected function get_architecte_data($architecte = null) { |
358 |
$val_architecte = array(); |
$val_architecte = null; |
359 |
if ($architecte !== null |
if ($architecte !== null |
360 |
&& $architecte !== '') { |
&& $architecte !== '') { |
361 |
// |
// |
363 |
"obj" => "architecte", |
"obj" => "architecte", |
364 |
"idx" => $architecte, |
"idx" => $architecte, |
365 |
)); |
)); |
366 |
$val_architecte = json_decode($inst_architecte->get_json_data(), true); |
$val_architecte = $inst_architecte->get_json_data(); |
367 |
} |
} |
368 |
return $val_architecte; |
return $val_architecte; |
369 |
} |
} |
370 |
|
|
371 |
protected function get_instruction_data(string $dossier) { |
protected function get_instruction_data(string $dossier, $type = 'decision') { |
372 |
$val_instruction = array(); |
$val_instruction = null; |
373 |
|
$instruction_with_doc = null; |
374 |
$inst_di = $this->f->get_inst__om_dbform(array( |
$inst_di = $this->f->get_inst__om_dbform(array( |
375 |
"obj" => "dossier", |
"obj" => "dossier", |
376 |
"idx" => $dossier, |
"idx" => $dossier, |
377 |
)); |
)); |
378 |
|
$idx = null; |
379 |
|
if ($type === 'decision') { |
380 |
|
$idx = $inst_di->get_last_instruction_decision(); |
381 |
|
} |
382 |
|
if ($type === 'incompletude') { |
383 |
|
$idx = $inst_di->get_last_instruction_incompletude(); |
384 |
|
} |
385 |
$inst_instruction = $this->f->get_inst__om_dbform(array( |
$inst_instruction = $this->f->get_inst__om_dbform(array( |
386 |
"obj" => "instruction", |
"obj" => "instruction", |
387 |
"idx" => $inst_di->get_last_instruction_decision(), |
"idx" => $idx, |
388 |
)); |
)); |
389 |
if (count($inst_instruction->val) > 0) { |
if (count($inst_instruction->val) > 0) { |
390 |
$val_instruction = json_decode($inst_instruction->get_json_data(), true); |
$val_instruction = array(); |
391 |
|
$instruction_data = $inst_instruction->get_json_data(); |
392 |
|
$val_instruction = $this->sort_instruction_data($instruction_data, $val_instruction); |
393 |
|
if ($instruction_data['om_fichier_instruction'] !== null |
394 |
|
&& $instruction_data['om_fichier_instruction'] !== '') { |
395 |
|
// |
396 |
|
$instruction_with_doc = $inst_instruction->getVal($inst_instruction->clePrimaire); |
397 |
|
} |
398 |
|
$inst_ev = $this->f->get_inst__om_dbform(array( |
399 |
|
"obj" => "evenement", |
400 |
|
"idx" => $inst_instruction->getVal('evenement'), |
401 |
|
)); |
402 |
|
if ($inst_ev->getVal('retour') === 't') { |
403 |
|
$instructions_related = $inst_instruction->get_related_instructions(); |
404 |
|
foreach ($instructions_related as $instruction) { |
405 |
|
if ($instruction !== null && $instruction !== '') { |
406 |
|
$inst_related_instruction = $this->f->get_inst__om_dbform(array( |
407 |
|
"obj" => "instruction", |
408 |
|
"idx" => $instruction, |
409 |
|
)); |
410 |
|
$instruction_data = $inst_related_instruction->get_json_data(); |
411 |
|
$val_instruction = $this->sort_instruction_data($instruction_data, $val_instruction); |
412 |
|
if ($instruction_data['om_fichier_instruction'] !== null |
413 |
|
&& $instruction_data['om_fichier_instruction'] !== '') { |
414 |
|
// |
415 |
|
$instruction_with_doc = $inst_related_instruction->getVal($inst_related_instruction->clePrimaire); |
416 |
|
} |
417 |
|
} |
418 |
|
} |
419 |
|
} |
420 |
|
if ($instruction_with_doc !== null) { |
421 |
|
// |
422 |
|
$val_instruction['path'] = sprintf('%s/%s&snippet=%s&obj=%s&champ=%s&id=%s', $_SERVER['HTTP_HOST'], 'openads/app/index.php?module=form', 'file', 'instruction', 'om_fichier_instruction', $instruction_with_doc); |
423 |
|
} |
424 |
} |
} |
425 |
return $val_instruction; |
return $val_instruction; |
426 |
} |
} |
427 |
|
|
428 |
|
protected function sort_instruction_data(array $values, array $res) { |
429 |
|
$fields = array( |
430 |
|
"date_envoi_signature", |
431 |
|
"date_retour_signature", |
432 |
|
"date_envoi_rar", |
433 |
|
"date_retour_rar", |
434 |
|
"date_envoi_controle_legalite", |
435 |
|
"date_retour_controle_legalite", |
436 |
|
"signataire_arrete", |
437 |
|
"om_fichier_instruction", |
438 |
|
"tacite", |
439 |
|
); |
440 |
|
foreach ($values as $key => $value) { |
441 |
|
if (in_array($key, $fields) === true) { |
442 |
|
if (array_key_exists($key, $res) === false |
443 |
|
&& $value !== null |
444 |
|
&& $value !== '') { |
445 |
|
// |
446 |
|
$res[$key] = $value; |
447 |
|
} elseif ($key === 'tacite' |
448 |
|
&& $value === 't') { |
449 |
|
// |
450 |
|
$res[$key] = $value; |
451 |
|
} |
452 |
|
} |
453 |
|
} |
454 |
|
return $res; |
455 |
|
} |
456 |
|
|
457 |
protected function get_document_numerise_data(string $dn) { |
protected function get_document_numerise_data(string $dn) { |
458 |
$val_dn = array(); |
$val_dn = array(); |
459 |
$inst_dn = $this->f->get_inst__om_dbform(array( |
$inst_dn = $this->f->get_inst__om_dbform(array( |
460 |
"obj" => "document_numerise", |
"obj" => "document_numerise", |
461 |
"idx" => $dn, |
"idx" => $dn, |
462 |
)); |
)); |
463 |
$val_dn = json_decode($inst_dn->get_json_data(), true); |
$val_dn = $inst_dn->get_json_data(); |
464 |
$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')); |
$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')); |
465 |
|
// Correspond à la nomenclature Plat'AU NATURE_PIECE |
466 |
|
$val_dn['nature'] = $val_dn['document_numerise_nature_libelle']; |
467 |
return $val_dn; |
return $val_dn; |
468 |
} |
} |
469 |
|
|
488 |
|
|
489 |
protected function view_form_json() { |
protected function view_form_json() { |
490 |
// Mise à jour des valeurs |
// Mise à jour des valeurs |
491 |
if ($this->f->get_submitted_get_value('valid') === 'true' |
if ($this->f->get_submitted_post_value('valid') === 'true' |
492 |
&& $this->f->get_submitted_get_value('state') !== null) { |
&& $this->f->get_submitted_post_value('state') !== null) { |
493 |
// |
// |
494 |
$params = array( |
$params = array( |
495 |
'val' => array( |
'val' => array( |
496 |
'state' => $this->f->get_submitted_get_value('state') |
'state' => $this->f->get_submitted_post_value('state') |
497 |
), |
), |
498 |
); |
); |
499 |
$update = $this->update_task($params); |
$update = $this->update_task($params); |
511 |
$this->f->displayMessage($message_class, $message); |
$this->f->displayMessage($message_class, $message); |
512 |
} |
} |
513 |
// |
// |
514 |
if ($this->f->get_submitted_get_value('valid') === 'true' |
if ($this->f->get_submitted_post_value('valid') === 'true' |
515 |
&& $this->f->get_submitted_get_value('external_uid') !== null) { |
&& $this->f->get_submitted_post_value('external_uid') !== null) { |
516 |
// |
// |
517 |
$inst_lien = $this->f->get_inst__om_dbform(array( |
$inst_lien = $this->f->get_inst__om_dbform(array( |
518 |
"obj" => "lien_id_interne_uid_externe", |
"obj" => "lien_id_interne_uid_externe", |
522 |
'lien_id_interne_uid_externe' => '', |
'lien_id_interne_uid_externe' => '', |
523 |
'object' => $this->get_lien_objet_by_type($this->getVal('type')), |
'object' => $this->get_lien_objet_by_type($this->getVal('type')), |
524 |
'object_id' => $this->getVal('object_id'), |
'object_id' => $this->getVal('object_id'), |
525 |
'external_uid' => $this->f->get_submitted_get_value('external_uid'), |
'external_uid' => $this->f->get_submitted_post_value('external_uid'), |
526 |
); |
); |
527 |
$add = $inst_lien->ajouter($valF); |
$add = $inst_lien->ajouter($valF); |
528 |
$message_class = "valid"; |
$message_class = "valid"; |
539 |
$this->f->displayMessage($message_class, $message); |
$this->f->displayMessage($message_class, $message); |
540 |
} |
} |
541 |
|
|
|
// Liste des valeurs à afficher |
|
|
$val = array(); |
|
|
// |
|
|
$val_task = array_combine($this->champs, $this->val); |
|
|
$val['task'] = $val_task; |
|
542 |
// |
// |
543 |
if ($this->getVal('type') === 'creation_DA') { |
if ($this->f->get_submitted_post_value('valid') === null) { |
544 |
$val['dossier_autorisation'] = $this->get_dossier_autorisation_data($this->getVal('object_id')); |
// Liste des valeurs à afficher |
545 |
$val['donnees_techniques'] = $this->get_donnees_techniques_data($this->getVal('object_id'), 'dossier_autorisation'); |
$val = array(); |
|
$val['dossier_autorisation_parcelle'] = $this->get_parcelles_data('dossier_autorisation', $val['dossier_autorisation']['dossier_autorisation']); |
|
|
$val_external_uid = array(); |
|
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier_autorisation']['dossier_autorisation'], 'dossier_autorisation'); |
|
|
$val['external_uid'] = $val_external_uid; |
|
|
} |
|
|
// |
|
|
if ($this->getVal('type') === 'creation_DI' |
|
|
|| $this->getVal('type') === 'modification_DI') { |
|
546 |
// |
// |
547 |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
$val_task = array_combine($this->champs, $this->val); |
548 |
$val['donnees_techniques'] = $this->get_donnees_techniques_data($this->getVal('object_id'), 'dossier_instruction'); |
foreach ($val_task as $key => $value) { |
549 |
$val['demandeur'] = $this->get_demandeurs_data($val['dossier']['dossier']); |
$val_task[$key] = strip_tags($value); |
550 |
$val['architecte'] = $this->get_architecte_data($val['donnees_techniques']['architecte']); |
} |
551 |
$val['dossier_parcelle'] = $this->get_parcelles_data('dossier', $val['dossier']['dossier']); |
$val_task['timestamp_log'] = json_decode($val_task['timestamp_log'], true); |
552 |
$val_external_uid = array(); |
$val['task'] = $val_task; |
553 |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
// |
554 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
if ($this->getVal('type') === 'creation_DA') { |
555 |
$val['external_uid'] = $val_external_uid; |
$val['dossier_autorisation'] = $this->get_dossier_autorisation_data($this->getVal('object_id')); |
556 |
} |
$val['donnees_techniques'] = $this->get_donnees_techniques_data($this->getVal('object_id'), 'dossier_autorisation'); |
557 |
// |
$val['dossier_autorisation_parcelle'] = $this->get_parcelles_data('dossier_autorisation', $val['dossier_autorisation']['dossier_autorisation']); |
558 |
if ($this->getVal('type') === 'qualification_DI') { |
$val_external_uid = array(); |
559 |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier_autorisation']['dossier_autorisation'], 'dossier_autorisation'); |
560 |
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier']); |
$val['external_uid'] = $val_external_uid; |
561 |
$val_external_uid = array(); |
} |
562 |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
// |
563 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
if ($this->getVal('type') === 'creation_DI' |
564 |
$val['external_uid'] = $val_external_uid; |
|| $this->getVal('type') === 'modification_DI' |
565 |
} |
|| $this->getVal('type') === 'depot_DI') { |
566 |
// |
// |
567 |
if ($this->getVal('type') === 'ajout_piece') { |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
568 |
$val['document_numerise'] = $this->get_document_numerise_data($this->getVal('object_id')); |
$val['donnees_techniques'] = $this->get_donnees_techniques_data($this->getVal('object_id'), 'dossier_instruction'); |
569 |
$val['dossier'] = $this->get_dossier_data($val['document_numerise']['dossier']); |
$val['demandeur'] = $this->get_demandeurs_data($val['dossier']['dossier']); |
570 |
$val_external_uid = array(); |
$architecte = isset($val['donnees_techniques']['architecte']) === true ? $val['donnees_techniques']['architecte'] : null; |
571 |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
$val['architecte'] = $this->get_architecte_data($architecte); |
572 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
$val['dossier_parcelle'] = $this->get_parcelles_data('dossier', $val['dossier']['dossier']); |
573 |
$val_external_uid['document_numerise'] = $this->get_external_uid($val['document_numerise']['document_numerise'], 'document_numerise'); |
$val_external_uid = array(); |
574 |
$val['external_uid'] = $val_external_uid; |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
575 |
} |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
576 |
|
$val['external_uid'] = $val_external_uid; |
577 |
|
} |
578 |
|
// |
579 |
|
if ($this->getVal('type') === 'qualification_DI') { |
580 |
|
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
581 |
|
$val_external_uid = array(); |
582 |
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
583 |
|
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
584 |
|
$val['external_uid'] = $val_external_uid; |
585 |
|
} |
586 |
|
// |
587 |
|
if ($this->getVal('type') === 'ajout_piece') { |
588 |
|
$val['document_numerise'] = $this->get_document_numerise_data($this->getVal('object_id')); |
589 |
|
$val['dossier'] = $this->get_dossier_data($val['document_numerise']['dossier']); |
590 |
|
$val_external_uid = array(); |
591 |
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
592 |
|
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
593 |
|
$val_external_uid['document_numerise'] = $this->get_external_uid($val['document_numerise']['document_numerise'], 'document_numerise'); |
594 |
|
$val['external_uid'] = $val_external_uid; |
595 |
|
} |
596 |
|
// |
597 |
|
if ($this->getVal('type') === 'decision_DI') { |
598 |
|
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
599 |
|
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier']); |
600 |
|
$val_external_uid = array(); |
601 |
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
602 |
|
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
603 |
|
$val['external_uid'] = $val_external_uid; |
604 |
|
} |
605 |
|
// |
606 |
|
if ($this->getVal('type') === 'incompletude_DI') { |
607 |
|
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
608 |
|
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier'], 'incompletude'); |
609 |
|
$val_external_uid = array(); |
610 |
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
611 |
|
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
612 |
|
$val['external_uid'] = $val_external_uid; |
613 |
|
} |
614 |
|
|
615 |
// Liste des valeurs affichée en JSON |
// Liste des valeurs affichée en JSON |
616 |
printf(json_encode($val)); |
printf(json_encode($val)); |
617 |
|
} |
618 |
} |
} |
619 |
|
|
620 |
protected function get_lien_objet_by_type($type) { |
protected function get_lien_objet_by_type($type) { |
623 |
if ($type === 'creation_DA') { |
if ($type === 'creation_DA') { |
624 |
$objet = 'dossier_autorisation'; |
$objet = 'dossier_autorisation'; |
625 |
} |
} |
626 |
if ($type === 'creation_DI' || $type = 'modification_DI') { |
if ($type === 'creation_DI' |
627 |
|
|| $type === 'depot_DI' |
628 |
|
|| $type === 'modification_DI' |
629 |
|
|| $type === 'qualification_DI' |
630 |
|
|| $type === 'decision_DI' |
631 |
|
|| $type === 'incompletude_DI') { |
632 |
|
// |
633 |
$objet = 'dossier'; |
$objet = 'dossier'; |
634 |
} |
} |
635 |
if ($type === 'ajout_piece') { |
if ($type === 'ajout_piece') { |