32 |
'creation_consultation', |
'creation_consultation', |
33 |
'modification_DA', |
'modification_DA', |
34 |
'create_DI', |
'create_DI', |
35 |
|
'envoi_CL', |
36 |
'notification_recepisse', |
'notification_recepisse', |
37 |
'notification_instruction', |
'notification_instruction', |
38 |
'notification_decision', |
'notification_decision', |
213 |
$const_name = 'STATUS_'.$key; |
$const_name = 'STATUS_'.$key; |
214 |
$const_value = constant("self::$const_name"); |
$const_value = constant("self::$const_name"); |
215 |
$contenu[0][] = $const_value; |
$contenu[0][] = $const_value; |
216 |
$contenu[1][] = __($const_value); |
$contenu[1][] = $const_value; |
217 |
} |
} |
218 |
|
|
219 |
$form->setSelect("state", $contenu); |
$form->setSelect("state", $contenu); |
603 |
} |
} |
604 |
} |
} |
605 |
|
|
606 |
|
// Envoi au contrôle de légalité |
607 |
|
// En cas de changement de l'état de la tâche envoi_CL, alors le suivi |
608 |
|
// des dates de l'instruction est effectué |
609 |
|
if ($val['type'] === 'envoi_CL' |
610 |
|
&& isset($this->valF['state']) === true |
611 |
|
&& $this->valF['state'] === self::STATUS_DONE) { |
612 |
|
// |
613 |
|
$inst_instruction = $this->f->get_inst__om_dbform(array( |
614 |
|
"obj" => "instruction", |
615 |
|
"idx" => $this->getVal('object_id'), |
616 |
|
)); |
617 |
|
if ($inst_instruction->has_an_edition() === true) { |
618 |
|
$valF_instruction = array(); |
619 |
|
foreach ($inst_instruction->champs as $champ) { |
620 |
|
$valF_instruction[$champ] = $inst_instruction->getVal($champ); |
621 |
|
} |
622 |
|
} |
623 |
|
$valF_instruction['date_envoi_controle_legalite'] = date("Y-m-d"); |
624 |
|
$inst_instruction->setParameter('maj', 1); |
625 |
|
$update_instruction = $inst_instruction->modifier($valF_instruction); |
626 |
|
if ($update_instruction === false) { |
627 |
|
$this->addToLog(__METHOD__."(): ".$inst_instruction->msg, DEBUG_MODE); |
628 |
|
return false; |
629 |
|
} |
630 |
|
} |
631 |
|
|
632 |
// |
// |
633 |
return true; |
return true; |
634 |
} |
} |
1576 |
$val['external_uids'] = $val_external_uid; |
$val['external_uids'] = $val_external_uid; |
1577 |
} |
} |
1578 |
// |
// |
1579 |
|
if ($this->getVal('type') === 'envoi_CL') { |
1580 |
|
// |
1581 |
|
$val['dossier'] = $this->get_dossier_data($this->getVal('dossier')); |
1582 |
|
$val['instruction'] = $this->get_instruction_data($this->getVal('dossier'), 'with-id', array('with-id' => $this->getVal('object_id'))); |
1583 |
|
$val['dossier_autorisation'] = $this->get_dossier_autorisation_data($val['dossier']['dossier_autorisation']); |
1584 |
|
$val_external_uid = array(); |
1585 |
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
1586 |
|
$val_external_uid['dossier'] = $this->get_external_uid($this->getVal('dossier'), 'dossier'); |
1587 |
|
$val_external_uid['decision'] = $this->get_external_uid($this->getVal('object_id'), 'instruction'); |
1588 |
|
if ($val_external_uid['decision'] === null) { |
1589 |
|
$inst_instruction = $this->f->get_inst__om_dbform(array( |
1590 |
|
"obj" => "instruction", |
1591 |
|
"idx" => $this->getVal('object_id'), |
1592 |
|
)); |
1593 |
|
$val_external_uid['decision'] = $this->get_external_uid($inst_instruction->get_related_instructions_next('retour_signature'), 'instruction'); |
1594 |
|
} |
1595 |
|
$val['external_uids'] = $val_external_uid; |
1596 |
|
} |
1597 |
|
// |
1598 |
if ($this->getVal('type') === 'notification_instruction' |
if ($this->getVal('type') === 'notification_instruction' |
1599 |
|| $this->getVal('type') === 'notification_recepisse' |
|| $this->getVal('type') === 'notification_recepisse' |
1600 |
|| $this->getVal('type') === 'notification_decision') { |
|| $this->getVal('type') === 'notification_decision') { |
1678 |
"obj" => "lien_id_interne_uid_externe", |
"obj" => "lien_id_interne_uid_externe", |
1679 |
"idx" => ']', |
"idx" => ']', |
1680 |
)); |
)); |
1681 |
if ($inst_lien->is_exists($object, $this->getVal('object_id'), $this->f->get_submitted_post_value('external_uid'), $this->getVal('dossier')) === false) { |
$object_id = $this->getVal('object_id'); |
1682 |
|
// Dans le cas spécifique de la mise à jour d'une notification |
1683 |
|
// et de la création d'une liaison d'identifiant pour l'objet demande, |
1684 |
|
// l'identifiant de l'objet n'est plus celui de la notification |
1685 |
|
// d'instruction mais celui du dossier d'instruction |
1686 |
|
if ($object === 'demande' |
1687 |
|
&& ($this->getVal('type') === 'notification_recepisse' |
1688 |
|
|| $this->getVal('type') === 'notification_instruction' |
1689 |
|
|| $this->getVal('type') === 'notification_decision')) { |
1690 |
|
// |
1691 |
|
$object_id = $this->getVal('dossier'); |
1692 |
|
} |
1693 |
|
if ($inst_lien->is_exists($object, $object_id, $this->f->get_submitted_post_value('external_uid'), $this->getVal('dossier')) === false) { |
1694 |
$valF = array( |
$valF = array( |
1695 |
'lien_id_interne_uid_externe' => '', |
'lien_id_interne_uid_externe' => '', |
1696 |
'object' => $object, |
'object' => $object, |
1697 |
'object_id' => $this->getVal('object_id'), |
'object_id' => $object_id, |
1698 |
'external_uid' => $this->f->get_submitted_post_value('external_uid'), |
'external_uid' => $this->f->get_submitted_post_value('external_uid'), |
1699 |
'dossier' => $this->getVal('dossier'), |
'dossier' => $this->getVal('dossier'), |
1700 |
'category' => $this->getVal('category'), |
'category' => $this->getVal('category'), |
1779 |
&& $stream === 'input') { |
&& $stream === 'input') { |
1780 |
$objects = array('dossier', 'dossier_autorisation', 'demande', ); |
$objects = array('dossier', 'dossier_autorisation', 'demande', ); |
1781 |
} |
} |
1782 |
if (in_array($type, array('decision_DI', 'incompletude_DI', 'completude_DI', )) === true) { |
if (in_array($type, array('decision_DI', 'incompletude_DI', 'completude_DI', 'envoi_CL', )) === true) { |
1783 |
$objects = array('instruction', ); |
$objects = array('instruction', ); |
1784 |
} |
} |
1785 |
if (in_array($type, array('pec_metier_consultation', )) === true |
if (in_array($type, array('pec_metier_consultation', )) === true |
1813 |
$objects = array('dossier_message', ); |
$objects = array('dossier_message', ); |
1814 |
} |
} |
1815 |
if (in_array($type, array('notification_recepisse', 'notification_instruction', 'notification_decision' )) === true) { |
if (in_array($type, array('notification_recepisse', 'notification_instruction', 'notification_decision' )) === true) { |
1816 |
$objects = array('instruction_notification', ); |
$objects = array('instruction_notification', 'demande', ); |
1817 |
} |
} |
1818 |
return $objects; |
return $objects; |
1819 |
} |
} |