67 |
"obj" => "task", |
"obj" => "task", |
68 |
"idx" => $task_exists, |
"idx" => $task_exists, |
69 |
)); |
)); |
70 |
|
$update_state = $inst_task->getVal('state'); |
71 |
|
if (isset($params['update_val']['state']) === true) { |
72 |
|
$update_state = $params['update_val']['state']; |
73 |
|
} |
74 |
$update_params = array( |
$update_params = array( |
75 |
'val' => array( |
'val' => array( |
76 |
'state' => $inst_task->getVal('state'), |
'state' => $update_state, |
77 |
), |
), |
78 |
); |
); |
79 |
return $inst_task->update_task($update_params); |
return $inst_task->update_task($update_params); |
368 |
} |
} |
369 |
|
|
370 |
protected function get_instruction_data(string $dossier) { |
protected function get_instruction_data(string $dossier) { |
371 |
$val_instruction = array(); |
$val_instruction = null; |
372 |
$inst_di = $this->f->get_inst__om_dbform(array( |
$inst_di = $this->f->get_inst__om_dbform(array( |
373 |
"obj" => "dossier", |
"obj" => "dossier", |
374 |
"idx" => $dossier, |
"idx" => $dossier, |
378 |
"idx" => $inst_di->get_last_instruction_decision(), |
"idx" => $inst_di->get_last_instruction_decision(), |
379 |
)); |
)); |
380 |
if (count($inst_instruction->val) > 0) { |
if (count($inst_instruction->val) > 0) { |
381 |
$val_instruction = $inst_instruction->get_json_data(); |
$val_instruction[$inst_instruction->getVal($inst_instruction->clePrimaire)] = $inst_instruction->get_json_data(); |
382 |
|
$inst_ev = $this->f->get_inst__om_dbform(array( |
383 |
|
"obj" => "evenement", |
384 |
|
"idx" => $inst_instruction->getVal('evenement'), |
385 |
|
)); |
386 |
|
if ($inst_ev->getVal('retour') === 't') { |
387 |
|
$instructions_related = $inst_instruction->get_related_instructions(); |
388 |
|
foreach ($instructions_related as $instruction) { |
389 |
|
$inst_related_instruction = $this->f->get_inst__om_dbform(array( |
390 |
|
"obj" => "instruction", |
391 |
|
"idx" => $instruction, |
392 |
|
)); |
393 |
|
$val_instruction[$instruction] = $inst_related_instruction->get_json_data(); |
394 |
|
} |
395 |
|
} |
396 |
} |
} |
397 |
return $val_instruction; |
return $val_instruction; |
398 |
} |
} |
520 |
// |
// |
521 |
if ($this->getVal('type') === 'qualification_DI') { |
if ($this->getVal('type') === 'qualification_DI') { |
522 |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
|
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier']); |
|
523 |
$val_external_uid = array(); |
$val_external_uid = array(); |
524 |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
525 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
535 |
$val_external_uid['document_numerise'] = $this->get_external_uid($val['document_numerise']['document_numerise'], 'document_numerise'); |
$val_external_uid['document_numerise'] = $this->get_external_uid($val['document_numerise']['document_numerise'], 'document_numerise'); |
536 |
$val['external_uid'] = $val_external_uid; |
$val['external_uid'] = $val_external_uid; |
537 |
} |
} |
538 |
|
// |
539 |
|
if ($this->getVal('type') === 'decision_DI') { |
540 |
|
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
541 |
|
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier']); |
542 |
|
$val_external_uid = array(); |
543 |
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
544 |
|
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
545 |
|
$val['external_uid'] = $val_external_uid; |
546 |
|
} |
547 |
|
|
548 |
// Liste des valeurs affichée en JSON |
// Liste des valeurs affichée en JSON |
549 |
printf(json_encode($val)); |
printf(json_encode($val)); |
556 |
if ($type === 'creation_DA') { |
if ($type === 'creation_DA') { |
557 |
$objet = 'dossier_autorisation'; |
$objet = 'dossier_autorisation'; |
558 |
} |
} |
559 |
if ($type === 'creation_DI' || $type === 'modification_DI') { |
if ($type === 'creation_DI' |
560 |
|
|| $type === 'modification_DI' |
561 |
|
|| $type === 'qualification_DI' |
562 |
|
|| $type === 'decision_DI') { |
563 |
|
// |
564 |
$objet = 'dossier'; |
$objet = 'dossier'; |
565 |
} |
} |
566 |
if ($type === 'ajout_piece') { |
if ($type === 'ajout_piece') { |