29 |
$this->constructeur($id,$db,$debug); |
$this->constructeur($id,$db,$debug); |
30 |
}// fin constructeur |
}// fin constructeur |
31 |
|
|
|
function setvalF($val){ |
|
|
$this->valF['instruction'] = $val['instruction']; |
|
|
$this->valF['destinataire'] = $val['destinataire']; |
|
|
$this->valF['lettretype'] = $val['lettretype']; |
|
|
$this->valF['dossier'] = $val['dossier']; |
|
|
if($val['datecourrier']!="") |
|
|
$this->valF['datecourrier'] = $this->dateDB($val['datecourrier']); |
|
|
$this->valF['complement'] = $val['complement']; |
|
|
$this->valF['complement2'] = $val['complement2']; |
|
|
$this->valF['evenement'] = $val['evenement']; |
|
|
$this->valF['delai'] = $val['delai']; // necessaire pour maj datecourrier |
|
|
} |
|
|
|
|
|
|
|
32 |
function cleSecondaire($id,&$db,$val,$DEBUG) { |
function cleSecondaire($id,&$db,$val,$DEBUG) { |
33 |
parent::cleSecondaire($id,$db,$val,$DEBUG); |
parent::cleSecondaire($id,$db,$val,$DEBUG); |
34 |
// controle suppression cle secondaire [secondary key delete control] |
// controle suppression cle secondaire [secondary key delete control] |
36 |
// specifique detruire que le dernier [specific instruction : delete the last event ] |
// specifique detruire que le dernier [specific instruction : delete the last event ] |
37 |
// ------------------------------------------------------------------------------------ |
// ------------------------------------------------------------------------------------ |
38 |
$dernierevenement=''; |
$dernierevenement=''; |
39 |
$sql="select max(instruction) from instruction where dossier ='". |
$sql="select max(instruction) from ".DB_PREFIXE."instruction where dossier ='". |
40 |
$this->idxformulaire."'"; |
$this->idxformulaire."'"; |
41 |
$dernierevenement = $db->getOne($sql); |
$dernierevenement = $db->getOne($sql); |
42 |
if($dernierevenement==$id){ |
if($dernierevenement==$id){ |
43 |
$this->correct=true; |
$this->correct=true; |
44 |
$this->msg="<br>"._('destruction_chronologique')." ok <br>"; |
$this->addToMessage(_('Destruction_chronologique')); |
45 |
}else{ |
}else{ |
46 |
$this->msg="<br>"._('destruction_evenement')." : ".$dernierevenement. |
$this->addToMessage(_('Destruction_evenement')." : ".$dernierevenement); |
47 |
"<br>"._('destruction_chronologique'); |
$this->addToMessage(_('Destruction_chronologique')); |
48 |
$this->correct=false; |
$this->correct=false; |
49 |
} |
} |
50 |
} |
} |
51 |
|
|
|
function verifier($val,&$db,$DEBUG){ |
|
|
$this->correct=True; |
|
|
$imgv=""; |
|
|
$f=" ! "; |
|
|
$imgv="<img src='../app/img/punaise.png' style='vertical-align:middle' hspace='2' border='0'>"; |
|
|
// obligatoire |
|
|
if ($this->valF['destinataire']==""){ |
|
|
$this->correct=false; |
|
|
$this->msg= $this->msg.$imgv." "._('instruction')." ". |
|
|
_('obligatoire').$f; |
|
|
} |
|
|
if ($val['datecourrier']==""){ |
|
|
$this->correct=false; |
|
|
$this->msg= $this->msg.$imgv." "._('datecourrier')." ". |
|
|
_('obligatoire').$f; |
|
|
} |
|
|
if ($val['evenement']==""){ |
|
|
$this->correct=false; |
|
|
$this->msg= $this->msg.$imgv." "._('evenement')." ". |
|
|
_('obligatoire').$f; |
|
|
} |
|
|
}//verifier |
|
|
|
|
52 |
function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire){ |
function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire){ |
53 |
if ($validation==0) { |
if ($validation==0 and $maj<2) { |
54 |
if ($maj == 0){ |
if ($maj == 0){ |
55 |
$form->setVal("destinataire", $idxformulaire); |
$form->setVal("destinataire", $idxformulaire); |
56 |
$form->setVal("dossier", $idxformulaire); |
$form->setVal("dossier", $idxformulaire); |
65 |
} |
} |
66 |
|
|
67 |
function setType(&$form,$maj) { |
function setType(&$form,$maj) { |
68 |
if ($maj < 2) { //ajouter et modifier |
parent::setType($form,$maj); |
69 |
$form->setType('destinataire', 'hidden'); |
if ($maj < 2) { //ajouter et modifier |
70 |
$form->setType('lettretype', 'hiddenstatic'); |
$form->setType('destinataire', 'hidden'); |
71 |
$form->setType('complement', 'textarea'); |
$form->setType('lettretype', 'hiddenstatic'); |
72 |
$form->setType('complement2', 'textarea'); |
$form->setType('complement', 'textarea'); |
73 |
|
$form->setType('complement2', 'textarea'); |
74 |
|
$form->setType('bible_auto', 'httpclick'); |
75 |
|
$form->setType('bible', 'httpclick'); |
76 |
|
$form->setType('bible2', 'httpclick'); |
77 |
|
$form->setType('dossier', 'hiddenstatic'); |
78 |
|
$form->setType('libelle', 'hiddenstatic'); |
79 |
|
if($maj==0){ // add |
80 |
|
$form->setType('instruction', 'hiddenstatic'); |
81 |
|
$form->setType('evenement', 'select'); |
82 |
|
$form->setType('datecourrier', 'date2'); |
83 |
|
}else{ // modify |
84 |
|
$form->setType('instruction', 'hiddenstatic'); |
85 |
|
$form->setType('evenement', 'hiddenstatic'); |
86 |
|
//$form->setType('datecourrier', 'hiddenstaticdate'); |
87 |
|
$form->setType('datecourrier', 'date2'); |
88 |
|
// necessaire pour calcul de date en modification |
89 |
|
$form->setType('delai', 'hiddenstatic'); |
90 |
|
} |
91 |
|
} elseif($maj==2){ |
92 |
|
$form->setType('dossier', 'hiddenstatic'); |
93 |
|
}else { |
94 |
|
$form->setType('destinataire', 'hidden'); |
95 |
|
$form->setType('dossier', 'static'); |
96 |
|
} |
97 |
$form->setType('complement3', 'hidden'); |
$form->setType('complement3', 'hidden'); |
98 |
|
$form->setType('bible_auto', 'hidden'); |
99 |
|
$form->setType('bible', 'hidden'); |
100 |
|
$form->setType('bible2', 'hidden'); |
101 |
$form->setType('bible3', 'hidden'); |
$form->setType('bible3', 'hidden'); |
102 |
$form->setType('complement4', 'hidden'); |
$form->setType('complement4', 'hidden'); |
103 |
$form->setType('bible4', 'hidden'); |
$form->setType('bible4', 'hidden'); |
123 |
$form->setType('bible14', 'hidden'); |
$form->setType('bible14', 'hidden'); |
124 |
$form->setType('complement15', 'hidden'); |
$form->setType('complement15', 'hidden'); |
125 |
$form->setType('bible15', 'hidden'); |
$form->setType('bible15', 'hidden'); |
|
$form->setType('bible_auto', 'httpclick'); |
|
|
$form->setType('bible', 'httpclick'); |
|
|
$form->setType('bible2', 'httpclick'); |
|
|
$form->setType('dossier', 'hiddenstatic'); |
|
126 |
$form->setType('delai', 'hidden'); |
$form->setType('delai', 'hidden'); |
127 |
$form->setType('etat', 'hidden'); |
$form->setType('etat', 'hidden'); |
128 |
$form->setType('accord_tacite', 'hidden'); |
$form->setType('accord_tacite', 'hidden'); |
141 |
$form->setType('archive_date_validite', 'hidden'); |
$form->setType('archive_date_validite', 'hidden'); |
142 |
$form->setType('archive_date_achevement', 'hidden'); |
$form->setType('archive_date_achevement', 'hidden'); |
143 |
$form->setType('archive_date_conformite', 'hidden'); |
$form->setType('archive_date_conformite', 'hidden'); |
144 |
$form->setType('archive_date_chantier', 'hidden'); |
$form->setType('archive_date_chantier', 'hidden'); |
|
$form->setType('libelle', 'hiddenstatic'); |
|
|
if($maj==0){ // add |
|
|
$form->setType('instruction', 'hiddenstatic'); |
|
|
$form->setType('evenement', 'select'); |
|
|
$form->setType('datecourrier', 'date2'); |
|
|
}else{ // modify |
|
|
$form->setType('instruction', 'hiddenstatic'); |
|
|
$form->setType('evenement', 'hiddenstatic'); |
|
|
//$form->setType('datecourrier', 'hiddenstaticdate'); |
|
|
$form->setType('datecourrier', 'date2'); |
|
|
// necessaire pour calcul de date en modification |
|
|
$form->setType('delai', 'hiddenstatic'); |
|
|
} |
|
|
}else{ // supprimer [delete] |
|
|
$form->setType('instruction', 'hiddenstatic'); |
|
|
$form->setType('dossier', 'hiddenstatic'); |
|
|
$form->setType('archive_delai', 'hiddenstatic'); |
|
|
$form->setType('archive_etat', 'hiddenstatic'); |
|
|
$form->setType('archive_accord_tacite', 'hiddenstatic'); |
|
|
$form->setType('archive_avis', 'hiddenstatic'); |
|
|
$form->setType('archive_date_complet', 'hiddenstatic'); |
|
|
$form->setType('archive_date_rejet', 'hiddenstatic'); |
|
|
$form->setType('archive_date_limite', 'hiddenstatic'); |
|
|
$form->setType('archive_date_notification_delai', 'hiddenstatic'); |
|
|
$form->setType('archive_date_decision', 'hiddenstatic'); |
|
|
$form->setType('archive_date_validite', 'hiddenstatic'); |
|
|
$form->setType('archive_date_achevement', 'hiddenstatic'); |
|
|
} |
|
|
} |
|
|
|
|
|
function setTaille(&$form,$maj){ |
|
|
$form->setTaille('complement', 120); |
|
|
$form->setTaille('complement2', 120); |
|
|
$form->setTaille('datecourrier', 12); |
|
145 |
} |
} |
146 |
|
|
147 |
|
function setSelect(&$form, $maj,&$db,$DEBUG) { |
148 |
|
if(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc.php")) |
149 |
|
include ("../sql/".$db->phptype."/".$this->table.".form.inc.php"); |
150 |
|
|
151 |
function setMax(&$form,$maj){ |
// *** evenement *** |
152 |
$form->setMax('complement',12 ); |
$contenu=array(); |
153 |
$form->setMax('complement2',12 ); |
// etat du dossier |
154 |
} |
$sql="select etat from ".DB_PREFIXE."dossier where dossier ='". |
155 |
|
$this->idxformulaire."'"; |
156 |
|
$etat_dossier = $db->getOne($sql); |
157 |
|
$nature_dossier= substr($this->idxformulaire,0,2); |
158 |
|
// recherche des evenement de transition |
159 |
|
$sql= $sql_transition." where transition.etat ='".$etat_dossier."' and (evenement.nature ='". |
160 |
|
$nature_dossier."' or (nature ='T' and nature !='CU')) order by evenement.action"; |
161 |
|
|
162 |
|
// *** attention en dur le CU |
163 |
|
|
164 |
|
|
165 |
//function setSelect(&$form, $maj,&$db,$DEBUG,$idxformulaire) { |
$res = $db->query($sql); |
166 |
function setSelect(&$form, $maj,&$db,$DEBUG) { |
if (database::isError($res)) |
167 |
if(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc")) |
die($res->getMessage()); |
168 |
include ("../sql/".$db->phptype."/".$this->table.".form.inc"); |
$contenu[0][0]=""; |
169 |
if($maj<2){ |
$contenu[1][0]=_('choisir')." "._('evenement'); |
170 |
// *** evenement *** |
$k=1; |
171 |
$contenu=array(); |
while ($row=& $res->fetchRow()){ |
172 |
// etat du dossier |
if($maj==0){ // ajouter |
173 |
$sql="select etat from dossier where dossier ='". |
$contenu[0][$k]=$row[0]; |
174 |
$this->idxformulaire."'"; |
$contenu[1][$k]=$row[1]; |
175 |
$etat_dossier = $db->getOne($sql); |
$k++; |
176 |
$nature_dossier= substr($this->idxformulaire,0,2); |
}else{ |
177 |
// recherche des evenement de transition |
// select hiddenstatic |
178 |
$sql= $sql_transition." where transition.etat ='".$etat_dossier."' and (evenement.nature ='". |
$contenu[0][$k]=$row[0]; |
179 |
$nature_dossier."' or (nature ='T' and nature !='CU')) order by evenement.action"; |
$contenu[1][$k]=$row[1]; |
180 |
// *** attention en dur le CU |
$k++; |
181 |
|
} |
182 |
|
} |
183 |
$res = $db->query($sql); |
$form->setSelect("evenement",$contenu); |
184 |
if (database::isError($res)) |
// lien bible_auto [link] |
185 |
die($res->getMessage()); |
$contenu=array(); |
186 |
$contenu[0][0]=""; |
$contenu[0]=" automatique "; |
187 |
$contenu[1][0]=_('choisir')." "._('evenement'); |
$form->setSelect("bible_auto",$contenu); |
188 |
$k=1; |
// lien bible1 |
189 |
while ($row=& $res->fetchRow()){ |
$contenu=array(); |
190 |
if($maj==0){ // ajouter |
$contenu[0]=" Bible "; |
191 |
$contenu[0][$k]=$row[0]; |
$form->setSelect("bible",$contenu); |
192 |
$contenu[1][$k]=$row[1]; |
// lien bible2 |
193 |
$k++; |
$contenu=array(); |
194 |
}else{ |
$contenu[0]=" Bible "; |
195 |
// select hiddenstatic |
$form->setSelect("bible2",$contenu); |
|
$contenu[0][$k]=$row[0]; |
|
|
$contenu[1][$k]=$row[1]; |
|
|
$k++; |
|
|
} |
|
|
} |
|
|
$form->setSelect("evenement",$contenu); |
|
|
// lien bible_auto [link] |
|
|
$contenu=array(); |
|
|
$contenu[0]=" automatique "; |
|
|
$form->setSelect("bible_auto",$contenu); |
|
|
// lien bible1 |
|
|
$contenu=array(); |
|
|
$contenu[0]=" Bible "; |
|
|
$form->setSelect("bible",$contenu); |
|
|
// lien bible2 |
|
|
$contenu=array(); |
|
|
$contenu[0]=" Bible "; |
|
|
$form->setSelect("bible2",$contenu); |
|
|
} |
|
196 |
} // function select |
} // function select |
197 |
|
|
198 |
function setGroupe(&$form,$maj){ |
function setGroupe(&$form,$maj){ |
224 |
$form->setLib('datecourrier',_(" du ")); |
$form->setLib('datecourrier',_(" du ")); |
225 |
} |
} |
226 |
|
|
|
function setOnchange(&$form,$maj){ |
|
|
$form->setOnchange("datecourrier","fdate(this)"); |
|
|
} |
|
|
|
|
227 |
// ================================================================== |
// ================================================================== |
228 |
// trigger avant modification données [trigger before modify data] |
// trigger avant modification données [trigger before modify data] |
229 |
// ================================================================== |
// ================================================================== |
230 |
function triggerajouter($id,&$db,$val,$DEBUG) { |
function triggerajouter($id,&$db,$val,$DEBUG) { |
231 |
// mise a jour instruction avec evenement |
// mise a jour instruction avec evenement |
232 |
// [modify instruction with evenement] |
// [modify instruction with evenement] |
233 |
$sql= "select * from evenement where evenement =".$this->valF['evenement']; |
$sql= "select * from ".DB_PREFIXE."evenement where evenement =".$this->valF['evenement']; |
234 |
$res = $db->query($sql); |
$res = $db->query($sql); |
235 |
if (database::isError($res)) die($res->getMessage()); |
if (database::isError($res)) die($res->getMessage()); |
236 |
if ($DEBUG == 1) |
if ($DEBUG == 1) |
237 |
echo " la requete ".$sql." est exécutée<br>"; |
echo " la requete ".$sql." est exécutée<br>"; |
238 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
239 |
$this->valF['action']=$row['action']; |
if(isset($row['action']) and !empty($row['action'])) { |
240 |
|
$this->valF['action']=$row['action']; |
241 |
|
} else { |
242 |
|
$this->valF['action']=NULL; |
243 |
|
} |
244 |
$this->valF['delai']=$row['delai']; |
$this->valF['delai']=$row['delai']; |
245 |
$this->valF['etat']=$row['etat']; |
if(isset($row['etat']) and !empty($row['etat'])) { |
246 |
|
$this->valF['etat']=$row['etat']; |
247 |
|
} else { |
248 |
|
$this->valF['etat']=NULL; |
249 |
|
} |
250 |
$this->valF['accord_tacite']=$row['accord_tacite']; |
$this->valF['accord_tacite']=$row['accord_tacite']; |
251 |
$this->valF['delai_notification']=$row['delai_notification']; |
$this->valF['delai_notification']=$row['delai_notification']; |
252 |
$this->valF['avis']=$row['avis']; |
if(isset($row['avis']) and !empty($row['avis'])) { |
253 |
|
$this->valF['avis']=$row['avis']; |
254 |
|
} else { |
255 |
|
$this->valF['avis']=NULL; |
256 |
|
} |
257 |
if($row['lettretype']!="") |
if($row['lettretype']!="") |
258 |
$this->valF['lettretype']=$row['lettretype']; |
$this->valF['lettretype']=$row['lettretype']; |
259 |
else |
else |
260 |
$this->valF['lettretype']="standard"; |
$this->valF['lettretype']="standard"; |
261 |
} |
} |
262 |
$sql= "select * from dossier where dossier = '".$this->valF['dossier']."'"; |
$sql= "select * from ".DB_PREFIXE."dossier where dossier = '".$this->valF['dossier']."'"; |
263 |
$res = $db->query($sql); |
$res = $db->query($sql); |
264 |
if (database::isError($res)) |
if (database::isError($res)) |
265 |
die($res->getMessage()); |
die($res->getMessage()); |
344 |
// voir parametrage des actions en dur |
// voir parametrage des actions en dur |
345 |
$param=1; |
$param=1; |
346 |
if($param==1){ |
if($param==1){ |
347 |
$sql="select * from action where action = '".$this->valF['action']."'"; |
$sql="select * from ".DB_PREFIXE."action where action = '".$this->valF['action']."'"; |
348 |
$res = $db->query($sql); |
$res = $db->query($sql); |
349 |
if (database::isError($res)) |
if (database::isError($res)) |
350 |
die($res->getMessage()); |
die($res->getMessage()); |
390 |
} |
} |
391 |
} |
} |
392 |
}else{ |
}else{ |
393 |
switch ($this->valF['action']) { |
switch ($this->valF['action']) { |
394 |
case "initialisation" : |
case "initialisation" : |
395 |
$valF['delai']= $this->valF['delai']; |
$valF['delai']= $this->valF['delai']; |
396 |
$valF['etat']= $this->valF['etat']; |
$valF['etat']= $this->valF['etat']; |
397 |
$valF['accord_tacite']= $this->valF['accord_tacite']; |
$valF['accord_tacite']= $this->valF['accord_tacite']; |
398 |
// la date_complet est la date de depot |
// la date_complet est la date de depot |
399 |
$valF['date_complet']= $this->archive_date_depot; // **** |
$valF['date_complet']= $this->archive_date_depot; // **** |
400 |
$valF['date_limite'] = $this->moisdate($valF['date_complet'],$valF['delai']); |
$valF['date_limite'] = $this->moisdate($valF['date_complet'],$valF['delai']); |
401 |
$valF['date_notification_delai'] = $this->moisdate($valF['date_complet'],1); |
$valF['date_notification_delai'] = $this->moisdate($valF['date_complet'],1); |
402 |
break; |
break; |
403 |
case "notification" : |
case "notification" : |
404 |
$valF['delai']= $this->valF['delai']; |
$valF['delai']= $this->valF['delai']; |
405 |
$valF['etat']= $this->valF['etat']; |
$valF['etat']= $this->valF['etat']; |
406 |
$valF['accord_tacite']= $this->valF['accord_tacite']; |
$valF['accord_tacite']= $this->valF['accord_tacite']; |
407 |
// la date_complet est celle precedemment saisie |
// la date_complet est celle precedemment saisie |
408 |
$valF['date_complet']=$this->valF['archive_date_complet']; |
$valF['date_complet']=$this->valF['archive_date_complet']; |
409 |
$valF['date_limite'] = $this->moisdate($valF['date_complet'],$valF['delai']); |
$valF['date_limite'] = $this->moisdate($valF['date_complet'],$valF['delai']); |
410 |
$valF['date_notification_delai'] = $this->moisdate($valF['date_complet'],1); |
$valF['date_notification_delai'] = $this->moisdate($valF['date_complet'],1); |
411 |
// la date du courrier ne doit pas etre depasse par rapport au delai de |
// la date du courrier ne doit pas etre depasse par rapport au delai de |
412 |
// notification [verify notification date] |
// notification [verify notification date] |
413 |
if($this->valF['archive_date_notification_delai']<$this->valF['datecourrier']) |
if($this->valF['archive_date_notification_delai']<$this->valF['datecourrier']) |
414 |
$this->msg=$this->msg."<br><img src='../img/erreur.gif'> "._("date_notification_delai")." ". |
$this->msg=$this->msg."<br><img src='../img/erreur.gif'> "._("date_notification_delai")." ". |
415 |
|
$this->valF['archive_date_notification_delai']." < "._('datecourrier'); |
416 |
|
// |
417 |
|
break; |
418 |
|
case "retour" : |
419 |
|
$valF['delai']= $this->valF['delai']; |
420 |
|
$valF['etat']= $this->valF['etat']; |
421 |
|
$valF['accord_tacite']= $this->valF['accord_tacite']; |
422 |
|
// la date_complet est celle de l evenement |
423 |
|
$valF['date_complet']= $this->valF['datecourrier']; |
424 |
|
$valF['date_limite'] = $this->moisdate($valF['date_complet'],$valF['delai']); |
425 |
|
$valF['date_notification_delai'] = $this->moisdate($valF['date_complet'],1); |
426 |
|
break; |
427 |
|
case "rejet" : |
428 |
|
//$valF['delai']=0; // *** delai a garder pour etat dpc |
429 |
|
$valF['etat']= $this->valF['etat']; |
430 |
|
$valF['accord_tacite']= $this->valF['accord_tacite']; |
431 |
|
// la date rejet est initialisee |
432 |
|
$valF['date_rejet']= $this->valF['datecourrier']; |
433 |
|
// les dates de depart et fin d instruction sont annulées |
434 |
|
$valF['date_limite'] =null; |
435 |
|
$valF['date_notification_delai'] =null; |
436 |
|
$valF['date_complet']=null; |
437 |
|
break; |
438 |
|
case "majoration" : |
439 |
|
$valF['delai']= $this->valF['archive_delai']+$this->valF['delai']; |
440 |
|
$valF['etat']= $this->valF['etat']; |
441 |
|
$valF['accord_tacite']= $this->valF['accord_tacite']; |
442 |
|
$valF['date_complet']=$this->valF['archive_date_complet']; |
443 |
|
// majoration de la date limite |
444 |
|
$valF['date_limite'] = $this->moisdate($valF['date_complet'],$valF['delai']); |
445 |
|
$valF['date_notification_delai'] = $this->moisdate($valF['date_complet'],1); |
446 |
|
// la date du courrier ne doit pas etre depasse par rapport au delai de |
447 |
|
// notification |
448 |
|
if($this->valF['archive_date_notification_delai']<$this->valF['datecourrier']) |
449 |
|
$this->msg=$this->msg."<br><img src='../img/erreur.gif'>"._("date_notification_delai"). |
450 |
$this->valF['archive_date_notification_delai']." < "._('datecourrier'); |
$this->valF['archive_date_notification_delai']." < "._('datecourrier'); |
451 |
// |
break; |
452 |
break; |
case "acceptation" : |
453 |
case "retour" : |
$valF['etat']= $this->valF['etat']; |
454 |
$valF['delai']= $this->valF['delai']; |
$valF['date_decision']= $this->valF['datecourrier']; |
455 |
$valF['etat']= $this->valF['etat']; |
$valF['avis']= $this->valF['avis']; |
456 |
$valF['accord_tacite']= $this->valF['accord_tacite']; |
// date de validite = date de l evenement + delai |
457 |
// la date_complet est celle de l evenement |
$valF['date_validite'] = $this->moisdate($this->valF['datecourrier'],$this->valF['delai']); |
458 |
$valF['date_complet']= $this->valF['datecourrier']; |
break; |
459 |
$valF['date_limite'] = $this->moisdate($valF['date_complet'],$valF['delai']); |
case "refus" : |
460 |
$valF['date_notification_delai'] = $this->moisdate($valF['date_complet'],1); |
$valF['etat']= $this->valF['etat']; |
461 |
break; |
$valF['date_decision']= $this->valF['datecourrier']; |
462 |
case "rejet" : |
$valF['avis']= $this->valF['avis']; |
463 |
//$valF['delai']=0; // *** delai a garder pour etat dpc |
break; |
464 |
$valF['etat']= $this->valF['etat']; |
case "prolongation" : |
465 |
$valF['accord_tacite']= $this->valF['accord_tacite']; |
$valF['date_validite'] = $this->moisdate($this->valF['archive_date_validite'],$this->valF['delai']); |
466 |
// la date rejet est initialisee |
break; |
467 |
$valF['date_rejet']= $this->valF['datecourrier']; |
case "sursis" : |
468 |
// les dates de depart et fin d instruction sont annulées |
$valF['date_limite'] = $this->moisdate($this->valF['datecourrier'],$this->valF['delai']); |
469 |
$valF['date_limite'] =null; |
$valF['etat']= $this->valF['etat']; |
470 |
$valF['date_notification_delai'] =null; |
$valF['accord_tacite']= $this->valF['accord_tacite']; |
471 |
$valF['date_complet']=null; |
$valF['avis']= $this->valF['avis']; |
472 |
break; |
$valF['date_decision']= $this->valF['datecourrier']; |
473 |
case "majoration" : |
$temp = $valF['date_limite']; |
474 |
$valF['delai']= $this->valF['archive_delai']+$this->valF['delai']; |
$valF['date_validite']= $this->moisdate($temp,2); |
475 |
$valF['etat']= $this->valF['etat']; |
break; |
476 |
$valF['accord_tacite']= $this->valF['accord_tacite']; |
case "execution" : |
477 |
$valF['date_complet']=$this->valF['archive_date_complet']; |
$valF['etat']= $this->valF['etat']; |
478 |
// majoration de la date limite |
$valF['date_chantier'] = $this->valF['datecourrier']; |
479 |
$valF['date_limite'] = $this->moisdate($valF['date_complet'],$valF['delai']); |
//echo $this->msg=$this->msg.$valF['date_chantier'].""; |
480 |
$valF['date_notification_delai'] = $this->moisdate($valF['date_complet'],1); |
break; |
481 |
// la date du courrier ne doit pas etre depasse par rapport au delai de |
case "achevement" : |
482 |
// notification |
$valF['etat']= $this->valF['etat']; |
483 |
if($this->valF['archive_date_notification_delai']<$this->valF['datecourrier']) |
$valF['date_achevement'] = $this->valF['datecourrier']; |
484 |
$this->msg=$this->msg."<br><img src='../img/erreur.gif'>"._("date_notification_delai"). |
break; |
485 |
$this->valF['archive_date_notification_delai']." < "._('datecourrier'); |
case "archivage" : |
486 |
break; |
$valF['etat']= $this->valF['etat']; |
487 |
case "acceptation" : |
$valF['date_conformite'] = $this->valF['datecourrier']; |
488 |
$valF['etat']= $this->valF['etat']; |
break; |
489 |
$valF['date_decision']= $this->valF['datecourrier']; |
|
490 |
$valF['avis']= $this->valF['avis']; |
default: |
491 |
// date de validite = date de l evenement + delai |
if ($this->valF['etat']!="") |
492 |
$valF['date_validite'] = $this->moisdate($this->valF['datecourrier'],$this->valF['delai']); |
$valF['etat']= $this->valF['etat']; |
493 |
break; |
}// end switch |
|
case "refus" : |
|
|
$valF['etat']= $this->valF['etat']; |
|
|
$valF['date_decision']= $this->valF['datecourrier']; |
|
|
$valF['avis']= $this->valF['avis']; |
|
|
break; |
|
|
case "prolongation" : |
|
|
$valF['date_validite'] = $this->moisdate($this->valF['archive_date_validite'],$this->valF['delai']); |
|
|
break; |
|
|
case "sursis" : |
|
|
$valF['date_limite'] = $this->moisdate($this->valF['datecourrier'],$this->valF['delai']); |
|
|
$valF['etat']= $this->valF['etat']; |
|
|
$valF['accord_tacite']= $this->valF['accord_tacite']; |
|
|
$valF['avis']= $this->valF['avis']; |
|
|
$valF['date_decision']= $this->valF['datecourrier']; |
|
|
$temp = $valF['date_limite']; |
|
|
$valF['date_validite']= $this->moisdate($temp,2); |
|
|
break; |
|
|
case "execution" : |
|
|
$valF['etat']= $this->valF['etat']; |
|
|
$valF['date_chantier'] = $this->valF['datecourrier']; |
|
|
//echo $this->msg=$this->msg.$valF['date_chantier'].""; |
|
|
break; |
|
|
case "achevement" : |
|
|
$valF['etat']= $this->valF['etat']; |
|
|
$valF['date_achevement'] = $this->valF['datecourrier']; |
|
|
break; |
|
|
case "archivage" : |
|
|
$valF['etat']= $this->valF['etat']; |
|
|
$valF['date_conformite'] = $this->valF['datecourrier']; |
|
|
break; |
|
|
|
|
|
default: |
|
|
if ($this->valF['etat']!="") |
|
|
$valF['etat']= $this->valF['etat']; |
|
|
}// end switch |
|
494 |
} // end param |
} // end param |
|
// mise à jour dossier [modify dossier] |
|
|
//if($param==1){ // parametrage en table |
|
|
// echo "<br>"; |
|
|
// print_r($valF); |
|
|
//} |
|
495 |
if($valF!=""){ |
if($valF!=""){ |
496 |
$cle= " dossier = '".$this->valF['dossier']."'"; |
$cle= " dossier = '".$this->valF['dossier']."'"; |
497 |
$res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle); |
$res1= $db->autoExecute(DB_PREFIXE.'dossier',$valF,DB_AUTOQUERY_UPDATE,$cle); |
498 |
if (database::isError($res1)) |
if (database::isError($res1)) |
499 |
die($res->getMessage()); |
die($res->getMessage()); |
500 |
if ($DEBUG == 1) |
if ($DEBUG == 1) |
511 |
* cette fonction apour objet de permettre de modifier la date courrier |
* cette fonction apour objet de permettre de modifier la date courrier |
512 |
*/ |
*/ |
513 |
$valF=array(); |
$valF=array(); |
514 |
$sql= "select action from evenement where evenement =".$this->valF['evenement']; |
$sql= "select action from ".DB_PREFIXE."evenement where evenement =".$this->valF['evenement']; |
515 |
$action = $db->getOne($sql); |
$action = $db->getOne($sql); |
516 |
if (database::isError($action)) die($action->getMessage().$sql); |
if (database::isError($action)) die($action->getMessage().$sql); |
517 |
$sql="select * from action where action = '".$action."'"; |
$sql="select * from ".DB_PREFIXE."action where action = '".$action."'"; |
518 |
$res = $db->query($sql); |
$res = $db->query($sql); |
519 |
if (database::isError($res)) die($res->getMessage().$sql); |
if (database::isError($res)) die($res->getMessage().$sql); |
520 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
549 |
} // while |
} // while |
550 |
if($valF!=array()){ |
if($valF!=array()){ |
551 |
$cle= " dossier = '".$this->valF['dossier']."'"; |
$cle= " dossier = '".$this->valF['dossier']."'"; |
552 |
$res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle); |
$res1= $db->autoExecute(DB_PREFIXE.'dossier',$valF,DB_AUTOQUERY_UPDATE,$cle); |
553 |
if (database::isError($res1)) |
if (database::isError($res1)) |
554 |
die($res->getMessage()); |
die($res->getMessage()); |
555 |
if ($DEBUG == 1) |
if ($DEBUG == 1) |
594 |
$valF['date_conformite']= $val['archive_date_conformite']; |
$valF['date_conformite']= $val['archive_date_conformite']; |
595 |
|
|
596 |
$cle= " dossier = '".$val['dossier']."'"; |
$cle= " dossier = '".$val['dossier']."'"; |
597 |
$res= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle); |
$res= $db->autoExecute(DB_PREFIXE.'dossier',$valF,DB_AUTOQUERY_UPDATE,$cle); |
598 |
if (database::isError($res)) |
if (database::isError($res)) |
599 |
die($res->getMessage()); |
die($res->getMessage()); |
600 |
else{ |
else{ |