114 |
} |
} |
115 |
} |
} |
116 |
|
|
117 |
|
// Sélectionne le signataire_arrete par défaut |
118 |
|
function setVal(&$form,$maj,$validation){ |
119 |
|
|
120 |
|
// Ajout |
121 |
|
if($maj == 0) { |
122 |
|
|
123 |
|
// Création de la requête |
124 |
|
$sql = "SELECT signataire_arrete |
125 |
|
FROM ".DB_PREFIXE."signataire_arrete |
126 |
|
WHERE defaut IS TRUE"; |
127 |
|
|
128 |
|
// Exécution de la requête |
129 |
|
$this->f->addToLog("deleteAllLienDossierInstructionTypeEvenementEvenement(): db->query(\"".$sql."\");", VERBOSE_MODE); |
130 |
|
$res = $this->f->db->query($sql); |
131 |
|
$this->f->isDatabaseError(); |
132 |
|
|
133 |
|
$row = $res->fetchrow(DB_FETCHMODE_ASSOC); |
134 |
|
|
135 |
|
if ( isset($row['signataire_arrete']) && is_numeric($row['signataire_arrete'])){ |
136 |
|
|
137 |
|
$form->setVal("signataire_arrete",$row['signataire_arrete']); |
138 |
|
} |
139 |
|
} |
140 |
|
} |
141 |
|
|
142 |
/*Met des valeurs par défaut dans certains des sous-formulaire*/ |
/*Met des valeurs par défaut dans certains des sous-formulaire*/ |
143 |
function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire){ |
function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire){ |
144 |
if ($validation==0 and $maj<2) { |
if ($validation==0 and $maj<2) { |
145 |
if ($maj == 0){ |
if ($maj == 0){ |
146 |
$form->setVal("destinataire", $idxformulaire); |
$form->setVal("destinataire", $idxformulaire); |
147 |
$form->setVal("dossier", $idxformulaire); |
$form->setVal("dossier", $idxformulaire); |
148 |
$form->setVal("datecourrier", date('Y-m-d')); |
$form->setVal("date_evenement", date('Y-m-d')); |
149 |
} |
} |
150 |
$form->setVal("bible_auto","bible_auto()"); |
$form->setVal("bible_auto","bible_auto()"); |
151 |
$form->setVal("bible","bible()"); |
$form->setVal("bible","bible()"); |
168 |
$form->setType('bible2', 'httpclick'); |
$form->setType('bible2', 'httpclick'); |
169 |
$form->setType('dossier', 'hiddenstatic'); |
$form->setType('dossier', 'hiddenstatic'); |
170 |
$form->setType('libelle', 'hiddenstatic'); |
$form->setType('libelle', 'hiddenstatic'); |
171 |
|
$form->setType('signataire_arrete','select'); |
172 |
if($maj==0){ // add |
if($maj==0){ // add |
173 |
$form->setType('instruction', 'hiddenstatic'); |
$form->setType('instruction', 'hiddenstatic'); |
174 |
$form->setType('evenement', 'select'); |
$form->setType('evenement', 'select'); |
175 |
$form->setType('datecourrier', 'date2'); |
$form->setType('date_evenement', 'date2'); |
176 |
}else{ // modify |
}else{ // modify |
177 |
$form->setType('instruction', 'hiddenstatic'); |
$form->setType('instruction', 'hiddenstatic'); |
178 |
$form->setType('evenement', 'hiddenstatic'); |
$form->setType('evenement', 'hiddenstatic'); |
179 |
//$form->setType('datecourrier', 'hiddenstaticdate'); |
//$form->setType('date_evenement', 'hiddenstaticdate'); |
180 |
$form->setType('datecourrier', 'date2'); |
$form->setType('date_evenement', 'date2'); |
181 |
// necessaire pour calcul de date en modification |
// necessaire pour calcul de date en modification |
182 |
$form->setType('delai', 'hiddenstatic'); |
$form->setType('delai', 'hiddenstatic'); |
183 |
} |
} |
184 |
} elseif($maj==2){ |
} elseif($maj==2){ |
185 |
$form->setType('dossier', 'hiddenstatic'); |
$form->setType('dossier', 'hiddenstatic'); |
186 |
|
$form->setType('bible_auto', 'hidden'); |
187 |
|
$form->setType('bible', 'hidden'); |
188 |
|
$form->setType('bible2', 'hidden'); |
189 |
}else { |
}else { |
190 |
$form->setType('destinataire', 'hidden'); |
$form->setType('destinataire', 'hidden'); |
191 |
$form->setType('dossier', 'static'); |
$form->setType('dossier', 'static'); |
192 |
|
$form->setType('bible_auto', 'hidden'); |
193 |
|
$form->setType('bible', 'hidden'); |
194 |
|
$form->setType('bible2', 'hidden'); |
195 |
} |
} |
196 |
$form->setType('complement3', 'hidden'); |
$form->setType('complement3', 'hidden'); |
|
$form->setType('bible_auto', 'hidden'); |
|
|
$form->setType('bible', 'hidden'); |
|
|
$form->setType('bible2', 'hidden'); |
|
197 |
$form->setType('bible3', 'hidden'); |
$form->setType('bible3', 'hidden'); |
198 |
$form->setType('complement4', 'hidden'); |
$form->setType('complement4', 'hidden'); |
199 |
$form->setType('bible4', 'hidden'); |
$form->setType('bible4', 'hidden'); |
245 |
if(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc.php")) |
if(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc.php")) |
246 |
include ("../sql/".$db->phptype."/".$this->table.".form.inc.php"); |
include ("../sql/".$db->phptype."/".$this->table.".form.inc.php"); |
247 |
|
|
248 |
|
parent::setSelect($form, $maj, $db, $DEBUG); |
249 |
|
|
250 |
// *** evenement *** |
// *** evenement *** |
251 |
$contenu=array(); |
$contenu=array(); |
252 |
// etat du dossier |
// etat du dossier |
253 |
$sql="select etat from ".DB_PREFIXE."dossier where dossier ='". |
$sql="select etat from ".DB_PREFIXE."dossier where dossier ='". |
254 |
$this->idxformulaire."'"; |
$this->idxformulaire."'"; |
255 |
$etat_dossier = $db->getOne($sql); |
$etat_dossier = $db->getOne($sql); |
256 |
$nature_dossier= substr($this->idxformulaire,0,2); |
// nature du dossier d'autorisation |
257 |
|
$sql="select code from ".DB_PREFIXE."dossier |
258 |
|
INNER JOIN ".DB_PREFIXE."dossier_autorisation ON |
259 |
|
dossier.dossier_autorisation = dossier_autorisation.dossier_autorisation |
260 |
|
INNER JOIN ".DB_PREFIXE."dossier_autorisation_type_detaille ON |
261 |
|
dossier_autorisation.dossier_autorisation_type_detaille = |
262 |
|
dossier_autorisation_type_detaille.dossier_autorisation_type_detaille |
263 |
|
WHERE dossier ='". |
264 |
|
$this->idxformulaire."'"; |
265 |
|
$nature_dossier = $db->getOne($sql); |
266 |
|
|
267 |
// recherche des evenement de transition |
// recherche des evenement de transition |
268 |
$sql= $sql_transition." where transition.etat ='".$etat_dossier."' and (evenement.nature ='". |
// XXX modifier la requète après la modification de structure du workflow |
269 |
$nature_dossier."' or (nature ='T' and nature !='CU')) order by evenement.action"; |
$sql= $sql_transition." where transition.etat ='".$etat_dossier."' and dossier='". |
270 |
|
$this->idxformulaire."' order by evenement.action"; |
271 |
|
|
272 |
// *** attention en dur le CU |
// *** attention en dur le CU |
273 |
|
$this->addToLog("setSelect(): db->query(\"".$sql."\");", VERBOSE_MODE); |
274 |
|
|
275 |
$res = $db->query($sql); |
$res = $db->query($sql); |
276 |
if (database::isError($res)) |
if (database::isError($res)) |
308 |
function setGroupe(&$form,$maj){ |
function setGroupe(&$form,$maj){ |
309 |
$form->setGroupe('evenement','D'); |
$form->setGroupe('evenement','D'); |
310 |
$form->setGroupe('libelle','G'); |
$form->setGroupe('libelle','G'); |
311 |
$form->setGroupe('datecourrier','G'); |
$form->setGroupe('date_evenement','G'); |
312 |
$form->setGroupe('lettretype','F'); |
$form->setGroupe('lettretype','F'); |
313 |
} |
} |
314 |
|
|
315 |
function setRegroupe(&$form,$maj){ |
function setRegroupe(&$form,$maj){ |
316 |
$form->setRegroupe('evenement','D',_('evenement'), "collapsible"); |
$form->setRegroupe('evenement','D',_('evenement'), "collapsible"); |
317 |
$form->setRegroupe('libelle','G',''); |
$form->setRegroupe('libelle','G',''); |
318 |
$form->setRegroupe('datecourrier','G',''); |
$form->setRegroupe('date_evenement','G',''); |
319 |
$form->setRegroupe('lettretype','F',''); |
$form->setRegroupe('lettretype','F',''); |
320 |
$form->setRegroupe('complement','D',_('complement'), "collapsible"); |
$form->setRegroupe('complement','D',_('complement'), "collapsible"); |
321 |
$form->setRegroupe('bible_auto','G',''); |
$form->setRegroupe('bible_auto','G',''); |
332 |
$form->setLib('bible',""); |
$form->setLib('bible',""); |
333 |
$form->setLib('bible2',""); |
$form->setLib('bible2',""); |
334 |
$form->setLib('lettretype',"->"._(" courrier ")); |
$form->setLib('lettretype',"->"._(" courrier ")); |
335 |
$form->setLib('datecourrier',_(" du ")); |
$form->setLib('date_evenement',_(" du ")); |
336 |
} |
} |
337 |
|
|
338 |
// ================================================================== |
// ================================================================== |
342 |
// mise a jour instruction avec evenement |
// mise a jour instruction avec evenement |
343 |
// [modify instruction with evenement] |
// [modify instruction with evenement] |
344 |
$sql= "select * from ".DB_PREFIXE."evenement where evenement =".$this->valF['evenement']; |
$sql= "select * from ".DB_PREFIXE."evenement where evenement =".$this->valF['evenement']; |
345 |
|
|
346 |
$res = $db->query($sql); |
$res = $db->query($sql); |
347 |
if (database::isError($res)) die($res->getMessage()); |
if (database::isError($res)) die($res->getMessage()); |
348 |
|
|
349 |
if ($DEBUG == 1) |
if ($DEBUG == 1) |
350 |
echo " la requete ".$sql." est exécutée<br>"; |
echo " la requete ".$sql." est exécutée<br>"; |
351 |
|
|
352 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
353 |
|
|
354 |
if(isset($row['action']) and !empty($row['action'])) { |
if(isset($row['action']) and !empty($row['action'])) { |
355 |
$this->valF['action']=$row['action']; |
$this->valF['action']=$row['action']; |
356 |
} else { |
} else { |
373 |
$this->valF['lettretype']=$row['lettretype']; |
$this->valF['lettretype']=$row['lettretype']; |
374 |
else |
else |
375 |
$this->valF['lettretype']="standard"; |
$this->valF['lettretype']="standard"; |
376 |
|
|
377 |
} |
} |
378 |
$sql= "select * from ".DB_PREFIXE."dossier where dossier = '".$this->valF['dossier']."'"; |
$sql= "select * from ".DB_PREFIXE."dossier where dossier = '".$this->valF['dossier']."'"; |
379 |
$res = $db->query($sql); |
$res = $db->query($sql); |
411 |
} |
} |
412 |
} |
} |
413 |
|
|
414 |
|
// Test si une restriction est valide |
415 |
|
// return boolean |
416 |
|
function restrictionIsValid($restriction){ |
417 |
|
|
418 |
|
/* Met des espace avant et après les opérateurs puis transforme la chaine en |
419 |
|
* un tableau */ |
420 |
|
$tabRestriction = str_replace(">="," >= ", |
421 |
|
str_replace("<="," <= ", |
422 |
|
str_replace("-"," - ", |
423 |
|
str_replace("+"," + ",$restriction)))); |
424 |
|
$tabRestriction = explode( " ", $tabRestriction); |
425 |
|
|
426 |
|
//Variables de résultat |
427 |
|
$res = array(); |
428 |
|
$i = 0; |
429 |
|
$comp = ""; |
430 |
|
|
431 |
|
|
432 |
|
//Test que le tableau n'est pas vide |
433 |
|
if ( count($tabRestriction) > 0 ){ |
434 |
|
|
435 |
|
$res[0] = $this->getRestrictionValue($tabRestriction[0]); |
436 |
|
|
437 |
|
//Calcul des variables |
438 |
|
for ( $j = 1 ; $j < count($tabRestriction) ; $j += 2 ) { |
439 |
|
|
440 |
|
//Variable de comparaison |
441 |
|
if ( strcmp( ">=", $tabRestriction[$j] ) == 0 || |
442 |
|
strcmp( "<=", $tabRestriction[$j]) ==0 ){ |
443 |
|
|
444 |
|
$comp = $tabRestriction[$j]; |
445 |
|
$res[++$i] = $this->getRestrictionValue($tabRestriction[$j+1]); |
446 |
|
} |
447 |
|
// Fait l'addition |
448 |
|
elseif ( strcmp( "+", $tabRestriction[$j]) == 0 ){ |
449 |
|
|
450 |
|
$res[$i] = $this->moisdate( $res[$i], $this->getRestrictionValue($tabRestriction[$j+1]) ); |
451 |
|
} |
452 |
|
} |
453 |
|
} |
454 |
|
|
455 |
|
// Effectue le test |
456 |
|
if ( strcmp($comp, ">=") == 0 ){ |
457 |
|
|
458 |
|
if ( $res[0] >= $res[1] || $res[0] == "" ){ |
459 |
|
|
460 |
|
return true; |
461 |
|
} |
462 |
|
else { |
463 |
|
|
464 |
|
return false; |
465 |
|
} |
466 |
|
} |
467 |
|
elseif ( strcmp($comp, "<=") == 0 ){ |
468 |
|
|
469 |
|
if ( $res[0] <= $res[1] || $res[1] == "" ){ |
470 |
|
|
471 |
|
return true; |
472 |
|
} |
473 |
|
else { |
474 |
|
|
475 |
|
return false; |
476 |
|
} |
477 |
|
} |
478 |
|
|
479 |
|
return true; |
480 |
|
} |
481 |
|
|
482 |
|
//Retourne la valeur de valF si $restrictionValue n'est pas un chiffre, le chiffre sinon |
483 |
|
function getRestrictionValue($restrictionValue){ |
484 |
|
|
485 |
|
return ( is_numeric($restrictionValue) ) ? |
486 |
|
$restrictionValue : |
487 |
|
$this->valF[$restrictionValue]; |
488 |
|
} |
489 |
|
|
490 |
function regle($regle){ |
function regle($regle){ |
491 |
$temp = explode ("+",$regle); |
$temp = explode ("+",$regle); |
492 |
//echo '|'.$regle; |
//echo '|'.$regle; |
602 |
$valF['date_notification_delai'] = $this->moisdate($valF['date_complet'],1); |
$valF['date_notification_delai'] = $this->moisdate($valF['date_complet'],1); |
603 |
// 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 |
604 |
// notification [verify notification date] |
// notification [verify notification date] |
605 |
if($this->valF['archive_date_notification_delai']<$this->valF['datecourrier']) |
if($this->valF['archive_date_notification_delai']<$this->valF['date_evenement']) |
606 |
$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")." ". |
607 |
$this->valF['archive_date_notification_delai']." < "._('datecourrier'); |
$this->valF['archive_date_notification_delai']." < "._('date_evenement'); |
608 |
// |
// |
609 |
break; |
break; |
610 |
case "retour" : |
case "retour" : |
612 |
$valF['etat']= $this->valF['etat']; |
$valF['etat']= $this->valF['etat']; |
613 |
$valF['accord_tacite']= $this->valF['accord_tacite']; |
$valF['accord_tacite']= $this->valF['accord_tacite']; |
614 |
// la date_complet est celle de l evenement |
// la date_complet est celle de l evenement |
615 |
$valF['date_complet']= $this->valF['datecourrier']; |
$valF['date_complet']= $this->valF['date_evenement']; |
616 |
$valF['date_limite'] = $this->moisdate($valF['date_complet'],$valF['delai']); |
$valF['date_limite'] = $this->moisdate($valF['date_complet'],$valF['delai']); |
617 |
$valF['date_notification_delai'] = $this->moisdate($valF['date_complet'],1); |
$valF['date_notification_delai'] = $this->moisdate($valF['date_complet'],1); |
618 |
break; |
break; |
621 |
$valF['etat']= $this->valF['etat']; |
$valF['etat']= $this->valF['etat']; |
622 |
$valF['accord_tacite']= $this->valF['accord_tacite']; |
$valF['accord_tacite']= $this->valF['accord_tacite']; |
623 |
// la date rejet est initialisee |
// la date rejet est initialisee |
624 |
$valF['date_rejet']= $this->valF['datecourrier']; |
$valF['date_rejet']= $this->valF['date_evenement']; |
625 |
// les dates de depart et fin d instruction sont annulées |
// les dates de depart et fin d instruction sont annulées |
626 |
$valF['date_limite'] =null; |
$valF['date_limite'] =null; |
627 |
$valF['date_notification_delai'] =null; |
$valF['date_notification_delai'] =null; |
637 |
$valF['date_notification_delai'] = $this->moisdate($valF['date_complet'],1); |
$valF['date_notification_delai'] = $this->moisdate($valF['date_complet'],1); |
638 |
// 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 |
639 |
// notification |
// notification |
640 |
if($this->valF['archive_date_notification_delai']<$this->valF['datecourrier']) |
if($this->valF['archive_date_notification_delai']<$this->valF['date_evenement']) |
641 |
$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"). |
642 |
$this->valF['archive_date_notification_delai']." < "._('datecourrier'); |
$this->valF['archive_date_notification_delai']." < "._('date_evenement'); |
643 |
break; |
break; |
644 |
case "acceptation" : |
case "acceptation" : |
645 |
$valF['etat']= $this->valF['etat']; |
$valF['etat']= $this->valF['etat']; |
646 |
$valF['date_decision']= $this->valF['datecourrier']; |
$valF['date_decision']= $this->valF['date_evenement']; |
647 |
$valF['avis_decision']= $this->valF['avis_decision']; |
$valF['avis_decision']= $this->valF['avis_decision']; |
648 |
// date de validite = date de l evenement + delai |
// date de validite = date de l evenement + delai |
649 |
$valF['date_validite'] = $this->moisdate($this->valF['datecourrier'],$this->valF['delai']); |
$valF['date_validite'] = $this->moisdate($this->valF['date_evenement'],$this->valF['delai']); |
650 |
break; |
break; |
651 |
case "refus" : |
case "refus" : |
652 |
$valF['etat']= $this->valF['etat']; |
$valF['etat']= $this->valF['etat']; |
653 |
$valF['date_decision']= $this->valF['datecourrier']; |
$valF['date_decision']= $this->valF['date_evenement']; |
654 |
$valF['avis_decision']= $this->valF['avis_decision']; |
$valF['avis_decision']= $this->valF['avis_decision']; |
655 |
break; |
break; |
656 |
case "prolongation" : |
case "prolongation" : |
657 |
$valF['date_validite'] = $this->moisdate($this->valF['archive_date_validite'],$this->valF['delai']); |
$valF['date_validite'] = $this->moisdate($this->valF['archive_date_validite'],$this->valF['delai']); |
658 |
break; |
break; |
659 |
case "sursis" : |
case "sursis" : |
660 |
$valF['date_limite'] = $this->moisdate($this->valF['datecourrier'],$this->valF['delai']); |
$valF['date_limite'] = $this->moisdate($this->valF['date_evenement'],$this->valF['delai']); |
661 |
$valF['etat']= $this->valF['etat']; |
$valF['etat']= $this->valF['etat']; |
662 |
$valF['accord_tacite']= $this->valF['accord_tacite']; |
$valF['accord_tacite']= $this->valF['accord_tacite']; |
663 |
$valF['avis_decision']= $this->valF['avis_decision']; |
$valF['avis_decision']= $this->valF['avis_decision']; |
664 |
$valF['date_decision']= $this->valF['datecourrier']; |
$valF['date_decision']= $this->valF['date_evenement']; |
665 |
$temp = $valF['date_limite']; |
$temp = $valF['date_limite']; |
666 |
$valF['date_validite']= $this->moisdate($temp,2); |
$valF['date_validite']= $this->moisdate($temp,2); |
667 |
break; |
break; |
668 |
case "execution" : |
case "execution" : |
669 |
$valF['etat']= $this->valF['etat']; |
$valF['etat']= $this->valF['etat']; |
670 |
$valF['date_chantier'] = $this->valF['datecourrier']; |
$valF['date_chantier'] = $this->valF['date_evenement']; |
671 |
//echo $this->msg=$this->msg.$valF['date_chantier'].""; |
//echo $this->msg=$this->msg.$valF['date_chantier'].""; |
672 |
break; |
break; |
673 |
case "achevement" : |
case "achevement" : |
674 |
$valF['etat']= $this->valF['etat']; |
$valF['etat']= $this->valF['etat']; |
675 |
$valF['date_achevement'] = $this->valF['datecourrier']; |
$valF['date_achevement'] = $this->valF['date_evenement']; |
676 |
break; |
break; |
677 |
case "archivage" : |
case "archivage" : |
678 |
$valF['etat']= $this->valF['etat']; |
$valF['etat']= $this->valF['etat']; |
679 |
$valF['date_conformite'] = $this->valF['datecourrier']; |
$valF['date_conformite'] = $this->valF['date_evenement']; |
680 |
break; |
break; |
681 |
|
|
682 |
default: |
default: |
768 |
if (database::isError($res)) die($res->getMessage().$sql); |
if (database::isError($res)) die($res->getMessage().$sql); |
769 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
770 |
// application des regles sur le courrier + delai |
// application des regles sur le courrier + delai |
771 |
if(preg_match("/datecourrier/",$row['regle_date_limite'])){ |
if(preg_match("/date_evenement/",$row['regle_date_limite'])){ |
772 |
$valF['date_limite']= $this->regle($row['regle_date_limite']); |
$valF['date_limite']= $this->regle($row['regle_date_limite']); |
773 |
} |
} |
774 |
if(preg_match("/datecourrier/",$row['regle_date_complet'])){ |
if(preg_match("/date_evenement/",$row['regle_date_complet'])){ |
775 |
$valF['date_complet']= $this->regle($row['regle_date_complet']); |
$valF['date_complet']= $this->regle($row['regle_date_complet']); |
776 |
} |
} |
777 |
if(preg_match("/datecourrier/",$row['regle_date_notification_delai'])){ |
if(preg_match("/date_evenement/",$row['regle_date_notification_delai'])){ |
778 |
$valF['date_notification_delai']= $this->regle($row['regle_date_notification_delai']); |
$valF['date_notification_delai']= $this->regle($row['regle_date_notification_delai']); |
779 |
} |
} |
780 |
if(preg_match("/datecourrier/",$row['regle_date_decision'])){ |
if(preg_match("/date_evenement/",$row['regle_date_decision'])){ |
781 |
$valF['date_decision']= $this->regle($row['regle_date_decision']); |
$valF['date_decision']= $this->regle($row['regle_date_decision']); |
782 |
} |
} |
783 |
if(preg_match("/datecourrier/",$row['regle_date_rejet'])){ |
if(preg_match("/date_evenement/",$row['regle_date_rejet'])){ |
784 |
$valF['date_rejet']= $this->regle($row['regle_date_rejet']); |
$valF['date_rejet']= $this->regle($row['regle_date_rejet']); |
785 |
} |
} |
786 |
if(preg_match("/datecourrier/",$row['regle_date_validite'])){ |
if(preg_match("/date_evenement/",$row['regle_date_validite'])){ |
787 |
$valF['date_validite']= $this->regle($row['regle_date_validite']); |
$valF['date_validite']= $this->regle($row['regle_date_validite']); |
788 |
} |
} |
789 |
if(preg_match("/datecourrier/",$row['regle_date_chantier'])){ |
if(preg_match("/date_evenement/",$row['regle_date_chantier'])){ |
790 |
$valF['date_chantier']= $this->regle($row['regle_date_chantier']); |
$valF['date_chantier']= $this->regle($row['regle_date_chantier']); |
791 |
} |
} |
792 |
if(preg_match("/datecourrier/",$row['regle_date_achevement'])){ |
if(preg_match("/date_evenement/",$row['regle_date_achevement'])){ |
793 |
$valF['date_achevement']= $this->regle($row['regle_date_achevement']); |
$valF['date_achevement']= $this->regle($row['regle_date_achevement']); |
794 |
} |
} |
795 |
if(preg_match("/datecourrier/",$row['regle_date_conformite'])){ |
if(preg_match("/date_evenement/",$row['regle_date_conformite'])){ |
796 |
$valF['date_conformite']= $this->regle($row['regle_date_conformite']); |
$valF['date_conformite']= $this->regle($row['regle_date_conformite']); |
797 |
} |
} |
798 |
} // while |
} // while |
902 |
return $annee."-".$mois."-".$jour ; |
return $annee."-".$mois."-".$jour ; |
903 |
} |
} |
904 |
|
|
905 |
|
// Vérifie la restriction sur l'événement |
906 |
|
function verifier($val = array(), &$db, $DEBUG){ |
907 |
|
parent::verifier($val, $db, $DEBUG); |
908 |
|
//Récupère la restriction |
909 |
|
$sql= "SELECT |
910 |
|
restriction |
911 |
|
FROM |
912 |
|
".DB_PREFIXE."evenement |
913 |
|
WHERE |
914 |
|
evenement =".$this->valF['evenement']; |
915 |
|
|
916 |
|
$res = $db->query($sql); |
917 |
|
$this->f->addToLog("verifier(): db->query(\"".$sql."\");", VERBOSE_MODE); |
918 |
|
$this->f->isDatabaseError(); |
919 |
|
|
920 |
|
$row=& $res->fetchRow(DB_FETCHMODE_ASSOC); |
921 |
|
|
922 |
|
//Test qu'une restriction est présente |
923 |
|
if ( isset($row['restriction']) && $row['restriction'] != "" ){ |
924 |
|
|
925 |
|
//Test si la restriction est valide |
926 |
|
if ( !$this->restrictionIsValid($row['restriction']) ){ |
927 |
|
|
928 |
|
$this->correct=false; |
929 |
|
$this->addToMessage(_("Restriction non valide")); |
930 |
|
} |
931 |
|
else { |
932 |
|
|
933 |
|
$this->correct = true; |
934 |
|
} |
935 |
|
} |
936 |
|
} |
937 |
|
|
938 |
}// fin classe |
}// fin classe |
939 |
?> |
?> |