423 |
type = \'%3$s\' |
type = \'%3$s\' |
424 |
AND (object_id = \'%4$s\' |
AND (object_id = \'%4$s\' |
425 |
%5$s) |
%5$s) |
426 |
|
AND state != \'%6$s\' |
427 |
', |
', |
428 |
DB_PREFIXE, |
DB_PREFIXE, |
429 |
$is_not_done == true ? 'state != \''.self::STATUS_DONE.'\' AND' : '', |
$is_not_done == true ? 'state != \''.self::STATUS_DONE.'\' AND' : '', |
430 |
$type, |
$type, |
431 |
$object_id, |
$object_id, |
432 |
$dossier !== null ? sprintf('OR dossier = \'%s\'', $dossier) : '' |
$dossier !== null ? sprintf('OR dossier = \'%s\'', $dossier) : '', |
433 |
|
self::STATUS_CANCELED |
434 |
); |
); |
435 |
$res = $this->f->get_one_result_from_db_query($query); |
$res = $this->f->get_one_result_from_db_query($query); |
436 |
if ($res['result'] !== null && $res['result'] !== '') { |
if ($res['result'] !== null && $res['result'] !== '') { |
440 |
} |
} |
441 |
|
|
442 |
/** |
/** |
443 |
|
* Permet la recherche multi-critères des tasks. |
444 |
|
* |
445 |
|
* @param array $search_values Chaque entrée du tableau est une ligne dans le WHERE |
446 |
|
* @return mixed Retourne le résultat de la requête ou false |
447 |
|
*/ |
448 |
|
public function task_exists_multi_search(array $search_values) { |
449 |
|
$query = sprintf(' |
450 |
|
SELECT task |
451 |
|
FROM %1$stask |
452 |
|
%2$s |
453 |
|
%3$s |
454 |
|
', |
455 |
|
DB_PREFIXE, |
456 |
|
empty($search_values) === false ? ' WHERE ' : '', |
457 |
|
implode(' AND ', $search_values) |
458 |
|
); |
459 |
|
$res = $this->f->get_all_results_from_db_query($query); |
460 |
|
if (count($res['result']) > 0) { |
461 |
|
return $res['result']; |
462 |
|
} |
463 |
|
return false; |
464 |
|
} |
465 |
|
|
466 |
|
/** |
467 |
* TRIGGER - triggerajouter. |
* TRIGGER - triggerajouter. |
468 |
* |
* |
469 |
* @param string $id |
* @param string $id |
535 |
parent::triggermodifierapres($id, $dnu1, $val, $dnu2); |
parent::triggermodifierapres($id, $dnu1, $val, $dnu2); |
536 |
|
|
537 |
// Suivi des notificiations |
// Suivi des notificiations |
538 |
|
// En cas de changement de l'état de la tâche de notification, alors |
539 |
|
// le suivi des dates de la notification et de l'instruction, est effectué |
540 |
if (isset($val['category']) === true |
if (isset($val['category']) === true |
541 |
&& $val['category'] === 'portal' |
&& $val['category'] === 'portal' |
542 |
&& isset($val['type']) === true |
&& isset($val['type']) === true |
545 |
|| $val['type'] === 'notification_decision')) { |
|| $val['type'] === 'notification_decision')) { |
546 |
// |
// |
547 |
if (isset($this->valF['state']) === true |
if (isset($this->valF['state']) === true |
548 |
&& $this->valF['state'] !== $this->getVal('state')) { |
&& $this->valF['state'] !== $this->getVal('state') |
549 |
|
&& $this->valF['state'] !== self::STATUS_CANCELED) { |
550 |
// |
// |
551 |
$inst_in = $this->f->get_inst__om_dbform(array( |
$inst_in = $this->f->get_inst__om_dbform(array( |
552 |
"obj" => "instruction_notification", |
"obj" => "instruction_notification", |
556 |
foreach ($inst_in->champs as $champ) { |
foreach ($inst_in->champs as $champ) { |
557 |
$valF_in[$champ] = $inst_in->getVal($champ); |
$valF_in[$champ] = $inst_in->getVal($champ); |
558 |
} |
} |
559 |
|
// Par défaut la date d'envoi et la date de premier accès sur |
560 |
|
// la notification ne sont pas renseignées |
561 |
$valF_in['date_envoi'] = null; |
$valF_in['date_envoi'] = null; |
562 |
$valF_in['date_premier_acces'] = null; |
$valF_in['date_premier_acces'] = null; |
563 |
// |
// Lorsque la tâche est correctement traitée |
564 |
if ($this->valF['state'] === self::STATUS_DONE) { |
if ($this->valF['state'] === self::STATUS_DONE) { |
565 |
// |
// |
566 |
$valF_in['statut'] = __("envoyé"); |
$valF_in['statut'] = __("envoyé"); |
567 |
$valF_in['commentaire'] = __("Notification traitée"); |
$valF_in['commentaire'] = __("Notification traitée"); |
568 |
$valF_in['date_envoi'] = date('d/m/Y H:i:s'); |
$valF_in['date_envoi'] = date('d/m/Y H:i:s'); |
569 |
// |
// Si l'instruction possède un document lié, alors ses dates |
570 |
|
// de suivi sont mises à jour |
571 |
$inst_instruction = $this->f->get_inst__om_dbform(array( |
$inst_instruction = $this->f->get_inst__om_dbform(array( |
572 |
"obj" => "instruction", |
"obj" => "instruction", |
573 |
"idx" => $inst_in->getVal('instruction'), |
"idx" => $inst_in->getVal('instruction'), |
587 |
} |
} |
588 |
} |
} |
589 |
} |
} |
590 |
|
// En cas d'erreur lors du traitement de la task |
591 |
if ($this->valF['state'] === self::STATUS_ERROR) { |
if ($this->valF['state'] === self::STATUS_ERROR) { |
592 |
$valF_in['statut'] = __("échec"); |
$valF_in['statut'] = __("échec"); |
593 |
$valF_in['commentaire'] = __("Le traitement de la notification a échoué"); |
$valF_in['commentaire'] = __("Le traitement de la notification a échoué"); |
594 |
} |
} |
595 |
|
// Met à jour la notification |
596 |
$inst_in->setParameter('maj', 1); |
$inst_in->setParameter('maj', 1); |
597 |
$update_in = $inst_in->modifier($valF_in); |
$update_in = $inst_in->modifier($valF_in); |
598 |
if ($update_in === false) { |
if ($update_in === false) { |
729 |
'val' => array( |
'val' => array( |
730 |
'state' => $update_state, |
'state' => $update_state, |
731 |
), |
), |
732 |
|
'object_id' => $valF['object_id'], |
733 |
); |
); |
734 |
return $inst_task->update_task($update_params); |
return $inst_task->update_task($update_params); |
735 |
} |
} |
757 |
$this->addToLog(__METHOD__."(): erreur timestamp log", DEBUG_MODE); |
$this->addToLog(__METHOD__."(): erreur timestamp log", DEBUG_MODE); |
758 |
return $this->end_treatment(__METHOD__, false); |
return $this->end_treatment(__METHOD__, false); |
759 |
} |
} |
760 |
|
// Vérification des object_id précédent en cas de tentative d'appliquer |
761 |
|
// l'état CANCELED sur la tâche |
762 |
|
if (isset($params['val']['state']) === true |
763 |
|
&& $params['val']['state'] === self::STATUS_CANCELED) { |
764 |
|
// Récupération du journal d'activité de la tâche sous forme de tableau |
765 |
|
// trié par ordre décroissant |
766 |
|
$log = $timestamp_log; |
767 |
|
unset($log['creation_date']); |
768 |
|
krsort($log); |
769 |
|
// Pour chaque entrée dans le journal d'activité de la tâche : |
770 |
|
// - vérification de la présence de l'object_id précédent |
771 |
|
// - vérification que l'object_id précédent existe toujours dans la base de données |
772 |
|
// - l'object_id est mise à jour avec la valeur de l'object_id précédent |
773 |
|
// - le state n'est pas modifié |
774 |
|
// - sortie du traitement dès que le premier object_id précédent existant est trouvé |
775 |
|
// - si aucun object_id précédent existant n'est trouvé alors ni le state, ni l'object_id n'est modifiés |
776 |
|
foreach ($log as $key => $value) { |
777 |
|
// |
778 |
|
if (isset($value['prev_object_id']) === true |
779 |
|
&& $this->getVal('object_id') !== $value['prev_object_id']) { |
780 |
|
// Récupère la liste des tables potentielles pour un type de tâche |
781 |
|
$tables = $this->get_tables_by_task_type($this->getVal('type'), $this->getVal('stream')); |
782 |
|
foreach ($tables as $table) { |
783 |
|
// Vérifie s'il y a un ou aucun résultat |
784 |
|
$query = sprintf(' |
785 |
|
SELECT COUNT(%2$s) |
786 |
|
FROM %1$s%2$s |
787 |
|
WHERE %2$s = \'%3$s\' |
788 |
|
', |
789 |
|
DB_PREFIXE, |
790 |
|
$table, |
791 |
|
$value['prev_object_id'] |
792 |
|
); |
793 |
|
$res = $this->f->get_one_result_from_db_query($query, true); |
794 |
|
if ($res['code'] === 'KO') { |
795 |
|
return $this->end_treatment(__METHOD__, false); |
796 |
|
} |
797 |
|
// Affectation des valeurs et sortie de la boucle |
798 |
|
if ($res['result'] == '1') { |
799 |
|
$params['object_id'] = $value['prev_object_id']; |
800 |
|
$params['val']['state'] = $this->getVal('state'); |
801 |
|
break; |
802 |
|
} |
803 |
|
} |
804 |
|
// Sortie de la boucle si les valeurs sont affectées |
805 |
|
if (isset($params['object_id']) === true |
806 |
|
&& $params['object_id'] === $value['prev_object_id']) { |
807 |
|
// |
808 |
|
break; |
809 |
|
} |
810 |
|
} |
811 |
|
} |
812 |
|
} |
813 |
|
// Mise à jour du journal d'activité de la tâche |
814 |
array_push($timestamp_log, array( |
array_push($timestamp_log, array( |
815 |
'modification_date' => date('Y-m-d H:i:s'), |
'modification_date' => date('Y-m-d H:i:s'), |
816 |
'state' => $params['val']['state'], |
'state' => $params['val']['state'], |
817 |
'prev_state' => $this->getVal('state'), |
'prev_state' => $this->getVal('state'), |
818 |
|
'object_id' => isset($params['object_id']) == true ? $params['object_id'] : $this->getVal('object_id'), |
819 |
|
'prev_object_id' => $this->getVal('object_id'), |
820 |
)); |
)); |
821 |
$timestamp_log = json_encode($timestamp_log); |
$timestamp_log = json_encode($timestamp_log); |
822 |
|
// Mise à jour de la tâche |
823 |
$valF = array( |
$valF = array( |
824 |
'task' => $this->getVal($this->clePrimaire), |
'task' => $this->getVal($this->clePrimaire), |
825 |
'type' => $this->getVal('type'), |
'type' => $this->getVal('type'), |
826 |
'timestamp_log' => $timestamp_log, |
'timestamp_log' => $timestamp_log, |
827 |
'state' => $params['val']['state'], |
'state' => $params['val']['state'], |
828 |
'object_id' => isset($params['object_id']) == true && $this->getVal('type') == 'create_DI' ? $params['object_id'] : $this->getVal('object_id'), |
'object_id' => isset($params['object_id']) == true ? $params['object_id'] : $this->getVal('object_id'), |
829 |
'stream' => $this->getVal('stream'), |
'stream' => $this->getVal('stream'), |
830 |
'dossier' => $this->getVal('dossier'), |
'dossier' => $this->getVal('dossier'), |
831 |
'json_payload' => $this->getVal('json_payload'), |
'json_payload' => $this->getVal('json_payload'), |
931 |
"obj" => "dossier", |
"obj" => "dossier", |
932 |
"idx" => $dossier, |
"idx" => $dossier, |
933 |
)); |
)); |
934 |
|
if (empty($inst_di->val) === true) { |
935 |
|
return $val_di; |
936 |
|
} |
937 |
$val_di = $inst_di->get_json_data(); |
$val_di = $inst_di->get_json_data(); |
938 |
if ($val_di['dossier_instruction_type_code'] === 'T') { |
if ($val_di['dossier_instruction_type_code'] === 'T') { |
939 |
$val_di['date_decision_transfert'] = $val_di['date_decision']; |
$val_di['date_decision_transfert'] = $val_di['date_decision']; |
1115 |
return $val_external_uid; |
return $val_external_uid; |
1116 |
} |
} |
1117 |
|
|
1118 |
protected function get_demandeurs_data(string $dossier) { |
protected function get_demandeurs_data($dossier) { |
1119 |
$val_demandeur = array(); |
$val_demandeur = array(); |
1120 |
|
if ($dossier === null) { |
1121 |
|
return $val_demandeur; |
1122 |
|
} |
1123 |
$inst_di = $this->f->get_inst__om_dbform(array( |
$inst_di = $this->f->get_inst__om_dbform(array( |
1124 |
"obj" => "dossier", |
"obj" => "dossier", |
1125 |
"idx" => $dossier, |
"idx" => $dossier, |
1150 |
return $val_architecte; |
return $val_architecte; |
1151 |
} |
} |
1152 |
|
|
1153 |
protected function get_instruction_data(string $dossier, $type = 'decision', $extra_params = array()) { |
protected function get_instruction_data($dossier, $type = 'decision', $extra_params = array()) { |
1154 |
$val_instruction = null; |
$val_instruction = null; |
1155 |
|
if ($dossier === null) { |
1156 |
|
return $val_instruction; |
1157 |
|
} |
1158 |
$instruction_with_doc = null; |
$instruction_with_doc = null; |
1159 |
$inst_di = $this->f->get_inst__om_dbform(array( |
$inst_di = $this->f->get_inst__om_dbform(array( |
1160 |
"obj" => "dossier", |
"obj" => "dossier", |
1218 |
* Récupère les informations |
* Récupère les informations |
1219 |
*/ |
*/ |
1220 |
protected function get_instruction_notification_data($category, $type = '', $extra_params = array()) { |
protected function get_instruction_notification_data($category, $type = '', $extra_params = array()) { |
1221 |
$val_in = array(); |
$val_in = null; |
1222 |
|
|
1223 |
$idx = null; |
$idx = null; |
1224 |
if ($type === 'with-id') { |
if ($type === 'with-id') { |
1230 |
"obj" => "instruction_notification", |
"obj" => "instruction_notification", |
1231 |
"idx" => $idx, |
"idx" => $idx, |
1232 |
)); |
)); |
1233 |
$val_in = $inst_in->get_json_data(); |
if (count($inst_in->val) > 0) { |
1234 |
|
$val_in = $inst_in->get_json_data(); |
1235 |
|
|
1236 |
// Récupération du message et du titre |
$val_in['parametre_courriel_type_titre'] = ''; |
1237 |
$inst_instruction = $this->f->get_inst__om_dbform(array( |
$val_in['parametre_courriel_type_message'] = ''; |
1238 |
"obj" => "instruction", |
// Récupération du message et du titre |
1239 |
"idx" => $inst_in->getVal('instruction'), |
if ($category === 'mail') { |
1240 |
)); |
$inst_instruction = $this->f->get_inst__om_dbform(array( |
1241 |
$collectivite_id = $inst_instruction->get_dossier_instruction_om_collectivite($inst_instruction->getVal('dossier')); |
"obj" => "instruction", |
1242 |
$phrase_type_notification = array(); |
"idx" => $inst_in->getVal('instruction'), |
1243 |
$phrase_type_notification = $this->f->get_notification_parametre_courriel_type($collectivite_id); |
)); |
1244 |
// |
$collectivite_id = $inst_instruction->get_dossier_instruction_om_collectivite($inst_instruction->getVal('dossier')); |
1245 |
$val_in['parametre_courriel_type_titre'] = $phrase_type_notification['parametre_courriel_type_titre']; |
$phrase_type_notification = array(); |
1246 |
$val_in['parametre_courriel_type_message'] = $phrase_type_notification['parametre_courriel_type_message']; |
$phrase_type_notification = $this->f->get_notification_parametre_courriel_type($collectivite_id); |
1247 |
|
$val_in['parametre_courriel_type_titre'] = $phrase_type_notification['parametre_courriel_type_titre']; |
1248 |
|
$val_in['parametre_courriel_type_message'] = $phrase_type_notification['parametre_courriel_type_message']; |
1249 |
|
} |
1250 |
|
|
1251 |
// Récupération des liens vers les documents et de l'id de l'instruction |
// Récupération des liens vers les documents et de l'id de l'instruction |
1252 |
// de l'annexe |
// de l'annexe |
1253 |
$infoDocNotif = $inst_in->getInfosDocumentsNotif($inst_in->getVal($inst_in->clePrimaire)); |
$infoDocNotif = $inst_in->getInfosDocumentsNotif($inst_in->getVal($inst_in->clePrimaire)); |
1254 |
$val_in['lien_telechargement_document'] = $infoDocNotif['document']['lien']; |
$val_in['lien_telechargement_document'] = $infoDocNotif['document']['lien']; |
1255 |
$val_in['lien_telechargement_annexe'] = $infoDocNotif['annexe']['lien']; |
$val_in['lien_telechargement_annexe'] = $infoDocNotif['annexe']['lien']; |
1256 |
$val_in['instruction_annexe'] = $infoDocNotif['annexe']['id_instruction']; |
$val_in['instruction_annexe'] = $infoDocNotif['annexe']['id_instruction']; |
1257 |
|
} |
1258 |
|
|
1259 |
return $val_in; |
return $val_in; |
1260 |
} |
} |
1292 |
return $res; |
return $res; |
1293 |
} |
} |
1294 |
|
|
1295 |
|
/** |
1296 |
|
* Permet de définir si l'instruction passée en paramètre est une instruction |
1297 |
|
* récépissé d'une demande et si la demande en question a générée un dossier d'instruction. |
1298 |
|
* |
1299 |
|
* @param integer $instruction Identifiant de l'instruction |
1300 |
|
* @return boolean |
1301 |
|
*/ |
1302 |
|
protected function is_demande_instruction_recepisse_without_dossier($instruction) { |
1303 |
|
if ($instruction === null) { |
1304 |
|
return false; |
1305 |
|
} |
1306 |
|
$query = sprintf(' |
1307 |
|
SELECT demande_type.dossier_instruction_type |
1308 |
|
FROM %1$sdemande |
1309 |
|
INNER JOIN %1$sdemande_type ON demande.demande_type = demande_type.demande_type |
1310 |
|
WHERE demande.instruction_recepisse = %2$s |
1311 |
|
', |
1312 |
|
DB_PREFIXE, |
1313 |
|
$instruction |
1314 |
|
); |
1315 |
|
$res = $this->f->get_one_result_from_db_query( |
1316 |
|
$query, |
1317 |
|
true |
1318 |
|
); |
1319 |
|
if ($res['code'] === 'KO') { |
1320 |
|
return null; |
1321 |
|
} |
1322 |
|
if ($res['result'] === '') { |
1323 |
|
return true; |
1324 |
|
} |
1325 |
|
return false; |
1326 |
|
} |
1327 |
|
|
1328 |
protected function get_document_numerise_data(string $dn) { |
protected function get_document_numerise_data(string $dn) { |
1329 |
$val_dn = array(); |
$val_dn = array(); |
1330 |
$inst_dn = $this->f->get_inst__om_dbform(array( |
$inst_dn = $this->f->get_inst__om_dbform(array( |
1486 |
if ($this->getVal('type') === 'decision_DI') { |
if ($this->getVal('type') === 'decision_DI') { |
1487 |
$val['dossier'] = $this->get_dossier_data($this->getVal('dossier')); |
$val['dossier'] = $this->get_dossier_data($this->getVal('dossier')); |
1488 |
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier'], 'with-id', array('with-id' => $this->getVal('object_id'))); |
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier'], 'with-id', array('with-id' => $this->getVal('object_id'))); |
1489 |
|
$val['instruction']['final'] = 't'; |
1490 |
if (isset($val['instruction']['signataire_arrete']) === true) { |
if (isset($val['instruction']['signataire_arrete']) === true) { |
1491 |
$val['signataire_arrete'] = $this->get_signataire_arrete_data($val['instruction']['signataire_arrete']); |
$val['signataire_arrete'] = $this->get_signataire_arrete_data($val['instruction']['signataire_arrete']); |
1492 |
} |
} |
1554 |
|| $this->getVal('type') === 'notification_decision') { |
|| $this->getVal('type') === 'notification_decision') { |
1555 |
// |
// |
1556 |
$val['dossier'] = $this->get_dossier_data($this->getVal('dossier')); |
$val['dossier'] = $this->get_dossier_data($this->getVal('dossier')); |
1557 |
$val['demandeur'] = $this->get_demandeurs_data($this->getVal('dossier')); |
$dossier_id = isset($val['dossier']['dossier']) === true ? $val['dossier']['dossier'] : null; |
1558 |
|
$val['demandeur'] = $this->get_demandeurs_data($dossier_id); |
1559 |
$val['instruction_notification'] = $this->get_instruction_notification_data($this->getVal('category'), 'with-id', array('with-id' => $this->getVal('object_id'))); |
$val['instruction_notification'] = $this->get_instruction_notification_data($this->getVal('category'), 'with-id', array('with-id' => $this->getVal('object_id'))); |
1560 |
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier'], 'with-id', array('with-id' => $val['instruction_notification']['instruction'])); |
$instruction_id = isset($val['instruction_notification']['instruction']) === true ? $val['instruction_notification']['instruction'] : null; |
1561 |
if ($val['instruction_notification']['instruction_annexe'] != '') { |
$instruction_annexe = isset($val['instruction_notification']['instruction_annexe']) === true ? $val['instruction_notification']['instruction_annexe'] : null; |
1562 |
$val['instruction_annexe'] = $this->get_instruction_data($val['dossier']['dossier'], 'with-id', array('with-id' => $val['instruction_notification']['instruction_annexe'])); |
$val['instruction'] = $this->get_instruction_data($dossier_id, 'with-id', array('with-id' => $instruction_id)); |
1563 |
|
// Précise qu'il s'agit d'une instruction final si l'instruction est liée à une |
1564 |
|
// demande dont le type ne génère pas de dossier |
1565 |
|
if ($this->is_demande_instruction_recepisse_without_dossier($instruction_id) === true) { |
1566 |
|
$val['instruction']['final'] = 't'; |
1567 |
|
} |
1568 |
|
// |
1569 |
|
if ($instruction_annexe != '') { |
1570 |
|
$val['instruction_annexe'] = $this->get_instruction_data($dossier_id, 'with-id', array('with-id' => $instruction_annexe)); |
1571 |
} |
} |
1572 |
$val_external_uid = array(); |
$val_external_uid = array(); |
1573 |
$val_external_uid['demande'] = $this->get_external_uid($val['dossier']['dossier'], 'demande'); |
// Affiche l'identifiant externe lié à l'instruction si cette combinaison existe, sinon celui lié au dossier |
1574 |
|
$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'); |
1575 |
$val['external_uids'] = $val_external_uid; |
$val['external_uids'] = $val_external_uid; |
1576 |
} |
} |
1577 |
// |
// |
1593 |
return json_encode($val, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); |
return json_encode($val, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); |
1594 |
} else { |
} else { |
1595 |
// Liste des valeurs affichée en JSON |
// Liste des valeurs affichée en JSON |
1596 |
printf(json_encode($val, JSON_UNESCAPED_SLASHES)); |
echo(json_encode($val, JSON_UNESCAPED_SLASHES)); |
1597 |
} |
} |
1598 |
} |
} |
1599 |
} |
} |
1760 |
return $objects; |
return $objects; |
1761 |
} |
} |
1762 |
|
|
1763 |
|
/** |
1764 |
|
* Récupère les tables auxquelles pourrait être rattaché l'objet lié à la tâche, |
1765 |
|
* par rapport à son type. |
1766 |
|
* |
1767 |
|
* @param string $type Type de la tâche |
1768 |
|
* @param string $stream input ou output |
1769 |
|
* @return array |
1770 |
|
*/ |
1771 |
|
function get_tables_by_task_type($type, $stream = 'all') { |
1772 |
|
$tables = array(); |
1773 |
|
if (in_array($type, array('creation_DA', 'modification_DA', )) === true) { |
1774 |
|
$tables = array('dossier_autorisation', ); |
1775 |
|
} |
1776 |
|
if (in_array($type, array('creation_DI', 'depot_DI', )) === true) { |
1777 |
|
$tables = array('dossier', ); |
1778 |
|
} |
1779 |
|
if (in_array($type, array('qualification_DI', )) === true) { |
1780 |
|
$tables = array('instruction', ); |
1781 |
|
} |
1782 |
|
if (in_array($type, array('create_DI_for_consultation', )) === true) { |
1783 |
|
$tables = array('dossier', ); |
1784 |
|
} |
1785 |
|
if (in_array($type, array('create_DI', )) === true |
1786 |
|
&& $stream === 'input') { |
1787 |
|
$tables = array('dossier', 'dossier_autorisation', 'demande', ); |
1788 |
|
} |
1789 |
|
if (in_array($type, array('decision_DI', 'incompletude_DI', 'completude_DI', )) === true) { |
1790 |
|
$tables = array('instruction', ); |
1791 |
|
} |
1792 |
|
if (in_array($type, array('pec_metier_consultation', )) === true |
1793 |
|
&& $stream === 'output') { |
1794 |
|
$tables = array('instruction', ); |
1795 |
|
} |
1796 |
|
if (in_array($type, array('avis_consultation', )) === true |
1797 |
|
&& $stream === 'output') { |
1798 |
|
$tables = array('instruction', ); |
1799 |
|
} |
1800 |
|
if (in_array($type, array('prescription', )) === true |
1801 |
|
&& $stream === 'output') { |
1802 |
|
$tables = array('instruction', ); |
1803 |
|
} |
1804 |
|
if (in_array($type, array('ajout_piece', 'add_piece', )) === true) { |
1805 |
|
$tables = array('document_numerise', ); |
1806 |
|
} |
1807 |
|
if (in_array($type, array('creation_consultation', )) === true) { |
1808 |
|
$tables = array('consultation', ); |
1809 |
|
} |
1810 |
|
if (in_array($type, array('pec_metier_consultation', )) === true |
1811 |
|
&& $stream === 'input') { |
1812 |
|
$tables = array('consultation', ); |
1813 |
|
} |
1814 |
|
if (in_array($type, array('avis_consultation', )) === true |
1815 |
|
&& $stream === 'input') { |
1816 |
|
$tables = array('consultation', ); |
1817 |
|
} |
1818 |
|
if (in_array($type, array('create_message', )) === true |
1819 |
|
&& $stream === 'input') { |
1820 |
|
$tables = array('dossier_message', ); |
1821 |
|
} |
1822 |
|
if (in_array($type, array('notification_recepisse', 'notification_instruction', 'notification_decision' )) === true) { |
1823 |
|
$tables = array('instruction_notification', ); |
1824 |
|
} |
1825 |
|
return $tables; |
1826 |
|
} |
1827 |
|
|
1828 |
} |
} |