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", |
273 |
$particular_case = false; |
$particular_case = false; |
274 |
$fields_tab_crea_loc_hab = $inst_dt->get_fields_tab_crea_loc_hab(); |
$fields_tab_crea_loc_hab = $inst_dt->get_fields_tab_crea_loc_hab(); |
275 |
foreach ($fields_tab_crea_loc_hab as $field) { |
foreach ($fields_tab_crea_loc_hab as $field) { |
276 |
if (isset($field) === false |
if (isset($val_dt[$field]) === false |
277 |
|| (isset($field) === true |
|| (isset($val_dt[$field]) === true |
278 |
&& $field !== null |
&& ($val_dt[$field] === null |
279 |
&& $field !== '')) { |
|| $val_dt[$field] === ''))) { |
280 |
// |
// |
281 |
$particular_case = true; |
$particular_case = true; |
282 |
} |
} |
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 = null; |
$val_instruction = null; |
373 |
$instruction_with_doc = null; |
$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 = array(); |
$val_instruction = array(); |
419 |
} |
} |
420 |
if ($instruction_with_doc !== null) { |
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); |
$val_instruction['path'] = sprintf('%s&snippet=%s&obj=%s&champ=%s&id=%s', 'openads/app/index.php?module=form', 'file', 'instruction', 'om_fichier_instruction', $instruction_with_doc); |
423 |
} |
} |
424 |
} |
} |
425 |
return $val_instruction; |
return $val_instruction; |
461 |
"idx" => $dn, |
"idx" => $dn, |
462 |
)); |
)); |
463 |
$val_dn = $inst_dn->get_json_data(); |
$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&snippet=%s&obj=%s&champ=%s&id=%s', 'openads/app/index.php?module=form', 'file', 'document_numerise', 'uid', $this->getVal('object_id')); |
465 |
// Correspond à la nomenclature Plat'AU NATURE_PIECE |
// Correspond à la nomenclature Plat'AU NATURE_PIECE |
466 |
$val_dn['nature'] = 'Initiale'; |
$val_dn['nature'] = $val_dn['document_numerise_nature_libelle']; |
467 |
return $val_dn; |
return $val_dn; |
468 |
} |
} |
469 |
|
|
602 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
603 |
$val['external_uid'] = $val_external_uid; |
$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 |
|
if ($this->getVal('type') === 'completude_DI') { |
616 |
|
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
617 |
|
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier'], 'completude'); |
618 |
|
$val_external_uid = array(); |
619 |
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
620 |
|
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
621 |
|
$val['external_uid'] = $val_external_uid; |
622 |
|
} |
623 |
|
|
624 |
// Liste des valeurs affichée en JSON |
// Liste des valeurs affichée en JSON |
625 |
printf(json_encode($val)); |
printf(json_encode($val, JSON_UNESCAPED_SLASHES)); |
626 |
} |
} |
627 |
} |
} |
628 |
|
|
636 |
|| $type === 'depot_DI' |
|| $type === 'depot_DI' |
637 |
|| $type === 'modification_DI' |
|| $type === 'modification_DI' |
638 |
|| $type === 'qualification_DI' |
|| $type === 'qualification_DI' |
639 |
|| $type === 'decision_DI') { |
|| $type === 'decision_DI' |
640 |
|
|| $type === 'incompletude_DI' |
641 |
|
|| $type === 'completude_DI') { |
642 |
// |
// |
643 |
$objet = 'dossier'; |
$objet = 'dossier'; |
644 |
} |
} |