11 |
"uid" => array( |
"uid" => array( |
12 |
"dossier" => "getDossier", |
"dossier" => "getDossier", |
13 |
"dossier_version" => "getDossierVersion", |
"dossier_version" => "getDossierVersion", |
14 |
"numDemandeAutor" => "getDossierAutorisation", |
"numDemandeAutor" => "getNumDemandeAutor", |
15 |
"anneemoisDemandeAutori" => "getDateDemandeInitiale", |
"anneemoisDemandeAutor" => "getAnneemoisDemandeAutor", |
16 |
"typeInstructionAutorisation" => "getDossierInstructionType", |
"typeInstruction" => "getTypeInstruction", |
17 |
"statutAutorisation" => "getStatut", |
"statutAutorisation" => "getStatutAutorisation", |
18 |
"typeAutorisation" => "getDossierAutorisationType", |
"typeAutorisation" => "getTypeAutorisation", |
19 |
"dateEvenementDocument" => "getDateEvenement", |
"dateEvenementDocument" => "getDateEvenementDocument", |
20 |
"filename" => "getFilename", |
"filename" => "getFilename", |
21 |
"groupeInstruction" => 'getGroupeInstruction', |
"groupeInstruction" => 'getGroupeInstruction', |
22 |
"title" => 'getTypeDoc', |
"title" => 'getTitle', |
23 |
), |
), |
24 |
"document_arrete" => array( |
"document_arrete" => array( |
25 |
"numArrete" => "getNumArrete", |
"numArrete" => "getNumArrete", |
26 |
"specialiteArrete" => "getSpecialiteArrete", |
"ReglementaireArrete" => "getReglementaireArrete", |
27 |
"decisionArrete" => "getDecisionArrete", |
"NotificationArrete" => "getNotificationArrete", |
28 |
"chketatReglementaire" => "getChketatReglementaire", |
"dateNotificationArrete" => "getDateNotificationArrete", |
29 |
"chkNotification" => "getChkNotification", |
"controleLegalite" => "getControleLegalite", |
30 |
"dateNotification" => "getDateNotification", |
"dateSignature" => "getDateSignature", |
|
"chkCreationdroit" => "getChkCreationdroit", |
|
|
"chkPublication" => "getChkPublication", |
|
|
"datePublication" => "getDatePublication", |
|
|
"chkControleLegalite" => "getChkControleLegalite", |
|
|
"dateSignatureArrete" => "getDateSignatureArrete", |
|
31 |
"nomSignataire" => "getNomSignataire", |
"nomSignataire" => "getNomSignataire", |
32 |
"qualiteSignataire" => "getQualiteSignataire", |
"qualiteSignataire" => "getQualiteSignataire", |
|
"chkDelegation" => "getChkDelegation", |
|
33 |
"ap_numRue" => "getAp_numRue", |
"ap_numRue" => "getAp_numRue", |
34 |
"ap_nomDeLaVoie" => "getAp_nomDeLaVoie", |
"ap_nomDeLaVoie" => "getAp_nomDeLaVoie", |
35 |
"ap_codePostal" => "getAp_codePostal", |
"ap_codePostal" => "getAp_codePostal", |
36 |
"ap_ville" => "getAp_ville", |
"ap_ville" => "getAp_ville", |
37 |
|
"activite" => "getActivite", |
38 |
|
"dateControleLegalite" => "getDateControleLegalite", |
39 |
|
"permanentArrete" => "getPermanentArrete", |
40 |
), |
), |
41 |
); |
); |
42 |
|
|
134 |
function setvalF($val) { |
function setvalF($val) { |
135 |
parent::setvalF($val); |
parent::setvalF($val); |
136 |
|
|
137 |
|
//Si le type est renseigné |
138 |
if ($val['document_numerise_type'] != "") { |
if ($val['document_numerise_type'] != "") { |
139 |
|
//Recupère le code du type du document |
140 |
$document_numerise_type = $this->get_document_numerise_type_code_by_id($val["document_numerise_type"]); |
$document_numerise_type = $this->get_document_numerise_type_code_by_id($val["document_numerise_type"]); |
141 |
|
|
142 |
|
// Si c'est un arrêté alors on ajoute les métadonnées pour ce type de document |
143 |
|
if ($this->get_document_numerise_type_categorie_libelle($val["document_numerise_type"]) == 'Arrêté') { |
144 |
|
|
145 |
|
// rassemble les elément des deux tableau |
146 |
|
$this->metadata['uid'] = array_merge($this->metadata['uid'], $this->metadata['document_arrete']); |
147 |
|
} |
148 |
} else { |
} else { |
149 |
$document_numerise_type = ""; |
$document_numerise_type = ""; |
150 |
} |
} |
155 |
|
|
156 |
//Génération automatique nom du fichier |
//Génération automatique nom du fichier |
157 |
$this->valF['nom_fichier'] = $this->generateFilename($this->valF["date_creation"], $document_numerise_type); |
$this->valF['nom_fichier'] = $this->generateFilename($this->valF["date_creation"], $document_numerise_type); |
|
|
|
|
// Si c'est un arrêté alors on ajoute les métadonnées pour ce type de document |
|
|
if ($this->get_document_numerise_type_categorie_libelle($val["document_numerise_type"]) == 'Arrêté') { |
|
|
|
|
|
// rassemble les elément des deux tableau |
|
|
$this->metadata['uid'] = array_merge($this->metadata['uid'], $this->metadata['document_arrete']); |
|
|
} |
|
158 |
} |
} |
159 |
|
|
160 |
/** |
/** |
161 |
* Permet de mettre à jour un champs dans la table instruction sans passer par ses triggers |
* Permet de mettre à jour un champs dans la table instruction sans passer par ses triggers |
162 |
* @param string $uid Identifiant du fichier |
* @param string $document_numerise Identifiant du fichier |
163 |
*/ |
*/ |
164 |
private function updateInstructionAutoExecute($uid) { |
private function updateInstructionAutoExecute($document_numerise) { |
165 |
|
|
166 |
// valeurs à mettre à jour |
// valeurs à mettre à jour |
167 |
$val = array("document_arrete"=>$uid); |
$val = array("document_numerise"=>$document_numerise); |
168 |
// met à jour la table instruction sans passer par ses triggers |
// met à jour la table instruction sans passer par ses triggers |
169 |
$res = $this->db->autoExecute(DB_PREFIXE."instruction", $val, DB_AUTOQUERY_UPDATE,"instruction=".$this->getLastInstruction($this->valF['dossier'])); |
$res = $this->db->autoExecute(DB_PREFIXE."instruction", $val, DB_AUTOQUERY_UPDATE,"instruction=".$this->getLastInstruction($this->valF['dossier'])); |
170 |
// Exécution du traitement |
// Exécution du traitement |
184 |
if ($this->get_document_numerise_type_categorie_libelle($val["document_numerise_type"]) == 'Arrêté') { |
if ($this->get_document_numerise_type_categorie_libelle($val["document_numerise_type"]) == 'Arrêté') { |
185 |
|
|
186 |
// Met à jour la table instruction |
// Met à jour la table instruction |
187 |
$this->updateInstructionAutoExecute($this->valF['uid']); |
$this->updateInstructionAutoExecute($this->valF['document_numerise']); |
188 |
} |
} |
189 |
|
|
190 |
} |
} |
274 |
* Récupération du numéro de dossier d'autorisation à ajouter aux métadonnées |
* Récupération du numéro de dossier d'autorisation à ajouter aux métadonnées |
275 |
* @return [type] [description] |
* @return [type] [description] |
276 |
*/ |
*/ |
277 |
protected function getDossierAutorisation() { |
protected function getNumDemandeAutor() { |
278 |
if(empty($this->specificMetadata)) { |
if(empty($this->specificMetadata)) { |
279 |
$this->getSpecificMetadata(); |
$this->getSpecificMetadata(); |
280 |
} |
} |
284 |
* Récupération de la date de demande initiale du dossier à ajouter aux métadonnées |
* Récupération de la date de demande initiale du dossier à ajouter aux métadonnées |
285 |
* @return [type] [description] |
* @return [type] [description] |
286 |
*/ |
*/ |
287 |
protected function getDateDemandeInitiale() { |
protected function getAnneemoisDemandeAutor() { |
288 |
if(empty($this->specificMetadata)) { |
if(empty($this->specificMetadata)) { |
289 |
$this->getSpecificMetadata(); |
$this->getSpecificMetadata(); |
290 |
} |
} |
294 |
* Récupération du type de dossier d'instruction à ajouter aux métadonnées |
* Récupération du type de dossier d'instruction à ajouter aux métadonnées |
295 |
* @return [type] [description] |
* @return [type] [description] |
296 |
*/ |
*/ |
297 |
protected function getDossierInstructionType() { |
protected function getTypeInstruction() { |
298 |
if(empty($this->specificMetadata)) { |
if(empty($this->specificMetadata)) { |
299 |
$this->getSpecificMetadata(); |
$this->getSpecificMetadata(); |
300 |
} |
} |
304 |
* Récupération du statut du dossier d'autorisation à ajouter aux métadonnées |
* Récupération du statut du dossier d'autorisation à ajouter aux métadonnées |
305 |
* @return [type] [description] |
* @return [type] [description] |
306 |
*/ |
*/ |
307 |
protected function getStatut() { |
protected function getStatutAutorisation() { |
308 |
if(empty($this->specificMetadata)) { |
if(empty($this->specificMetadata)) { |
309 |
$this->getSpecificMetadata(); |
$this->getSpecificMetadata(); |
310 |
} |
} |
314 |
* Récupération du type de dossier d'autorisation à ajouter aux métadonnées |
* Récupération du type de dossier d'autorisation à ajouter aux métadonnées |
315 |
* @return [type] [description] |
* @return [type] [description] |
316 |
*/ |
*/ |
317 |
protected function getDossierAutorisationType() { |
protected function getTypeAutorisation() { |
318 |
if(empty($this->specificMetadata)) { |
if(empty($this->specificMetadata)) { |
319 |
$this->getSpecificMetadata(); |
$this->getSpecificMetadata(); |
320 |
} |
} |
331 |
* Récupération de la date d'ajout de document à ajouter aux métadonnées |
* Récupération de la date d'ajout de document à ajouter aux métadonnées |
332 |
* @return [type] [description] |
* @return [type] [description] |
333 |
*/ |
*/ |
334 |
protected function getDateEvenement() { |
protected function getDateEvenementDocument() { |
335 |
return date("d/m/Y", strtotime($this->valF["date_creation"])); |
return date("Y-m-d", strtotime($this->valF["date_creation"])); |
336 |
} |
} |
337 |
/** |
/** |
338 |
* Récupération du groupe d'instruction à ajouter aux métadonnées |
* Récupération du groupe d'instruction à ajouter aux métadonnées |
348 |
* Récupération du libellé du type du document à ajouter aux métadonnées |
* Récupération du libellé du type du document à ajouter aux métadonnées |
349 |
* @return string Groupe d'instruction |
* @return string Groupe d'instruction |
350 |
*/ |
*/ |
351 |
protected function getTypeDoc() { |
protected function getTitle() { |
352 |
//Requête sql |
//Requête sql |
353 |
$sql = "SELECT libelle |
$sql = "SELECT libelle |
354 |
FROM ".DB_PREFIXE."document_numerise_type |
FROM ".DB_PREFIXE."document_numerise_type |
355 |
WHERE document_numerise_type = ".$this->valF["document_numerise_type"]; |
WHERE document_numerise_type = ".$this->valF["document_numerise_type"]; |
356 |
$document_numerise_type_libelle = $this->db->getOne($sql); |
$document_numerise_type_libelle = $this->db->getOne($sql); |
357 |
$this->addToLog("db->getone(\"".$sql."\");", VERBOSE_MODE); |
$this->addToLog("db->getone(\"".$sql."\");", VERBOSE_MODE); |
358 |
$this->f->addToLog("getTypeDoc() : db->getOne(".$sql.")", VERBOSE_MODE); |
$this->f->addToLog("getTitle() : db->getOne(".$sql.")", VERBOSE_MODE); |
359 |
if (database::isError($document_numerise_type_libelle)) { |
if (database::isError($document_numerise_type_libelle)) { |
360 |
die(); |
die(); |
361 |
} |
} |
375 |
return ''; |
return ''; |
376 |
} |
} |
377 |
/** |
/** |
|
* @return string ads |
|
|
*/ |
|
|
function getSpecialiteArrete() { |
|
|
return "ADS"; |
|
|
} |
|
|
/** |
|
|
* @return string decision |
|
|
*/ |
|
|
function getDecisionArrete() { |
|
|
if (empty($this->metadonneesArrete)) { |
|
|
$this->getArreteMetadata(); |
|
|
} |
|
|
return $this->metadonneesArrete["decisionarrete"]; |
|
|
} |
|
|
/** |
|
378 |
* @return chaîne vide |
* @return chaîne vide |
379 |
*/ |
*/ |
380 |
function getChketatReglementaire() { |
function getReglementaireArrete() { |
381 |
return 'true'; |
return 'true'; |
382 |
} |
} |
383 |
/** |
/** |
384 |
* @return boolean de notification au pétitionnaire |
* @return boolean de notification au pétitionnaire |
385 |
*/ |
*/ |
386 |
function getChkNotification() { |
function getNotificationArrete() { |
387 |
return 'true'; |
return 'true'; |
388 |
} |
} |
389 |
/** |
/** |
390 |
* @return date de notification au pétitionnaire |
* @return date de notification au pétitionnaire |
391 |
*/ |
*/ |
392 |
function getDateNotification() { |
function getDateNotificationArrete() { |
393 |
if (empty($this->metadonneesArrete)) { |
if (empty($this->metadonneesArrete)) { |
394 |
$this->getArreteMetadata(); |
$this->getArreteMetadata(); |
395 |
} |
} |
396 |
return $this->metadonneesArrete["datenotification"]; |
return $this->metadonneesArrete["datenotification"]; |
397 |
} |
} |
398 |
/** |
/** |
|
* @return chaîne vide |
|
|
*/ |
|
|
function getChkCreationdroit() { |
|
|
return "true"; |
|
|
} |
|
|
/** |
|
|
* @return chaîne vide |
|
|
*/ |
|
|
function getChkPublication() { |
|
|
return "true"; |
|
|
} |
|
|
/** |
|
|
* @return chaîne vide |
|
|
*/ |
|
|
function getDatePublication() { |
|
|
return ""; |
|
|
} |
|
|
/** |
|
399 |
* @return boolean check si le document est passé au contrôle de légalité |
* @return boolean check si le document est passé au contrôle de légalité |
400 |
*/ |
*/ |
401 |
function getChkControleLegalite() { |
function getControleLegalite() { |
402 |
return 'true'; |
return 'true'; |
403 |
} |
} |
404 |
/** |
/** |
405 |
* @return date de signature de l'arrêté |
* @return date de signature de l'arrêté |
406 |
*/ |
*/ |
407 |
function getDateSignatureArrete() { |
function getDateSignature() { |
408 |
if (empty($this->metadonneesArrete)) { |
if (empty($this->metadonneesArrete)) { |
409 |
$this->getArreteMetadata(); |
$this->getArreteMetadata(); |
410 |
} |
} |
429 |
return $this->metadonneesArrete["qualitesignataire"]; |
return $this->metadonneesArrete["qualitesignataire"]; |
430 |
} |
} |
431 |
/** |
/** |
|
* @return string chaîne vide |
|
|
*/ |
|
|
function getChkDelegation() { |
|
|
return "true"; |
|
|
} |
|
|
/** |
|
432 |
* @return string numéro du terrain |
* @return string numéro du terrain |
433 |
*/ |
*/ |
434 |
function getAp_numRue() { |
function getAp_numRue() { |
464 |
} |
} |
465 |
return $this->metadonneesArrete["ap_ville"]; |
return $this->metadonneesArrete["ap_ville"]; |
466 |
} |
} |
467 |
|
/** |
468 |
|
* @return string activité |
469 |
|
*/ |
470 |
|
function getActivite() { |
471 |
|
return "Droit du sol"; |
472 |
|
} |
473 |
|
/** |
474 |
|
* @return string date du retour de controle légalité |
475 |
|
*/ |
476 |
|
function getDateControleLegalite() { |
477 |
|
if (empty($this->metadonneesArrete)) { |
478 |
|
$this->getArreteMetadata(); |
479 |
|
} |
480 |
|
return $this->metadonneesArrete["datecontrolelegalite"]; |
481 |
|
} |
482 |
|
/** |
483 |
|
* @return string vide |
484 |
|
*/ |
485 |
|
function getPermanentArrete() { |
486 |
|
return ""; |
487 |
|
} |
488 |
|
|
489 |
// Fin des méthodes de récupération des métadonnées |
// Fin des méthodes de récupération des métadonnées |
490 |
// }}} |
// }}} |
607 |
function getArreteMetadata() { |
function getArreteMetadata() { |
608 |
$sqlArrete = "SELECT signataire_arrete.nom as \"nomsignataire\", |
$sqlArrete = "SELECT signataire_arrete.nom as \"nomsignataire\", |
609 |
signataire_arrete.qualite as \"qualitesignataire\", |
signataire_arrete.qualite as \"qualitesignataire\", |
|
instruction.date_evenement as \"datesignaturearrete\", |
|
610 |
instruction.etat as \"decisionarrete\", |
instruction.etat as \"decisionarrete\", |
611 |
instruction.date_retour_rar as \"datenotification\", |
instruction.date_retour_rar as \"datenotification\", |
612 |
instruction.date_retour_signature as \"datesignaturesrrete\", |
instruction.date_retour_signature as \"datesignaturearrete\", |
613 |
|
instruction.date_retour_controle_legalite as \"datecontrolelegalite\", |
614 |
dossier.terrain_adresse_voie_numero as \"ap_numrue\", |
dossier.terrain_adresse_voie_numero as \"ap_numrue\", |
615 |
dossier.complement as \"ap_nomdelavoie\", |
dossier.complement as \"ap_nomdelavoie\", |
616 |
dossier.terrain_adresse_code_postal as \"ap_codepostal\", |
dossier.terrain_adresse_code_postal as \"ap_codepostal\", |
656 |
* @param string $idx Identifiant du dossier d'instruction |
* @param string $idx Identifiant du dossier d'instruction |
657 |
* @return string Le statut du dossier d'instruction |
* @return string Le statut du dossier d'instruction |
658 |
*/ |
*/ |
659 |
function getStatutDossier($idx){ |
function getStatutAutorisationDossier($idx){ |
660 |
|
|
661 |
$statut = ''; |
$statut = ''; |
662 |
|
|
673 |
dossier.etat = etat.etat |
dossier.etat = etat.etat |
674 |
WHERE dossier ='".$idx."'"; |
WHERE dossier ='".$idx."'"; |
675 |
$statut = $this->db->getOne($sql); |
$statut = $this->db->getOne($sql); |
676 |
$this->f->addToLog("getStatutDossier() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
$this->f->addToLog("getStatutAutorisationDossier() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
677 |
if ( database::isError($statut)){ |
if ( database::isError($statut)){ |
678 |
die(); |
die(); |
679 |
} |
} |
746 |
JOIN ".DB_PREFIXE."dossier ON instruction.dossier = dossier.dossier |
JOIN ".DB_PREFIXE."dossier ON instruction.dossier = dossier.dossier |
747 |
WHERE dossier.dossier='".$dossier."'"; |
WHERE dossier.dossier='".$dossier."'"; |
748 |
$lastInstruction = $this->db->getOne($sql); |
$lastInstruction = $this->db->getOne($sql); |
749 |
$this->f->addToLog("getStatutDossier() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
$this->f->addToLog("getStatutAutorisationDossier() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
750 |
if ( database::isError($lastInstruction)){ |
if ( database::isError($lastInstruction)){ |
751 |
die(); |
die(); |
752 |
} |
} |
753 |
|
|
754 |
return $lastInstruction; |
return $lastInstruction; |
755 |
} |
} |
756 |
|
|
757 |
|
/** |
758 |
|
* Méthode de verification du contenu |
759 |
|
*/ |
760 |
|
function verifier($val, &$db, $DEBUG) { |
761 |
|
parent::verifier($val, $db, $DEBUG); |
762 |
|
|
763 |
|
// Si c'est un arrêté |
764 |
|
if ($this->get_document_numerise_type_categorie_libelle($val["document_numerise_type"]) == 'Arrêté') { |
765 |
|
|
766 |
|
// Les champs date_retour_rar, date_retour_controle_legalite et date_retour_signature sont obligatoire pour un document arrêté |
767 |
|
if(!$this->getDateNotificationArrete() || $this->getDateNotificationArrete() == '') { |
768 |
|
$this->correct = false; |
769 |
|
$this->addToMessage( _('Le champ').' <span class="bold">'._("date_retour_rar").'</span> '._('est obligatoire pour un arrete.')); |
770 |
|
} |
771 |
|
|
772 |
|
if(!$this->getDateSignature() || $this->getDateSignature() == '') { |
773 |
|
$this->correct = false; |
774 |
|
$this->addToMessage( _('Le champ').' <span class="bold">'._("date_retour_signature").'</span> '._('est obligatoire pour un arrete.')); |
775 |
|
} |
776 |
|
|
777 |
|
if(!$this->getDateControleLegalite() || $this->getDateControleLegalite() == '') { |
778 |
|
$this->correct = false; |
779 |
|
$this->addToMessage( _('Le champ').' <span class="bold">'._("date_retour_controle_legalite").'</span> '._('est obligatoire pour un arrete.')); |
780 |
|
} |
781 |
|
} |
782 |
|
} |
783 |
|
|
784 |
}// fin classe |
}// fin classe |
785 |
?> |
?> |