340 |
|
|
341 |
function regle($regle){ |
function regle($regle){ |
342 |
$temp = explode ("+",$regle); |
$temp = explode ("+",$regle); |
343 |
echo '/'.$regle.sizeof($temp); |
echo '|'.$regle; |
344 |
if(sizeof($temp)==1) |
// cas rejet |
345 |
if($temp[0]=="archive_date_depot") |
if($zone=="null") // 1 dimension -> null |
346 |
|
return null; |
347 |
|
if(sizeof($temp)==1) // 1 dimension |
348 |
|
if($temp[0]=="archive_date_depot") // initialisation avec le depot |
349 |
return $this->$regle; |
return $this->$regle; |
350 |
else |
else // cas general |
351 |
return $this->valF[$regle]; |
return $this->valF[$regle]; |
352 |
else{ |
if(sizeof($temp)==2){ // 2 dimensions |
353 |
if($temp[0]=="archive_date_depot") |
if($temp[0]=="archive_date_depot") //initialisation avec le depot |
354 |
if(is_numeric($temp[1])) |
if(is_numeric($temp[1])) |
355 |
return $this->moisdate($this->$temp[0], $temp[1]); |
return $this->moisdate($this->$temp[0], $temp[1]); |
356 |
else |
else |
357 |
return $this->moisdate($this->$temp[0], $this->valF[$temp[1]]); |
return $this->moisdate($this->$temp[0], $this->valF[$temp[1]]); |
358 |
|
if($temp[0]=="archive_delai") // majoration de delai |
359 |
|
return $this->valF[$temp[0]]+$this->valF[$temp[1]]; |
360 |
|
// cas general 2 dimensions |
361 |
if(is_numeric($temp[1])) |
if(is_numeric($temp[1])) |
362 |
return $this->moisdate($this->valF[$temp[0]], $temp[1]); |
return $this->moisdate($this->valF[$temp[0]], $temp[1]); |
363 |
else |
else |
364 |
return $this->moisdate($this->valF[$temp[0]], $this->valF[$temp[1]]); |
return $this->moisdate($this->valF[$temp[0]], $this->valF[$temp[1]]); |
365 |
} |
} |
366 |
|
if(sizeof($temp)==3){ // 3 dimensions |
367 |
|
// cas date de validite de sursis |
368 |
|
if(is_numeric($temp[1])) |
369 |
|
$temp1 = $this->moisdate($this->valF[$temp[0]], $temp[1]); |
370 |
|
else |
371 |
|
$temp1 = $this->moisdate($this->valF[$temp[0]], $this->valF[$temp[1]]); |
372 |
|
if(is_numeric($temp[2])) |
373 |
|
return $this->moisdate($temp1, $temp[2]); |
374 |
|
else |
375 |
|
return $this->moisdate($temp1, $this->valF[$temp[2]]); |
376 |
|
} |
377 |
} |
} |
378 |
|
|
379 |
|
|
386 |
// voir parametrage CU en dur |
// voir parametrage CU en dur |
387 |
// voir parametrage des actions en dur |
// voir parametrage des actions en dur |
388 |
$param=1; |
$param=1; |
|
|
|
389 |
if($param==1){ |
if($param==1){ |
390 |
$sql="select * from action where action = '".$this->valF['action']."'"; |
$sql="select * from action where action = '".$this->valF['action']."'"; |
391 |
$res = $db->query($sql); |
$res = $db->query($sql); |
401 |
if($row['regle_accord_tacite']!=''){ |
if($row['regle_accord_tacite']!=''){ |
402 |
$valF['accord_tacite']= $this->regle($row['regle_accord_tacite']); |
$valF['accord_tacite']= $this->regle($row['regle_accord_tacite']); |
403 |
} |
} |
404 |
|
if($row['regle_avis']!=''){ |
405 |
|
$valF['avis']= $this->regle($row['regle_avis']); |
406 |
|
} |
407 |
if($row['regle_date_limite']!=''){ |
if($row['regle_date_limite']!=''){ |
408 |
$valF['date_limite']= $this->regle($row['regle_date_limite']); |
$valF['date_limite']= $this->regle($row['regle_date_limite']); |
409 |
} |
} |
413 |
if($row['regle_date_notification_delai']!=''){ |
if($row['regle_date_notification_delai']!=''){ |
414 |
$valF['date_notification_delai']= $this->regle($row['regle_date_notification_delai']); |
$valF['date_notification_delai']= $this->regle($row['regle_date_notification_delai']); |
415 |
} |
} |
416 |
|
if($row['regle_date_decision']!=''){ |
417 |
|
$valF['date_decision']= $this->regle($row['regle_date_decision']); |
418 |
|
} |
419 |
|
if($row['regle_date_rejet']!=''){ |
420 |
|
$valF['date_rejet']= $this->regle($row['regle_date_rejet']); |
421 |
|
} |
422 |
|
if($row['regle_date_validite']!=''){ |
423 |
|
$valF['date_validite']= $this->regle($row['regle_date_validite']); |
424 |
|
} |
425 |
|
if($row['regle_date_chantier']!=''){ |
426 |
|
$valF['date_chantier']= $this->regle($row['regle_date_chantier']); |
427 |
|
} |
428 |
|
if($row['regle_date_achevement']!=''){ |
429 |
|
$valF['date_achevement']= $this->regle($row['regle_date_achevement']); |
430 |
|
} |
431 |
|
if($row['regle_date_conformite']!=''){ |
432 |
|
$valF['date_conformite']= $this->regle($row['regle_date_conformite']); |
433 |
|
} |
434 |
} |
} |
435 |
}else{ |
}else{ |
|
|
|
436 |
switch ($this->valF['action']) { |
switch ($this->valF['action']) { |
437 |
case "initialisation" : |
case "initialisation" : |
438 |
$valF['delai']= $this->valF['delai']; |
$valF['delai']= $this->valF['delai']; |
536 |
}// end switch |
}// end switch |
537 |
} // end param |
} // end param |
538 |
// mise à jour dossier [modify dossier] |
// mise à jour dossier [modify dossier] |
539 |
print_r($valF); |
if($param==1){ // parametrage en table |
540 |
|
echo "<br>"; |
541 |
|
print_r($valF); |
542 |
|
} |
543 |
if($valF!=""){ |
if($valF!=""){ |
544 |
$cle= " dossier = '".$this->valF['dossier']."'"; |
$cle= " dossier = '".$this->valF['dossier']."'"; |
545 |
$res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle); |
$res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle); |