30 |
function dossier($id,&$db,$DEBUG) { |
function dossier($id,&$db,$DEBUG) { |
31 |
$this->constructeur($id,$db,$DEBUG); |
$this->constructeur($id,$db,$DEBUG); |
32 |
} // fin constructeur |
} // fin constructeur |
33 |
|
|
34 |
/*Mutateur pour ma variable dossier_instruction_type*/ |
/*Mutateur pour ma variable dossier_instruction_type*/ |
35 |
public function getDossierInstructionType(){ |
public function getDossierInstructionType(){ |
36 |
return $this->dossier_instruction_type; |
return $this->dossier_instruction_type; |
56 |
$this->actions_sup = array(); |
$this->actions_sup = array(); |
57 |
$this->setParameter("actions", array()); |
$this->setParameter("actions", array()); |
58 |
} |
} |
59 |
|
|
60 |
|
/* |
61 |
|
* Si une action 'rapport_instruction' est présente et |
62 |
|
* que le le rapport d'instruction existe déjà, lien vers l'objet en modification |
63 |
|
* sinon, lien vers un script qui va créer le nouvel objet et |
64 |
|
* rediriger l'utilisateur vers l'objet en modification. |
65 |
|
*/ |
66 |
|
|
67 |
|
// Vérifie si un rapport d'instruction existe déjà |
68 |
|
if ( isset($this->actions_sup["rapport_instruction"]) ) { |
69 |
|
|
70 |
|
// Requête de vérification |
71 |
|
$sql = "SELECT |
72 |
|
rapport_instruction |
73 |
|
FROM |
74 |
|
".DB_PREFIXE."rapport_instruction |
75 |
|
WHERE |
76 |
|
dossier_instruction = '".$this->getParameter('idx')."'"; |
77 |
|
|
78 |
|
// Ajout au log |
79 |
|
$this->f->addToLog("checkAccessibility(): db->query(\"".$sql."\");", VERBOSE_MODE); |
80 |
|
|
81 |
|
// Exécution de la requête |
82 |
|
$res=$this->f->db->query($sql); |
83 |
|
$this->f->isDatabaseError($res); |
84 |
|
|
85 |
|
/* |
86 |
|
* S'il n'y a pas de rapport d'instruction, redirection vers un script |
87 |
|
* de création, puis vers l'objet. |
88 |
|
* */ |
89 |
|
if ( $res->numrows() == 0 ){ |
90 |
|
|
91 |
|
$this->actions_sup["rapport_instruction"]["lien"] = |
92 |
|
'../app/rapport_instruction.php?idx='; |
93 |
|
} |
94 |
|
// S'il a déjà été créé, lien vers l'objet en modification |
95 |
|
elseif ( $res->numrows() > 0 ){ |
96 |
|
|
97 |
|
$row = & $res->fetchRow(DB_FETCHMODE_ASSOC); |
98 |
|
$this->actions_sup["rapport_instruction"]["lien"] = |
99 |
|
'../scr/form.php?obj=rapport_instruction&action=1&idx='. |
100 |
|
$row['rapport_instruction'].'&idD='; |
101 |
|
} |
102 |
|
|
103 |
|
} |
104 |
} |
} |
105 |
|
|
106 |
/** |
/** |
166 |
} |
} |
167 |
|
|
168 |
/*Création du numéro de dossier*/ |
/*Création du numéro de dossier*/ |
169 |
$this->valF['dossier'] = $val['dossier_autorisation']."/$code$numeroVersion"; |
$this->valF['dossier'] = $val['dossier_autorisation']."$code$numeroVersion"; |
170 |
} |
} |
171 |
|
|
172 |
/*Récupère la valeur du suffixe d'un dossier_instruction_type*/ |
/*Récupère la valeur du suffixe d'un dossier_instruction_type*/ |
294 |
unset ($this->valF['date_conformite']); |
unset ($this->valF['date_conformite']); |
295 |
} |
} |
296 |
|
|
297 |
|
/*Vérification des données saisies*/ |
298 |
function verifier($val,&$db,$DEBUG){ |
function verifier($val,&$db,$DEBUG){ |
299 |
parent::verifier($val,$db,$DEBUG); |
parent::verifier($val,$db,$DEBUG); |
300 |
if($val['parcelle']!="" and $val['sig']!='Oui'){ |
if($val['parcelle']!="" and $val['sig']!='Oui'){ |
427 |
// cache |
// cache |
428 |
if($maj==0) $form->setType('dossier', 'hidden'); |
if($maj==0) $form->setType('dossier', 'hidden'); |
429 |
$form->setType('annee', 'hidden'); |
$form->setType('annee', 'hidden'); |
|
$form->setType('nature', 'select'); |
|
430 |
$form->setType('parcelle_archive','hidden'); |
$form->setType('parcelle_archive','hidden'); |
431 |
$form->setType('parcelle_lot_archive','hidden'); |
$form->setType('parcelle_lot_archive','hidden'); |
432 |
$form->setType('objet_dossier','hidden'); // PC |
$form->setType('objet_dossier','hidden'); // PC |
520 |
} |
} |
521 |
if($maj == 3) { |
if($maj == 3) { |
522 |
$form->setType('annee', 'hidden'); |
$form->setType('annee', 'hidden'); |
|
$form->setType('nature', 'selectstatic'); |
|
523 |
$form->setType('temp1','hidden'); |
$form->setType('temp1','hidden'); |
524 |
$form->setType('temp2','hidden'); |
$form->setType('temp2','hidden'); |
525 |
$form->setType('temp3','hidden'); |
$form->setType('temp3','hidden'); |
536 |
$form->setType('division', 'hidden'); |
$form->setType('division', 'hidden'); |
537 |
} |
} |
538 |
$form->setType('dossier_autorisation', 'hiddenstatic'); |
$form->setType('dossier_autorisation', 'hiddenstatic'); |
539 |
|
$form->setType('dossier_instruction_type', 'selectstatic'); |
540 |
// |
// |
541 |
if ($maj == 0) { |
if ($maj == 0) { |
542 |
$form->setType('dossier_autorisation', 'select'); |
$form->setType('dossier_autorisation', 'select'); |
554 |
if ($maj == 0){ |
if ($maj == 0){ |
555 |
//$dossier_cp = $this->f->collectivite["cp"]; |
//$dossier_cp = $this->f->collectivite["cp"]; |
556 |
//$dossier_ville = $this->f->collectivite["ville"]; |
//$dossier_ville = $this->f->collectivite["ville"]; |
|
//$form->setVal('nature', $this->nature); |
|
557 |
|
|
558 |
$form->setVal('annee', date('y')); |
$form->setVal('annee', date('y')); |
559 |
$form->setVal('date_demande', date('Y-m-d')); |
$form->setVal('date_demande', date('Y-m-d')); |
659 |
$contenu[0]=array("dossier",$this->getParameter("idx")); |
$contenu[0]=array("dossier",$this->getParameter("idx")); |
660 |
$form->setSelect('geom',$contenu); |
$form->setSelect('geom',$contenu); |
661 |
} |
} |
662 |
|
// arrondissement recherche anvancée |
663 |
|
$this->init_select($form, $db, $maj, $debug, "arrondissement", |
664 |
|
$sql_arrondissement, $sql_arrondissement_by_id, false); |
665 |
|
// dossier_autorisation_type_detaille recherche anvancée |
666 |
|
$this->init_select($form, $db, $maj, $debug, "dossier_autorisation_type_detaille", |
667 |
|
$sql_dossier_autorisation_type_detaille, $sql_dossier_autorisation_type_detaille_by_id, false); |
668 |
/* |
/* |
669 |
* Affichage de données dans le select de la parcelle |
* Affichage de données dans le select de la parcelle |
670 |
* */ |
* */ |
703 |
// $form->setGroupe('division','F'); |
// $form->setGroupe('division','F'); |
704 |
//}else{ |
//}else{ |
705 |
// $form->setGroupe('dossier','D'); |
// $form->setGroupe('dossier','D'); |
|
// $form->setGroupe('nature','G'); |
|
706 |
// $form->setGroupe('annee','G'); |
// $form->setGroupe('annee','G'); |
707 |
// $form->setGroupe('date_demande','G'); |
// $form->setGroupe('date_demande','G'); |
708 |
// $form->setGroupe('date_depot','G'); |
// $form->setGroupe('date_depot','G'); |
969 |
|
|
970 |
if ($this->f->getParameter('option_erp') != "") { |
if ($this->f->getParameter('option_erp') != "") { |
971 |
// envoi du message a ERP en cas d'un depot du dossier dat |
// envoi du message a ERP en cas d'un depot du dossier dat |
972 |
if ($this->valF['nature'] == |
if ($this->getDATDCode($this->valF['dossier']) == |
973 |
$this->f->getParameter('erp_depot_dossier_dat')) { |
$this->f->getParameter('erp_depot_dossier_dat')) { |
974 |
$msgenque = new MessageEnqueuer(); |
$msgenque = new MessageEnqueuer(); |
975 |
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
977 |
} |
} |
978 |
|
|
979 |
// envoi du message a ERP en cas d'une demande d'ouverture DAT |
// envoi du message a ERP en cas d'une demande d'ouverture DAT |
980 |
if ($this->valF['nature'] == |
if ($this->getDATDCode($this->valF['dossier']) == |
981 |
$this->f->getParameter('erp_demande_ouverture_dat')) { |
$this->f->getParameter('erp_demande_ouverture_dat')) { |
982 |
$msgenque = new MessageEnqueuer(); |
$msgenque = new MessageEnqueuer(); |
983 |
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
986 |
|
|
987 |
if ($this->valF['erp'] === true) { |
if ($this->valF['erp'] === true) { |
988 |
// envoi du message a ERP en cas d'annulation d'une demande |
// envoi du message a ERP en cas d'annulation d'une demande |
989 |
if ($this->valF['nature'] == |
if ($this->getDATDCode($this->valF['dossier']) == |
990 |
$this->f->getParameter('erp_annulation_demande')) { |
$this->f->getParameter('erp_annulation_demande')) { |
991 |
$msgenque = new MessageEnqueuer(); |
$msgenque = new MessageEnqueuer(); |
992 |
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
995 |
|
|
996 |
// envoi du message a ERP en cas d'ouverture d'un dossier PC "rattache" |
// envoi du message a ERP en cas d'ouverture d'un dossier PC "rattache" |
997 |
// au dossier DAACT |
// au dossier DAACT |
998 |
if ($this->valF['nature'] == |
if ($this->getDATDCode($this->valF['dossier']) == |
999 |
$this->f->getParameter('erp_demande_ouverture_pc_daact')) { |
$this->f->getParameter('erp_demande_ouverture_pc_daact')) { |
1000 |
$msgenque = new MessageEnqueuer(); |
$msgenque = new MessageEnqueuer(); |
1001 |
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
1235 |
|
|
1236 |
// envoi du message "ERP Qualifie" pour un dossier DAT qui a besoin |
// envoi du message "ERP Qualifie" pour un dossier DAT qui a besoin |
1237 |
// de la qualification URBA |
// de la qualification URBA |
1238 |
if ($this->valF['nature'] == |
if ($this->getDATDCode($this->valF['dossier']) == |
1239 |
$this->f->getParameter('erp_nature_dat')) { |
$this->f->getParameter('erp_nature_dat')) { |
1240 |
$msgenque = new MessageEnqueuer(); |
$msgenque = new MessageEnqueuer(); |
1241 |
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
1248 |
|
|
1249 |
// envoi des messages a ERP en cas du dossier PC traite par URBA, et |
// envoi des messages a ERP en cas du dossier PC traite par URBA, et |
1250 |
// qui etait classifie come ERP |
// qui etait classifie come ERP |
1251 |
if (substr($this->valF['nature'], 0, 2) == |
if ($this->getDATDCode($this->valF['dossier']) == |
1252 |
$this->f->getParameter('erp_dossier_nature_pc') |
$this->f->getParameter('erp_dossier_nature_pc') |
1253 |
&& $this->valF['erp'] == true) { |
&& $this->valF['erp'] == true) { |
1254 |
$msgenque = new MessageEnqueuer(); |
$msgenque = new MessageEnqueuer(); |
1259 |
} |
} |
1260 |
} // fin de if($this->f->getParameter('option_erp')) |
} // fin de if($this->f->getParameter('option_erp')) |
1261 |
} |
} |
1262 |
|
|
1263 |
|
/** |
1264 |
|
* Retourne le type de dossier d'autorisation du dossier courant : |
1265 |
|
* - dossier_autorisation_type_detaille.code |
1266 |
|
**/ |
1267 |
|
function getDATDCode($idxDossier) { |
1268 |
|
$sql = "SELECT dossier_autorisation_type_detaille.code |
1269 |
|
FROM ".DB_PREFIXE."dossier_autorisation_type_detaille |
1270 |
|
INNER JOIN ".DB_PREFIXE."dossier_autorisation |
1271 |
|
ON dossier_autorisation_type_detaille.dossier_autorisation_type_detaille = |
1272 |
|
dossier_autorisation.dossier_autorisation_type_detaille |
1273 |
|
INNER JOIN ".DB_PREFIXE."dossier ON dossier.dossier_autorisation = dossier_autorisation.dossier_autorisation |
1274 |
|
WHERE dossier.dossier = '".$idxDossier."'"; |
1275 |
|
$res = $this -> db -> getOne($sql); |
1276 |
|
$this->f->isDatabaseError(); |
1277 |
|
$this->addToLog($sql); |
1278 |
|
return $res; |
1279 |
|
} |
1280 |
|
|
1281 |
|
|
1282 |
/** |
/** |