19 |
"view" => "view_json_data", |
"view" => "view_json_data", |
20 |
"permission_suffix" => "consulter", |
"permission_suffix" => "consulter", |
21 |
); |
); |
22 |
|
$this->class_actions[997] = array( |
23 |
|
"identifier" => "json_data", |
24 |
|
"view" => "view_update_json_data", |
25 |
|
"permission_suffix" => "modifier", |
26 |
|
); |
27 |
|
$this->class_actions[996] = array( |
28 |
|
"identifier" => "json_data", |
29 |
|
"view" => "view_add_json_data", |
30 |
|
"permission_suffix" => "ajouter", |
31 |
|
); |
32 |
|
} |
33 |
|
|
34 |
|
public function setvalF($val = array()) { |
35 |
|
parent::setvalF($val); |
36 |
|
// |
37 |
|
if (array_key_exists('timestamp_log', $val) === true) { |
38 |
|
$this->valF['timestamp_log'] = str_replace("'", '"', $val['timestamp_log']); |
39 |
|
} |
40 |
|
} |
41 |
|
|
42 |
|
/** |
43 |
|
* |
44 |
|
* @return array |
45 |
|
*/ |
46 |
|
function get_var_sql_forminc__champs() { |
47 |
|
return array( |
48 |
|
"task", |
49 |
|
"type", |
50 |
|
"state", |
51 |
|
"object_id", |
52 |
|
"dossier", |
53 |
|
"stream", |
54 |
|
"json_payload", |
55 |
|
"timestamp_log", |
56 |
|
); |
57 |
|
} |
58 |
|
|
59 |
|
function setType(&$form, $maj) { |
60 |
|
parent::setType($form, $maj); |
61 |
|
// Récupération du mode de l'action |
62 |
|
$crud = $this->get_action_crud($maj); |
63 |
|
|
64 |
|
if ($maj < 2) { |
65 |
|
$form->setType("state", "select"); |
66 |
|
$form->setType("stream", "select"); |
67 |
|
$form->setType("json_payload", "jsonprettyprint"); |
68 |
|
} |
69 |
|
if ($maj == 3){ |
70 |
|
$form->setType('dossier', 'link'); |
71 |
|
$form->setType('json_payload', 'jsonprettyprint'); |
72 |
|
} |
73 |
|
|
74 |
|
} |
75 |
|
|
76 |
|
/** |
77 |
|
* |
78 |
|
*/ |
79 |
|
function setSelect(&$form, $maj, &$dnu1 = null, $dnu2 = null) { |
80 |
|
if($maj < 2) { |
81 |
|
$contenu=array(); |
82 |
|
|
83 |
|
$contenu[0][0]="draft"; |
84 |
|
$contenu[1][0]=_('draft'); |
85 |
|
$contenu[0][1]="new"; |
86 |
|
$contenu[1][1]=_('new'); |
87 |
|
$contenu[0][2]="pending"; |
88 |
|
$contenu[1][2]=_('pending'); |
89 |
|
$contenu[0][3]="done"; |
90 |
|
$contenu[1][3]=_('done'); |
91 |
|
$contenu[0][4]="archived"; |
92 |
|
$contenu[1][4]=_('archived'); |
93 |
|
$contenu[0][5]="error"; |
94 |
|
$contenu[1][5]=_('error'); |
95 |
|
$contenu[0][6]="debug"; |
96 |
|
$contenu[1][6]=_('debug'); |
97 |
|
|
98 |
|
$form->setSelect("state", $contenu); |
99 |
|
|
100 |
|
$contenu_stream =array(); |
101 |
|
$contenu_stream[0][0]="input"; |
102 |
|
$contenu_stream[1][0]=_('input'); |
103 |
|
$contenu_stream[0][1]="output"; |
104 |
|
$contenu_stream[1][1]=_('output'); |
105 |
|
$form->setSelect("stream", $contenu_stream); |
106 |
|
|
107 |
|
} |
108 |
|
|
109 |
|
if ($maj == 3) { |
110 |
|
if ($this->getVal('stream') == 'output') { |
111 |
|
$inst_dossier = $this->f->get_inst__om_dbform(array( |
112 |
|
"obj" => "dossier", |
113 |
|
"idx" => $form->val['dossier'], |
114 |
|
)); |
115 |
|
|
116 |
|
if($form->val['type'] == "creation_DA"){ |
117 |
|
$obj_link = 'dossier_autorisation'; |
118 |
|
} else { |
119 |
|
$obj_link = 'dossier_instruction'; |
120 |
|
} |
121 |
|
|
122 |
|
$params = array(); |
123 |
|
$params['obj'] = $obj_link; |
124 |
|
$params['libelle'] = $inst_dossier->getVal('dossier'); |
125 |
|
$params['title'] = "Consulter le dossier"; |
126 |
|
$params['idx'] = $form->val['dossier']; |
127 |
|
$form->setSelect("dossier", $params); |
128 |
|
} |
129 |
|
} |
130 |
|
} |
131 |
|
|
132 |
|
/** |
133 |
|
* SETTER_FORM - setVal (setVal). |
134 |
|
* |
135 |
|
* @return void |
136 |
|
*/ |
137 |
|
function setVal(&$form, $maj, $validation, &$dnu1 = null, $dnu2 = null) { |
138 |
|
// parent::setVal($form, $maj, $validation); |
139 |
|
// |
140 |
|
if ($this->getVal('stream') == "output") { |
141 |
|
$form->setVal('json_payload', $this->view_form_json(true)); |
142 |
|
} else { |
143 |
|
$form->setVal('json_payload', htmlentities($this->getVal('json_payload'))); |
144 |
|
} |
145 |
|
} |
146 |
|
|
147 |
|
public function verifier($val = array(), &$dnu1 = null, $dnu2 = null) { |
148 |
|
parent::verifier($val, $dnu1, $dnu2); |
149 |
|
// |
150 |
|
if (array_key_exists('timestamp_log', $this->valF) === true |
151 |
|
&& is_array(json_decode($this->valF['timestamp_log'], true)) === false) { |
152 |
|
// |
153 |
|
$this->correct = false; |
154 |
|
$this->addToMessage(sprintf( |
155 |
|
__("Le champ %s doit être dans un format JSON valide."), |
156 |
|
sprintf('<span class="bold">%s</span>', $this->getLibFromField('timestamp_log')) |
157 |
|
)); |
158 |
|
} |
159 |
} |
} |
160 |
|
|
161 |
protected function task_exists(string $type, string $object_id) { |
protected function task_exists(string $type, string $object_id) { |
197 |
'timestamp_log' => $timestamp_log, |
'timestamp_log' => $timestamp_log, |
198 |
'state' => isset($params['val']['state']) === true ? $params['val']['state'] : 'new', |
'state' => isset($params['val']['state']) === true ? $params['val']['state'] : 'new', |
199 |
'object_id' => $params['val']['object_id'], |
'object_id' => $params['val']['object_id'], |
200 |
|
'dossier' => $params['val']['dossier'], |
201 |
|
'stream' => isset($params['val']['stream']) === true ? $params['val']['stream'] : 'output', |
202 |
|
'json_payload' => isset($params['val']['json_payload']) === true ? $params['val']['json_payload'] : '{}', |
203 |
); |
); |
204 |
$task_exists = $this->task_exists($valF['type'], $valF['object_id']); |
$task_exists = $this->task_exists($valF['type'], $valF['object_id']); |
205 |
|
if ($valF['type'] === 'modification_DI' && $task_exists === false) { |
206 |
|
$task_exists = $this->task_exists('creation_DI', $valF['object_id']); |
207 |
|
} |
208 |
if ($task_exists !== false) { |
if ($task_exists !== false) { |
209 |
$inst_task = $this->f->get_inst__om_dbform(array( |
$inst_task = $this->f->get_inst__om_dbform(array( |
210 |
"obj" => "task", |
"obj" => "task", |
255 |
'timestamp_log' => $timestamp_log, |
'timestamp_log' => $timestamp_log, |
256 |
'state' => $params['val']['state'], |
'state' => $params['val']['state'], |
257 |
'object_id' => $this->getVal('object_id'), |
'object_id' => $this->getVal('object_id'), |
258 |
|
'stream' => $this->getVal('stream'), |
259 |
|
'dossier' => $this->getVal('dossier'), |
260 |
|
'json_payload' => $this->getVal('json_payload'), |
261 |
); |
); |
262 |
$update = $this->modifier($valF); |
$update = $this->modifier($valF); |
263 |
if ($update === false) { |
if ($update === false) { |
316 |
* |
* |
317 |
FROM %1$stask |
FROM %1$stask |
318 |
%2$s |
%2$s |
319 |
|
ORDER BY task ASC |
320 |
', |
', |
321 |
DB_PREFIXE, |
DB_PREFIXE, |
322 |
$where |
$where |
328 |
$list_tasks = array(); |
$list_tasks = array(); |
329 |
foreach ($res['result'] as $task) { |
foreach ($res['result'] as $task) { |
330 |
$task['timestamp_log'] = json_decode($task['timestamp_log'], true); |
$task['timestamp_log'] = json_decode($task['timestamp_log'], true); |
331 |
|
$task['dossier'] = $task['object_id']; |
332 |
|
if ($this->get_lien_objet_by_type($task['type']) === 'document_numerise') { |
333 |
|
$val_dn = $this->get_document_numerise_data($task['object_id']); |
334 |
|
$task['dossier'] = $val_dn['dossier']; |
335 |
|
} |
336 |
$list_tasks[$task['task']] = $task; |
$list_tasks[$task['task']] = $task; |
337 |
} |
} |
338 |
printf(json_encode($list_tasks)); |
printf(json_encode($list_tasks)); |
422 |
$particular_case = false; |
$particular_case = false; |
423 |
$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(); |
424 |
foreach ($fields_tab_crea_loc_hab as $field) { |
foreach ($fields_tab_crea_loc_hab as $field) { |
425 |
if (isset($field) === false |
if (isset($val_dt[$field]) === false |
426 |
|| (isset($field) === true |
|| (isset($val_dt[$field]) === true |
427 |
&& $field !== null |
&& ($val_dt[$field] === null |
428 |
&& $field !== '')) { |
|| $val_dt[$field] === ''))) { |
429 |
// |
// |
430 |
$particular_case = true; |
$particular_case = true; |
431 |
} |
} |
499 |
)); |
)); |
500 |
$val_demandeur[$demandeur['demandeur']] = $inst_demandeur->get_json_data(); |
$val_demandeur[$demandeur['demandeur']] = $inst_demandeur->get_json_data(); |
501 |
$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'; |
|
502 |
} |
} |
503 |
return $val_demandeur; |
return $val_demandeur; |
504 |
} |
} |
517 |
return $val_architecte; |
return $val_architecte; |
518 |
} |
} |
519 |
|
|
520 |
protected function get_instruction_data(string $dossier) { |
protected function get_instruction_data(string $dossier, $type = 'decision') { |
521 |
$val_instruction = null; |
$val_instruction = null; |
522 |
|
$instruction_with_doc = null; |
523 |
$inst_di = $this->f->get_inst__om_dbform(array( |
$inst_di = $this->f->get_inst__om_dbform(array( |
524 |
"obj" => "dossier", |
"obj" => "dossier", |
525 |
"idx" => $dossier, |
"idx" => $dossier, |
526 |
)); |
)); |
527 |
|
$idx = null; |
528 |
|
if ($type === 'decision') { |
529 |
|
$idx = $inst_di->get_last_instruction_decision(); |
530 |
|
} |
531 |
|
if ($type === 'incompletude') { |
532 |
|
$idx = $inst_di->get_last_instruction_incompletude(); |
533 |
|
} |
534 |
$inst_instruction = $this->f->get_inst__om_dbform(array( |
$inst_instruction = $this->f->get_inst__om_dbform(array( |
535 |
"obj" => "instruction", |
"obj" => "instruction", |
536 |
"idx" => $inst_di->get_last_instruction_decision(), |
"idx" => $idx, |
537 |
)); |
)); |
538 |
if (count($inst_instruction->val) > 0) { |
if (count($inst_instruction->val) > 0) { |
539 |
$val_instruction[$inst_instruction->getVal($inst_instruction->clePrimaire)] = $inst_instruction->get_json_data(); |
$val_instruction = array(); |
540 |
|
$instruction_data = $inst_instruction->get_json_data(); |
541 |
|
$val_instruction = $this->sort_instruction_data($instruction_data, $val_instruction); |
542 |
|
if ($instruction_data['om_fichier_instruction'] !== null |
543 |
|
&& $instruction_data['om_fichier_instruction'] !== '') { |
544 |
|
// |
545 |
|
$instruction_with_doc = $inst_instruction->getVal($inst_instruction->clePrimaire); |
546 |
|
} |
547 |
$inst_ev = $this->f->get_inst__om_dbform(array( |
$inst_ev = $this->f->get_inst__om_dbform(array( |
548 |
"obj" => "evenement", |
"obj" => "evenement", |
549 |
"idx" => $inst_instruction->getVal('evenement'), |
"idx" => $inst_instruction->getVal('evenement'), |
551 |
if ($inst_ev->getVal('retour') === 't') { |
if ($inst_ev->getVal('retour') === 't') { |
552 |
$instructions_related = $inst_instruction->get_related_instructions(); |
$instructions_related = $inst_instruction->get_related_instructions(); |
553 |
foreach ($instructions_related as $instruction) { |
foreach ($instructions_related as $instruction) { |
554 |
$inst_related_instruction = $this->f->get_inst__om_dbform(array( |
if ($instruction !== null && $instruction !== '') { |
555 |
"obj" => "instruction", |
$inst_related_instruction = $this->f->get_inst__om_dbform(array( |
556 |
"idx" => $instruction, |
"obj" => "instruction", |
557 |
)); |
"idx" => $instruction, |
558 |
$val_instruction[$instruction] = $inst_related_instruction->get_json_data(); |
)); |
559 |
|
$instruction_data = $inst_related_instruction->get_json_data(); |
560 |
|
$val_instruction = $this->sort_instruction_data($instruction_data, $val_instruction); |
561 |
|
if ($instruction_data['om_fichier_instruction'] !== null |
562 |
|
&& $instruction_data['om_fichier_instruction'] !== '') { |
563 |
|
// |
564 |
|
$instruction_with_doc = $inst_related_instruction->getVal($inst_related_instruction->clePrimaire); |
565 |
|
} |
566 |
|
} |
567 |
} |
} |
568 |
} |
} |
569 |
|
if ($instruction_with_doc !== null) { |
570 |
|
// |
571 |
|
$val_instruction['path'] = sprintf('%s&snippet=%s&obj=%s&champ=%s&id=%s', 'app/index.php?module=form', 'file', 'instruction', 'om_fichier_instruction', $instruction_with_doc); |
572 |
|
} |
573 |
} |
} |
574 |
return $val_instruction; |
return $val_instruction; |
575 |
} |
} |
576 |
|
|
577 |
|
protected function sort_instruction_data(array $values, array $res) { |
578 |
|
$fields = array( |
579 |
|
"date_envoi_signature", |
580 |
|
"date_retour_signature", |
581 |
|
"date_envoi_rar", |
582 |
|
"date_retour_rar", |
583 |
|
"date_envoi_controle_legalite", |
584 |
|
"date_retour_controle_legalite", |
585 |
|
"signataire_arrete", |
586 |
|
"om_fichier_instruction", |
587 |
|
"tacite", |
588 |
|
"lettretype", |
589 |
|
); |
590 |
|
foreach ($values as $key => $value) { |
591 |
|
if (in_array($key, $fields) === true) { |
592 |
|
if (array_key_exists($key, $res) === false |
593 |
|
&& $value !== null |
594 |
|
&& $value !== '') { |
595 |
|
// |
596 |
|
$res[$key] = $value; |
597 |
|
} elseif ($key === 'tacite' |
598 |
|
&& $value === 't') { |
599 |
|
// |
600 |
|
$res[$key] = $value; |
601 |
|
} |
602 |
|
} |
603 |
|
} |
604 |
|
return $res; |
605 |
|
} |
606 |
|
|
607 |
protected function get_document_numerise_data(string $dn) { |
protected function get_document_numerise_data(string $dn) { |
608 |
$val_dn = array(); |
$val_dn = array(); |
609 |
$inst_dn = $this->f->get_inst__om_dbform(array( |
$inst_dn = $this->f->get_inst__om_dbform(array( |
611 |
"idx" => $dn, |
"idx" => $dn, |
612 |
)); |
)); |
613 |
$val_dn = $inst_dn->get_json_data(); |
$val_dn = $inst_dn->get_json_data(); |
614 |
$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', 'app/index.php?module=form', 'file', 'document_numerise', 'uid', $this->getVal('object_id')); |
615 |
// Correspond à la nomenclature Plat'AU NATURE_PIECE |
// Correspond à la nomenclature Plat'AU NATURE_PIECE |
616 |
$val_dn['nature'] = 'Initiale'; |
$val_dn['nature'] = $val_dn['document_numerise_nature_libelle']; |
617 |
return $val_dn; |
return $val_dn; |
618 |
} |
} |
619 |
|
|
636 |
return $val_dp; |
return $val_dp; |
637 |
} |
} |
638 |
|
|
639 |
protected function view_form_json() { |
protected function view_form_json($in_field = false) { |
|
// Mise à jour des valeurs |
|
|
if ($this->f->get_submitted_post_value('valid') === 'true' |
|
|
&& $this->f->get_submitted_post_value('state') !== null) { |
|
|
// |
|
|
$params = array( |
|
|
'val' => array( |
|
|
'state' => $this->f->get_submitted_post_value('state') |
|
|
), |
|
|
); |
|
|
$update = $this->update_task($params); |
|
|
$message_class = "valid"; |
|
|
$message = $this->msg; |
|
|
if ($update === false) { |
|
|
$this->addToLog($this->msg, DEBUG_MODE); |
|
|
$message_class = "error"; |
|
|
$message = sprintf( |
|
|
'%s %s', |
|
|
__('Impossible de mettre à jour la tâche.'), |
|
|
__('Veuillez contacter votre administrateur.') |
|
|
); |
|
|
} |
|
|
$this->f->displayMessage($message_class, $message); |
|
|
} |
|
|
// |
|
|
if ($this->f->get_submitted_post_value('valid') === 'true' |
|
|
&& $this->f->get_submitted_post_value('external_uid') !== null) { |
|
|
// |
|
|
$inst_lien = $this->f->get_inst__om_dbform(array( |
|
|
"obj" => "lien_id_interne_uid_externe", |
|
|
"idx" => ']', |
|
|
)); |
|
|
$valF = array( |
|
|
'lien_id_interne_uid_externe' => '', |
|
|
'object' => $this->get_lien_objet_by_type($this->getVal('type')), |
|
|
'object_id' => $this->getVal('object_id'), |
|
|
'external_uid' => $this->f->get_submitted_post_value('external_uid'), |
|
|
); |
|
|
$add = $inst_lien->ajouter($valF); |
|
|
$message_class = "valid"; |
|
|
$message = $inst_lien->msg; |
|
|
if ($add === false) { |
|
|
$this->addToLog($inst_lien->msg, DEBUG_MODE); |
|
|
$message_class = "error"; |
|
|
$message = sprintf( |
|
|
'%s %s', |
|
|
__("Impossible de mettre à jour le lien entre l'identifiant interne et l'identifiant de l'application externe."), |
|
|
__('Veuillez contacter votre administrateur.') |
|
|
); |
|
|
} |
|
|
$this->f->displayMessage($message_class, $message); |
|
|
} |
|
|
|
|
640 |
// |
// |
641 |
if ($this->f->get_submitted_post_value('valid') === null) { |
if ($this->f->get_submitted_post_value('valid') === null) { |
642 |
// Liste des valeurs à afficher |
// Liste des valeurs à afficher |
659 |
} |
} |
660 |
// |
// |
661 |
if ($this->getVal('type') === 'creation_DI' |
if ($this->getVal('type') === 'creation_DI' |
662 |
|| $this->getVal('type') === 'modification_DI') { |
|| $this->getVal('type') === 'modification_DI' |
663 |
|
|| $this->getVal('type') === 'depot_DI') { |
664 |
// |
// |
665 |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
666 |
$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'); |
700 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
701 |
$val['external_uid'] = $val_external_uid; |
$val['external_uid'] = $val_external_uid; |
702 |
} |
} |
703 |
|
// |
704 |
|
if ($this->getVal('type') === 'incompletude_DI') { |
705 |
|
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
706 |
|
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier'], 'incompletude'); |
707 |
|
$val_external_uid = array(); |
708 |
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
709 |
|
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
710 |
|
$val['external_uid'] = $val_external_uid; |
711 |
|
} |
712 |
|
// |
713 |
|
if ($this->getVal('type') === 'completude_DI') { |
714 |
|
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
715 |
|
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier'], 'completude'); |
716 |
|
$val_external_uid = array(); |
717 |
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
718 |
|
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
719 |
|
$val['external_uid'] = $val_external_uid; |
720 |
|
} |
721 |
|
|
722 |
// Liste des valeurs affichée en JSON |
if ($in_field === true) { |
723 |
printf(json_encode($val)); |
return json_encode($val, JSON_PRETTY_PRINT ,JSON_UNESCAPED_SLASHES); |
724 |
|
} else { |
725 |
|
// Liste des valeurs affichée en JSON |
726 |
|
printf(json_encode($val, JSON_UNESCAPED_SLASHES)); |
727 |
|
} |
728 |
} |
} |
729 |
} |
} |
730 |
|
|
731 |
|
function view_update_json_data() { |
732 |
|
// Mise à jour des valeurs |
733 |
|
// |
734 |
|
$params = array( |
735 |
|
'val' => array( |
736 |
|
'state' => $this->f->get_submitted_post_value('state') |
737 |
|
), |
738 |
|
); |
739 |
|
$update = $this->update_task($params); |
740 |
|
$message_class = "valid"; |
741 |
|
$message = $this->msg; |
742 |
|
if ($update === false) { |
743 |
|
$this->addToLog($this->msg, DEBUG_MODE); |
744 |
|
$message_class = "error"; |
745 |
|
$message = sprintf( |
746 |
|
'%s %s', |
747 |
|
__('Impossible de mettre à jour la tâche.'), |
748 |
|
__('Veuillez contacter votre administrateur.') |
749 |
|
); |
750 |
|
} |
751 |
|
$this->f->displayMessage($message_class, $message); |
752 |
|
// |
753 |
|
$inst_lien = $this->f->get_inst__om_dbform(array( |
754 |
|
"obj" => "lien_id_interne_uid_externe", |
755 |
|
"idx" => ']', |
756 |
|
)); |
757 |
|
$valF = array( |
758 |
|
'lien_id_interne_uid_externe' => '', |
759 |
|
'object' => $this->get_lien_objet_by_type($this->getVal('type')), |
760 |
|
'object_id' => $this->getVal('object_id'), |
761 |
|
'external_uid' => $this->f->get_submitted_post_value('external_uid'), |
762 |
|
); |
763 |
|
$add = $inst_lien->ajouter($valF); |
764 |
|
$message_class = "valid"; |
765 |
|
$message = $inst_lien->msg; |
766 |
|
if ($add === false) { |
767 |
|
$this->addToLog($inst_lien->msg, DEBUG_MODE); |
768 |
|
$message_class = "error"; |
769 |
|
$message = sprintf( |
770 |
|
'%s %s', |
771 |
|
__("Impossible de mettre à jour le lien entre l'identifiant interne et l'identifiant de l'application externe."), |
772 |
|
__('Veuillez contacter votre administrateur.') |
773 |
|
); |
774 |
|
} |
775 |
|
$this->f->displayMessage($message_class, $message); |
776 |
|
} |
777 |
|
|
778 |
|
function view_add_json_data() { |
779 |
|
$params = array(); |
780 |
|
$params['val']['stream'] = 'input'; |
781 |
|
$params['val']['type'] = $this->f->get_submitted_post_value('type'); |
782 |
|
$params['val']['object_id'] = $this->f->get_submitted_post_value('object_id'); |
783 |
|
$params['val']['dossier'] = $this->f->get_submitted_post_value('dossier'); |
784 |
|
$params['val']['json_payload'] = $this->f->get_submitted_post_value('json_payload'); |
785 |
|
$this->add_task($params); |
786 |
|
} |
787 |
|
|
788 |
protected function get_lien_objet_by_type($type) { |
protected function get_lien_objet_by_type($type) { |
789 |
// |
// |
790 |
$objet = ''; |
$objet = ''; |
792 |
$objet = 'dossier_autorisation'; |
$objet = 'dossier_autorisation'; |
793 |
} |
} |
794 |
if ($type === 'creation_DI' |
if ($type === 'creation_DI' |
795 |
|
|| $type === 'depot_DI' |
796 |
|| $type === 'modification_DI' |
|| $type === 'modification_DI' |
797 |
|| $type === 'qualification_DI' |
|| $type === 'qualification_DI' |
798 |
|| $type === 'decision_DI') { |
|| $type === 'decision_DI' |
799 |
|
|| $type === 'incompletude_DI' |
800 |
|
|| $type === 'completude_DI') { |
801 |
// |
// |
802 |
$objet = 'dossier'; |
$objet = 'dossier'; |
803 |
} |
} |
806 |
} |
} |
807 |
return $objet; |
return $objet; |
808 |
} |
} |
809 |
|
|
810 |
|
function setLayout(&$form, $maj) { |
811 |
|
$form->setBloc('json_payload', 'D', '', 'col_6'); |
812 |
|
$form->setFieldset('json_payload', 'DF', _("json_payload"), "collapsible, startClosed"); |
813 |
|
$form->setBloc('json_payload', 'F'); |
814 |
|
$form->setBloc('timestamp_log', 'DF', '', 'col_9'); |
815 |
|
} |
816 |
|
|
817 |
} |
} |