347 |
)); |
)); |
348 |
$val_demandeur[$demandeur['demandeur']] = $inst_demandeur->get_json_data(); |
$val_demandeur[$demandeur['demandeur']] = $inst_demandeur->get_json_data(); |
349 |
$val_demandeur[$demandeur['demandeur']]['petitionnaire_principal'] = $demandeur['petitionnaire_principal']; |
$val_demandeur[$demandeur['demandeur']]['petitionnaire_principal'] = $demandeur['petitionnaire_principal']; |
|
// Valeur par défaut pour expériementation sequence 1 |
|
|
$val_demandeur[$demandeur['demandeur']]['commerciale'] = 'f'; |
|
350 |
} |
} |
351 |
return $val_demandeur; |
return $val_demandeur; |
352 |
} |
} |
367 |
|
|
368 |
protected function get_instruction_data(string $dossier) { |
protected function get_instruction_data(string $dossier) { |
369 |
$val_instruction = null; |
$val_instruction = null; |
370 |
|
$instruction_with_doc = null; |
371 |
$inst_di = $this->f->get_inst__om_dbform(array( |
$inst_di = $this->f->get_inst__om_dbform(array( |
372 |
"obj" => "dossier", |
"obj" => "dossier", |
373 |
"idx" => $dossier, |
"idx" => $dossier, |
377 |
"idx" => $inst_di->get_last_instruction_decision(), |
"idx" => $inst_di->get_last_instruction_decision(), |
378 |
)); |
)); |
379 |
if (count($inst_instruction->val) > 0) { |
if (count($inst_instruction->val) > 0) { |
380 |
$val_instruction[$inst_instruction->getVal($inst_instruction->clePrimaire)] = $inst_instruction->get_json_data(); |
$val_instruction = array(); |
381 |
|
$instruction_data = $inst_instruction->get_json_data(); |
382 |
|
$val_instruction = $this->sort_instruction_data($instruction_data, $val_instruction); |
383 |
|
if ($instruction_data['om_fichier_instruction'] !== null |
384 |
|
&& $instruction_data['om_fichier_instruction'] !== '') { |
385 |
|
// |
386 |
|
$instruction_with_doc = $inst_instruction->getVal($inst_instruction->clePrimaire); |
387 |
|
} |
388 |
$inst_ev = $this->f->get_inst__om_dbform(array( |
$inst_ev = $this->f->get_inst__om_dbform(array( |
389 |
"obj" => "evenement", |
"obj" => "evenement", |
390 |
"idx" => $inst_instruction->getVal('evenement'), |
"idx" => $inst_instruction->getVal('evenement'), |
392 |
if ($inst_ev->getVal('retour') === 't') { |
if ($inst_ev->getVal('retour') === 't') { |
393 |
$instructions_related = $inst_instruction->get_related_instructions(); |
$instructions_related = $inst_instruction->get_related_instructions(); |
394 |
foreach ($instructions_related as $instruction) { |
foreach ($instructions_related as $instruction) { |
395 |
$inst_related_instruction = $this->f->get_inst__om_dbform(array( |
if ($instruction !== null && $instruction !== '') { |
396 |
"obj" => "instruction", |
$inst_related_instruction = $this->f->get_inst__om_dbform(array( |
397 |
"idx" => $instruction, |
"obj" => "instruction", |
398 |
)); |
"idx" => $instruction, |
399 |
$val_instruction[$instruction] = $inst_related_instruction->get_json_data(); |
)); |
400 |
|
$instruction_data = $inst_related_instruction->get_json_data(); |
401 |
|
$val_instruction = $this->sort_instruction_data($instruction_data, $val_instruction); |
402 |
|
if ($instruction_data['om_fichier_instruction'] !== null |
403 |
|
&& $instruction_data['om_fichier_instruction'] !== '') { |
404 |
|
// |
405 |
|
$instruction_with_doc = $inst_related_instruction->getVal($inst_related_instruction->clePrimaire); |
406 |
|
} |
407 |
|
} |
408 |
} |
} |
409 |
} |
} |
410 |
|
if ($instruction_with_doc !== null) { |
411 |
|
// |
412 |
|
$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); |
413 |
|
} |
414 |
} |
} |
415 |
return $val_instruction; |
return $val_instruction; |
416 |
} |
} |
417 |
|
|
418 |
|
protected function sort_instruction_data(array $values, array $res) { |
419 |
|
$fields = array( |
420 |
|
"date_envoi_signature", |
421 |
|
"date_retour_signature", |
422 |
|
"date_envoi_rar", |
423 |
|
"date_retour_rar", |
424 |
|
"date_envoi_controle_legalite", |
425 |
|
"date_retour_controle_legalite", |
426 |
|
"signataire_arrete", |
427 |
|
"om_fichier_instruction", |
428 |
|
"tacite", |
429 |
|
); |
430 |
|
foreach ($values as $key => $value) { |
431 |
|
if (in_array($key, $fields) === true) { |
432 |
|
if (array_key_exists($key, $res) === false |
433 |
|
&& $value !== null |
434 |
|
&& $value !== '') { |
435 |
|
// |
436 |
|
$res[$key] = $value; |
437 |
|
} elseif ($key === 'tacite' |
438 |
|
&& $value === 't') { |
439 |
|
// |
440 |
|
$res[$key] = $value; |
441 |
|
} |
442 |
|
} |
443 |
|
} |
444 |
|
return $res; |
445 |
|
} |
446 |
|
|
447 |
protected function get_document_numerise_data(string $dn) { |
protected function get_document_numerise_data(string $dn) { |
448 |
$val_dn = array(); |
$val_dn = array(); |
449 |
$inst_dn = $this->f->get_inst__om_dbform(array( |
$inst_dn = $this->f->get_inst__om_dbform(array( |
551 |
} |
} |
552 |
// |
// |
553 |
if ($this->getVal('type') === 'creation_DI' |
if ($this->getVal('type') === 'creation_DI' |
554 |
|| $this->getVal('type') === 'modification_DI') { |
|| $this->getVal('type') === 'modification_DI' |
555 |
|
|| $this->getVal('type') === 'depot_DI') { |
556 |
// |
// |
557 |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
558 |
$val['donnees_techniques'] = $this->get_donnees_techniques_data($this->getVal('object_id'), 'dossier_instruction'); |
$val['donnees_techniques'] = $this->get_donnees_techniques_data($this->getVal('object_id'), 'dossier_instruction'); |
605 |
$objet = 'dossier_autorisation'; |
$objet = 'dossier_autorisation'; |
606 |
} |
} |
607 |
if ($type === 'creation_DI' |
if ($type === 'creation_DI' |
608 |
|
|| $type === 'depot_DI' |
609 |
|| $type === 'modification_DI' |
|| $type === 'modification_DI' |
610 |
|| $type === 'qualification_DI' |
|| $type === 'qualification_DI' |
611 |
|| $type === 'decision_DI') { |
|| $type === 'decision_DI') { |