369 |
|
|
370 |
protected function get_instruction_data(string $dossier) { |
protected function get_instruction_data(string $dossier) { |
371 |
$val_instruction = null; |
$val_instruction = null; |
372 |
|
$instruction_with_doc = null; |
373 |
$inst_di = $this->f->get_inst__om_dbform(array( |
$inst_di = $this->f->get_inst__om_dbform(array( |
374 |
"obj" => "dossier", |
"obj" => "dossier", |
375 |
"idx" => $dossier, |
"idx" => $dossier, |
379 |
"idx" => $inst_di->get_last_instruction_decision(), |
"idx" => $inst_di->get_last_instruction_decision(), |
380 |
)); |
)); |
381 |
if (count($inst_instruction->val) > 0) { |
if (count($inst_instruction->val) > 0) { |
382 |
$val_instruction[$inst_instruction->getVal($inst_instruction->clePrimaire)] = $inst_instruction->get_json_data(); |
$val_instruction = array(); |
383 |
|
$instruction_data = $inst_instruction->get_json_data(); |
384 |
|
$val_instruction = $this->sort_instruction_data($instruction_data, $val_instruction); |
385 |
|
if ($instruction_data['om_fichier_instruction'] !== null |
386 |
|
&& $instruction_data['om_fichier_instruction'] !== '') { |
387 |
|
// |
388 |
|
$instruction_with_doc = $inst_instruction->getVal($inst_instruction->clePrimaire); |
389 |
|
} |
390 |
$inst_ev = $this->f->get_inst__om_dbform(array( |
$inst_ev = $this->f->get_inst__om_dbform(array( |
391 |
"obj" => "evenement", |
"obj" => "evenement", |
392 |
"idx" => $inst_instruction->getVal('evenement'), |
"idx" => $inst_instruction->getVal('evenement'), |
394 |
if ($inst_ev->getVal('retour') === 't') { |
if ($inst_ev->getVal('retour') === 't') { |
395 |
$instructions_related = $inst_instruction->get_related_instructions(); |
$instructions_related = $inst_instruction->get_related_instructions(); |
396 |
foreach ($instructions_related as $instruction) { |
foreach ($instructions_related as $instruction) { |
397 |
$inst_related_instruction = $this->f->get_inst__om_dbform(array( |
if ($instruction !== null && $instruction !== '') { |
398 |
"obj" => "instruction", |
$inst_related_instruction = $this->f->get_inst__om_dbform(array( |
399 |
"idx" => $instruction, |
"obj" => "instruction", |
400 |
)); |
"idx" => $instruction, |
401 |
$val_instruction[$instruction] = $inst_related_instruction->get_json_data(); |
)); |
402 |
|
$instruction_data = $inst_related_instruction->get_json_data(); |
403 |
|
$val_instruction = $this->sort_instruction_data($instruction_data, $val_instruction); |
404 |
|
if ($instruction_data['om_fichier_instruction'] !== null |
405 |
|
&& $instruction_data['om_fichier_instruction'] !== '') { |
406 |
|
// |
407 |
|
$instruction_with_doc = $inst_related_instruction->getVal($inst_related_instruction->clePrimaire); |
408 |
|
} |
409 |
|
} |
410 |
} |
} |
411 |
} |
} |
412 |
|
if ($instruction_with_doc !== null) { |
413 |
|
// |
414 |
|
$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); |
415 |
|
} |
416 |
} |
} |
417 |
return $val_instruction; |
return $val_instruction; |
418 |
} |
} |
419 |
|
|
420 |
|
protected function sort_instruction_data(array $values, array $res) { |
421 |
|
$fields = array( |
422 |
|
"date_envoi_signature", |
423 |
|
"date_retour_signature", |
424 |
|
"date_envoi_rar", |
425 |
|
"date_retour_rar", |
426 |
|
"date_envoi_controle_legalite", |
427 |
|
"date_retour_controle_legalite", |
428 |
|
"signataire_arrete", |
429 |
|
"om_fichier_instruction", |
430 |
|
"tacite", |
431 |
|
); |
432 |
|
foreach ($values as $key => $value) { |
433 |
|
if (in_array($key, $fields) === true) { |
434 |
|
if (array_key_exists($key, $res) === false |
435 |
|
&& $value !== null |
436 |
|
&& $value !== '') { |
437 |
|
// |
438 |
|
$res[$key] = $value; |
439 |
|
} elseif ($key === 'tacite' |
440 |
|
&& $value === 't') { |
441 |
|
// |
442 |
|
$res[$key] = $value; |
443 |
|
} |
444 |
|
} |
445 |
|
} |
446 |
|
return $res; |
447 |
|
} |
448 |
|
|
449 |
protected function get_document_numerise_data(string $dn) { |
protected function get_document_numerise_data(string $dn) { |
450 |
$val_dn = array(); |
$val_dn = array(); |
451 |
$inst_dn = $this->f->get_inst__om_dbform(array( |
$inst_dn = $this->f->get_inst__om_dbform(array( |