65 |
$this->correct=True; |
$this->correct=True; |
66 |
$imgv=""; |
$imgv=""; |
67 |
$f=" ! "; |
$f=" ! "; |
68 |
$imgv="<img src='../img/punaise.png' style='vertical-align:middle' hspace='2' border='0'>"; |
$imgv="<img src='../app/img/punaise.png' style='vertical-align:middle' hspace='2' border='0'>"; |
69 |
// obligatoire |
// obligatoire |
70 |
if ($this->valF['destinataire']==""){ |
if ($this->valF['destinataire']==""){ |
71 |
$this->correct=false; |
$this->correct=false; |
162 |
}else{ // modify |
}else{ // modify |
163 |
$form->setType('instruction', 'hiddenstatic'); |
$form->setType('instruction', 'hiddenstatic'); |
164 |
$form->setType('evenement', 'hiddenstatic'); |
$form->setType('evenement', 'hiddenstatic'); |
165 |
$form->setType('datecourrier', 'hiddenstaticdate'); |
//$form->setType('datecourrier', 'hiddenstaticdate'); |
166 |
|
$form->setType('datecourrier', 'date2'); |
167 |
} |
} |
168 |
}else{ // supprimer [delete] |
}else{ // supprimer [delete] |
169 |
$form->setType('instruction', 'hiddenstatic'); |
$form->setType('instruction', 'hiddenstatic'); |
338 |
} |
} |
339 |
} |
} |
340 |
|
|
341 |
|
function regle($regle){ |
342 |
|
$temp = explode ("+",$regle); |
343 |
|
echo '/'.$regle.sizeof($temp); |
344 |
|
if(sizeof($temp)==1) |
345 |
|
if($temp[0]=="archive_date_depot") |
346 |
|
return $this->$regle; |
347 |
|
else |
348 |
|
return $this->valF[$regle]; |
349 |
|
else{ |
350 |
|
if($temp[0]=="archive_date_depot") |
351 |
|
if(is_numeric($temp[1])) |
352 |
|
return $this->moisdate($this->$temp[0], $temp[1]); |
353 |
|
else |
354 |
|
return $this->moisdate($this->$temp[0], $this->valF[$temp[1]]); |
355 |
|
if(is_numeric($temp[1])) |
356 |
|
return $this->moisdate($this->valF[$temp[0]], $temp[1]); |
357 |
|
else |
358 |
|
return $this->moisdate($this->valF[$temp[0]], $this->valF[$temp[1]]); |
359 |
|
} |
360 |
|
} |
361 |
|
|
362 |
|
|
363 |
|
|
364 |
// ================================================================== |
// ================================================================== |
365 |
// valeur dossier apres modification [values dossier after action] |
// valeur dossier apres modification [values dossier after action] |
366 |
// ================================================================== |
// ================================================================== |
368 |
// mise a null au lieu de "" / voir compatibilite mysql |
// mise a null au lieu de "" / voir compatibilite mysql |
369 |
// voir parametrage CU en dur |
// voir parametrage CU en dur |
370 |
// voir parametrage des actions en dur |
// voir parametrage des actions en dur |
371 |
|
$param=1; |
372 |
|
|
373 |
|
if($param==1){ |
374 |
|
$sql="select * from action where action = '".$this->valF['action']."'"; |
375 |
|
$res = $db->query($sql); |
376 |
|
if (database::isError($res)) |
377 |
|
die($res->getMessage()); |
378 |
|
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
379 |
|
if($row['regle_etat']!=''){ |
380 |
|
$valF['etat']= $this->regle($row['regle_etat']); |
381 |
|
} |
382 |
|
if($row['regle_delai']!=''){ |
383 |
|
$valF['delai']= $this->regle($row['regle_delai']); |
384 |
|
} |
385 |
|
if($row['regle_accord_tacite']!=''){ |
386 |
|
$valF['accord_tacite']= $this->regle($row['regle_accord_tacite']); |
387 |
|
} |
388 |
|
if($row['regle_date_limite']!=''){ |
389 |
|
$valF['date_limite']= $this->regle($row['regle_date_limite']); |
390 |
|
} |
391 |
|
if($row['regle_date_complet']!=''){ |
392 |
|
$valF['date_complet']= $this->regle($row['regle_date_complet']); |
393 |
|
} |
394 |
|
if($row['regle_date_notification_delai']!=''){ |
395 |
|
$valF['date_notification_delai']= $this->regle($row['regle_date_notification_delai']); |
396 |
|
} |
397 |
|
} |
398 |
|
}else{ |
399 |
|
|
400 |
switch ($this->valF['action']) { |
switch ($this->valF['action']) { |
401 |
case "initialisation" : |
case "initialisation" : |
403 |
$valF['etat']= $this->valF['etat']; |
$valF['etat']= $this->valF['etat']; |
404 |
$valF['accord_tacite']= $this->valF['accord_tacite']; |
$valF['accord_tacite']= $this->valF['accord_tacite']; |
405 |
// la date_complet est la date de depot |
// la date_complet est la date de depot |
406 |
$valF['date_complet']= $this->archive_date_depot; |
$valF['date_complet']= $this->archive_date_depot; // **** |
407 |
$valF['date_limite'] = $this->moisdate($valF['date_complet'],$valF['delai']); |
$valF['date_limite'] = $this->moisdate($valF['date_complet'],$valF['delai']); |
408 |
$valF['date_notification_delai'] = $this->moisdate($valF['date_complet'],1); |
$valF['date_notification_delai'] = $this->moisdate($valF['date_complet'],1); |
409 |
break; |
break; |
498 |
if ($this->valF['etat']!="") |
if ($this->valF['etat']!="") |
499 |
$valF['etat']= $this->valF['etat']; |
$valF['etat']= $this->valF['etat']; |
500 |
}// end switch |
}// end switch |
501 |
|
} // end param |
502 |
// mise à jour dossier [modify dossier] |
// mise à jour dossier [modify dossier] |
503 |
|
print_r($valF); |
504 |
if($valF!=""){ |
if($valF!=""){ |
505 |
$cle= " dossier = '".$this->valF['dossier']."'"; |
$cle= " dossier = '".$this->valF['dossier']."'"; |
506 |
$res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle); |
$res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle); |
521 |
$valF['delai']=$val['archive_delai']; |
$valF['delai']=$val['archive_delai']; |
522 |
$valF['accord_tacite']=$val['archive_accord_tacite']; |
$valF['accord_tacite']=$val['archive_accord_tacite']; |
523 |
$valF['etat']=$val['archive_etat']; |
$valF['etat']=$val['archive_etat']; |
524 |
$valF['avis']=$val['archive_avis']; |
if($val['archive_avis']=='') |
525 |
|
$valF['avis']= null; |
526 |
|
else |
527 |
|
$valF['avis']=$val['archive_avis']; |
528 |
// if= compatibilite pgsql |
// if= compatibilite pgsql |
529 |
if($val['archive_date_complet']!='') |
if($val['archive_date_complet']!='') |
530 |
$valF['date_complet']=$val['archive_date_complet']; |
$valF['date_complet']=$val['archive_date_complet']; |
544 |
$valF['date_chantier']= $val['archive_date_chantier']; |
$valF['date_chantier']= $val['archive_date_chantier']; |
545 |
if($val['archive_date_conformite']!='') |
if($val['archive_date_conformite']!='') |
546 |
$valF['date_conformite']= $val['archive_date_conformite']; |
$valF['date_conformite']= $val['archive_date_conformite']; |
547 |
|
|
548 |
$cle= " dossier = '".$val['dossier']."'"; |
$cle= " dossier = '".$val['dossier']."'"; |
549 |
$res= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle); |
$res= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle); |
550 |
if (database::isError($res)) |
if (database::isError($res)) |