13 |
const STATUS_ERROR = 'error'; |
const STATUS_ERROR = 'error'; |
14 |
const STATUS_DEBUG = 'debug'; |
const STATUS_DEBUG = 'debug'; |
15 |
const STATUS_ARCHIVED = 'archived'; |
const STATUS_ARCHIVED = 'archived'; |
16 |
|
const STATUS_CANCELED = 'canceled'; |
17 |
|
|
18 |
|
/** |
19 |
|
* Liste des types de tâche concernant les services instructeurs |
20 |
|
*/ |
21 |
|
const TASK_TYPE_SI = array( |
22 |
|
'creation_DA', |
23 |
|
'creation_DI', |
24 |
|
'depot_DI', |
25 |
|
'modification_DI', |
26 |
|
'qualification_DI', |
27 |
|
'decision_DI', |
28 |
|
'incompletude_DI', |
29 |
|
'completude_DI', |
30 |
|
'ajout_piece', |
31 |
|
'add_piece', |
32 |
|
'creation_consultation', |
33 |
|
'modification_DA', |
34 |
|
'create_DI', |
35 |
|
'envoi_CL', |
36 |
|
'notification_recepisse', |
37 |
|
'notification_instruction', |
38 |
|
'notification_decision', |
39 |
|
'notification_service_consulte', |
40 |
|
'notification_tiers_consulte', |
41 |
|
); |
42 |
|
|
43 |
|
/** |
44 |
|
* Liste des types de tâche concernant les services consultés |
45 |
|
*/ |
46 |
|
const TASK_TYPE_SC = array( |
47 |
|
'create_DI_for_consultation', |
48 |
|
'avis_consultation', |
49 |
|
'pec_metier_consultation', |
50 |
|
'create_message', |
51 |
|
'notification_recepisse', |
52 |
|
'notification_instruction', |
53 |
|
'notification_decision', |
54 |
|
'notification_service_consulte', |
55 |
|
'notification_tiers_consulte', |
56 |
|
'prescription', |
57 |
|
); |
58 |
|
|
59 |
|
/** |
60 |
|
* Catégorie de la tâche |
61 |
|
*/ |
62 |
|
var $category = 'platau'; |
63 |
|
|
64 |
/** |
/** |
65 |
* Définition des actions disponibles sur la classe. |
* Définition des actions disponibles sur la classe. |
88 |
|
|
89 |
public function setvalF($val = array()) { |
public function setvalF($val = array()) { |
90 |
|
|
91 |
// les guillets doubles sont remplacés automatiquement par des simples |
// // les guillets doubles sont remplacés automatiquement par des simples |
92 |
// dans core/om_formulaire.clasS.php::recupererPostvar() |
// // dans core/om_formulaire.clasS.php::recupererPostvar() |
93 |
// voir le ticket https://dev.atreal.fr/projets/openmairie/tracker/209 |
// // voir le ticket https://dev.atreal.fr/projets/openmairie/tracker/209 |
94 |
// ceci est un hack sale temporaire en attendant résolution du ticket |
// // ceci est un hack sale temporaire en attendant résolution du ticket |
95 |
foreach(array('json_payload', 'timestamp_log') as $key) { |
// foreach(array('json_payload', 'timestamp_log') as $key) { |
96 |
if (isset($val[$key]) && ! empty($val[$key]) && |
// if (isset($val[$key]) && ! empty($val[$key]) && |
97 |
isset($_POST[$key]) && ! empty($_POST[$key])) { |
// isset($_POST[$key]) && ! empty($_POST[$key])) { |
98 |
$submited_payload = $_POST[$key]; |
// $submited_payload = $_POST[$key]; |
99 |
if (! empty($submited_payload)) { |
// if (! empty($submited_payload)) { |
100 |
$new_payload = str_replace("'", '"', $val[$key]); |
// $new_payload = str_replace("'", '"', $val[$key]); |
101 |
if ($new_payload == $submited_payload || |
// if ($new_payload == $submited_payload || |
102 |
strpos($submited_payload, '"') === false) { |
// strpos($submited_payload, '"') === false) { |
103 |
$val[$key] = $new_payload; |
// $val[$key] = $new_payload; |
104 |
} |
// } |
105 |
else { |
// else { |
106 |
$error_msg = sprintf( |
// $error_msg = sprintf( |
107 |
__("La convertion des guillemets de la payload JSON '%s' ". |
// __("La convertion des guillemets de la payload JSON '%s' ". |
108 |
"n'est pas idempotente (courante: %s, postée: %s, convertie: %s)"), |
// "n'est pas idempotente (courante: %s, postée: %s, convertie: %s)"), |
109 |
$key, var_export($val[$key], true), var_export($submited_payload, true), |
// $key, var_export($val[$key], true), var_export($submited_payload, true), |
110 |
var_export($new_payload, true)); |
// var_export($new_payload, true)); |
111 |
$this->correct = false; |
// $this->correct = false; |
112 |
$this->addToMessage($error_msg); |
// $this->addToMessage($error_msg); |
113 |
$this->addToLog(__METHOD__."() erreur : $error_msg", DEBUG_MODE); |
// $this->addToLog(__METHOD__."() erreur : $error_msg", DEBUG_MODE); |
114 |
return false; |
// return false; |
115 |
} |
// } |
116 |
} |
// } |
117 |
} |
// } |
118 |
} |
// } |
119 |
|
|
120 |
parent::setvalF($val); |
parent::setvalF($val); |
121 |
|
|
122 |
|
// XXX Ancien code : permet de ne pas avoir d'erreru lors de la modification d'une task |
123 |
|
if (array_key_exists('timestamp_log', $val) === true) { |
124 |
|
$this->valF['timestamp_log'] = str_replace("'", '"', $val['timestamp_log']); |
125 |
|
} |
126 |
|
|
127 |
// récupération de l'ID de l'objet existant |
// récupération de l'ID de l'objet existant |
128 |
$id = property_exists($this, 'id') ? $this->id : null; |
$id = property_exists($this, 'id') ? $this->id : null; |
129 |
if(isset($val[$this->clePrimaire])) { |
if(isset($val[$this->clePrimaire])) { |
139 |
if (! isset($val['json_payload']) || empty($val['json_payload'])) { |
if (! isset($val['json_payload']) || empty($val['json_payload'])) { |
140 |
|
|
141 |
// récupère l'objet existant |
// récupère l'objet existant |
142 |
$existing = $this->f->findObjectById(get_class($this), $id); |
$existing = $this->f->findObjectById('task', $id); |
143 |
if (! empty($existing)) { |
if (! empty($existing)) { |
144 |
|
|
145 |
// récupère la payload de l'objet |
// récupère la payload de l'objet |
150 |
} |
} |
151 |
} |
} |
152 |
} |
} |
153 |
|
|
154 |
|
if (array_key_exists('category', $val) === false |
155 |
|
|| $this->valF['category'] === '' |
156 |
|
|| $this->valF['category'] === null) { |
157 |
|
// |
158 |
|
$this->valF['category'] = $this->category; |
159 |
|
} |
160 |
|
|
161 |
|
// Si last_modification_time est vide, la valeur est remplacée par NULL |
162 |
|
// pour eviter d'avoir une erreur de base de données car le champ est au format time. |
163 |
|
if ($val['last_modification_time'] == "") { |
164 |
|
$this->valF['last_modification_time'] = NULL; |
165 |
|
} else { |
166 |
|
$this->valF['last_modification_time'] = $val['last_modification_time']; |
167 |
|
} |
168 |
|
|
169 |
|
// Si creation_time est vide, la valeur est remplacée par NULL |
170 |
|
// pour eviter d'avoir une erreur de base de données car le champ est au format time. |
171 |
|
if ($val['creation_time'] == "") { |
172 |
|
$this->valF['creation_time'] = NULL; |
173 |
|
} else { |
174 |
|
$this->valF['creation_time'] = $val['creation_time']; |
175 |
|
} |
176 |
} |
} |
177 |
|
|
178 |
/** |
/** |
187 |
"object_id", |
"object_id", |
188 |
"dossier", |
"dossier", |
189 |
"stream", |
"stream", |
190 |
|
"creation_date", |
191 |
|
"creation_time", |
192 |
|
"CONCAT_WS(' ', to_char(task.creation_date, 'DD/MM/YYYY'), task.creation_time) AS date_creation", |
193 |
|
'last_modification_date', |
194 |
|
'last_modification_time', |
195 |
"json_payload", |
"json_payload", |
196 |
"timestamp_log", |
"timestamp_log", |
197 |
|
"category", |
198 |
); |
); |
199 |
} |
} |
200 |
|
|
204 |
// Récupération du mode de l'action |
// Récupération du mode de l'action |
205 |
$crud = $this->get_action_crud($maj); |
$crud = $this->get_action_crud($maj); |
206 |
|
|
207 |
|
// ALL |
208 |
|
$form->setType("category", "hidden"); |
209 |
|
|
210 |
// MODE CREER |
// MODE CREER |
211 |
if ($maj == 0 || $crud == 'create') { |
if ($maj == 0 || $crud == 'create') { |
212 |
$form->setType("state", "select"); |
$form->setType("state", "select"); |
213 |
$form->setType("stream", "select"); |
$form->setType("stream", "select"); |
214 |
$form->setType("json_payload", "textarea"); |
$form->setType("json_payload", "textarea"); |
215 |
} |
} |
216 |
// MDOE MODIFIER |
// MODE MODIFIER |
217 |
if ($maj == 1 || $crud == 'update') { |
if ($maj == 1 || $crud == 'update') { |
218 |
$form->setType("state", "select"); |
$form->setType("state", "select"); |
219 |
$form->setType("stream", "select"); |
$form->setType("stream", "select"); |
220 |
$form->setType("json_payload", "jsonprettyprint"); |
$form->setType("json_payload", "jsonprettyprint"); |
221 |
|
$form->setType("creation_date", "hidden"); |
222 |
|
$form->setType("creation_time", "hidden"); |
223 |
|
$form->setType("date_creation", "static"); |
224 |
|
$form->setType("last_modification_date", "hidden"); |
225 |
|
$form->setType("last_modification_time", "hidden"); |
226 |
} |
} |
227 |
// MODE CONSULTER |
// MODE CONSULTER |
228 |
if ($maj == 3 || $crud == 'read') { |
if ($maj == 3 || $crud == 'read') { |
229 |
$form->setType('dossier', 'link'); |
$form->setType('dossier', 'link'); |
230 |
$form->setType('json_payload', 'jsonprettyprint'); |
$form->setType('json_payload', 'jsonprettyprint'); |
231 |
|
$form->setType("creation_date", "hidden"); |
232 |
|
$form->setType("creation_time", "hidden"); |
233 |
|
$form->setType("date_creation", "static"); |
234 |
|
$form->setType("last_modification_date", "hidden"); |
235 |
|
$form->setType("last_modification_time", "hidden"); |
236 |
} |
} |
237 |
|
|
238 |
} |
} |
244 |
if($maj < 2) { |
if($maj < 2) { |
245 |
|
|
246 |
$contenu = array(); |
$contenu = array(); |
247 |
foreach(array('DRAFT', 'NEW', 'PENDING', 'DONE', 'ERROR', 'DEBUG') as $key) { |
foreach(array('DRAFT', 'NEW', 'PENDING', 'DONE', 'ERROR', 'DEBUG', 'ARCHIVED', 'CANCELED') as $key) { |
248 |
$const_name = 'STATUS_'.$key; |
$const_name = 'STATUS_'.$key; |
249 |
$const_value = constant("self::$const_name"); |
$const_value = constant("self::$const_name"); |
250 |
$contenu[0][] = $const_value; |
$contenu[0][] = $const_value; |
251 |
$contenu[1][] = __($const_value); |
$contenu[1][] = $const_value; |
252 |
} |
} |
253 |
|
|
254 |
$form->setSelect("state", $contenu); |
$form->setSelect("state", $contenu); |
269 |
"idx" => $form->val['dossier'], |
"idx" => $form->val['dossier'], |
270 |
)); |
)); |
271 |
|
|
272 |
if($form->val['type'] == "creation_DA"){ |
if($form->val['type'] == "creation_DA" |
273 |
|
|| $form->val['type'] == "modification_DA"){ |
274 |
|
// |
275 |
$obj_link = 'dossier_autorisation'; |
$obj_link = 'dossier_autorisation'; |
276 |
} else { |
} else { |
277 |
$obj_link = 'dossier_instruction'; |
$obj_link = 'dossier_instruction'; |
373 |
$json_payload = json_decode($this->valF['json_payload'], true); |
$json_payload = json_decode($this->valF['json_payload'], true); |
374 |
|
|
375 |
// défini une liste de chemin de clés requises |
// défini une liste de chemin de clés requises |
376 |
$paths = array( |
$paths = array(); |
377 |
'external_uids/dossier' |
if ($this->valF['category'] === 'platau') { |
378 |
); |
$paths = array( |
379 |
|
'external_uids/dossier' |
380 |
|
); |
381 |
|
} |
382 |
|
|
383 |
// tâche de type création de DI/DA |
// tâche de type création de DI/DA |
384 |
if (isset($this->valF['type']) !== false && $this->valF['type'] == 'create_DI_for_consultation') { |
if (isset($this->valF['type']) !== false && $this->valF['type'] == 'create_DI_for_consultation') { |
396 |
} |
} |
397 |
|
|
398 |
// présence d'un moyen d'identifier la collectivité/le service |
// présence d'un moyen d'identifier la collectivité/le service |
399 |
if (! isset($json_payload['dossier']['acteur']) && |
if (! isset($json_payload['external_uids']['acteur']) && |
400 |
! isset($json_payload['dossier']['om_collectivite'])) { |
! isset($json_payload['dossier']['om_collectivite'])) { |
401 |
$this->correct = false; |
$this->correct = false; |
402 |
$this->addToMessage(sprintf( |
$this->addToMessage(sprintf( |
403 |
__("L'une des clés %s ou %s est obligatoire dans le contenu du champ %s pour une tâche entrante."), |
__("L'une des clés %s ou %s est obligatoire dans le contenu du champ %s pour une tâche entrante."), |
404 |
sprintf('<span class="bold">%s</span>', 'dossier/acteur'), |
sprintf('<span class="bold">%s</span>', 'external_uids/acteur'), |
405 |
sprintf('<span class="bold">%s</span>', 'dossier/om_collectivite'), |
sprintf('<span class="bold">%s</span>', 'dossier/om_collectivite'), |
406 |
sprintf('<span class="bold">%s</span>', $this->getLibFromField('json_payload')) |
sprintf('<span class="bold">%s</span>', $this->getLibFromField('json_payload')) |
407 |
)); |
)); |
444 |
return $ret && $this->correct; |
return $ret && $this->correct; |
445 |
} |
} |
446 |
|
|
447 |
protected function task_exists(string $type, string $object_id) { |
/** |
448 |
|
* [task_exists description] |
449 |
|
* @param string $type [description] |
450 |
|
* @param string $object_id [description] |
451 |
|
* @param bool $is_not_done [description] |
452 |
|
* @return [type] [description] |
453 |
|
*/ |
454 |
|
public function task_exists(string $type, string $object_id, string $dossier = null, bool $is_not_done = true) { |
455 |
$query = sprintf(' |
$query = sprintf(' |
456 |
SELECT task |
SELECT task |
457 |
FROM %1$stask |
FROM %1$stask |
458 |
WHERE state != \'%2$s\' |
WHERE %2$s |
459 |
AND type = \'%3$s\' |
type = \'%3$s\' |
460 |
AND object_id = \'%4$s\' |
AND (object_id = \'%4$s\' |
461 |
|
%5$s) |
462 |
|
AND state != \'%6$s\' |
463 |
', |
', |
464 |
DB_PREFIXE, |
DB_PREFIXE, |
465 |
self::STATUS_DONE, |
$is_not_done == true ? 'state != \''.self::STATUS_DONE.'\' AND' : '', |
466 |
$type, |
$type, |
467 |
$object_id |
$object_id, |
468 |
|
$dossier !== null ? sprintf('OR dossier = \'%s\'', $dossier) : '', |
469 |
|
self::STATUS_CANCELED |
470 |
); |
); |
471 |
$res = $this->f->get_one_result_from_db_query($query); |
$res = $this->f->get_one_result_from_db_query($query); |
472 |
if ($res['result'] !== null && $res['result'] !== '') { |
if ($res['result'] !== null && $res['result'] !== '') { |
476 |
} |
} |
477 |
|
|
478 |
/** |
/** |
479 |
|
* Permet la recherche multi-critères des tasks. |
480 |
|
* |
481 |
|
* @param array $search_values Chaque entrée du tableau est une ligne dans le WHERE |
482 |
|
* @return mixed Retourne le résultat de la requête ou false |
483 |
|
*/ |
484 |
|
public function task_exists_multi_search(array $search_values) { |
485 |
|
$query = sprintf(' |
486 |
|
SELECT * |
487 |
|
FROM %1$stask |
488 |
|
%2$s |
489 |
|
%3$s |
490 |
|
', |
491 |
|
DB_PREFIXE, |
492 |
|
empty($search_values) === false ? ' WHERE ' : '', |
493 |
|
implode(' AND ', $search_values) |
494 |
|
); |
495 |
|
$res = $this->f->get_all_results_from_db_query($query); |
496 |
|
if (count($res['result']) > 0) { |
497 |
|
return $res['result']; |
498 |
|
} |
499 |
|
return false; |
500 |
|
} |
501 |
|
|
502 |
|
/** |
503 |
* TRIGGER - triggerajouter. |
* TRIGGER - triggerajouter. |
504 |
* |
* |
505 |
* @param string $id |
* @param string $id |
523 |
! empty($json_payload['dossier']['dossier'])) { |
! empty($json_payload['dossier']['dossier'])) { |
524 |
$this->valF["dossier"] = $json_payload['dossier']['dossier']; |
$this->valF["dossier"] = $json_payload['dossier']['dossier']; |
525 |
} |
} |
526 |
|
} |
527 |
|
|
528 |
/** |
// gestion d'une tache de type notification et de category mail |
529 |
* Puisque le dossier n'a potentiellement pas encore été créé |
if (isset($val['type']) |
530 |
* alors il faut ne faut chercher à récupérer le numéro de dossier openADS |
&& ((//$val['type'] === 'notification_recepisse' |
531 |
* à partir de l'external_uids (en passant par la table de liens) |
$val['type'] === 'notification_instruction' |
532 |
// sinon si la tâche possède une clé external_uids/dossier |
|| $val['type'] === 'notification_decision') |
533 |
elseif(isset($json_payload['external_uids']['dossier']) && |
&& isset($val['category']) |
534 |
! empty($json_payload['external_uids']['dossier'])) { |
&& $val['category'] === 'mail') |
535 |
|
|| $val['type'] === 'notification_service_consulte' |
536 |
|
|| $val['type'] === 'notification_tiers_consulte' |
537 |
|
) { |
538 |
|
// Récupère la payload de la tache |
539 |
|
$data = array(); |
540 |
|
// TODO : pour l'instant la gestion des notifs des demandeurs a été séparée |
541 |
|
// de celle des autres type de notif afin de ne pas risquer de casser l'existant |
542 |
|
// et pour des contraintes de temps. A optimiser plus tard |
543 |
|
if ($val['type'] === 'notification_service_consulte' |
544 |
|
|| $val['type'] === 'notification_tiers_consulte') { |
545 |
|
$data['instruction_notification'] = $this->get_instruction_notification_data_annexe_multiple( |
546 |
|
$this->valF['category'], |
547 |
|
'with-id', |
548 |
|
array('with-id' => $this->valF['object_id']) |
549 |
|
); |
550 |
|
} else { |
551 |
|
$data['instruction_notification'] = $this->get_instruction_notification_data( |
552 |
|
$this->valF['category'], |
553 |
|
'with-id', |
554 |
|
array('with-id' => $this->valF['object_id']) |
555 |
|
); |
556 |
|
} |
557 |
|
$data['dossier'] = $this->get_dossier_data($this->valF['dossier']); |
558 |
|
|
559 |
// instancie l'objet lien_id_interne_uid_externe |
// Récupère l'instance de la notification |
560 |
$inst_lien = $this->f->get_inst__om_dbform(array( |
$inst_notif = $this->f->get_inst__om_dbform(array( |
561 |
"obj" => "lien_id_interne_uid_externe", |
"obj" => "instruction_notification", |
562 |
"idx" => ']', |
"idx" => $val['object_id'], |
563 |
|
)); |
564 |
|
// Envoi le mail et met à jour le suivi |
565 |
|
$envoiMail = $inst_notif->send_mail_notification($data, $val['type']); |
566 |
|
// Passage de la tache à done si elle a réussi et à error |
567 |
|
// si l'envoi a échoué |
568 |
|
$this->valF['state'] = 'done'; |
569 |
|
if ($envoiMail === false) { |
570 |
|
$this->valF['state'] = 'error'; |
571 |
|
} |
572 |
|
} |
573 |
|
} |
574 |
|
|
575 |
|
/** |
576 |
|
* TRIGGER - triggermodifierapres. |
577 |
|
* |
578 |
|
* @param string $id |
579 |
|
* @param null &$dnu1 @deprecated Ne pas utiliser. |
580 |
|
* @param array $val Tableau des valeurs brutes. |
581 |
|
* @param null $dnu2 @deprecated Ne pas utiliser. |
582 |
|
* |
583 |
|
* @return boolean |
584 |
|
*/ |
585 |
|
public function triggermodifierapres($id, &$dnu1 = null, $val = array(), $dnu2 = null) { |
586 |
|
parent::triggermodifierapres($id, $dnu1, $val, $dnu2); |
587 |
|
|
588 |
|
// Suivi des notificiations |
589 |
|
// En cas de changement de l'état de la tâche de notification, alors |
590 |
|
// le suivi des dates de la notification et de l'instruction, est effectué |
591 |
|
if (isset($val['category']) === true |
592 |
|
&& $val['category'] === 'portal' |
593 |
|
&& isset($val['type']) === true |
594 |
|
&& ($val['type'] === 'notification_recepisse' |
595 |
|
|| $val['type'] === 'notification_instruction' |
596 |
|
|| $val['type'] === 'notification_decision' |
597 |
|
|| $val['type'] === 'notification_service_consulte' |
598 |
|
|| $val['type'] === 'notification_tiers_consulte')) { |
599 |
|
// |
600 |
|
if (isset($this->valF['state']) === true |
601 |
|
&& $this->valF['state'] !== $this->getVal('state') |
602 |
|
&& $this->valF['state'] !== self::STATUS_CANCELED) { |
603 |
|
// |
604 |
|
$inst_in = $this->f->get_inst__om_dbform(array( |
605 |
|
"obj" => "instruction_notification", |
606 |
|
"idx" => $val['object_id'], |
607 |
)); |
)); |
608 |
if(! $dossier = $inst_lien->get_id_dossier_from_external_uid( |
$valF_in = array(); |
609 |
$json_payload['external_uids']['dossier'])){ |
foreach ($inst_in->champs as $champ) { |
610 |
$error_msg = sprintf( |
$valF_in[$champ] = $inst_in->getVal($champ); |
611 |
__("Aucune correspondance de dossier pour l'external_uid.dossier '%s'."), |
} |
612 |
$json_payload['external_uids']['dossier']); |
// Par défaut la date d'envoi et la date de premier accès sur |
613 |
$this->addToLog(__METHOD__."() : erreur : $error_msg", DEBUG_MODE); |
// la notification ne sont pas renseignées |
614 |
$this->addToMessage($error_msg); |
$valF_in['date_envoi'] = null; |
615 |
$this->correct = false; |
$valF_in['date_premier_acces'] = null; |
616 |
|
// Lorsque la tâche est correctement traitée |
617 |
|
if ($this->valF['state'] === self::STATUS_DONE) { |
618 |
|
// |
619 |
|
$valF_in['statut'] = __("envoyé"); |
620 |
|
$valF_in['commentaire'] = __("Notification traitée"); |
621 |
|
$valF_in['date_envoi'] = date('d/m/Y H:i:s'); |
622 |
|
// Si l'instruction possède un document lié, alors ses dates |
623 |
|
// de suivi sont mises à jour |
624 |
|
$inst_instruction = $this->f->get_inst__om_dbform(array( |
625 |
|
"obj" => "instruction", |
626 |
|
"idx" => $inst_in->getVal('instruction'), |
627 |
|
)); |
628 |
|
if ($inst_instruction->has_an_edition() === true) { |
629 |
|
$valF_instruction = array(); |
630 |
|
foreach ($inst_instruction->champs as $champ) { |
631 |
|
$valF_instruction[$champ] = $inst_instruction->getVal($champ); |
632 |
|
} |
633 |
|
$valF_instruction['date_envoi_rar'] = date('d/m/Y'); |
634 |
|
$valF_instruction['date_retour_rar'] = date('d/m/Y', strtotime('now + 1 day')); |
635 |
|
$inst_instruction->setParameter('maj', 1); |
636 |
|
$update_instruction = $inst_instruction->modifier($valF_instruction); |
637 |
|
if ($update_instruction === false) { |
638 |
|
$this->addToLog(__METHOD__."(): ".$inst_instruction->msg, DEBUG_MODE); |
639 |
|
return false; |
640 |
|
} |
641 |
|
} |
642 |
|
} |
643 |
|
// En cas d'erreur lors du traitement de la task |
644 |
|
if ($this->valF['state'] === self::STATUS_ERROR) { |
645 |
|
$valF_in['statut'] = __("échec"); |
646 |
|
$valF_in['commentaire'] = __("Le traitement de la notification a échoué"); |
647 |
|
} |
648 |
|
// Met à jour la notification |
649 |
|
$inst_in->setParameter('maj', 1); |
650 |
|
$update_in = $inst_in->modifier($valF_in); |
651 |
|
if ($update_in === false) { |
652 |
|
$this->addToLog(__METHOD__."(): ".$inst_in->msg, DEBUG_MODE); |
653 |
return false; |
return false; |
654 |
} |
} |
655 |
$this->valF["dossier"] = $dossier; |
} |
656 |
}*/ |
} |
657 |
|
|
658 |
|
// Envoi au contrôle de légalité |
659 |
|
// En cas de changement de l'état de la tâche envoi_CL, alors le suivi |
660 |
|
// des dates de l'instruction est effectué |
661 |
|
if ($val['type'] === 'envoi_CL' |
662 |
|
&& isset($this->valF['state']) === true |
663 |
|
&& $this->valF['state'] === self::STATUS_DONE) { |
664 |
|
// |
665 |
|
$inst_instruction = $this->f->get_inst__om_dbform(array( |
666 |
|
"obj" => "instruction", |
667 |
|
"idx" => $this->getVal('object_id'), |
668 |
|
)); |
669 |
|
if ($inst_instruction->has_an_edition() === true) { |
670 |
|
$valF_instruction = array(); |
671 |
|
foreach ($inst_instruction->champs as $champ) { |
672 |
|
$valF_instruction[$champ] = $inst_instruction->getVal($champ); |
673 |
|
} |
674 |
|
} |
675 |
|
$valF_instruction['date_envoi_controle_legalite'] = date("Y-m-d"); |
676 |
|
$inst_instruction->setParameter('maj', 1); |
677 |
|
$update_instruction = $inst_instruction->modifier($valF_instruction); |
678 |
|
if ($update_instruction === false) { |
679 |
|
$this->addToLog(__METHOD__."(): ".$inst_instruction->msg, DEBUG_MODE); |
680 |
|
return false; |
681 |
|
} |
682 |
} |
} |
683 |
|
|
684 |
|
// |
685 |
|
return true; |
686 |
} |
} |
687 |
|
|
688 |
/** |
/** |
694 |
*/ |
*/ |
695 |
public function add_task($params = array()) { |
public function add_task($params = array()) { |
696 |
$this->begin_treatment(__METHOD__); |
$this->begin_treatment(__METHOD__); |
697 |
$timestamp_log = json_encode(array( |
|
698 |
'creation_date' => date('Y-m-d H:i:s'), |
// Vérifie si la task doit être ajoutée en fonction du mode de l'application, |
699 |
)); |
// seulement pour les tasks output |
700 |
|
$task_types_si = self::TASK_TYPE_SI; |
701 |
|
$task_types_sc = self::TASK_TYPE_SC; |
702 |
|
$stream = isset($params['val']['stream']) === true ? $params['val']['stream'] : 'output'; |
703 |
|
if ($stream === 'output' |
704 |
|
&& isset($params['val']['type']) === true |
705 |
|
&& $this->f->is_option_mode_service_consulte_enabled() === true |
706 |
|
&& in_array($params['val']['type'], $task_types_sc) === false) { |
707 |
|
// |
708 |
|
return $this->end_treatment(__METHOD__, true); |
709 |
|
} |
710 |
|
if ($stream === 'output' |
711 |
|
&& isset($params['val']['type']) === true |
712 |
|
&& $this->f->is_option_mode_service_consulte_enabled() === false |
713 |
|
&& in_array($params['val']['type'], $task_types_si) === false) { |
714 |
|
// |
715 |
|
return $this->end_treatment(__METHOD__, true); |
716 |
|
} |
717 |
|
|
718 |
|
// |
719 |
|
$timestamp_log = json_encode(array()); |
720 |
|
|
721 |
|
// |
722 |
|
$category = isset($params['val']['category']) === true ? $params['val']['category'] : $this->category; |
723 |
|
|
724 |
// Si la tâche est de type ajout_piece et de stream input alors on ajoute le fichier |
// Si la tâche est de type ajout_piece et de stream input alors on ajoute le fichier |
725 |
// et on ajoute l'uid dans le champ json_payload avant l'ajout de la tâche |
// et on ajoute l'uid dans le champ json_payload avant l'ajout de la tâche |
726 |
if (isset($params['val']['type']) |
if (isset($params['val']['type']) |
727 |
&& $params['val']['type'] == "add_piece" |
&& ($params['val']['type'] == "add_piece" || $params['val']['type'] == "avis_consultation") |
728 |
&& isset($params['val']['stream']) |
&& isset($params['val']['stream']) |
729 |
&& $params['val']['stream'] == "input" ) { |
&& $params['val']['stream'] == "input" ) { |
730 |
// |
// |
731 |
$json_payload = json_decode($params['val']['json_payload'], true); |
$json_payload = json_decode($params['val']['json_payload'], true); |
732 |
$document_numerise = $json_payload['document_numerise']; |
if (json_last_error() !== JSON_ERROR_NONE) { |
733 |
$file_content = base64_decode($document_numerise["file_content"]); |
$this->addToMessage(__("Le contenu JSON de la tâche n'est pas valide.")); |
|
if ($file_content === false){ |
|
|
$this->addToMessage(__("Le contenu du fichier lié à la tâche n'a pas pu etre recupere.")); |
|
734 |
return $this->end_treatment(__METHOD__, false); |
return $this->end_treatment(__METHOD__, false); |
735 |
} |
} |
736 |
$metadata = array( |
if (isset($json_payload['document_numerise']) === true |
737 |
"filename" => $document_numerise['nom_fichier'], |
&& empty($json_payload['document_numerise']) === false) { |
738 |
"size" => strlen($file_content), |
// |
739 |
"mimetype" => $document_numerise['file_content_type'], |
$document_numerise = $json_payload['document_numerise']; |
740 |
"date_creation" => $document_numerise['date_creation'], |
$file_content = base64_decode($document_numerise["file_content"]); |
741 |
); |
if ($file_content === false){ |
742 |
$uid_fichier = $this->f->storage->create($file_content, $metadata, "from_content"); |
$this->addToMessage(__("Le contenu du fichier lié à la tâche n'a pas pu etre recupere.")); |
743 |
if ($uid_fichier === OP_FAILURE) { |
return $this->end_treatment(__METHOD__, false); |
744 |
$this->addToMessage(__("Erreur lors de la creation du fichier lié à la tâche.")); |
} |
745 |
return $this->end_treatment(__METHOD__, false); |
$metadata = array( |
746 |
|
"filename" => $document_numerise['nom_fichier'], |
747 |
|
"size" => strlen($file_content), |
748 |
|
"mimetype" => $document_numerise['file_content_type'], |
749 |
|
"date_creation" => isset($document_numerise['date_creation']) === true ? $document_numerise['date_creation'] : date("Y-m-d"), |
750 |
|
); |
751 |
|
$uid_fichier = $this->f->storage->create($file_content, $metadata, "from_content", "task.uid_fichier"); |
752 |
|
if ($uid_fichier === OP_FAILURE) { |
753 |
|
$this->addToMessage(__("Erreur lors de la creation du fichier lié à la tâche.")); |
754 |
|
return $this->end_treatment(__METHOD__, false); |
755 |
|
} |
756 |
|
$json_payload["document_numerise"]["uid"] = $uid_fichier; |
757 |
|
// Le fichier a été ajouté nous n'avons plus besoin du champ file_content dans la payload |
758 |
|
unset($json_payload["document_numerise"]["file_content"]); |
759 |
|
$params['val']['json_payload'] = json_encode($json_payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); |
760 |
} |
} |
|
$json_payload["document_numerise"]["uid"] = $uid_fichier; |
|
|
// Le fichier a été ajouté nous n'avons plus besoin du champ file_content dans la payload |
|
|
unset($json_payload["document_numerise"]["file_content"]); |
|
|
$params['val']['json_payload'] = json_encode($json_payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); |
|
761 |
} |
} |
762 |
|
|
763 |
// Mise à jour du DI |
// Mise à jour du DI |
768 |
'state' => isset($params['val']['state']) === true ? $params['val']['state'] : self::STATUS_NEW, |
'state' => isset($params['val']['state']) === true ? $params['val']['state'] : self::STATUS_NEW, |
769 |
'object_id' => isset($params['val']['object_id']) ? $params['val']['object_id'] : '', |
'object_id' => isset($params['val']['object_id']) ? $params['val']['object_id'] : '', |
770 |
'dossier' => isset($params['val']['dossier']) ? $params['val']['dossier'] : '', |
'dossier' => isset($params['val']['dossier']) ? $params['val']['dossier'] : '', |
771 |
'stream' => isset($params['val']['stream']) === true ? $params['val']['stream'] : 'output', |
'stream' => $stream, |
772 |
'json_payload' => isset($params['val']['json_payload']) === true ? $params['val']['json_payload'] : '{}', |
'json_payload' => isset($params['val']['json_payload']) === true ? $params['val']['json_payload'] : '{}', |
773 |
|
'category' => $category, |
774 |
|
'creation_date' => date('Y-m-d'), |
775 |
|
'creation_time' => date('H:i:s'), |
776 |
|
'last_modification_date' => null, |
777 |
|
'last_modification_time' => null, |
778 |
); |
); |
779 |
|
|
780 |
// tâche sortante |
// tâche sortante |
781 |
if($valF["stream"] == "output"){ |
$typeNonConcerne = array( |
782 |
|
'notification_recepisse', |
783 |
|
'notification_instruction', |
784 |
|
'notification_decision', |
785 |
|
'notification_service_consulte', |
786 |
|
'notification_tiers_consulte' |
787 |
|
); |
788 |
|
if ($valF["stream"] == "output" |
789 |
|
&& ! in_array($valF['type'], $typeNonConcerne)) { |
790 |
// TODO expliquer ce code |
// TODO expliquer ce code |
791 |
$task_exists = $this->task_exists($valF['type'], $valF['object_id']); |
$task_exists = $this->task_exists($valF['type'], $valF['object_id'], $valF['dossier']); |
792 |
if ($valF['type'] === 'modification_DI' && $task_exists === false) { |
if ($valF['type'] === 'modification_DI' && $task_exists === false) { |
793 |
$task_exists = $this->task_exists('creation_DI', $valF['object_id']); |
$task_exists = $this->task_exists('creation_DI', $valF['object_id']); |
794 |
} |
} |
795 |
|
if ($valF['type'] === 'modification_DA' && $task_exists === false) { |
796 |
|
$task_exists = $this->task_exists('creation_DA', $valF['object_id']); |
797 |
|
} |
798 |
|
if ($valF['type'] === 'ajout_piece') { |
799 |
|
$task_exists = $this->task_exists('ajout_piece', $valF['object_id']); |
800 |
|
} |
801 |
|
if ($valF['type'] === 'creation_consultation') { |
802 |
|
$task_exists = $this->task_exists('creation_consultation', $valF['object_id']); |
803 |
|
} |
804 |
if ($task_exists !== false) { |
if ($task_exists !== false) { |
805 |
$inst_task = $this->f->get_inst__om_dbform(array( |
$inst_task = $this->f->get_inst__om_dbform(array( |
806 |
"obj" => "task", |
"obj" => "task", |
814 |
'val' => array( |
'val' => array( |
815 |
'state' => $update_state, |
'state' => $update_state, |
816 |
), |
), |
817 |
|
'object_id' => $valF['object_id'], |
818 |
); |
); |
819 |
return $inst_task->update_task($update_params); |
return $inst_task->update_task($update_params); |
820 |
} |
} |
821 |
} |
} |
|
|
|
822 |
$add = $this->ajouter($valF); |
$add = $this->ajouter($valF); |
823 |
$this->addToLog(__METHOD__."(): retour de l'ajout de tâche: ".var_export($add, true), VERBOSE_MODE); |
$this->addToLog(__METHOD__."(): retour de l'ajout de tâche: ".var_export($add, true), VERBOSE_MODE); |
824 |
if ($add === false) { |
if ($add === false) { |
842 |
$this->addToLog(__METHOD__."(): erreur timestamp log", DEBUG_MODE); |
$this->addToLog(__METHOD__."(): erreur timestamp log", DEBUG_MODE); |
843 |
return $this->end_treatment(__METHOD__, false); |
return $this->end_treatment(__METHOD__, false); |
844 |
} |
} |
845 |
|
// Vérification des object_id précédent en cas de tentative d'appliquer |
846 |
|
// l'état CANCELED sur la tâche |
847 |
|
if (isset($params['val']['state']) === true |
848 |
|
&& $params['val']['state'] === self::STATUS_CANCELED) { |
849 |
|
// Récupération du journal d'activité de la tâche sous forme de tableau |
850 |
|
// trié par ordre décroissant |
851 |
|
$log = $timestamp_log; |
852 |
|
unset($log['creation_date']); |
853 |
|
krsort($log); |
854 |
|
// Pour chaque entrée dans le journal d'activité de la tâche : |
855 |
|
// - vérification de la présence de l'object_id précédent |
856 |
|
// - vérification que l'object_id précédent existe toujours dans la base de données |
857 |
|
// - l'object_id est mise à jour avec la valeur de l'object_id précédent |
858 |
|
// - le state n'est pas modifié |
859 |
|
// - sortie du traitement dès que le premier object_id précédent existant est trouvé |
860 |
|
// - si aucun object_id précédent existant n'est trouvé alors ni le state, ni l'object_id n'est modifiés |
861 |
|
foreach ($log as $key => $value) { |
862 |
|
// |
863 |
|
if (isset($value['prev_object_id']) === true |
864 |
|
&& $this->getVal('object_id') !== $value['prev_object_id']) { |
865 |
|
// Récupère la liste des tables potentielles pour un type de tâche |
866 |
|
$tables = $this->get_tables_by_task_type($this->getVal('type'), $this->getVal('stream')); |
867 |
|
foreach ($tables as $table) { |
868 |
|
// Vérifie s'il y a un ou aucun résultat |
869 |
|
$query = sprintf(' |
870 |
|
SELECT COUNT(%2$s) |
871 |
|
FROM %1$s%2$s |
872 |
|
WHERE %2$s::CHARACTER VARYING = \'%3$s\' |
873 |
|
', |
874 |
|
DB_PREFIXE, |
875 |
|
$table, |
876 |
|
$value['prev_object_id'] |
877 |
|
); |
878 |
|
$res = $this->f->get_one_result_from_db_query($query, true); |
879 |
|
if ($res['code'] === 'KO') { |
880 |
|
return $this->end_treatment(__METHOD__, false); |
881 |
|
} |
882 |
|
// Affectation des valeurs et sortie de la boucle |
883 |
|
if ($res['result'] == '1') { |
884 |
|
$params['object_id'] = $value['prev_object_id']; |
885 |
|
$params['val']['state'] = $this->getVal('state'); |
886 |
|
break; |
887 |
|
} |
888 |
|
} |
889 |
|
// Sortie de la boucle si les valeurs sont affectées |
890 |
|
if (isset($params['object_id']) === true |
891 |
|
&& $params['object_id'] === $value['prev_object_id']) { |
892 |
|
// |
893 |
|
break; |
894 |
|
} |
895 |
|
} |
896 |
|
} |
897 |
|
} |
898 |
|
// Mise à jour du journal d'activité de la tâche |
899 |
array_push($timestamp_log, array( |
array_push($timestamp_log, array( |
900 |
'modification_date' => date('Y-m-d H:i:s'), |
'modification_date' => date('Y-m-d H:i:s'), |
901 |
'state' => $params['val']['state'], |
'state' => $params['val']['state'], |
902 |
'prev_state' => $this->getVal('state'), |
'prev_state' => $this->getVal('state'), |
903 |
|
'object_id' => isset($params['object_id']) == true ? $params['object_id'] : $this->getVal('object_id'), |
904 |
|
'prev_object_id' => $this->getVal('object_id'), |
905 |
)); |
)); |
906 |
$timestamp_log = json_encode($timestamp_log); |
$timestamp_log = json_encode($timestamp_log); |
907 |
|
// Mise à jour de la tâche |
908 |
$valF = array( |
$valF = array( |
909 |
'task' => $this->getVal($this->clePrimaire), |
'task' => $this->getVal($this->clePrimaire), |
910 |
'type' => $this->getVal('type'), |
'type' => $this->getVal('type'), |
911 |
'timestamp_log' => $timestamp_log, |
'timestamp_log' => $timestamp_log, |
912 |
'state' => $params['val']['state'], |
'state' => $params['val']['state'], |
913 |
'object_id' => $this->getVal('object_id'), |
'object_id' => isset($params['object_id']) == true ? $params['object_id'] : $this->getVal('object_id'), |
914 |
'stream' => $this->getVal('stream'), |
'stream' => $this->getVal('stream'), |
915 |
'dossier' => $this->getVal('dossier'), |
'dossier' => $this->getVal('dossier'), |
916 |
'json_payload' => $this->getVal('json_payload'), |
'json_payload' => $this->getVal('json_payload'), |
917 |
|
'category' => $this->getVal('category'), |
918 |
|
'creation_date' => $this->getVal('creation_date'), |
919 |
|
'creation_time' => $this->getVal('creation_time'), |
920 |
|
'last_modification_date' => date('Y-m-d'), |
921 |
|
'last_modification_time' => date('H:i:s'), |
922 |
); |
); |
923 |
$update = $this->modifier($valF); |
$update = $this->modifier($valF); |
924 |
if ($update === false) { |
if ($update === false) { |
967 |
|
|
968 |
protected function view_tab_json() { |
protected function view_tab_json() { |
969 |
$where = ''; |
$where = ''; |
970 |
if ($this->f->get_submitted_get_value('state') !== null |
$category = null; |
971 |
&& $this->f->get_submitted_get_value('state') !== '') { |
// Liste des paramètres possibles pour la recherche des tâches |
972 |
|
$params = array( |
973 |
|
'task', |
974 |
|
'type', |
975 |
|
'state', |
976 |
|
'object_id', |
977 |
|
'dossier', |
978 |
|
'stream', |
979 |
|
'category', |
980 |
|
'lien_id_interne_uid_externe', |
981 |
|
'object', |
982 |
|
'external_uid', |
983 |
|
); |
984 |
|
// Pour chaque paramètre possible, vérification de son existance et de sa |
985 |
|
// valeur pour compléter la requête de recherche |
986 |
|
foreach ($params as $param) { |
987 |
// |
// |
988 |
$where = sprintf(' WHERE state = \'%s\' ', $this->f->get_submitted_get_value('state')); |
if ($this->f->get_submitted_get_value($param) !== null |
989 |
|
&& $this->f->get_submitted_get_value($param) !== '') { |
990 |
|
// Condition spécifique au champ 'category' |
991 |
|
if ($param === 'category') { |
992 |
|
$category = $this->f->get_submitted_get_value('category'); |
993 |
|
} |
994 |
|
// |
995 |
|
$where_or_and = 'WHERE'; |
996 |
|
if ($where !== '') { |
997 |
|
$where_or_and = 'AND'; |
998 |
|
} |
999 |
|
$table = 'task'; |
1000 |
|
if ($param === 'lien_id_interne_uid_externe' |
1001 |
|
|| $param === 'object' |
1002 |
|
|| $param === 'external_uid') { |
1003 |
|
// |
1004 |
|
$table = 'lien_id_interne_uid_externe'; |
1005 |
|
} |
1006 |
|
$where .= sprintf(' %s %s.%s = \'%s\' ', $where_or_and, $table, $param, $this->f->get_submitted_get_value($param)); |
1007 |
|
} |
1008 |
} |
} |
1009 |
|
// |
1010 |
$query = sprintf(' |
$query = sprintf(' |
1011 |
SELECT |
SELECT |
1012 |
* |
task.* |
1013 |
FROM %1$stask |
FROM %1$stask |
1014 |
|
LEFT JOIN %1$slien_id_interne_uid_externe |
1015 |
|
ON task.object_id = lien_id_interne_uid_externe.object_id |
1016 |
|
AND task.category = lien_id_interne_uid_externe.category |
1017 |
%2$s |
%2$s |
1018 |
ORDER BY task ASC |
ORDER BY task ASC |
1019 |
', |
', |
1026 |
} |
} |
1027 |
$list_tasks = array(); |
$list_tasks = array(); |
1028 |
foreach ($res['result'] as $task) { |
foreach ($res['result'] as $task) { |
1029 |
$task['timestamp_log'] = json_decode($task['timestamp_log'], true); |
unset($task['timestamp_log']); |
1030 |
$task['dossier'] = $task['object_id']; |
unset($task['json_payload']); |
1031 |
if ($this->get_lien_objet_by_type($task['type']) === 'document_numerise') { |
if ($task['type'] === 'ajout_piece') { |
1032 |
$val_dn = $this->get_document_numerise_data($task['object_id']); |
$val_dn = $this->get_document_numerise_data($task['object_id']); |
1033 |
$task['dossier'] = $val_dn['dossier']; |
} |
1034 |
|
if ($task['stream'] === 'output') { |
1035 |
|
$task['external_uids'] = array_merge( |
1036 |
|
$this->get_all_external_uids($task['dossier'], array(), $category !== null ? $category : $task['category']), |
1037 |
|
$this->get_all_external_uids($task['object_id'], array(), $category !== null ? $category : $task['category']) |
1038 |
|
); |
1039 |
} |
} |
1040 |
$list_tasks[$task['task']] = $task; |
$list_tasks[$task['task']] = $task; |
1041 |
} |
} |
1042 |
printf(json_encode($list_tasks)); |
echo(json_encode($list_tasks)); |
1043 |
} |
} |
1044 |
|
|
1045 |
protected function get_dossier_data(string $dossier) { |
protected function get_dossier_data(string $dossier) { |
1048 |
"obj" => "dossier", |
"obj" => "dossier", |
1049 |
"idx" => $dossier, |
"idx" => $dossier, |
1050 |
)); |
)); |
1051 |
|
if (empty($inst_di->val) === true) { |
1052 |
|
return $val_di; |
1053 |
|
} |
1054 |
$val_di = $inst_di->get_json_data(); |
$val_di = $inst_di->get_json_data(); |
1055 |
if ($val_di['dossier_instruction_type_code'] === 'T') { |
if ($val_di['dossier_instruction_type_code'] === 'T') { |
1056 |
$val_di['date_decision_transfert'] = $val_di['date_decision']; |
$val_di['date_decision_transfert'] = $val_di['date_decision']; |
1181 |
return $val_dt; |
return $val_dt; |
1182 |
} |
} |
1183 |
|
|
1184 |
protected function get_external_uid($fk_idx, string $fk_idx_2) { |
/** |
1185 |
|
* Récupère la liste des objets distincts existants dans la table des liens |
1186 |
|
* entre identifiants internes et identifiants externes. |
1187 |
|
* |
1188 |
|
* @return array |
1189 |
|
*/ |
1190 |
|
protected function get_list_distinct_objects_external_link() { |
1191 |
|
$query = sprintf(' |
1192 |
|
SELECT |
1193 |
|
DISTINCT(object) |
1194 |
|
FROM %1$slien_id_interne_uid_externe |
1195 |
|
ORDER BY object ASC |
1196 |
|
', |
1197 |
|
DB_PREFIXE |
1198 |
|
); |
1199 |
|
$res = $this->f->get_all_results_from_db_query($query, true); |
1200 |
|
if ($res['code'] === 'KO') { |
1201 |
|
return array(); |
1202 |
|
} |
1203 |
|
$result = array(); |
1204 |
|
foreach ($res['result'] as $object) { |
1205 |
|
$result[] = $object['object']; |
1206 |
|
} |
1207 |
|
return $result; |
1208 |
|
} |
1209 |
|
|
1210 |
|
protected function get_external_uid($fk_idx, string $fk_idx_2, $fk_idx_3 = 'platau', $order_asc_desc = 'DESC') { |
1211 |
$inst_external_uid = $this->f->get_inst__by_other_idx(array( |
$inst_external_uid = $this->f->get_inst__by_other_idx(array( |
1212 |
"obj" => "lien_id_interne_uid_externe", |
"obj" => "lien_id_interne_uid_externe", |
1213 |
"fk_field" => 'object_id', |
"fk_field" => 'object_id', |
1214 |
"fk_idx" => $fk_idx, |
"fk_idx" => $fk_idx, |
1215 |
"fk_field_2" => 'object', |
"fk_field_2" => 'object', |
1216 |
"fk_idx_2" => $fk_idx_2, |
"fk_idx_2" => $fk_idx_2, |
1217 |
|
"fk_field_3" => 'category', |
1218 |
|
"fk_idx_3" => $fk_idx_3, |
1219 |
|
"order_field" => 'lien_id_interne_uid_externe', |
1220 |
|
"order_asc_desc" => $order_asc_desc, |
1221 |
)); |
)); |
1222 |
return $inst_external_uid->getVal('external_uid'); |
return $inst_external_uid->getVal('external_uid'); |
1223 |
} |
} |
1224 |
|
|
1225 |
protected function get_demandeurs_data(string $dossier) { |
protected function get_all_external_uids($fk_idx, $link_objects = array(), $category='platau') { |
1226 |
|
if (count($link_objects) == 0) { |
1227 |
|
$link_objects = $this->get_list_distinct_objects_external_link(); |
1228 |
|
} |
1229 |
|
$val_external_uid = array(); |
1230 |
|
foreach ($link_objects as $link_object) { |
1231 |
|
$external_uid = $this->get_external_uid($fk_idx, $link_object, $category); |
1232 |
|
if ($external_uid !== '' && $external_uid !== null) { |
1233 |
|
$val_external_uid[$link_object] = $external_uid; |
1234 |
|
} |
1235 |
|
} |
1236 |
|
return $val_external_uid; |
1237 |
|
} |
1238 |
|
|
1239 |
|
protected function get_demandeurs_data($dossier) { |
1240 |
$val_demandeur = array(); |
$val_demandeur = array(); |
1241 |
|
if ($dossier === null) { |
1242 |
|
return $val_demandeur; |
1243 |
|
} |
1244 |
$inst_di = $this->f->get_inst__om_dbform(array( |
$inst_di = $this->f->get_inst__om_dbform(array( |
1245 |
"obj" => "dossier", |
"obj" => "dossier", |
1246 |
"idx" => $dossier, |
"idx" => $dossier, |
1271 |
return $val_architecte; |
return $val_architecte; |
1272 |
} |
} |
1273 |
|
|
1274 |
protected function get_instruction_data(string $dossier, $type = 'decision', $extra_params = array()) { |
protected function get_instruction_data($dossier, $type = 'decision', $extra_params = array()) { |
1275 |
$val_instruction = null; |
$val_instruction = null; |
1276 |
|
if ($dossier === null) { |
1277 |
|
return $val_instruction; |
1278 |
|
} |
1279 |
$instruction_with_doc = null; |
$instruction_with_doc = null; |
1280 |
$inst_di = $this->f->get_inst__om_dbform(array( |
$inst_di = $this->f->get_inst__om_dbform(array( |
1281 |
"obj" => "dossier", |
"obj" => "dossier", |
1335 |
return $val_instruction; |
return $val_instruction; |
1336 |
} |
} |
1337 |
|
|
1338 |
|
/** |
1339 |
|
* Récupère les informations |
1340 |
|
*/ |
1341 |
|
protected function get_instruction_notification_data($category, $type = '', $extra_params = array()) { |
1342 |
|
$val_in = null; |
1343 |
|
|
1344 |
|
$idx = null; |
1345 |
|
if ($type === 'with-id') { |
1346 |
|
$idx = $extra_params['with-id']; |
1347 |
|
} |
1348 |
|
|
1349 |
|
// récupére les données à intégrer à la payload |
1350 |
|
$inst_in = $this->f->get_inst__om_dbform(array( |
1351 |
|
"obj" => "instruction_notification", |
1352 |
|
"idx" => $idx, |
1353 |
|
)); |
1354 |
|
if (count($inst_in->val) > 0) { |
1355 |
|
$val_in = $inst_in->get_json_data(); |
1356 |
|
|
1357 |
|
$val_in['parametre_courriel_type_titre'] = ''; |
1358 |
|
$val_in['parametre_courriel_type_message'] = ''; |
1359 |
|
// Récupération du message et du titre |
1360 |
|
if ($category === 'mail') { |
1361 |
|
$inst_instruction = $this->f->get_inst__om_dbform(array( |
1362 |
|
"obj" => "instruction", |
1363 |
|
"idx" => $inst_in->getVal('instruction'), |
1364 |
|
)); |
1365 |
|
$collectivite_id = $inst_instruction->get_dossier_instruction_om_collectivite($inst_instruction->getVal('dossier')); |
1366 |
|
$phrase_type_notification = array(); |
1367 |
|
$phrase_type_notification = $this->f->get_notification_parametre_courriel_type($collectivite_id, $this->valF['type']); |
1368 |
|
$val_in['parametre_courriel_type_titre'] = $phrase_type_notification['parametre_courriel_type_titre']; |
1369 |
|
$val_in['parametre_courriel_type_message'] = $phrase_type_notification['parametre_courriel_type_message']; |
1370 |
|
} |
1371 |
|
|
1372 |
|
// Récupération des liens vers les documents et de l'id de l'instruction |
1373 |
|
// de l'annexe |
1374 |
|
$infoDocNotif = $inst_in->getInfosDocumentsNotif($inst_in->getVal($inst_in->clePrimaire)); |
1375 |
|
$val_in['lien_telechargement_document'] = $infoDocNotif['document']['lien']; |
1376 |
|
$val_in['lien_telechargement_annexe'] = $infoDocNotif['annexe']['lien']; |
1377 |
|
$val_in['instruction_annexe'] = $infoDocNotif['annexe']['id_instruction']; |
1378 |
|
} |
1379 |
|
|
1380 |
|
return $val_in; |
1381 |
|
} |
1382 |
|
|
1383 |
|
/** |
1384 |
|
* Récupère les informations pour les notifications ayant plusieurs annexe |
1385 |
|
*/ |
1386 |
|
protected function get_instruction_notification_data_annexe_multiple($category, $type = '', $extra_params = array()) { |
1387 |
|
$val_in = null; |
1388 |
|
|
1389 |
|
$idx = null; |
1390 |
|
if ($type === 'with-id') { |
1391 |
|
$idx = $extra_params['with-id']; |
1392 |
|
} |
1393 |
|
|
1394 |
|
// récupére les données à intégrer à la payload |
1395 |
|
$inst_in = $this->f->get_inst__om_dbform(array( |
1396 |
|
"obj" => "instruction_notification", |
1397 |
|
"idx" => $idx, |
1398 |
|
)); |
1399 |
|
if (count($inst_in->val) > 0) { |
1400 |
|
$val_in = $inst_in->get_json_data(); |
1401 |
|
|
1402 |
|
$val_in['parametre_courriel_type_titre'] = ''; |
1403 |
|
$val_in['parametre_courriel_type_message'] = ''; |
1404 |
|
// Récupération du message et du titre |
1405 |
|
if ($category === 'mail') { |
1406 |
|
$inst_instruction = $this->f->get_inst__om_dbform(array( |
1407 |
|
"obj" => "instruction", |
1408 |
|
"idx" => $inst_in->getVal('instruction'), |
1409 |
|
)); |
1410 |
|
$collectivite_id = $inst_instruction->get_dossier_instruction_om_collectivite($inst_instruction->getVal('dossier')); |
1411 |
|
$phrase_type_notification = array(); |
1412 |
|
$phrase_type_notification = $this->f->get_notification_parametre_courriel_type($collectivite_id, $this->valF['type']); |
1413 |
|
$val_in['parametre_courriel_type_titre'] = $phrase_type_notification['parametre_courriel_type_titre']; |
1414 |
|
$val_in['parametre_courriel_type_message'] = $phrase_type_notification['parametre_courriel_type_message']; |
1415 |
|
} |
1416 |
|
|
1417 |
|
// Récupération des liens vers les documents et de l'id de l'instruction |
1418 |
|
// de l'annexe |
1419 |
|
$infoDocNotif = $inst_in->getInfosDocumentsNotifAnnexeMultiple($inst_in->getVal($inst_in->clePrimaire)); |
1420 |
|
$val_in['lien_telechargement_document'] = $infoDocNotif['document']['lien']; |
1421 |
|
$val_in['annexes'] = $infoDocNotif['annexes']; |
1422 |
|
} |
1423 |
|
|
1424 |
|
return $val_in; |
1425 |
|
} |
1426 |
|
|
1427 |
protected function sort_instruction_data(array $values, array $res) { |
protected function sort_instruction_data(array $values, array $res) { |
1428 |
$fields = array( |
$fields = array( |
1429 |
"date_evenement", |
"date_evenement", |
1437 |
"om_fichier_instruction", |
"om_fichier_instruction", |
1438 |
"tacite", |
"tacite", |
1439 |
"lettretype", |
"lettretype", |
1440 |
|
"commentaire", |
1441 |
|
"complement_om_html", |
1442 |
); |
); |
1443 |
foreach ($values as $key => $value) { |
foreach ($values as $key => $value) { |
1444 |
if (in_array($key, $fields) === true) { |
if (in_array($key, $fields) === true) { |
1457 |
return $res; |
return $res; |
1458 |
} |
} |
1459 |
|
|
1460 |
|
/** |
1461 |
|
* Permet de définir si l'instruction passée en paramètre est une instruction |
1462 |
|
* récépissé d'une demande et si la demande en question a générée un dossier d'instruction. |
1463 |
|
* |
1464 |
|
* @param integer $instruction Identifiant de l'instruction |
1465 |
|
* @return boolean |
1466 |
|
*/ |
1467 |
|
protected function is_demande_instruction_recepisse_without_dossier($instruction) { |
1468 |
|
if ($instruction === null) { |
1469 |
|
return false; |
1470 |
|
} |
1471 |
|
$query = sprintf(' |
1472 |
|
SELECT demande_type.dossier_instruction_type |
1473 |
|
FROM %1$sdemande |
1474 |
|
INNER JOIN %1$sdemande_type ON demande.demande_type = demande_type.demande_type |
1475 |
|
WHERE demande.instruction_recepisse = %2$s |
1476 |
|
', |
1477 |
|
DB_PREFIXE, |
1478 |
|
$instruction |
1479 |
|
); |
1480 |
|
$res = $this->f->get_one_result_from_db_query( |
1481 |
|
$query, |
1482 |
|
true |
1483 |
|
); |
1484 |
|
if ($res['code'] === 'KO') { |
1485 |
|
return null; |
1486 |
|
} |
1487 |
|
if ($res['result'] === '') { |
1488 |
|
return true; |
1489 |
|
} |
1490 |
|
return false; |
1491 |
|
} |
1492 |
|
|
1493 |
protected function get_document_numerise_data(string $dn) { |
protected function get_document_numerise_data(string $dn) { |
1494 |
$val_dn = array(); |
$val_dn = array(); |
1495 |
$inst_dn = $this->f->get_inst__om_dbform(array( |
$inst_dn = $this->f->get_inst__om_dbform(array( |
1522 |
return $val_dp; |
return $val_dp; |
1523 |
} |
} |
1524 |
|
|
1525 |
|
protected function get_avis_decision_data(string $dossier) { |
1526 |
|
$inst_di = $this->f->get_inst__om_dbform(array( |
1527 |
|
"obj" => "dossier", |
1528 |
|
"idx" => $dossier, |
1529 |
|
)); |
1530 |
|
$ad = $inst_di->getVal('avis_decision'); |
1531 |
|
$val_ad = array(); |
1532 |
|
if ($ad !== null) { |
1533 |
|
$inst_ad = $this->f->get_inst__om_dbform(array( |
1534 |
|
"obj" => "avis_decision", |
1535 |
|
"idx" => $ad, |
1536 |
|
)); |
1537 |
|
$val_ad = $inst_ad->get_json_data(); |
1538 |
|
$val_ad['txAvis'] = "Voir document joint"; |
1539 |
|
if (isset($val_ad['tacite']) === true |
1540 |
|
&& $val_ad['tacite'] === 't') { |
1541 |
|
// |
1542 |
|
$val_ad['txAvis'] = "Sans objet"; |
1543 |
|
} |
1544 |
|
} |
1545 |
|
return $val_ad; |
1546 |
|
} |
1547 |
|
|
1548 |
|
protected function get_signataire_arrete_data(string $sa) { |
1549 |
|
$inst_sa = $this->f->get_inst__om_dbform(array( |
1550 |
|
"obj" => "signataire_arrete", |
1551 |
|
"idx" => $sa, |
1552 |
|
)); |
1553 |
|
$val_sa = array_combine($inst_sa->champs, $inst_sa->val); |
1554 |
|
foreach ($val_sa as $key => $value) { |
1555 |
|
$val_sa[$key] = strip_tags($value); |
1556 |
|
} |
1557 |
|
return $val_sa; |
1558 |
|
} |
1559 |
|
|
1560 |
|
// XXX WIP |
1561 |
|
protected function get_consultation_data(string $consultation) { |
1562 |
|
$val_consultation = array(); |
1563 |
|
$inst_consultation = $this->f->get_inst__om_dbform(array( |
1564 |
|
"obj" => "consultation", |
1565 |
|
"idx" => $consultation, |
1566 |
|
)); |
1567 |
|
$val_consultation = $inst_consultation->get_json_data(); |
1568 |
|
if (isset($val_consultation['fichier']) === true |
1569 |
|
&& $val_consultation['fichier'] !== '') { |
1570 |
|
// |
1571 |
|
$val_consultation['path_fichier'] = sprintf('%s&snippet=%s&obj=%s&champ=%s&id=%s', 'app/index.php?module=form', 'file', 'consultation', 'fichier', $this->getVal('object_id')); |
1572 |
|
} |
1573 |
|
if (isset($val_consultation['om_fichier_consultation']) === true |
1574 |
|
&& $val_consultation['om_fichier_consultation'] !== '') { |
1575 |
|
// |
1576 |
|
$val_consultation['path_om_fichier_consultation'] = sprintf('%s&snippet=%s&obj=%s&champ=%s&id=%s', 'app/index.php?module=form', 'file', 'consultation', 'om_fichier_consultation', $this->getVal('object_id')); |
1577 |
|
} |
1578 |
|
return $val_consultation; |
1579 |
|
} |
1580 |
|
|
1581 |
|
// XXX WIP |
1582 |
|
protected function get_service_data(string $service) { |
1583 |
|
$val_service = array(); |
1584 |
|
$inst_service = $this->f->get_inst__om_dbform(array( |
1585 |
|
"obj" => "service", |
1586 |
|
"idx" => $service, |
1587 |
|
)); |
1588 |
|
$val_service = $inst_service->get_json_data(); |
1589 |
|
return $val_service; |
1590 |
|
} |
1591 |
|
|
1592 |
protected function view_form_json($in_field = false) { |
protected function view_form_json($in_field = false) { |
1593 |
// |
// |
1594 |
if ($this->f->get_submitted_post_value('valid') === null) { |
if ($this->f->get_submitted_post_value('valid') === null |
1595 |
|
&& $this->getVal('state') !== self::STATUS_CANCELED) { |
1596 |
// Liste des valeurs à afficher |
// Liste des valeurs à afficher |
1597 |
$val = array(); |
$val = array(); |
1598 |
// |
// |
1603 |
$val_task['timestamp_log'] = json_decode($val_task['timestamp_log'], true); |
$val_task['timestamp_log'] = json_decode($val_task['timestamp_log'], true); |
1604 |
$val['task'] = $val_task; |
$val['task'] = $val_task; |
1605 |
// |
// |
1606 |
if ($this->getVal('type') === 'creation_DA') { |
if ($this->getVal('type') === 'creation_DA' |
1607 |
|
|| $this->getVal('type') === 'modification_DA') { |
1608 |
|
// |
1609 |
$val['dossier_autorisation'] = $this->get_dossier_autorisation_data($this->getVal('object_id')); |
$val['dossier_autorisation'] = $this->get_dossier_autorisation_data($this->getVal('object_id')); |
1610 |
$val['donnees_techniques'] = $this->get_donnees_techniques_data($this->getVal('object_id'), 'dossier_autorisation'); |
$val['donnees_techniques'] = $this->get_donnees_techniques_data($this->getVal('object_id'), 'dossier_autorisation'); |
1611 |
$val['dossier_autorisation_parcelle'] = $this->get_parcelles_data('dossier_autorisation', $val['dossier_autorisation']['dossier_autorisation']); |
$val['dossier_autorisation_parcelle'] = $this->get_parcelles_data('dossier_autorisation', $val['dossier_autorisation']['dossier_autorisation']); |
1631 |
} |
} |
1632 |
// |
// |
1633 |
if ($this->getVal('type') === 'qualification_DI') { |
if ($this->getVal('type') === 'qualification_DI') { |
1634 |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
$val['dossier'] = $this->get_dossier_data($this->getVal('dossier')); |
1635 |
$val_external_uid = array(); |
$val_external_uid = array(); |
1636 |
$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'); |
1637 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
1644 |
$val_external_uid = array(); |
$val_external_uid = array(); |
1645 |
$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'); |
1646 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
1647 |
$val_external_uid['document_numerise'] = $this->get_external_uid($val['document_numerise']['document_numerise'], 'document_numerise'); |
$val_external_uid['piece'] = $this->get_external_uid($val['document_numerise']['document_numerise'], 'piece'); |
1648 |
$val['external_uids'] = $val_external_uid; |
$val['external_uids'] = $val_external_uid; |
1649 |
} |
} |
1650 |
// |
// |
1651 |
if ($this->getVal('type') === 'decision_DI') { |
if ($this->getVal('type') === 'decision_DI') { |
1652 |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
$val['dossier'] = $this->get_dossier_data($this->getVal('dossier')); |
1653 |
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier']); |
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier'], 'with-id', array('with-id' => $this->getVal('object_id'))); |
1654 |
|
$val['instruction']['final'] = 't'; |
1655 |
|
if (isset($val['instruction']['signataire_arrete']) === true) { |
1656 |
|
$val['signataire_arrete'] = $this->get_signataire_arrete_data($val['instruction']['signataire_arrete']); |
1657 |
|
} |
1658 |
$val_external_uid = array(); |
$val_external_uid = array(); |
1659 |
$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'); |
1660 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
1662 |
} |
} |
1663 |
// |
// |
1664 |
if ($this->getVal('type') === 'incompletude_DI') { |
if ($this->getVal('type') === 'incompletude_DI') { |
1665 |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
$val['dossier'] = $this->get_dossier_data($this->getVal('dossier')); |
1666 |
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier'], 'incompletude'); |
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier'], 'with-id', array('with-id' => $this->getVal('object_id'))); |
1667 |
$val_external_uid = array(); |
$val_external_uid = array(); |
1668 |
$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'); |
1669 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
1671 |
} |
} |
1672 |
// |
// |
1673 |
if ($this->getVal('type') === 'completude_DI') { |
if ($this->getVal('type') === 'completude_DI') { |
1674 |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
$val['dossier'] = $this->get_dossier_data($this->getVal('dossier')); |
1675 |
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier'], 'completude'); |
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier'], 'with-id', array('with-id' => $this->getVal('object_id'))); |
1676 |
$val_external_uid = array(); |
$val_external_uid = array(); |
1677 |
$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'); |
1678 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
1685 |
$val_external_uid = array(); |
$val_external_uid = array(); |
1686 |
$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'); |
1687 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
1688 |
$val_external_uid['consultation'] = $this->get_external_uid($val['dossier']['dossier'], 'consultation'); |
$val_external_uid['dossier_consultation'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier_consultation'); |
1689 |
|
$val['external_uids'] = $val_external_uid; |
1690 |
|
} |
1691 |
|
// |
1692 |
|
if ($this->getVal('type') === 'avis_consultation') { |
1693 |
|
$val['dossier'] = $this->get_dossier_data($this->getVal('dossier')); |
1694 |
|
$val['instruction'] = $this->get_instruction_data($this->getVal('dossier'), 'with-id', array('with-id' => $this->getVal('object_id'))); |
1695 |
|
$val['avis_decision'] = $this->get_avis_decision_data($this->getVal('dossier')); |
1696 |
|
if (isset($val['instruction']['signataire_arrete']) === true) { |
1697 |
|
$val['signataire_arrete'] = $this->get_signataire_arrete_data($val['instruction']['signataire_arrete']); |
1698 |
|
} |
1699 |
|
$val_external_uid = array(); |
1700 |
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
1701 |
|
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
1702 |
|
$val_external_uid['dossier_consultation'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier_consultation'); |
1703 |
|
$val_external_uid['avis_dossier_consultation'] = $this->get_external_uid($this->getVal('object_id'), 'avis_dossier_consultation'); |
1704 |
|
$val['external_uids'] = $val_external_uid; |
1705 |
|
} |
1706 |
|
// XXX WIP |
1707 |
|
if ($this->getVal('type') === 'creation_consultation') { |
1708 |
|
// |
1709 |
|
$val['dossier'] = $this->get_dossier_data($this->getVal('dossier')); |
1710 |
|
$val['consultation'] = $this->get_consultation_data($this->getVal('object_id')); |
1711 |
|
$val['service'] = $this->get_service_data($val['consultation']['service']); |
1712 |
|
$val_external_uid = array(); |
1713 |
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
1714 |
|
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
1715 |
|
$val['external_uids'] = $val_external_uid; |
1716 |
|
} |
1717 |
|
// |
1718 |
|
if ($this->getVal('type') === 'envoi_CL') { |
1719 |
|
// |
1720 |
|
$val['dossier'] = $this->get_dossier_data($this->getVal('dossier')); |
1721 |
|
$val['instruction'] = $this->get_instruction_data($this->getVal('dossier'), 'with-id', array('with-id' => $this->getVal('object_id'))); |
1722 |
|
$val['dossier_autorisation'] = $this->get_dossier_autorisation_data($val['dossier']['dossier_autorisation']); |
1723 |
|
$val_external_uid = array(); |
1724 |
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
1725 |
|
$val_external_uid['dossier'] = $this->get_external_uid($this->getVal('dossier'), 'dossier'); |
1726 |
|
$val_external_uid['decision'] = $this->get_external_uid($this->getVal('object_id'), 'instruction'); |
1727 |
|
if ($val_external_uid['decision'] === '') { |
1728 |
|
$inst_instruction = $this->f->get_inst__om_dbform(array( |
1729 |
|
"obj" => "instruction", |
1730 |
|
"idx" => $this->getVal('object_id'), |
1731 |
|
)); |
1732 |
|
$val_external_uid['decision'] = $this->get_external_uid($inst_instruction->get_related_instructions_next('retour_signature'), 'instruction'); |
1733 |
|
} |
1734 |
|
$val['external_uids'] = $val_external_uid; |
1735 |
|
} |
1736 |
|
// |
1737 |
|
if ($this->getVal('type') === 'notification_instruction' |
1738 |
|
|| $this->getVal('type') === 'notification_recepisse' |
1739 |
|
|| $this->getVal('type') === 'notification_decision') { |
1740 |
|
// |
1741 |
|
$val['dossier'] = $this->get_dossier_data($this->getVal('dossier')); |
1742 |
|
$dossier_id = isset($val['dossier']['dossier']) === true ? $val['dossier']['dossier'] : null; |
1743 |
|
$val['demandeur'] = $this->get_demandeurs_data($dossier_id); |
1744 |
|
$val['instruction_notification'] = $this->get_instruction_notification_data($this->getVal('category'), 'with-id', array('with-id' => $this->getVal('object_id'))); |
1745 |
|
$instruction_id = isset($val['instruction_notification']['instruction']) === true ? $val['instruction_notification']['instruction'] : null; |
1746 |
|
$instruction_annexe = isset($val['instruction_notification']['instruction_annexe']) === true ? $val['instruction_notification']['instruction_annexe'] : null; |
1747 |
|
$val['instruction'] = $this->get_instruction_data($dossier_id, 'with-id', array('with-id' => $instruction_id)); |
1748 |
|
// Précise qu'il s'agit d'une instruction final si l'instruction est liée à une |
1749 |
|
// demande dont le type ne génère pas de dossier |
1750 |
|
if ($this->is_demande_instruction_recepisse_without_dossier($instruction_id) === true) { |
1751 |
|
$val['instruction']['final'] = 't'; |
1752 |
|
} |
1753 |
|
// |
1754 |
|
if ($instruction_annexe != '') { |
1755 |
|
$val['instruction_annexe'] = $this->get_instruction_data($dossier_id, 'with-id', array('with-id' => $instruction_annexe)); |
1756 |
|
} |
1757 |
|
$val_external_uid = array(); |
1758 |
|
// Affiche l'identifiant de la demande concernant le dossier d'instruction |
1759 |
|
$val_external_uid['demande'] = $this->get_external_uid($dossier_id, 'demande', 'portal', 'ASC'); |
1760 |
|
$val_external_uid['demande (instruction)'] = $this->get_external_uid($instruction_id, 'demande', 'portal', 'ASC'); |
1761 |
|
$val_external_uid['instruction_notification'] = $this->get_external_uid($this->getVal('object_id'), 'instruction_notification', 'portal'); |
1762 |
|
$val['external_uids'] = $val_external_uid; |
1763 |
|
} |
1764 |
|
if ($this->getVal('type') === 'notification_service_consulte' |
1765 |
|
|| $this->getVal('type') === 'notification_tiers_consulte') { |
1766 |
|
// |
1767 |
|
$val['dossier'] = $this->get_dossier_data($this->getVal('dossier')); |
1768 |
|
$dossier_id = isset($val['dossier']['dossier']) === true ? $val['dossier']['dossier'] : null; |
1769 |
|
$val['demandeur'] = $this->get_demandeurs_data($dossier_id); |
1770 |
|
$val['instruction_notification'] = $this->get_instruction_notification_data_annexe_multiple($this->getVal('category'), 'with-id', array('with-id' => $this->getVal('object_id'))); |
1771 |
|
$instruction_id = isset($val['instruction_notification']['instruction']) === true ? $val['instruction_notification']['instruction'] : null; |
1772 |
|
$instruction_annexes = isset($val['instruction_notification']['annexes']) === true ? $val['instruction_notification']['annexes'] : null; |
1773 |
|
$val['instruction'] = $this->get_instruction_data($dossier_id, 'with-id', array('with-id' => $instruction_id)); |
1774 |
|
// Précise qu'il s'agit d'une instruction final si l'instruction est liée à une |
1775 |
|
// demande dont le type ne génère pas de dossier |
1776 |
|
if ($this->is_demande_instruction_recepisse_without_dossier($instruction_id) === true) { |
1777 |
|
$val['instruction']['final'] = 't'; |
1778 |
|
} |
1779 |
|
// |
1780 |
|
if (is_array($instruction_annexes) && $instruction_annexes != array()) { |
1781 |
|
$val['instruction_annexe'] = array(); |
1782 |
|
$numAnnexe = 0; |
1783 |
|
foreach ($instruction_annexes as $annexe) { |
1784 |
|
if ($annexe['document_type'] === 'instruction') { |
1785 |
|
$val['instruction_annexe']['annexe_'.$numAnnexe++] = $this->get_instruction_data($dossier_id, 'with-id', array('with-id' => $annexe['document_id'])); |
1786 |
|
} elseif ($annexe['document_type'] === 'consultation') { |
1787 |
|
$val['instruction_annexe']['annexe_'.$numAnnexe++] = $this->get_consultation_data($annexe['document_id']); |
1788 |
|
} |
1789 |
|
} |
1790 |
|
} |
1791 |
|
$val_external_uid = array(); |
1792 |
|
// Affiche l'identifiant externe lié à l'instruction si cette combinaison existe, sinon celui lié au dossier |
1793 |
|
$val_external_uid['demande'] = $this->get_external_uid($instruction_id, 'demande') !== '' ? $this->get_external_uid($instruction_id, 'demande') : $this->get_external_uid($dossier_id, 'demande'); |
1794 |
|
$val['external_uids'] = $val_external_uid; |
1795 |
|
} |
1796 |
|
// |
1797 |
|
if ($this->getVal('type') === 'prescription') { |
1798 |
|
$val['dossier'] = $this->get_dossier_data($this->getVal('dossier')); |
1799 |
|
$val['instruction'] = $this->get_instruction_data($this->getVal('dossier'), 'with-id', array('with-id' => $this->getVal('object_id'))); |
1800 |
|
$val['avis_decision'] = $this->get_avis_decision_data($this->getVal('dossier')); |
1801 |
|
if (isset($val['instruction']['signataire_arrete']) === true) { |
1802 |
|
$val['signataire_arrete'] = $this->get_signataire_arrete_data($val['instruction']['signataire_arrete']); |
1803 |
|
} |
1804 |
|
$val_external_uid = array(); |
1805 |
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
1806 |
|
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
1807 |
|
$val_external_uid['dossier_consultation'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier_consultation'); |
1808 |
|
$val_external_uid['prescription'] = $this->get_external_uid($this->getVal('object_id'), 'prescription'); |
1809 |
$val['external_uids'] = $val_external_uid; |
$val['external_uids'] = $val_external_uid; |
1810 |
} |
} |
1811 |
|
|
1813 |
return json_encode($val, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); |
return json_encode($val, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); |
1814 |
} else { |
} else { |
1815 |
// Liste des valeurs affichée en JSON |
// Liste des valeurs affichée en JSON |
1816 |
printf(json_encode($val, JSON_UNESCAPED_SLASHES)); |
echo(json_encode($val, JSON_UNESCAPED_SLASHES)); |
1817 |
} |
} |
1818 |
} |
} |
1819 |
} |
} |
1820 |
|
|
1821 |
function post_update_task() { |
function post_update_task() { |
1822 |
// Mise à jour des valeurs |
// Mise à jour des valeurs |
1823 |
// |
|
1824 |
$params = array( |
// Modification de l'état de la tâche |
1825 |
'val' => array( |
if ($this->f->get_submitted_post_value('state') !== null) { |
1826 |
'state' => $this->f->get_submitted_post_value('state') |
$params = array( |
1827 |
), |
'val' => array( |
1828 |
); |
'state' => $this->f->get_submitted_post_value('state') |
1829 |
$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.') |
|
1830 |
); |
); |
1831 |
|
$update = $this->update_task($params); |
1832 |
|
$message_class = "valid"; |
1833 |
|
$message = $this->msg; |
1834 |
|
if ($update === false) { |
1835 |
|
$this->addToLog($this->msg, DEBUG_MODE); |
1836 |
|
$message_class = "error"; |
1837 |
|
$message = sprintf( |
1838 |
|
'%s %s', |
1839 |
|
__('Impossible de mettre à jour la tâche.'), |
1840 |
|
__('Veuillez contacter votre administrateur.') |
1841 |
|
); |
1842 |
|
} |
1843 |
|
$this->f->displayMessage($message_class, $message); |
1844 |
} |
} |
1845 |
$this->f->displayMessage($message_class, $message); |
|
1846 |
// |
// Sauvegarde de l'uid externe retourné |
1847 |
$inst_lien = $this->f->get_inst__om_dbform(array( |
if ($this->f->get_submitted_post_value('external_uid') !== null) { |
1848 |
"obj" => "lien_id_interne_uid_externe", |
// |
1849 |
"idx" => ']', |
$objects = $this->get_objects_by_task_type($this->getVal('type'), $this->getVal('stream')); |
1850 |
)); |
foreach ($objects as $object) { |
1851 |
$valF = array( |
$inst_lien = $this->f->get_inst__om_dbform(array( |
1852 |
'lien_id_interne_uid_externe' => '', |
"obj" => "lien_id_interne_uid_externe", |
1853 |
'object' => $this->get_lien_objet_by_type($this->getVal('type')), |
"idx" => ']', |
1854 |
'object_id' => $this->getVal('object_id'), |
)); |
1855 |
'external_uid' => $this->f->get_submitted_post_value('external_uid'), |
$object_id = $this->getVal('object_id'); |
1856 |
); |
$is_exists = $inst_lien->is_exists($object, $object_id, $this->f->get_submitted_post_value('external_uid'), $this->getVal('dossier')); |
1857 |
$add = $inst_lien->ajouter($valF); |
// Dans le cas spécifique de la mise à jour d'une notification |
1858 |
$message_class = "valid"; |
// et de la création d'une liaison d'identifiant pour l'objet demande, |
1859 |
$message = $inst_lien->msg; |
// l'identifiant de l'objet n'est plus celui de la notification |
1860 |
if ($add === false) { |
// d'instruction mais celui du dossier d'instruction |
1861 |
$this->addToLog($inst_lien->msg, DEBUG_MODE); |
if ($object === 'demande' |
1862 |
$message_class = "error"; |
&& ($this->getVal('type') === 'notification_recepisse' |
1863 |
$message = sprintf( |
|| $this->getVal('type') === 'notification_instruction' |
1864 |
'%s %s', |
|| $this->getVal('type') === 'notification_decision' |
1865 |
__("Impossible de mettre à jour le lien entre l'identifiant interne et l'identifiant de l'application externe."), |
|| $this->getVal('type') === 'notification_service_consulte' |
1866 |
__('Veuillez contacter votre administrateur.') |
|| $this->getVal('type') === 'notification_tiers_consulte')) { |
1867 |
); |
// |
1868 |
|
$object_id = $this->getVal('dossier'); |
1869 |
|
// Il ne doit y avoir qu'une liaison entre le numéro du dossier interne et un uid externe de "demande" |
1870 |
|
$is_exists = $inst_lien->is_exists($object, $object_id, null, $this->getVal('dossier')); |
1871 |
|
} |
1872 |
|
if ($is_exists === false) { |
1873 |
|
$valF = array( |
1874 |
|
'lien_id_interne_uid_externe' => '', |
1875 |
|
'object' => $object, |
1876 |
|
'object_id' => $object_id, |
1877 |
|
'external_uid' => $this->f->get_submitted_post_value('external_uid'), |
1878 |
|
'dossier' => $this->getVal('dossier'), |
1879 |
|
'category' => $this->getVal('category'), |
1880 |
|
); |
1881 |
|
$add = $inst_lien->ajouter($valF); |
1882 |
|
$message_class = "valid"; |
1883 |
|
$message = $inst_lien->msg; |
1884 |
|
if ($add === false) { |
1885 |
|
$this->addToLog($inst_lien->msg, DEBUG_MODE); |
1886 |
|
$message_class = "error"; |
1887 |
|
$message = sprintf( |
1888 |
|
'%s %s', |
1889 |
|
__("Impossible de mettre à jour le lien entre l'identifiant interne et l'identifiant de l'application externe."), |
1890 |
|
__('Veuillez contacter votre administrateur.') |
1891 |
|
); |
1892 |
|
} |
1893 |
|
$this->f->displayMessage($message_class, $message); |
1894 |
|
} |
1895 |
|
} |
1896 |
} |
} |
|
$this->f->displayMessage($message_class, $message); |
|
1897 |
} |
} |
1898 |
|
|
1899 |
function post_add_task() { |
function post_add_task() { |
1903 |
'stream' => 'input', |
'stream' => 'input', |
1904 |
'json_payload' => html_entity_decode($this->f->get_submitted_post_value('json_payload')), |
'json_payload' => html_entity_decode($this->f->get_submitted_post_value('json_payload')), |
1905 |
'type' => $this->f->get_submitted_post_value('type'), |
'type' => $this->f->get_submitted_post_value('type'), |
1906 |
|
'category' => $this->f->get_submitted_post_value('category'), |
1907 |
) |
) |
1908 |
)); |
)); |
1909 |
$message = $this->msg; |
$message = sprintf( |
1910 |
|
__("Tâche %s ajoutée avec succès"), |
1911 |
|
$this->getVal($this->clePrimaire)). |
1912 |
|
'<br/><br/>'. |
1913 |
|
$this->msg; |
1914 |
$message_class = "valid"; |
$message_class = "valid"; |
1915 |
if ($result === false){ |
if ($result === false){ |
1916 |
$this->addToLog($this->msg, DEBUG_MODE); |
$this->addToLog($this->msg, DEBUG_MODE); |
1924 |
$this->f->displayMessage($message_class, $message); |
$this->f->displayMessage($message_class, $message); |
1925 |
} |
} |
1926 |
|
|
|
function get_lien_objet_by_type($type) { |
|
|
// |
|
|
$objet = ''; |
|
|
if ($type === 'creation_DA') { |
|
|
$objet = 'dossier_autorisation'; |
|
|
} |
|
|
if ($type === 'creation_DI' |
|
|
|| $type === 'create_DI_for_consultation' |
|
|
|| $type === 'depot_DI' |
|
|
|| $type === 'modification_DI' |
|
|
|| $type === 'qualification_DI' |
|
|
|| $type === 'decision_DI' |
|
|
|| $type === 'incompletude_DI' |
|
|
|| $type === 'completude_DI' |
|
|
|| $type === 'pec_metier_consultation') { |
|
|
// |
|
|
$objet = 'dossier'; |
|
|
} |
|
|
if ($type === 'ajout_piece') { |
|
|
$objet = 'document_numerise'; |
|
|
} |
|
|
// La tâche entrante se nomme add_piece |
|
|
if ($type === 'add_piece') { |
|
|
$objet = 'piece'; |
|
|
} |
|
|
return $objet; |
|
|
} |
|
|
|
|
1927 |
function setLayout(&$form, $maj) { |
function setLayout(&$form, $maj) { |
1928 |
|
|
1929 |
// Récupération du mode de l'action |
// Récupération du mode de l'action |
1938 |
$form->setBloc('timestamp_log', 'DF', '', 'col_9'); |
$form->setBloc('timestamp_log', 'DF', '', 'col_9'); |
1939 |
} |
} |
1940 |
|
|
1941 |
|
/** |
1942 |
|
* Récupère le nom de l'objet à mentionner dans la table lien_id_interne_uid_externe |
1943 |
|
* en fonction du type et du stream de la tâche. |
1944 |
|
* |
1945 |
|
* @param string $type Type de la tâche |
1946 |
|
* @param string $stream Stream de la tâche |
1947 |
|
* |
1948 |
|
* @return array |
1949 |
|
*/ |
1950 |
|
function get_objects_by_task_type($type, $stream = 'all') { |
1951 |
|
$objects = array(); |
1952 |
|
if (in_array($type, array('creation_DA', 'modification_DA', )) === true) { |
1953 |
|
$objects = array('dossier_autorisation', ); |
1954 |
|
} |
1955 |
|
if (in_array($type, array('creation_DI', 'depot_DI', 'notification_DI', 'qualification_DI', )) === true) { |
1956 |
|
$objects = array('dossier', ); |
1957 |
|
} |
1958 |
|
if (in_array($type, array('create_DI_for_consultation', )) === true) { |
1959 |
|
$objects = array('dossier', 'dossier_consultation', ); |
1960 |
|
} |
1961 |
|
if (in_array($type, array('create_DI', )) === true |
1962 |
|
&& $stream === 'input') { |
1963 |
|
$objects = array('dossier', 'dossier_autorisation', 'demande', ); |
1964 |
|
} |
1965 |
|
if (in_array($type, array('decision_DI', 'incompletude_DI', 'completude_DI', )) === true) { |
1966 |
|
$objects = array('instruction', ); |
1967 |
|
} |
1968 |
|
if (in_array($type, array('envoi_CL', )) === true) { |
1969 |
|
$objects = array('instruction_action_cl', ); |
1970 |
|
} |
1971 |
|
if (in_array($type, array('pec_metier_consultation', )) === true |
1972 |
|
&& $stream === 'output') { |
1973 |
|
$objects = array('pec_dossier_consultation', ); |
1974 |
|
} |
1975 |
|
if (in_array($type, array('avis_consultation', )) === true |
1976 |
|
&& $stream === 'output') { |
1977 |
|
$objects = array('avis_dossier_consultation', ); |
1978 |
|
} |
1979 |
|
if (in_array($type, array('prescription', )) === true |
1980 |
|
&& $stream === 'output') { |
1981 |
|
$objects = array('prescription', ); |
1982 |
|
} |
1983 |
|
if (in_array($type, array('ajout_piece', 'add_piece', )) === true) { |
1984 |
|
$objects = array('piece', ); |
1985 |
|
} |
1986 |
|
if (in_array($type, array('creation_consultation', )) === true) { |
1987 |
|
$objects = array('consultation', ); |
1988 |
|
} |
1989 |
|
if (in_array($type, array('pec_metier_consultation', )) === true |
1990 |
|
&& $stream === 'input') { |
1991 |
|
$objects = array('pec_metier_consultation', ); |
1992 |
|
} |
1993 |
|
if (in_array($type, array('avis_consultation', )) === true |
1994 |
|
&& $stream === 'input') { |
1995 |
|
$objects = array('avis_consultation', ); |
1996 |
|
} |
1997 |
|
if (in_array($type, array('create_message', )) === true |
1998 |
|
&& $stream === 'input') { |
1999 |
|
$objects = array('dossier_message', ); |
2000 |
|
} |
2001 |
|
if (in_array( |
2002 |
|
$type, |
2003 |
|
array( |
2004 |
|
'notification_recepisse', |
2005 |
|
'notification_instruction', |
2006 |
|
'notification_decision', |
2007 |
|
'notification_service_consulte', |
2008 |
|
'notification_tiers_consulte', |
2009 |
|
) |
2010 |
|
) === true) { |
2011 |
|
$objects = array('instruction_notification', 'demande', ); |
2012 |
|
} |
2013 |
|
return $objects; |
2014 |
|
} |
2015 |
|
|
2016 |
|
/** |
2017 |
|
* Récupère les tables auxquelles pourrait être rattaché l'objet lié à la tâche, |
2018 |
|
* par rapport à son type. |
2019 |
|
* |
2020 |
|
* @param string $type Type de la tâche |
2021 |
|
* @param string $stream input ou output |
2022 |
|
* @return array |
2023 |
|
*/ |
2024 |
|
function get_tables_by_task_type($type, $stream = 'all') { |
2025 |
|
$tables = array(); |
2026 |
|
if (in_array($type, array('creation_DA', 'modification_DA', )) === true) { |
2027 |
|
$tables = array('dossier_autorisation', ); |
2028 |
|
} |
2029 |
|
if (in_array($type, array('creation_DI', 'depot_DI', )) === true) { |
2030 |
|
$tables = array('dossier', ); |
2031 |
|
} |
2032 |
|
if (in_array($type, array('qualification_DI', )) === true) { |
2033 |
|
$tables = array('instruction', 'dossier', ); |
2034 |
|
} |
2035 |
|
if (in_array($type, array('create_DI_for_consultation', )) === true) { |
2036 |
|
$tables = array('dossier', ); |
2037 |
|
} |
2038 |
|
if (in_array($type, array('create_DI', )) === true |
2039 |
|
&& $stream === 'input') { |
2040 |
|
$tables = array('dossier', 'dossier_autorisation', 'demande', ); |
2041 |
|
} |
2042 |
|
if (in_array($type, array('decision_DI', 'incompletude_DI', 'completude_DI', )) === true) { |
2043 |
|
$tables = array('instruction', ); |
2044 |
|
} |
2045 |
|
if (in_array($type, array('pec_metier_consultation', )) === true |
2046 |
|
&& $stream === 'output') { |
2047 |
|
$tables = array('instruction', ); |
2048 |
|
} |
2049 |
|
if (in_array($type, array('avis_consultation', )) === true |
2050 |
|
&& $stream === 'output') { |
2051 |
|
$tables = array('instruction', ); |
2052 |
|
} |
2053 |
|
if (in_array($type, array('prescription', )) === true |
2054 |
|
&& $stream === 'output') { |
2055 |
|
$tables = array('instruction', ); |
2056 |
|
} |
2057 |
|
if (in_array($type, array('ajout_piece', 'add_piece', )) === true) { |
2058 |
|
$tables = array('document_numerise', ); |
2059 |
|
} |
2060 |
|
if (in_array($type, array('creation_consultation', )) === true) { |
2061 |
|
$tables = array('consultation', ); |
2062 |
|
} |
2063 |
|
if (in_array($type, array('pec_metier_consultation', )) === true |
2064 |
|
&& $stream === 'input') { |
2065 |
|
$tables = array('consultation', ); |
2066 |
|
} |
2067 |
|
if (in_array($type, array('avis_consultation', )) === true |
2068 |
|
&& $stream === 'input') { |
2069 |
|
$tables = array('consultation', ); |
2070 |
|
} |
2071 |
|
if (in_array($type, array('create_message', )) === true |
2072 |
|
&& $stream === 'input') { |
2073 |
|
$tables = array('dossier_message', ); |
2074 |
|
} |
2075 |
|
if (in_array( |
2076 |
|
$type, |
2077 |
|
array( |
2078 |
|
'notification_recepisse', |
2079 |
|
'notification_instruction', |
2080 |
|
'notification_decision', |
2081 |
|
'notification_service_consulte', |
2082 |
|
'notification_tiers_consulte' |
2083 |
|
) |
2084 |
|
) === true) { |
2085 |
|
$tables = array('instruction_notification', ); |
2086 |
|
} |
2087 |
|
return $tables; |
2088 |
|
} |
2089 |
|
|
2090 |
} |
} |