168 |
$form->setType('dossier', 'hidden'); |
$form->setType('dossier', 'hidden'); |
169 |
$form->setType('libelle', 'hiddenstatic'); |
$form->setType('libelle', 'hiddenstatic'); |
170 |
$form->setType('signataire_arrete','select'); |
$form->setType('signataire_arrete','select'); |
171 |
|
$form->setType('date_envoi_signature','datedisabled'); |
172 |
|
$form->setType('date_retour_signature','datedisabled'); |
173 |
|
$form->setType('date_envoi_rar','datedisabled'); |
174 |
|
$form->setType('date_retour_rar','datedisabled'); |
175 |
|
$form->setType('date_envoi_controle_legalite','datedisabled'); |
176 |
|
$form->setType('date_retour_controle_legalite','datedisabled'); |
177 |
if($maj==0){ // add |
if($maj==0){ // add |
178 |
$form->setType('instruction', 'hiddenstatic'); |
$form->setType('instruction', 'hiddenstatic'); |
179 |
$form->setType('evenement', 'select'); |
$form->setType('evenement', 'select'); |
340 |
} |
} |
341 |
} |
} |
342 |
|
|
343 |
|
// Vérification de la non modification des dates de suivi |
344 |
|
function updateDate($champ) { |
345 |
|
if($this->valF[$champ] != "") { |
346 |
|
if($this->getVal($champ) != "" AND $this->getVal($champ) != $this->valF[$champ]) { |
347 |
|
$this->correct = false; |
348 |
|
$this->addToMessage(_("Les dates de suivis ne peuvent etre modifiees")); |
349 |
|
} |
350 |
|
} |
351 |
|
} |
352 |
|
|
353 |
// Sélectionne le signataire_arrete par défaut |
// Sélectionne le signataire_arrete par défaut |
354 |
function setVal(&$form,$maj,$validation){ |
function setVal(&$form,$maj,$validation){ |
355 |
|
|
813 |
if (database::isError($action)) { |
if (database::isError($action)) { |
814 |
die($action->getMessage()); |
die($action->getMessage()); |
815 |
} |
} |
816 |
|
|
817 |
|
// Récupération de tous les paramètres de l'événement sélectionné |
818 |
|
$sql = "SELECT * FROM ".DB_PREFIXE."evenement |
819 |
|
WHERE evenement=".$this->valF['evenement']; |
820 |
|
$res = $db->query($sql); |
821 |
|
$this->addToLog("triggerajouter(): db->query(\"".$sql."\");", VERBOSE_MODE); |
822 |
|
if (database::isError($res)) { |
823 |
|
die($res->getMessage()); |
824 |
|
} |
825 |
|
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) { |
826 |
|
// Ajout d'un événement d'instruction |
827 |
|
|
828 |
|
if ($this->getVal('date_retour_signature') == "" AND $this->valF['date_retour_signature'] != "") { |
829 |
|
$new_instruction = new instruction("]", $db, $DEBUG); |
830 |
|
foreach($new_instruction->champs as $champ) { |
831 |
|
$valNewInstr[$champ] = ""; |
832 |
|
} |
833 |
|
|
834 |
|
$valNewInstr["evenement"] = $row['evenement_retour_signature']; |
835 |
|
$valNewInstr["destinataire"] = $this->valF['destinataire']; |
836 |
|
$valNewInstr["dossier"] = $this->valF['dossier']; |
837 |
|
$valNewInstr["date_evenement"] = date("d/m/Y"); |
838 |
|
$new_instruction->ajouter($valNewInstr,$db, $DEBUG); |
839 |
|
} |
840 |
|
} |
841 |
|
|
842 |
// Récupération des paramètres de l'action |
// Récupération des paramètres de l'action |
843 |
$sql = "SELECT * FROM ".DB_PREFIXE."action |
$sql = "SELECT * FROM ".DB_PREFIXE."action |
844 |
WHERE action='".$action."'"; |
WHERE action='".$action."'"; |
1074 |
$this->correct = true; |
$this->correct = true; |
1075 |
} |
} |
1076 |
} |
} |
1077 |
|
|
1078 |
|
$this->updateDate("date_envoi_signature"); |
1079 |
|
$this->updateDate("date_retour_signature"); |
1080 |
|
$this->updateDate("date_envoi_rar"); |
1081 |
|
$this->updateDate("date_retour_rar"); |
1082 |
|
$this->updateDate("date_envoi_controle_legalite"); |
1083 |
|
$this->updateDate("date_retour_controle_legalite"); |
1084 |
} |
} |
1085 |
|
|
1086 |
/** |
/** |