176 |
$form->setType('archive_date_chantier', 'hidden'); |
$form->setType('archive_date_chantier', 'hidden'); |
177 |
// |
// |
178 |
$form->setType('numero_arrete', 'hidden'); |
$form->setType('numero_arrete', 'hidden'); |
179 |
|
// |
180 |
|
$form->setType('code_barres', 'hidden'); |
181 |
|
|
182 |
// |
// |
183 |
$form->setType('archive_incompletude','hidden'); |
$form->setType('archive_incompletude','hidden'); |
605 |
$this->valF['archive_delai_incompletude']= $row['delai_incompletude']; |
$this->valF['archive_delai_incompletude']= $row['delai_incompletude']; |
606 |
} |
} |
607 |
} |
} |
608 |
|
|
609 |
|
// Identifiant du type de courrier |
610 |
|
$idTypeCourrier = '11'; |
611 |
|
$idCourrier = str_pad($this->valF["instruction"], 10, "0", STR_PAD_LEFT); |
612 |
|
// Code barres |
613 |
|
$this->valF["code_barres"] = $idTypeCourrier . $idCourrier; |
614 |
} |
} |
615 |
|
|
616 |
// Test si une restriction est valide |
// Test si une restriction est valide |
1260 |
// Vérifie la restriction sur l'événement |
// Vérifie la restriction sur l'événement |
1261 |
function verifier($val = array(), &$db, $DEBUG){ |
function verifier($val = array(), &$db, $DEBUG){ |
1262 |
parent::verifier($val, $db, $DEBUG); |
parent::verifier($val, $db, $DEBUG); |
|
//Récupère la restriction |
|
|
$sql= "SELECT |
|
|
restriction |
|
|
FROM |
|
|
".DB_PREFIXE."evenement |
|
|
WHERE |
|
|
evenement =".$val['evenement']; |
|
|
|
|
|
$res = $db->query($sql); |
|
|
$this->addToLog("verifier(): db->query(\"".$sql."\");", VERBOSE_MODE); |
|
|
if (database::isError($res)) { |
|
|
die($res->getMessage()); |
|
|
} |
|
|
$row=& $res->fetchRow(DB_FETCHMODE_ASSOC); |
|
1263 |
|
|
1264 |
//Test qu'une restriction est présente |
if ( isset($val['evenement']) && is_numeric($val['evenement'])){ |
1265 |
if ( isset($row['restriction']) && $row['restriction'] != "" ){ |
//Récupère la restriction |
1266 |
|
$sql= "SELECT |
1267 |
//Test si la restriction est valide |
restriction |
1268 |
if ( !$this->restrictionIsValid($row['restriction']) ){ |
FROM |
1269 |
|
".DB_PREFIXE."evenement |
1270 |
$this->correct=false; |
WHERE |
1271 |
$this->addToMessage(_("Restriction non valide")); |
evenement =".$val['evenement']; |
1272 |
} |
|
1273 |
else { |
$res = $db->query($sql); |
1274 |
|
$this->addToLog("verifier(): db->query(\"".$sql."\");", VERBOSE_MODE); |
1275 |
|
if (database::isError($res)) { |
1276 |
|
die($res->getMessage()); |
1277 |
|
} |
1278 |
|
$row=& $res->fetchRow(DB_FETCHMODE_ASSOC); |
1279 |
|
|
1280 |
|
//Test qu'une restriction est présente |
1281 |
|
if ( isset($row['restriction']) && $row['restriction'] != "" ){ |
1282 |
|
|
1283 |
$this->correct = true; |
//Test si la restriction est valide |
1284 |
|
if ( !$this->restrictionIsValid($row['restriction']) ){ |
1285 |
|
|
1286 |
|
$this->correct=false; |
1287 |
|
$this->addToMessage(_("Restriction non valide")); |
1288 |
|
} |
1289 |
|
else { |
1290 |
|
|
1291 |
|
$this->correct = true; |
1292 |
|
} |
1293 |
} |
} |
1294 |
} |
} |
1295 |
|
|
1296 |
$this->updateDate("date_envoi_signature"); |
$this->updateDate("date_envoi_signature"); |
1297 |
$this->updateDate("date_retour_signature"); |
$this->updateDate("date_retour_signature"); |
1298 |
$this->updateDate("date_envoi_rar"); |
$this->updateDate("date_envoi_rar"); |