25 |
var $aff_localisation = "collapsible"; |
var $aff_localisation = "collapsible"; |
26 |
var $aff_description = "startClosed"; |
var $aff_description = "startClosed"; |
27 |
var $aff_amenagement = "startClosed"; |
var $aff_amenagement = "startClosed"; |
28 |
|
var $dossier_instruction_type; |
29 |
|
var $valIdDemandeur = array("petitionnaire_principal" => "", |
30 |
|
"delegataire" => "", |
31 |
|
"petitionnaire" => array()); |
32 |
|
var $postedIdDemandeur = array("petitionnaire_principal" => "", |
33 |
|
"delegataire" => "", |
34 |
|
"petitionnaire" => array()); |
35 |
|
|
36 |
function dossier($id,&$db,$DEBUG) { |
function dossier($id,&$db,$DEBUG) { |
37 |
$this->constructeur($id,$db,$DEBUG); |
$this->constructeur($id,$db,$DEBUG); |
38 |
} // fin constructeur |
} // fin constructeur |
39 |
|
|
40 |
|
/*Mutateur pour ma variable dossier_instruction_type*/ |
41 |
|
public function getDossierInstructionType(){ |
42 |
|
return $this->dossier_instruction_type; |
43 |
|
} |
44 |
|
public function setDossierInstructionType($dossier_instruction_type){ |
45 |
|
$this->dossier_instruction_type = $dossier_instruction_type; |
46 |
|
} |
47 |
|
|
48 |
|
// {{{ Gestion de la confidentialité des données spécifiques |
49 |
|
|
50 |
|
/** |
51 |
|
* Surcharge pour gérer les actions disponibles dans le portlet |
52 |
|
*/ |
53 |
|
function checkAccessibility() { |
54 |
|
// |
55 |
|
parent::checkAccessibility(); |
56 |
|
// Si l'utilisateur est un intructeur qui en correspond pas à la |
57 |
|
// division du dossier |
58 |
|
if ($this->f->isUserInstructeur() |
59 |
|
&& isset($this->f->om_utilisateur["division"]) |
60 |
|
&& $this->f->om_utilisateur["division"] != $this->getDivisionFromDossier()) { |
61 |
|
// |
62 |
|
$this->actions_sup = array(); |
63 |
|
$this->setParameter("actions", array()); |
64 |
|
} |
65 |
|
} |
66 |
|
|
67 |
|
/** |
68 |
|
* Cette methode est à surcharger elle permet de tester dans chaque classe |
69 |
|
* des droits des droits spécifiques en fonction des données |
70 |
|
*/ |
71 |
|
function canAccess() { |
72 |
|
// Si l'utilisateur est un intructeur qui ne correspond pas à la |
73 |
|
// division du dossier |
74 |
|
if ($this->f->isUserInstructeur() |
75 |
|
&& $this->f->om_utilisateur["division"] != $this->getDivisionFromDossier() |
76 |
|
&& $this->getParameter("maj") != 3) { |
77 |
|
// |
78 |
|
return false; |
79 |
|
} |
80 |
|
// |
81 |
|
return true; |
82 |
|
} |
83 |
|
|
84 |
|
/** |
85 |
|
* Cette méthode permet de récupérer la division d'un dossier |
86 |
|
*/ |
87 |
|
function getDivisionFromDossier() { |
88 |
|
// |
89 |
|
if (!isset($this->val[array_search("dossier", $this->champs)])) { |
90 |
|
return NULL; |
91 |
|
} |
92 |
|
// |
93 |
|
$sql = "select division from ".DB_PREFIXE."dossier "; |
94 |
|
$sql .= " where dossier='".$this->val[array_search("dossier", $this->champs)]."'"; |
95 |
|
// |
96 |
|
$division = $this->db->getOne($sql); |
97 |
|
$this->addToLog("getDivisionFromDossier(): db->getone(\"".$sql."\")", VERBOSE_MODE); |
98 |
|
database::isError($division); |
99 |
|
// |
100 |
|
return $division; |
101 |
|
} |
102 |
|
|
103 |
|
// }}} |
104 |
|
/* |
105 |
|
* Ajoute un numéro au dossier |
106 |
|
* |
107 |
|
*/ |
108 |
function setValFAjout($val = array()) { |
function setValFAjout($val = array()) { |
109 |
// Cle primaire |
|
110 |
$lettre=$this->f->collectivite["lettre"]; |
/*Récupération de la lettre associé au type de dossier d'instruction*/ |
111 |
$numero_unique = $this->f->collectivite["numero_unique"]; |
$code = $this->getCode($this->getDossierInstructionType()); |
112 |
if($numero_unique==1){ |
|
113 |
// numero unique (voir dyn/var.inc) |
/* Récupération de la valeur du suffixe ce dossier_instruction_type */ |
114 |
$temp=$this->$db->nextId(DB_PREFIXE.$this->table); |
$suffixe = $this->getSuffixe($this->getDossierInstructionType()); |
115 |
}else{ |
|
116 |
// numero suivant nature |
/*S'il est à TRUE, on récupère le numéro de version du dossier d'autorisation*/ |
117 |
$temp=$this->db->nextId(DB_PREFIXE."dossier_".$val['nature']); |
$numeroVersion = ""; |
118 |
|
if ( $suffixe == 't' ){ |
119 |
|
|
120 |
|
$numeroVersion = $this->getNumeroVersion($val['dossier_autorisation']); |
121 |
|
|
122 |
|
/* Incrémentation du numéro de version */ |
123 |
|
if ( is_numeric($numeroVersion) or $numeroVersion == -1 ){ |
124 |
|
|
125 |
|
$this->incrementNumeroVersion($val['dossier_autorisation'], ++$numeroVersion); |
126 |
|
} |
127 |
} |
} |
128 |
$temp=str_pad($temp,4,"0", STR_PAD_LEFT); |
|
129 |
$this->valF['dossier'] = $this->valF['nature'].$this->valF['annee']. |
/*Création du numéro de dossier*/ |
130 |
$lettre.$temp; |
$this->valF['dossier'] = $val['dossier_autorisation']."$code$numeroVersion"; |
131 |
|
$this->valF['version'] = $numeroVersion; |
132 |
} |
} |
133 |
|
|
134 |
|
/*Récupère la valeur du suffixe d'un dossier_instruction_type*/ |
135 |
|
function getSuffixe($dossierInstructionType){ |
136 |
|
|
137 |
|
$suffixe = ""; |
138 |
|
|
139 |
|
$sql = "SELECT |
140 |
|
suffixe |
141 |
|
FROM |
142 |
|
".DB_PREFIXE."dossier_instruction_type |
143 |
|
WHERE |
144 |
|
dossier_instruction_type = $dossierInstructionType"; |
145 |
|
|
146 |
|
$this->addToLog("getSuffixe(): db->query(\"".$sql."\")", VERBOSE_MODE); |
147 |
|
$res = $this->db->query($sql); |
148 |
|
if (database :: isError($res)) |
149 |
|
die($res->getMessage()."erreur ".$sql); |
150 |
|
|
151 |
|
if ( $res->numRows() > 0 ){ |
152 |
|
|
153 |
|
$row = $res->fetchRow(DB_FETCHMODE_ASSOC); |
154 |
|
$suffixe = $row['suffixe']; |
155 |
|
} |
156 |
|
|
157 |
|
return $suffixe; |
158 |
|
} |
159 |
|
|
160 |
|
/*Récupère dans la table de paramètrage la lettre correspondant |
161 |
|
* au dossier_instruction_type |
162 |
|
*/ |
163 |
|
function getCode($dossierInstructionType){ |
164 |
|
|
165 |
|
$code = ""; |
166 |
|
|
167 |
|
$sql = "SELECT |
168 |
|
code |
169 |
|
FROM |
170 |
|
".DB_PREFIXE."dossier_instruction_type |
171 |
|
WHERE |
172 |
|
dossier_instruction_type = $dossierInstructionType"; |
173 |
|
|
174 |
|
$this->addToLog("getCode(): db->query(\"".$sql."\")", VERBOSE_MODE); |
175 |
|
$res = $this->db->query($sql); |
176 |
|
if (database :: isError($res)) |
177 |
|
die($res->getMessage()."erreur ".$sql); |
178 |
|
|
179 |
|
if ( $res->numRows() > 0 ){ |
180 |
|
|
181 |
|
$row = $res->fetchRow(DB_FETCHMODE_ASSOC); |
182 |
|
$code = $row['code']; |
183 |
|
} |
184 |
|
|
185 |
|
return $code; |
186 |
|
} |
187 |
|
|
188 |
|
/*Récupère le numéro de version d'un dossier_autorisation*/ |
189 |
|
function getNumeroVersion($dossierAutorisation){ |
190 |
|
|
191 |
|
$numeroVersion = ""; |
192 |
|
|
193 |
|
$sql = "SELECT |
194 |
|
numero_version |
195 |
|
FROM |
196 |
|
".DB_PREFIXE."dossier_autorisation |
197 |
|
WHERE |
198 |
|
dossier_autorisation = '$dossierAutorisation'"; |
199 |
|
|
200 |
|
$this->addToLog("getNumeroVersion(): db->query(\"".$sql."\")", VERBOSE_MODE); |
201 |
|
$res = $this->db->query($sql); |
202 |
|
if (database :: isError($res)) |
203 |
|
die($res->getMessage()."erreur ".$sql); |
204 |
|
|
205 |
|
if ( $res->numRows() > 0 ){ |
206 |
|
|
207 |
|
$row = $res->fetchRow(DB_FETCHMODE_ASSOC); |
208 |
|
$numeroVersion = $row['numero_version']; |
209 |
|
} |
210 |
|
|
211 |
|
return $numeroVersion; |
212 |
|
} |
213 |
|
|
214 |
|
/*Incrémente le numéro de version du dossier*/ |
215 |
|
function incrementNumeroVersion($dossierAutorisation, $nouveauNumeroVersion) { |
216 |
|
|
217 |
|
$valF = array ( |
218 |
|
"numero_version" => $nouveauNumeroVersion |
219 |
|
); |
220 |
|
|
221 |
|
$res = $this->db->autoExecute(DB_PREFIXE."dossier_autorisation", |
222 |
|
$valF, |
223 |
|
DB_AUTOQUERY_UPDATE, |
224 |
|
"dossier_autorisation = '$dossierAutorisation'"); |
225 |
|
|
226 |
|
if (database :: isError($res)) |
227 |
|
die($res->getMessage()."erreur ".$sql); |
228 |
|
|
229 |
|
} |
230 |
|
|
231 |
function setvalF($val){ |
function setvalF($val){ |
232 |
parent::setvalF($val); |
parent::setvalF($val); |
233 |
|
|
234 |
|
// Récupération des id demandeurs postés |
235 |
|
$this->getPostedValues(); |
236 |
|
|
237 |
// enlever les valeurs a ne pas saisir -> recherche en trigger ajouter et modifier |
// enlever les valeurs a ne pas saisir -> recherche en trigger ajouter et modifier |
238 |
// $sig = 1 |
// $sig = 1 |
239 |
unset ($this->valF['geom']); |
unset ($this->valF['geom']); |
244 |
unset ($this->valF['etat']); |
unset ($this->valF['etat']); |
245 |
unset ($this->valF['delai']); |
unset ($this->valF['delai']); |
246 |
unset ($this->valF['accord_tacite']); |
unset ($this->valF['accord_tacite']); |
|
unset ($this->valF['types']); |
|
247 |
} |
} |
248 |
unset ($this->valF['avis_decision']); // avis + libelle avis |
unset ($this->valF['avis_decision']); // avis + libelle avis |
249 |
unset ($this->valF['terrain_surface_calcul']); |
unset ($this->valF['terrain_surface_calcul']); |
259 |
unset ($this->valF['date_conformite']); |
unset ($this->valF['date_conformite']); |
260 |
} |
} |
261 |
|
|
262 |
|
/*Vérification des données saisies*/ |
263 |
function verifier($val,&$db,$DEBUG){ |
function verifier($val,&$db,$DEBUG){ |
264 |
parent::verifier($val,$db,$DEBUG); |
parent::verifier($val,$db,$DEBUG); |
265 |
|
if(!isset($this->postedIdDemandeur["petitionnaire_principal"]) OR |
266 |
|
empty($this->postedIdDemandeur["petitionnaire_principal"])) { |
267 |
|
$this->correct = false; |
268 |
|
$this->addToMessage(_("La saisie d'un petitionnaire principal est obligatoire.")); |
269 |
|
} |
270 |
if($val['parcelle']!="" and $val['sig']!='Oui'){ |
if($val['parcelle']!="" and $val['sig']!='Oui'){ |
271 |
if (!preg_match('/^[0-9]{3} [A-Z]{1,3} [0-9]{1,5}$/', $val['parcelle']) && !preg_match('/^[0-9]{3}[A-Z]{1,3}[0-9]{1,5}$/', $val['parcelle'])){ |
if (!preg_match('/^[0-9]{3} [A-Z]{1,3} [0-9]{1,5}$/', $val['parcelle']) && !preg_match('/^[0-9]{3}[A-Z]{1,3}[0-9]{1,5}$/', $val['parcelle'])){ |
272 |
$this->correct=false; |
$this->correct=false; |
273 |
$this->addToMessage("<br>format parcelle incorrect"); |
$this->addToMessage("<br>format parcelle incorrect"); |
274 |
} |
} |
275 |
} |
} |
|
// regles travaux verification |
|
|
if ($this->valF['travaux']!=""){ |
|
|
$sql= "select * from ".DB_PREFIXE."regle where id = '".$this->valF['travaux']. |
|
|
"' and controle = 'travaux' order by ordre"; |
|
|
$res = $db->query($sql); |
|
|
if (database :: isError($res)) die($res->getMessage().$sql); |
|
|
$this->addToLog("requete ".$sql." execute <br>", EXTRA_VERBOSE_MODE); |
|
|
$regle=0; |
|
|
$msg=""; |
|
|
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
|
|
if(isset($this->valF[$row['champ']])) |
|
|
$champvaleur=$this->valF[$row['champ']]; |
|
|
else |
|
|
$champvaleur=0; |
|
|
switch ($row['operateur']) { |
|
|
case ">" : |
|
|
if($row['sens']=="plus"){ |
|
|
if($champvaleur > $row['valeur']) |
|
|
$condition = 1; |
|
|
else |
|
|
$condition = 0; |
|
|
if($regle==1 or $condition == 1) |
|
|
$regle=1; |
|
|
else |
|
|
$regle=0; |
|
|
$msg=$msg."<br> + ".$row['message']." [".$row['champ']." = ". |
|
|
$champvaleur."]"; |
|
|
}else{ |
|
|
if($champvaleur > $row['valeur']){ |
|
|
$condition = 0; |
|
|
}else{ |
|
|
$condition = 1; |
|
|
$regle=0; |
|
|
} |
|
|
$msg=$msg."<br> ou ".$row['message']." [".$row['champ']." = ". |
|
|
$champvaleur."]"; |
|
|
} |
|
|
break; |
|
|
case ">=": |
|
|
if($row['sens']=="plus"){ |
|
|
if($champvaleur >= $row['valeur']) |
|
|
$condition = 1; |
|
|
else |
|
|
$condition = 0; |
|
|
if($regle==1 or $condition == 1) |
|
|
$regle=1; |
|
|
else |
|
|
$regle=0; |
|
|
$msg=$msg."<br> + ".$row['message']." [".$row['champ']." = ". |
|
|
$champvaleur."]"; |
|
|
}else{ |
|
|
if($champvaleur >= $row['valeur']){ |
|
|
$condition = 0; |
|
|
|
|
|
}else{ |
|
|
$condition = 1; |
|
|
$regle=0; |
|
|
} |
|
|
$msg=$msg."<br> ou ".$row['message']." [".$row['champ']." = ". |
|
|
$champvaleur."]"; |
|
|
} |
|
|
break; |
|
|
case "<" : |
|
|
if($row['sens']=="plus"){ |
|
|
if($champvaleur < $row['valeur']) |
|
|
$condition = 1; |
|
|
else |
|
|
$condition = 0; |
|
|
if($regle==1 or $condition == 1) |
|
|
$regle=1; |
|
|
else |
|
|
$regle=0; |
|
|
$msg=$msg."<br> + ".$row['message']." [".$row['champ']." = ". |
|
|
$champvaleur."]"; |
|
|
}else{ |
|
|
if($champvaleur < $row['valeur']){ |
|
|
$condition = 0; |
|
|
}else{ |
|
|
$condition = 1; |
|
|
$regle=0; |
|
|
} |
|
|
$msg=$msg."<br> et ".$row['message']." [".$row['champ']." = ". |
|
|
$champvaleur."]"; |
|
|
} |
|
|
break; |
|
|
case "==": |
|
|
if($row['sens']=="plus"){ |
|
|
if($champvaleur == $row['valeur']) |
|
|
$condition = 1; |
|
|
else |
|
|
$condition = 0; |
|
|
if($regle==1 or $condition == 1) |
|
|
$regle=1; |
|
|
else |
|
|
$regle=0; |
|
|
$msg=$msg."<br> + ".$row['message']." [".$row['champ']." = ". |
|
|
$champvaleur."]"; |
|
|
}else{ |
|
|
if($champvaleur == $row['valeur']){ |
|
|
$condition = 0; |
|
|
|
|
|
}else{ |
|
|
$condition = 1; |
|
|
$regle=0; |
|
|
} |
|
|
$msg=$msg."<br> ou ".$row['message']." [".$row['champ']." = ". |
|
|
$champvaleur."]"; |
|
|
} |
|
|
break; |
|
|
//break; |
|
|
} // switch |
|
|
if($regle==0) |
|
|
$this->addToMessage($msg." <br>"); |
|
|
} // while |
|
|
} // travaux |
|
276 |
}//verifier |
}//verifier |
277 |
|
|
278 |
|
|
279 |
function setType(&$form,$maj) { |
function setType(&$form,$maj) { |
280 |
parent::setType($form,$maj); |
parent::setType($form,$maj); |
281 |
|
$form->setType('amenagement','hidden'); // PC |
282 |
|
$form->setType('parcelle_lot','hidden'); // PC |
283 |
|
$form->setType('parcelle_lot_lotissement','hidden'); // PC |
284 |
|
$form->setType('version','hidden'); // PC |
285 |
|
$form->setType('incompletude','hidden'); |
286 |
|
$form->setType('evenement_suivant_tacite','hidden'); |
287 |
|
$form->setType('evenement_suivant_tacite_incompletude','hidden'); |
288 |
|
$form->setType('etat_pendant_incompletude','hidden'); |
289 |
if ($maj < 2) { //ajouter et modifier |
if ($maj < 2) { //ajouter et modifier |
290 |
// cache |
// cache |
291 |
if($maj==0) $form->setType('dossier', 'hidden'); |
if($maj==0) $form->setType('dossier', 'hidden'); |
292 |
$form->setType('annee', 'hidden'); |
$form->setType('annee', 'hidden'); |
|
$form->setType('nature', 'select'); |
|
293 |
$form->setType('parcelle_archive','hidden'); |
$form->setType('parcelle_archive','hidden'); |
294 |
$form->setType('parcelle_lot_archive','hidden'); |
$form->setType('parcelle_lot_archive','hidden'); |
|
$form->setType('objet_dossier','hidden'); // PC |
|
|
$form->setType('amenagement','hidden'); // PC |
|
|
$form->setType('parcelle_lot','hidden'); // PC |
|
|
$form->setType('parcelle_lot_lotissement','hidden'); // PC |
|
295 |
|
|
296 |
$form->setType('geom1', 'hidden'); |
$form->setType('geom1', 'hidden'); |
297 |
$form->setType('geom', 'geom'); |
$form->setType('geom', 'geom'); |
300 |
//select |
//select |
301 |
$form->setType('terrain_numero_complement','select'); |
$form->setType('terrain_numero_complement','select'); |
302 |
|
|
|
// combo |
|
|
$form->setType('rivoli','comboD'); |
|
|
$form->setType('terrain_adresse','comboG'); |
|
|
$form->setType('architecte_nom','comboG'); |
|
|
$form->setType('architecte','comboD'); |
|
303 |
|
|
304 |
|
|
305 |
// hiddenstatic |
// hiddenstatic |
306 |
if($maj==1) $form->setType('dossier', 'hiddenstatic'); |
if($maj==1) $form->setType('dossier', 'hiddenstatic'); |
307 |
$form->setType('etat','hiddenstatic'); |
$form->setType('etat','hiddenstatic'); |
308 |
$form->setType('avis_decision','hiddenstatic'); |
$form->setType('avis_decision','hiddenstatic'); |
309 |
|
$form->setType('delai_incompletude','hiddenstatic'); |
310 |
$form->setType('delai','hiddenstatic'); |
$form->setType('delai','hiddenstatic'); |
311 |
$form->setType('terrain_surface_calcul','hiddenstatic'); |
$form->setType('terrain_surface_calcul','hiddenstatic'); |
312 |
$form->setType('shon_calcul','hiddenstatic'); |
$form->setType('shon_calcul','hiddenstatic'); |
313 |
|
|
314 |
$form->setType('accord_tacite','hiddenstatic'); |
$form->setType('accord_tacite','hiddenstatic'); |
|
$form->setType('types', 'hiddenstatic'); // transfert modificatif |
|
315 |
|
|
316 |
|
|
317 |
// hiddenstaticdate |
// hiddenstaticdate |
325 |
$form->setType('date_chantier','hiddenstaticdate'); |
$form->setType('date_chantier','hiddenstaticdate'); |
326 |
$form->setType('date_achevement','hiddenstaticdate'); |
$form->setType('date_achevement','hiddenstaticdate'); |
327 |
$form->setType('date_conformite','hiddenstaticdate'); |
$form->setType('date_conformite','hiddenstaticdate'); |
328 |
|
$form->setType('date_limite_incompletude','hiddenstaticdate'); |
329 |
|
|
330 |
|
$form->setType('date_demande','hiddenstaticdate'); |
331 |
|
$form->setType('date_depot','hiddenstaticdate'); |
332 |
|
$form->setType('date_dernier_depot','hiddenstaticdate'); |
333 |
|
|
334 |
// checkbox |
// checkbox |
335 |
$form->setType('sig','checkbox'); |
$form->setType('sig','checkbox'); |
|
$form->setType('delegataire','checkbox'); |
|
|
|
|
|
// mail |
|
|
$form->setType('delegataire_email','mail'); |
|
|
$form->setType('demandeur_email','mail'); |
|
336 |
|
|
337 |
// zones temp et strategysig |
// zones temp et strategysig |
338 |
|
|
351 |
$form->setType('temp3',$temp3_type); |
$form->setType('temp3',$temp3_type); |
352 |
$form->setType('temp4',$temp4_type); |
$form->setType('temp4',$temp4_type); |
353 |
$form->setType('temp5',$temp5_type); |
$form->setType('temp5',$temp5_type); |
354 |
|
$form->setType('a_qualifier', 'checkbox'); |
355 |
|
|
356 |
|
$form->setType('parcelle', 'hidden'); |
357 |
|
$form->setType('pos', 'hidden'); |
358 |
|
$form->setType('sig', 'hidden'); |
359 |
|
$form->setType('batiment_nombre', 'hidden'); |
360 |
|
$form->setType('logement_nombre', 'hidden'); |
361 |
|
$form->setType('hauteur', 'hidden'); |
362 |
|
$form->setType('piece_nombre', 'hidden'); |
363 |
|
$form->setType('shon', 'hidden'); |
364 |
|
$form->setType('shon_calcul', 'hidden'); |
365 |
|
$form->setType('shob', 'hidden'); |
366 |
|
$form->setType('lot', 'hidden'); |
367 |
} |
} |
368 |
if ($maj == 1) { |
if ($maj == 1) { |
369 |
// |
// |
386 |
} |
} |
387 |
if($maj == 3) { |
if($maj == 3) { |
388 |
$form->setType('annee', 'hidden'); |
$form->setType('annee', 'hidden'); |
|
$form->setType('nature', 'selectstatic'); |
|
389 |
$form->setType('temp1','hidden'); |
$form->setType('temp1','hidden'); |
390 |
$form->setType('temp2','hidden'); |
$form->setType('temp2','hidden'); |
391 |
$form->setType('temp3','hidden'); |
$form->setType('temp3','hidden'); |
395 |
$form->setType('parcelle_lot_archive','hidden'); |
$form->setType('parcelle_lot_archive','hidden'); |
396 |
$form->setType('geom1','hidden'); |
$form->setType('geom1','hidden'); |
397 |
$form->setType('geom','hidden'); |
$form->setType('geom','hidden'); |
398 |
|
$form->setType('a_qualifier', 'checkboxstatic'); |
399 |
|
$form->setType('terrain_references_cadastrales','referencescadastralesstatic'); // PC |
400 |
|
$form->setType('parcelle', 'hidden'); |
401 |
|
$form->setType('pos', 'hidden'); |
402 |
|
$form->setType('sig', 'hidden'); |
403 |
|
$form->setType('batiment_nombre', 'hidden'); |
404 |
|
$form->setType('logement_nombre', 'hidden'); |
405 |
|
$form->setType('hauteur', 'hidden'); |
406 |
|
$form->setType('piece_nombre', 'hidden'); |
407 |
|
$form->setType('shon', 'hidden'); |
408 |
|
$form->setType('shon_calcul', 'hidden'); |
409 |
|
$form->setType('shob', 'hidden'); |
410 |
|
$form->setType('lot', 'hidden'); |
411 |
} |
} |
|
$form->setType('a_qualifier', 'hidden'); |
|
412 |
// |
// |
413 |
if(!$this->f->getParameter('afficher_division') === 'true') { |
if(!$this->f->getParameter('afficher_division') === 'true') { |
414 |
$form->setType('division', 'hidden'); |
$form->setType('division', 'hidden'); |
415 |
} |
} |
416 |
|
$form->setType('dossier_autorisation', 'hiddenstatic'); |
417 |
|
$form->setType('dossier_instruction_type', 'selecthiddenstatic'); |
418 |
|
// |
419 |
|
if ($maj == 0) { |
420 |
|
$form->setType('dossier_autorisation', 'select'); |
421 |
|
} |
422 |
|
// On cache enjeu_ERP si l'option n'est pas activée |
423 |
|
if($this->f->getParameter('option_ERP') != 'true') { |
424 |
|
$form->setType('erp', 'hidden'); |
425 |
|
$form->setType('enjeu_erp', 'hidden'); |
426 |
|
} |
427 |
} |
} |
428 |
|
|
429 |
function setVal(&$form,$maj,$validation){ |
function setVal(&$form,$maj,$validation){ |
432 |
if ($maj == 0){ |
if ($maj == 0){ |
433 |
//$dossier_cp = $this->f->collectivite["cp"]; |
//$dossier_cp = $this->f->collectivite["cp"]; |
434 |
//$dossier_ville = $this->f->collectivite["ville"]; |
//$dossier_ville = $this->f->collectivite["ville"]; |
|
//$form->setVal('nature', $this->nature); |
|
435 |
|
|
436 |
$form->setVal('annee', date('y')); |
$form->setVal('annee', date('y')); |
437 |
$form->setVal('date_demande', date('Y-m-d')); |
$form->setVal('date_demande', date('Y-m-d')); |
448 |
|
|
449 |
$form->setVal('accord_tacite', 'Non'); |
$form->setVal('accord_tacite', 'Non'); |
450 |
$form->setVal('etat', 'initialiser'); |
$form->setVal('etat', 'initialiser'); |
|
$form->setVal('types', 'Initial'); |
|
451 |
} |
} |
452 |
} |
} |
453 |
} |
} |
458 |
if(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc.php")) |
if(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc.php")) |
459 |
include ("../sql/".$db->phptype."/".$this->table.".form.inc.php"); |
include ("../sql/".$db->phptype."/".$this->table.".form.inc.php"); |
460 |
if($maj<2){ |
if($maj<2){ |
|
// travaux |
|
|
$contenu=array(); |
|
|
// prise en compte du solde en ajout |
|
|
if($maj==0) |
|
|
$sql_travaux = $sql_travaux. |
|
|
" and solde = 'Non' order by libelle"; |
|
|
else |
|
|
$sql_travaux = $sql_travaux. |
|
|
" order by libelle"; |
|
|
$res = $db->query($sql_travaux); |
|
|
if (database::isError($res)) die($res->getMessage()).$sql_travaux; |
|
|
$this->addToLog(" la requete ".$sql_travaux." est executee", VERBOSE_MODE); |
|
|
$contenu[0][0]=""; |
|
|
$contenu[1][0]=_('choisir')." "._('travaux'); |
|
|
$k=1; |
|
|
while ($row=& $res->fetchRow()){ |
|
|
$contenu[0][$k]=$row[0]; |
|
|
$contenu[1][$k]=$row[1]; |
|
|
$k++; |
|
|
} |
|
|
$form->setSelect("travaux",$contenu); |
|
|
|
|
|
// code et libelle voie |
|
|
$contenu=""; |
|
|
$contenu[0][0]="rivoli";// table |
|
|
$contenu[0][1]="rivoli"; // zone origine |
|
|
$contenu[1][0]="libelle"; |
|
|
$contenu[1][1]="terrain_adresse"; |
|
|
$form->setSelect("rivoli",$contenu); |
|
|
//terrain_adresse |
|
|
$contenu=""; |
|
|
$contenu[0][0]="rivoli";// table |
|
|
$contenu[0][1]="libelle"; // zone origine |
|
|
$contenu[1][0]="rivoli"; |
|
|
$contenu[1][1]="rivoli"; |
|
|
$form->setSelect("terrain_adresse",$contenu); |
|
|
// code et libelle architecte |
|
|
$contenu=""; |
|
|
$contenu[0][0]="architecte";// table |
|
|
$contenu[0][1]="architecte"; // zone origine |
|
|
$contenu[1][0]="nom"; |
|
|
$contenu[1][1]="architecte_nom"; |
|
|
$form->setSelect("architecte",$contenu); |
|
|
$contenu=""; |
|
|
$contenu[0][0]="architecte";// table |
|
|
$contenu[0][1]="nom"; // zone origine |
|
|
$contenu[1][0]="architecte"; |
|
|
$contenu[1][1]="architecte"; |
|
|
$form->setSelect("architecte_nom",$contenu); |
|
461 |
// parcelle_lot |
// parcelle_lot |
462 |
$contenu=""; |
$contenu=""; |
463 |
$contenu[0][0]="parcelle_lot";// table |
$contenu[0][0]="parcelle_lot";// table |
487 |
$contenu[0]=array("dossier",$this->getParameter("idx")); |
$contenu[0]=array("dossier",$this->getParameter("idx")); |
488 |
$form->setSelect('geom',$contenu); |
$form->setSelect('geom',$contenu); |
489 |
} |
} |
490 |
|
// arrondissement recherche anvancée |
491 |
|
$this->init_select($form, $db, $maj, $debug, "arrondissement", |
492 |
|
$sql_arrondissement, $sql_arrondissement_by_id, false); |
493 |
|
// dossier_autorisation_type_detaille recherche anvancée |
494 |
|
$this->init_select($form, $db, $maj, $debug, "dossier_autorisation_type_detaille", |
495 |
|
$sql_dossier_autorisation_type_detaille, $sql_dossier_autorisation_type_detaille_by_id, false); |
496 |
/* |
/* |
497 |
* Affichage de données dans le select de la parcelle |
* Affichage de données dans le select de la parcelle |
498 |
* */ |
* */ |
522 |
function setLib(&$form,$maj) { |
function setLib(&$form,$maj) { |
523 |
parent::setLib($form,$maj); |
parent::setLib($form,$maj); |
524 |
$form->setLib('geom',''); |
$form->setLib('geom',''); |
525 |
|
$form->setLib('date_limite',_("date limite d'instruction")); |
526 |
|
$form->setLib('delai',_("delai d'instruction")); |
527 |
|
|
528 |
} |
} |
529 |
|
|
530 |
function setGroupe(&$form,$maj){ |
function setGroupe(&$form,$maj){ |
|
//If ($maj==0){ |
|
|
// $form->setGroupe('date_demande','D'); |
|
|
// $form->setGroupe('date_depot','G'); |
|
|
// $form->setGroupe('division','F'); |
|
|
//}else{ |
|
|
// $form->setGroupe('dossier','D'); |
|
|
// $form->setGroupe('nature','G'); |
|
|
// $form->setGroupe('annee','G'); |
|
|
// $form->setGroupe('date_demande','G'); |
|
|
// $form->setGroupe('date_depot','G'); |
|
|
// $form->setGroupe('division','F'); |
|
|
//} |
|
|
$form->setGroupe('demandeur_categorie','D'); |
|
|
$form->setGroupe('demandeur_civilite','G'); |
|
|
$form->setGroupe('demandeur_nom','F'); |
|
|
|
|
|
$form->setGroupe('demandeur_societe','D'); |
|
|
$form->setGroupe('demandeur_adresse','G'); |
|
|
$form->setGroupe('demandeur_adresse_complement','F'); |
|
|
|
|
|
$form->setGroupe('demandeur_cp','D'); |
|
|
$form->setGroupe('demandeur_ville','G'); |
|
|
$form->setGroupe('demandeur_pays','F'); |
|
|
|
|
|
$form->setGroupe('demandeur_email','D'); |
|
|
$form->setGroupe('demandeur_telephone','F'); |
|
|
|
|
|
$form->setGroupe('delegataire','D'); |
|
|
$form->setGroupe('delegataire_civilite','G'); |
|
|
$form->setGroupe('delegataire_nom','F'); |
|
|
|
|
|
$form->setGroupe('delegataire_societe','D'); |
|
|
$form->setGroupe('delegataire_adresse','G'); |
|
|
$form->setGroupe('delegataire_adresse_complement','F'); |
|
|
$form->setGroupe('delegataire_cp','D'); |
|
|
$form->setGroupe('delegataire_ville','G'); |
|
|
$form->setGroupe('delegataire_pays','F'); |
|
|
|
|
|
$form->setGroupe('delegataire_email','D'); |
|
|
$form->setGroupe('delegataire_telephone','F'); |
|
|
|
|
|
$form->setGroupe('architecte','D'); |
|
|
$form->setGroupe('architecte_nom','F'); |
|
|
//$form->setGroupe('saisie_architecte','F'); |
|
|
|
|
|
$form->setGroupe('travaux','D'); |
|
|
$form->setGroupe('travaux_complement','F'); |
|
|
|
|
|
// terrain |
|
|
$form->setGroupe('terrain_numero','D'); |
|
|
$form->setGroupe('terrain_numero_complement','G'); |
|
|
$form->setGroupe('rivoli','F'); |
|
|
$form->setGroupe('terrain_adresse','D'); |
|
|
$form->setGroupe('terrain_adresse_complement','F'); |
|
|
|
|
|
$form->setGroupe('terrain_cp','D'); |
|
|
$form->setGroupe('terrain_ville','F'); |
|
|
|
|
|
// surface |
|
|
$form->setGroupe('terrain_surface','D'); |
|
|
$form->setGroupe('terrain_surface_calcul','F'); |
|
|
|
|
|
// instruction |
|
|
$form->setGroupe('date_complet','D'); |
|
|
$form->setGroupe('date_rejet','G'); |
|
|
$form->setGroupe('rejet','G'); |
|
|
$form->setGroupe('delai','F'); |
|
|
|
|
|
$form->setGroupe('date_limite','D'); |
|
|
$form->setGroupe('date_notification_delai','G'); |
|
|
$form->setGroupe('accord_tacite','G'); |
|
|
$form->setGroupe('etat','F'); |
|
|
|
|
|
$form->setGroupe('date_decision','D'); |
|
|
$form->setGroupe('avis_decision','G'); |
|
|
$form->setGroupe('date_validite','G'); |
|
|
$form->setGroupe('types','F'); |
|
|
|
|
|
$form->setGroupe('date_chantier','D'); |
|
|
$form->setGroupe('date_achevement','G'); |
|
|
$form->setGroupe('date_conformite','F'); |
|
531 |
|
|
532 |
// localisation |
// localisation |
533 |
$form->setGroupe('parcelle','D'); |
$form->setGroupe('parcelle','D'); |
543 |
$form->setGroupe('geom','F'); |
$form->setGroupe('geom','F'); |
544 |
} |
} |
545 |
|
|
|
// description |
|
|
$form->setGroupe('batiment_nombre','D'); |
|
|
$form->setGroupe('logement_nombre','G'); |
|
|
$form->setGroupe('hauteur','G'); |
|
|
$form->setGroupe('piece_nombre','F'); |
|
|
|
|
|
$form->setGroupe('shon','D'); |
|
|
$form->setGroupe('shon_calcul','G'); |
|
|
$form->setGroupe('shob','G'); |
|
|
$form->setGroupe('lot','F'); |
|
|
|
|
|
$form->setGroupe('amenagement','D'); |
|
|
$form->setGroupe('parcelle_lot','G'); |
|
|
$form->setGroupe('parcelle_lot_lotissement','F'); |
|
546 |
} |
} |
547 |
|
|
548 |
function setOnchange(&$form,$maj){ |
function setOnchange(&$form,$maj){ |
563 |
function setLayout(&$form, $maj) { |
function setLayout(&$form, $maj) { |
564 |
// |
// |
565 |
$form->setBloc('dossier', 'D', '', ($maj == 3 ? 'col_9':'col_12')); |
$form->setBloc('dossier', 'D', '', ($maj == 3 ? 'col_9':'col_12')); |
566 |
$form->setBloc('dossier', 'D', '', 'col_9'); |
$form->setBloc('dossier', 'D', '', 'col_9'); |
567 |
$form->setFieldset('dossier', 'D', _("Dossier d'instruction")); |
|
568 |
$form->setFieldset('autorite_competente', 'F'); |
$form->setFieldset('dossier', 'D', _("Dossier d'instruction")); |
569 |
$form->setBloc('autorite_competente', 'F'); |
$form->setFieldset('autorite_competente', 'F'); |
570 |
$form->setBloc('date_demande', 'D', '', 'col_3'); |
|
571 |
$form->setFieldset('date_demande', 'D', _("Depot")); |
$form->setBloc('autorite_competente', 'F'); |
572 |
$form->setFieldset('date_depot', 'F'); |
|
573 |
$form->setFieldset('enjeu_urba', 'D', _("Enjeu")); |
$form->setBloc('date_demande', 'D', '', 'col_3'); |
574 |
$form->setFieldset('enjeu_erp', 'F'); |
|
575 |
$form->setBloc('enjeu_erp', 'F'); |
$form->setFieldset('date_demande', 'D', _("Depot")); |
576 |
$form->setBloc('enjeu_erp', 'F'); |
$form->setFieldset('date_dernier_depot', 'F'); |
577 |
// |
|
578 |
$form->setBloc('objet_dossier', 'D', '', 'col_12'); |
$form->setFieldset('enjeu_urba', 'D', _("Enjeu")); |
579 |
// |
$form->setFieldset('enjeu_erp', 'F'); |
580 |
$form->setFieldset('date_complet', 'D', _('Instruction'), 'col_12'); |
|
581 |
$form->setRegroupe('date_conformite','F',''); |
$form->setFieldset('erp', 'D', _("Qualification")); |
582 |
|
$form->setFieldset('a_qualifier', 'F'); |
583 |
|
|
584 |
|
$form->setBloc('a_qualifier', 'F'); |
585 |
|
$form->setBloc('a_qualifier', 'F'); |
586 |
// |
// |
587 |
$form->setBloc('geom1', 'F'); |
$form->setBloc('date_complet', 'D', '', 'col_12'); |
588 |
|
|
589 |
|
$form->setFieldset('date_complet', 'D', _('Instruction'), 'col_12'); |
590 |
|
|
591 |
|
$form->setBloc('date_complet', 'D', '', 'col_4'); |
592 |
|
$form->setBloc('date_limite_incompletude', 'F'); |
593 |
|
|
594 |
|
$form->setBloc('date_rejet', 'D', '', 'col_4'); |
595 |
|
$form->setBloc('delai_incompletude', 'F'); |
596 |
|
|
597 |
|
$form->setBloc('etat', 'D', '', 'col_4'); |
598 |
|
$form->setBloc('date_conformite', 'F'); |
599 |
|
|
600 |
|
$form->setFieldset('date_conformite','F',''); |
601 |
|
|
602 |
|
$form->setBloc('date_conformite', 'F'); |
603 |
|
|
604 |
|
$form->setBloc('parcelle','D',"", "col_12"); |
605 |
|
$form->setBloc('geom1','F'); |
606 |
|
|
607 |
|
//Fieldset "Localisation du terrain" |
608 |
|
$form->setBloc('terrain_references_cadastrales','D',"","col_12"); |
609 |
|
$form->setFieldset('terrain_references_cadastrales','D',_('Localisation du terrain')); |
610 |
|
$form->setFieldset('terrain_superficie','F',''); |
611 |
|
$form->setBloc('terrain_superficie','F'); |
612 |
} |
} |
613 |
|
|
614 |
function setRegroupe(&$form,$maj) { |
function setRegroupe(&$form,$maj) { |
623 |
//$form->setRegroupe('date_depot','G',''); |
//$form->setRegroupe('date_depot','G',''); |
624 |
//$form->setRegroupe('division','F',''); |
//$form->setRegroupe('division','F',''); |
625 |
|
|
626 |
// travaux |
|
|
$form->setRegroupe('architecte','D',_('Architecte')." / "._("Travaux"), $this->aff_travaux); |
|
|
$form->setRegroupe('architecte_nom','G',''); |
|
|
$form->setRegroupe('travaux','G',''); |
|
|
$form->setRegroupe('travaux_complement','F',''); |
|
|
|
|
|
//// instruction |
|
|
//$form->setRegroupe('date_complet','D',_('Instruction'), $this->aff_instruction); |
|
|
//$form->setRegroupe('date_rejet','G',''); |
|
|
//$form->setRegroupe('date_notification_delai','G',''); |
|
|
//$form->setRegroupe('delai','G',''); |
|
|
//$form->setRegroupe('date_limite','G','Decision '); |
|
|
//$form->setRegroupe('accord_tacite','G',''); |
|
|
//$form->setRegroupe('etat','G',''); |
|
|
//$form->setRegroupe('date_decision','G',''); |
|
|
//$form->setRegroupe('avis_decision','G',''); |
|
|
//$form->setRegroupe('date_validite','G',''); |
|
|
//$form->setRegroupe('types','G',''); |
|
|
//$form->setRegroupe('date_chantier','G',''); |
|
|
//$form->setRegroupe('date_achevement','G',''); |
|
|
//$form->setRegroupe('date_conformite','F',''); |
|
|
|
|
|
// demandeur |
|
|
$form->setRegroupe('demandeur_categorie','D',_('Demandeur'), $this->aff_demandeur); |
|
|
$form->setRegroupe('demandeur_civilite','G',''); |
|
|
$form->setRegroupe('demandeur_nom','G',''); |
|
|
$form->setRegroupe('demandeur_societe','G',''); |
|
|
$form->setRegroupe('demandeur_adresse','G','Decision '); |
|
|
$form->setRegroupe('demandeur_cp','G',''); |
|
|
$form->setRegroupe('demandeur_ville','G',''); |
|
|
$form->setRegroupe('demandeur_pays','G',''); |
|
|
$form->setRegroupe('demandeur_email','G',''); |
|
|
$form->setRegroupe('demandeur_telephone','F',''); |
|
|
|
|
|
|
|
|
// delegataire |
|
|
$form->setRegroupe('delegataire','D',_('delegataire'), $this->aff_delegataire); |
|
|
$form->setRegroupe('delegataire_civilite','G',''); |
|
|
$form->setRegroupe('delegataire_nom','G',''); |
|
|
$form->setRegroupe('delegataire_societe','G',''); |
|
|
$form->setRegroupe('delegataire_adresse','G','Decision '); |
|
|
$form->setRegroupe('delegataire_cp','G',''); |
|
|
$form->setRegroupe('delegataire_ville','G',''); |
|
|
$form->setRegroupe('delegataire_pays','G',''); |
|
|
$form->setRegroupe('delegataire_email','G',''); |
|
|
$form->setRegroupe('delegataire_telephone','F',''); |
|
|
|
|
|
// terrain |
|
|
$form->setRegroupe('terrain_numero','D',_('terrain'), $this->aff_terrain); |
|
|
$form->setRegroupe('terrain_numero_complement','G',''); |
|
|
$form->setRegroupe('rivoli','G',''); |
|
|
$form->setRegroupe('terrain_adresse','G',''); |
|
|
$form->setRegroupe('terrain_adresse_complement','G',''); |
|
|
$form->setRegroupe('terrain_cp','G',''); |
|
|
$form->setRegroupe('terrain_ville','G',''); |
|
|
$form->setRegroupe('terrain_surface','G',_('surface'),'');// $this->aff_surface); |
|
|
$form->setRegroupe('terrain_surface_calcul','F',''); |
|
|
|
|
|
// localisation |
|
|
$form->setRegroupe('parcelle','D',_('localisation'), $this->aff_localisation); |
|
|
$form->setRegroupe('pos','G',''); |
|
|
$form->setRegroupe('sig','F',''); |
|
|
if($maj==1){ |
|
|
$form->setRegroupe('sig','G',''); |
|
|
$form->setRegroupe('geom','F',''); |
|
|
} |
|
|
|
|
|
// description |
|
|
$form->setRegroupe('batiment_nombre','D',_('statistique'), $this->aff_description); |
|
|
$form->setRegroupe('logement_nombre','G',''); |
|
|
$form->setRegroupe('hauteur','G',''); |
|
|
$form->setRegroupe('piece_nombre','G',''); |
|
|
$form->setRegroupe('shon','G',''); |
|
|
$form->setRegroupe('shon_calcul','G',''); |
|
|
$form->setRegroupe('shob','G',''); |
|
|
$form->setRegroupe('lot','F',''); |
|
627 |
|
|
628 |
$form->setRegroupe('description','D',_('description').' '._('servitude'), $this->aff_amenagement); |
$form->setRegroupe('description','D',_('description').' '._('servitude'), $this->aff_amenagement); |
629 |
$form->setRegroupe('servitude','F',''); |
$form->setRegroupe('servitude','F',''); |
630 |
|
|
631 |
// amenagement |
|
|
$form->setRegroupe('amenagement','D',_('Amenagement'), $this->aff_amenagement); |
|
|
$form->setRegroupe('parcelle_lot','G',''); |
|
|
$form->setRegroupe('parcelle_lot_lotissement','F',''); |
|
632 |
} |
} |
633 |
|
|
|
|
|
|
|
|
634 |
/* ============================================================= |
/* ============================================================= |
635 |
* fonction trigger relative a la connexion SIG |
* fonction trigger relative a la connexion SIG |
636 |
* $sig = 1 dans dyn/var.inc |
* $sig = 1 dans dyn/var.inc |
651 |
|
|
652 |
} |
} |
653 |
|
|
654 |
// envoie d'une message au service REST d'ERP |
|
655 |
if ($this->valF['enjeu_erp'] === true) { |
if ($this->f->getParameter('option_erp') != "") { |
656 |
$msgenque = new MessageEnqueuer(); |
// envoi du message a ERP en cas d'un depot du dossier dat |
657 |
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
if ($this->getDATDCode($this->valF['dossier']) == |
658 |
$msgenque->enqueueMessage($msgenque::$ERP_DEPOT_DOSSIER_DAT); |
$this->f->getParameter('erp_depot_dossier_dat')) { |
659 |
} |
$msgenque = new MessageEnqueuer(); |
660 |
|
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
661 |
|
$msgenque->enqueueMessage($msgenque::$ERP_DEPOT_DOSSIER_DAT); |
662 |
|
} |
663 |
|
|
664 |
|
// envoi du message a ERP en cas d'une demande d'ouverture DAT |
665 |
|
if ($this->getDATDCode($this->valF['dossier']) == |
666 |
|
$this->f->getParameter('erp_demande_ouverture_dat')) { |
667 |
|
$msgenque = new MessageEnqueuer(); |
668 |
|
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
669 |
|
$msgenque->enqueueMessage($msgenque::$ERP_DEMANDE_OUVERTURE_DAT); |
670 |
|
} |
671 |
|
|
672 |
|
if ($this->valF['erp'] === true) { |
673 |
|
// envoi du message a ERP en cas d'annulation d'une demande |
674 |
|
if ($this->getDATDCode($this->valF['dossier']) == |
675 |
|
$this->f->getParameter('erp_annulation_demande')) { |
676 |
|
$msgenque = new MessageEnqueuer(); |
677 |
|
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
678 |
|
$msgenque->enqueueMessage($msgenque::$ERP_ANNULATION_DEMANDE); |
679 |
|
} |
680 |
|
|
681 |
|
// envoi du message a ERP en cas d'ouverture d'un dossier PC "rattache" |
682 |
|
// au dossier DAACT |
683 |
|
if ($this->getDATDCode($this->valF['dossier']) == |
684 |
|
$this->f->getParameter('erp_demande_ouverture_pc_daact')) { |
685 |
|
$msgenque = new MessageEnqueuer(); |
686 |
|
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
687 |
|
$msgenque->enqueueMessage($msgenque::$ERP_DEMANDE_OUVERTURE_PC); |
688 |
|
} |
689 |
|
} |
690 |
|
} // fin de if ($this->f->getParameter('option_erp') != "") |
691 |
|
|
692 |
|
// Mise à jour des données du dossier d'autorisation |
693 |
|
require_once "../obj/dossier_autorisation.class.php"; |
694 |
|
$da = new dossier_autorisation($this->valF["dossier_autorisation"], $this->db, DEBUG); |
695 |
|
$da->majDossierAutorisation(); |
696 |
} |
} |
697 |
|
|
698 |
/* |
/* |
722 |
$sql = "SELECT |
$sql = "SELECT |
723 |
quartier, arrondissement |
quartier, arrondissement |
724 |
FROM |
FROM |
725 |
quartier |
".DB_PREFIXE."quartier |
726 |
WHERE |
WHERE |
727 |
code_impots='$quartier'"; |
code_impots='$quartier'"; |
728 |
|
|
758 |
/* |
/* |
759 |
* Retourne l'intructeur correspondant le mieux à la parcelle |
* Retourne l'intructeur correspondant le mieux à la parcelle |
760 |
* */ |
* */ |
761 |
function getInstructeurDivision( $quartier, $arrondissement, $section, $nature) { |
function getInstructeurDivision( $quartier, $arrondissement, $section, $dossier_autorisation) { |
762 |
|
|
763 |
$quartier = ( $quartier == NULL ) ? -1 : $quartier; |
$quartier = ( $quartier == NULL ) ? -1 : $quartier; |
764 |
$arrondissement = ( $arrondissement == NULL ) ? -1 : $arrondissement; |
$arrondissement = ( $arrondissement == NULL ) ? -1 : $arrondissement; |
765 |
|
|
766 |
|
/*Récupération du dossier_autorisation_type_detaille concerné par le $dossier_autorisation*/ |
767 |
$sql = " |
$sql = " |
768 |
SELECT |
SELECT |
769 |
instructeur, section, quartier, arrondissement, nature |
dossier_autorisation_type_detaille |
770 |
FROM |
FROM |
771 |
lien_localisation_nature l |
".DB_PREFIXE."dossier_autorisation |
772 |
WHERE |
WHERE |
773 |
( nature IS NULL AND arrondissement IS NULL AND quartier IS NULL AND section IS NULL ) OR |
dossier_autorisation = '$dossier_autorisation'"; |
|
( nature IS NULL AND arrondissement IS NULL AND quartier IS NULL AND section = '$section' ) OR |
|
|
( nature IS NULL AND arrondissement IS NULL AND quartier = $quartier AND section IS NULL ) OR |
|
|
( nature IS NULL AND arrondissement IS NULL AND quartier = $quartier AND section = '$section' ) OR |
|
|
( nature IS NULL AND arrondissement = $arrondissement AND quartier IS NULL AND section IS NULL ) OR |
|
|
( nature IS NULL AND arrondissement = $arrondissement AND quartier IS NULL AND section = '$section' ) OR |
|
|
( nature IS NULL AND arrondissement = $arrondissement AND quartier = $quartier AND section IS NULL ) OR |
|
|
( nature IS NULL AND arrondissement = $arrondissement AND quartier = $quartier AND section = '$section' ) OR |
|
|
( nature = '$nature' AND arrondissement IS NULL AND quartier IS NULL AND section IS NULL ) OR |
|
|
( nature = '$nature' AND arrondissement IS NULL AND quartier IS NULL AND section = '$section' ) OR |
|
|
( nature = '$nature' AND arrondissement IS NULL AND quartier = $quartier AND section IS NULL ) OR |
|
|
( nature = '$nature' AND arrondissement IS NULL AND quartier = $quartier AND section = '$section' ) OR |
|
|
( nature = '$nature' AND arrondissement = $arrondissement AND quartier IS NULL AND section IS NULL ) OR |
|
|
( nature = '$nature' AND arrondissement = $arrondissement AND quartier IS NULL AND section = '$section' ) OR |
|
|
( nature = '$nature' AND arrondissement = $arrondissement AND quartier = $quartier AND section IS NULL ) OR |
|
|
( nature = '$nature' AND arrondissement = $arrondissement AND quartier = $quartier AND section = '$section' ) |
|
|
ORDER BY section, quartier, arrondissement, nature |
|
|
LIMIT 1 |
|
|
"; |
|
774 |
|
|
775 |
$this->addToLog("getInstructeurDivision( quartier, arrondissement, section, nature) : db->query(\"$sql\")", VERBOSE_MODE); |
$this->addToLog("getInstructeurDivision : db->query(\"$sql\")", VERBOSE_MODE); |
776 |
$res = $this->db->query($sql); |
$resDATD = $this->db->query($sql); |
777 |
if (database :: isError($res)) |
if (database :: isError($resDATD)) |
778 |
die($res->getMessage()."erreur ".$sql); |
die($resDATD->getMessage()."erreur ".$sql); |
779 |
|
|
780 |
if ( $res->numRows() > 0 ){ |
if ( $resDATD->numRows() > 0 ){ |
781 |
|
$rowDATD = $resDATD->fetchRow(DB_FETCHMODE_ASSOC); |
782 |
|
|
783 |
$row = $res->fetchRow(DB_FETCHMODE_ASSOC); |
$sql = " |
784 |
|
SELECT |
785 |
|
instructeur, section, quartier, arrondissement, dossier_autorisation_type_detaille |
786 |
|
FROM |
787 |
|
".DB_PREFIXE."affectation_automatique l |
788 |
|
WHERE |
789 |
|
( dossier_autorisation_type_detaille IS NULL AND arrondissement IS NULL AND quartier IS NULL AND section IS NULL ) OR |
790 |
|
( dossier_autorisation_type_detaille IS NULL AND arrondissement IS NULL AND quartier IS NULL AND section = '$section' ) OR |
791 |
|
( dossier_autorisation_type_detaille IS NULL AND arrondissement IS NULL AND quartier = $quartier AND section IS NULL ) OR |
792 |
|
( dossier_autorisation_type_detaille IS NULL AND arrondissement IS NULL AND quartier = $quartier AND section = '$section' ) OR |
793 |
|
( dossier_autorisation_type_detaille IS NULL AND arrondissement = $arrondissement AND quartier IS NULL AND section IS NULL ) OR |
794 |
|
( dossier_autorisation_type_detaille IS NULL AND arrondissement = $arrondissement AND quartier IS NULL AND section = '$section' ) OR |
795 |
|
( dossier_autorisation_type_detaille IS NULL AND arrondissement = $arrondissement AND quartier = $quartier AND section IS NULL ) OR |
796 |
|
( dossier_autorisation_type_detaille IS NULL AND arrondissement = $arrondissement AND quartier = $quartier AND section = '$section' ) OR |
797 |
|
( dossier_autorisation_type_detaille = ".$rowDATD['dossier_autorisation_type_detaille']." AND arrondissement IS NULL AND quartier IS NULL AND section IS NULL ) OR |
798 |
|
( dossier_autorisation_type_detaille = ".$rowDATD['dossier_autorisation_type_detaille']." AND arrondissement IS NULL AND quartier IS NULL AND section = '$section' ) OR |
799 |
|
( dossier_autorisation_type_detaille = ".$rowDATD['dossier_autorisation_type_detaille']." AND arrondissement IS NULL AND quartier = $quartier AND section IS NULL ) OR |
800 |
|
( dossier_autorisation_type_detaille = ".$rowDATD['dossier_autorisation_type_detaille']." AND arrondissement IS NULL AND quartier = $quartier AND section = '$section' ) OR |
801 |
|
( dossier_autorisation_type_detaille = ".$rowDATD['dossier_autorisation_type_detaille']." AND arrondissement = $arrondissement AND quartier IS NULL AND section IS NULL ) OR |
802 |
|
( dossier_autorisation_type_detaille = ".$rowDATD['dossier_autorisation_type_detaille']." AND arrondissement = $arrondissement AND quartier IS NULL AND section = '$section' ) OR |
803 |
|
( dossier_autorisation_type_detaille = ".$rowDATD['dossier_autorisation_type_detaille']." AND arrondissement = $arrondissement AND quartier = $quartier AND section IS NULL ) OR |
804 |
|
( dossier_autorisation_type_detaille = ".$rowDATD['dossier_autorisation_type_detaille']." AND arrondissement = $arrondissement AND quartier = $quartier AND section = '$section' ) |
805 |
|
ORDER BY section, quartier, arrondissement, dossier_autorisation_type_detaille |
806 |
|
LIMIT 1 |
807 |
|
"; |
808 |
|
|
809 |
$sql = "SELECT division FROM instructeur WHERE instructeur = ".$row['instructeur']; |
$this->addToLog("getInstructeurDivision : db->query(\"$sql\")", VERBOSE_MODE); |
810 |
$res = $this->db->query($sql); |
$res = $this->db->query($sql); |
811 |
if (database :: isError($res)) |
if (database :: isError($res)) |
812 |
die($res->getMessage()."erreur ".$sql); |
die($res->getMessage()."erreur ".$sql); |
813 |
|
|
814 |
if ( $res->numRows() > 0 ){ |
if ( $res->numRows() > 0 ){ |
815 |
|
|
816 |
$rowT=& $res->fetchRow(DB_FETCHMODE_ASSOC); |
$row = $res->fetchRow(DB_FETCHMODE_ASSOC); |
817 |
$row['division'] = $rowT['division']; |
|
818 |
|
$sql = "SELECT division FROM ".DB_PREFIXE."instructeur WHERE instructeur = ".$row['instructeur']; |
819 |
|
$res = $this->db->query($sql); |
820 |
|
if (database :: isError($res)) |
821 |
|
die($res->getMessage()."erreur ".$sql); |
822 |
|
|
823 |
|
if ( $res->numRows() > 0 ){ |
824 |
|
|
825 |
|
$rowT=& $res->fetchRow(DB_FETCHMODE_ASSOC); |
826 |
|
$row['division'] = $rowT['division']; |
827 |
|
} |
828 |
|
|
829 |
|
return $row; |
830 |
} |
} |
|
|
|
|
return $row; |
|
831 |
} |
} |
832 |
|
|
833 |
return NULL; |
return NULL; |
834 |
} |
} |
835 |
|
|
847 |
$quartier = NULL; |
$quartier = NULL; |
848 |
$arrondissement = NULL; |
$arrondissement = NULL; |
849 |
$section = NULL; |
$section = NULL; |
850 |
|
$instructeur = NULL; |
851 |
|
|
852 |
// Si la parcelle n'est pas vide alors on récupère la section, le |
// Si la parcelle n'est pas vide alors on récupère la section, le |
853 |
// quartier et l'arrondissement |
// quartier et l'arrondissement |
869 |
$section = $this->getSection($val['parcelle']); |
$section = $this->getSection($val['parcelle']); |
870 |
} |
} |
871 |
|
|
872 |
// Si aucun instructeur n'est saisi et que la nature n'est pas vide |
// Si aucun instructeur n'est saisi et que la dossier_autorisation_type_detaille n'est pas vide |
873 |
// alors on récupère l'instructeur et la division depuis l'affectation |
// alors on récupère l'instructeur et la division depuis l'affectation |
874 |
if ( ( empty($this->valF['instructeur']) || $this->valF['instructeur'] == '' ) && $val['nature'] != '' ) { |
if ( ( empty($this->valF['instructeur']) || $this->valF['instructeur'] == '' ) && $val['dossier_autorisation'] != '' ) { |
875 |
|
|
876 |
// |
// |
877 |
$instructeurDivision = $this->getInstructeurDivision($quartier, $arrondissement, $section, $val['nature']); |
$instructeurDivision = $this->getInstructeurDivision($quartier, $arrondissement, $section, $val['dossier_autorisation']); |
878 |
if ( $instructeurDivision != NULL ){ |
if ( $instructeurDivision != NULL ){ |
879 |
|
|
880 |
$instructeur = $instructeurDivision['instructeur']; |
$instructeur = $instructeurDivision['instructeur']; |
917 |
$this->addToMessage("<br>"._("Parcelle ou parcelle_lot non renseignee dans dossier")." ".$id." <br>"); |
$this->addToMessage("<br>"._("Parcelle ou parcelle_lot non renseignee dans dossier")." ".$id." <br>"); |
918 |
} |
} |
919 |
} |
} |
920 |
// si la qualification est changée, envoie une message au service ERP |
|
921 |
if ($this->val[array_search('a_qualifier', $this->champs)] != $this->valF['a_qualifier'] |
// verification si envoi vers ERP est active |
922 |
&& $this->valF['enjeu_erp'] === true) { |
if ($this->f->getParameter('option_erp') != "") { |
923 |
$msgenque = new MessageEnqueuer(); |
if ($this->val[array_search('a_qualifier', $this->champs)] == 't' |
924 |
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
&& $this->valF['a_qualifier'] === false) { |
925 |
//$msgenque->competence(xxx); // TODO |
|
926 |
//$msgenque->contrainte_plu(xxx); // TODO |
// envoi du message "ERP Qualifie" pour un dossier DAT qui a besoin |
927 |
$msgenque->enqueueMessage($msgenque::$ERP_DEPOT_DOSSIER_DAT); |
// de la qualification URBA |
928 |
|
if ($this->getDATDCode($this->valF['dossier']) == |
929 |
|
$this->f->getParameter('erp_nature_dat')) { |
930 |
|
$msgenque = new MessageEnqueuer(); |
931 |
|
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
932 |
|
$msgenque->setCompetence($this->valF['autorite_competente']); |
933 |
|
$msgenque->setContraintePlu($this->valF['servitude']); |
934 |
|
$msgenque->setReferenceCadastrale( |
935 |
|
$this->getReferenceCadastrale($this->valF['dossier'])); |
936 |
|
$msgenque->enqueueMessage($msgenque::$ERP_QUALIFIE); |
937 |
|
} |
938 |
|
|
939 |
|
// envoi des messages a ERP en cas du dossier PC traite par URBA, et |
940 |
|
// qui etait classifie come ERP |
941 |
|
if ($this->getDATDCode($this->valF['dossier']) == |
942 |
|
$this->f->getParameter('erp_dossier_nature_pc') |
943 |
|
&& $this->valF['erp'] == true) { |
944 |
|
$msgenque = new MessageEnqueuer(); |
945 |
|
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
946 |
|
$msgenque->enqueueMessage($msgenque::$ERP_DEMANDE_COMPLETUDE_PC); |
947 |
|
$msgenque->enqueueMessage($msgenque::$ERP_DEMANDE_QUALIFICATION_PC); |
948 |
|
} |
949 |
|
} |
950 |
|
} // fin de if($this->f->getParameter('option_erp')) |
951 |
|
|
952 |
|
// Ajout ou modification des demandeurs |
953 |
|
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
954 |
|
} |
955 |
|
|
956 |
|
/** |
957 |
|
* Ne servira surement pas mais dans le doute autant recalculer les données du DA |
958 |
|
*/ |
959 |
|
function triggersupprimerapres($id,&$db,$val,$DEBUG) { |
960 |
|
// Mise à jour des données du dossier d'autorisation |
961 |
|
require_once "../obj/dossier_autorisation.class.php"; |
962 |
|
$da = new dossier_autorisation($this->valF["dossier_autorisation"], $this->db, DEBUG); |
963 |
|
$da->majDossierAutorisation(); |
964 |
|
} |
965 |
|
|
966 |
|
/** |
967 |
|
* Retourne le type de dossier d'autorisation du dossier courant : |
968 |
|
* - dossier_autorisation_type_detaille.code |
969 |
|
**/ |
970 |
|
function getDATDCode($idxDossier) { |
971 |
|
$sql = "SELECT dossier_autorisation_type_detaille.code |
972 |
|
FROM ".DB_PREFIXE."dossier_autorisation_type_detaille |
973 |
|
INNER JOIN ".DB_PREFIXE."dossier_autorisation |
974 |
|
ON dossier_autorisation_type_detaille.dossier_autorisation_type_detaille = |
975 |
|
dossier_autorisation.dossier_autorisation_type_detaille |
976 |
|
INNER JOIN ".DB_PREFIXE."dossier ON dossier.dossier_autorisation = dossier_autorisation.dossier_autorisation |
977 |
|
WHERE dossier.dossier = '".$idxDossier."'"; |
978 |
|
$res = $this -> db -> getOne($sql); |
979 |
|
$this->f->addToLog("getDATDCode() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
980 |
|
if ( database::isError($res)){ |
981 |
|
die(); |
982 |
} |
} |
983 |
|
return $res; |
984 |
} |
} |
985 |
|
|
986 |
|
|
987 |
|
/** |
988 |
|
* Retourne la reference cadastrale de la demande attache a un dossier ERP |
989 |
|
* specifique |
990 |
|
* @param string $dossier L'identifiant du dossier |
991 |
|
* @return string|null La reference cadastrale si elle est trouve, |
992 |
|
* sinon NULL. En cas d'erreur de la BD, l'execution s'arrete. |
993 |
|
*/ |
994 |
|
function getReferenceCadastrale($dossier) { |
995 |
|
$sql = "SELECT terrain_references_cadastrales FROM ".DB_PREFIXE."demande WHERE dossier_instruction = '" . $dossier . "'"; |
996 |
|
$res = $this->db->limitquery($sql, 0, 1); |
997 |
|
$this->addToLog("getReferenceCadastrale(): db->limitquery(\"". |
998 |
|
str_replace(",",", ",$sql)."\", 0, 1);", VERBOSE_MODE); |
999 |
|
// Si une erreur survient on die |
1000 |
|
if (database::isError($res, true)) { |
1001 |
|
// Appel de la methode de recuperation des erreurs |
1002 |
|
$this->erreur_db($res->getDebugInfo(), $res->getMessage(), 'demande'); |
1003 |
|
} |
1004 |
|
// retourne la nature du dossier |
1005 |
|
while ($row =& $res->fetchRow()) { |
1006 |
|
return $row[0]; |
1007 |
|
} |
1008 |
|
// la nature n'etait pas trouve, ce qui ne devrait pas se passer |
1009 |
|
return NULL; |
1010 |
|
} |
1011 |
|
|
1012 |
|
|
1013 |
function sig_parametre(&$db){ |
function sig_parametre(&$db){ |
1014 |
if (file_exists ("../dyn/var.inc")) |
if (file_exists ("../dyn/var.inc")) |
1154 |
$this->servitude.=" [".$row['libelle']."] ".$row['observation']." a ".round($row['distance'],2)." m - "; |
$this->servitude.=" [".$row['libelle']."] ".$row['observation']." a ".round($row['distance'],2)." m - "; |
1155 |
} |
} |
1156 |
} |
} |
1157 |
|
|
1158 |
|
/** |
1159 |
|
* Gestion des liens entre la demande et les demandeurs recemment ajoutés |
1160 |
|
**/ |
1161 |
|
function insertLinkDemandeDemandeur($db, $DEBUG) { |
1162 |
|
// |
1163 |
|
require_once "../obj/lien_dossier_demandeur.class.php"; |
1164 |
|
// Sippression des anciens demandeurs |
1165 |
|
$this->deleteLinkDossierDemandeur($db, $DEBUG); |
1166 |
|
|
1167 |
|
// Ajout du pétitionnaire principal |
1168 |
|
if(!empty($this->postedIdDemandeur['petitionnaire_principal'])) { |
1169 |
|
$this->addLinkDossierDemandeur($this->postedIdDemandeur['petitionnaire_principal'], true, $db, $DEBUG); |
1170 |
|
} |
1171 |
|
|
1172 |
|
// Ajout du délégataire |
1173 |
|
if(!empty($this->postedIdDemandeur['delegataire'])) { |
1174 |
|
$this->addLinkDossierDemandeur($this->postedIdDemandeur['delegataire'], false, $db, $DEBUG); |
1175 |
|
} |
1176 |
|
|
1177 |
|
// Ajout des pétitionnaires |
1178 |
|
if(isset($this->postedIdDemandeur['petitionnaire'])) { |
1179 |
|
// Ajout des nouveaux liens |
1180 |
|
foreach ($this->postedIdDemandeur['petitionnaire'] as $petitionnaire) { |
1181 |
|
$this->addLinkDossierDemandeur($petitionnaire, false, $db, $DEBUG); |
1182 |
|
} |
1183 |
|
} |
1184 |
|
} |
1185 |
|
|
1186 |
|
|
1187 |
|
/** |
1188 |
|
* Fonction permettant d'ajouter un lien |
1189 |
|
* entre la table demande et demandeur |
1190 |
|
**/ |
1191 |
|
function addLinkDossierDemandeur($id, $principal, $db, $DEBUG) { |
1192 |
|
$lienAjout = new lien_dossier_demandeur( |
1193 |
|
"]", |
1194 |
|
$db, |
1195 |
|
$DEBUG); |
1196 |
|
$lien = array('lien_dossier_demandeur' => "", |
1197 |
|
'petitionnaire_principal' => (($principal)?"t":"f"), |
1198 |
|
'dossier' => $this->valF['dossier'], |
1199 |
|
'demandeur' => $id); |
1200 |
|
$lienAjout->ajouter($lien, $db, $DEBUG); |
1201 |
|
$lienAjout->__destruct(); |
1202 |
|
} |
1203 |
|
|
1204 |
|
/** |
1205 |
|
* Fonction permettant de supprimer un lien |
1206 |
|
* entre la table demande et demandeur |
1207 |
|
**/ |
1208 |
|
function deleteLinkDossierDemandeur($db, $DEBUG) { |
1209 |
|
// Suppression |
1210 |
|
$sql = "DELETE FROM ".DB_PREFIXE."lien_dossier_demandeur ". |
1211 |
|
"WHERE dossier='".$this->valF['dossier']."'"; |
1212 |
|
// Execution de la requete de suppression de l'objet |
1213 |
|
$res = $db->query($sql); |
1214 |
|
// Logger |
1215 |
|
$this->f->addToLog("supprimer(): db->query(\"".$sql."\");", VERBOSE_MODE); |
1216 |
|
if ( database::isError($res)){ |
1217 |
|
die(); |
1218 |
|
} |
1219 |
|
|
1220 |
|
} |
1221 |
|
|
1222 |
|
/** |
1223 |
|
* Methode de recupération des valeurs postées |
1224 |
|
**/ |
1225 |
|
function getPostedValues() { |
1226 |
|
// Récupération des demandeurs dans POST |
1227 |
|
if (isset($_POST['petitionnaire_principal']) OR |
1228 |
|
isset($_POST['delegataire']) OR |
1229 |
|
isset($_POST['petitionnaire'])) { |
1230 |
|
if( isset($_POST['petitionnaire_principal']) AND |
1231 |
|
!empty($_POST['petitionnaire_principal'])) { |
1232 |
|
$this->postedIdDemandeur['petitionnaire_principal'] = $_POST['petitionnaire_principal']; |
1233 |
|
} |
1234 |
|
if( isset($_POST['delegataire']) AND |
1235 |
|
!empty($_POST['delegataire'])) { |
1236 |
|
$this->postedIdDemandeur['delegataire'] = $_POST['delegataire']; |
1237 |
|
} |
1238 |
|
if( isset($_POST['petitionnaire']) AND |
1239 |
|
!empty($_POST['petitionnaire'])) { |
1240 |
|
$this->postedIdDemandeur['petitionnaire'] = $_POST['petitionnaire']; |
1241 |
|
} |
1242 |
|
} |
1243 |
|
} |
1244 |
|
|
1245 |
|
/** |
1246 |
|
* Méthode permettant de récupérer les id des demandeurs liés à la table |
1247 |
|
* liée passée en paramètre |
1248 |
|
* |
1249 |
|
* @param string $from Table liée : "demande", "dossier", dossier_autorisation" |
1250 |
|
* @param string $id Identifiant (clé primaire de la table liée en question) |
1251 |
|
*/ |
1252 |
|
function listeDemandeur($from, $id) { |
1253 |
|
// Récupération des demandeurs de la base |
1254 |
|
$sql = "SELECT demandeur.demandeur, |
1255 |
|
demandeur.type_demandeur, |
1256 |
|
lien_".$from."_demandeur.petitionnaire_principal |
1257 |
|
FROM ".DB_PREFIXE."lien_".$from."_demandeur |
1258 |
|
INNER JOIN ".DB_PREFIXE."demandeur |
1259 |
|
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
1260 |
|
WHERE ".$from." = '".$id."'"; |
1261 |
|
$res = $this->f->db->query($sql); |
1262 |
|
$this->f->addToLog("listeDemandeur(): db->query(\"".$sql."\")", VERBOSE_MODE); |
1263 |
|
if ( database::isError($res)){ |
1264 |
|
die(); |
1265 |
|
} |
1266 |
|
// Stockage du résultat dans un tableau |
1267 |
|
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
1268 |
|
if ($row['petitionnaire_principal'] == 't' AND |
1269 |
|
$row['type_demandeur']=="petitionnaire") { |
1270 |
|
$this->valIdDemandeur['petitionnaire_principal']=$row['demandeur']; |
1271 |
|
} elseif ($row['petitionnaire_principal'] == 'f' AND |
1272 |
|
$row['type_demandeur']=="petitionnaire"){ |
1273 |
|
$this->valIdDemandeur['petitionnaire'][]=$row['demandeur']; |
1274 |
|
} elseif ($row['type_demandeur']=="delegataire"){ |
1275 |
|
$this->valIdDemandeur['delegataire']=$row['demandeur']; |
1276 |
|
} |
1277 |
|
} |
1278 |
|
} |
1279 |
|
|
1280 |
|
/** |
1281 |
|
* Ajout de la liste des demandeurs |
1282 |
|
*/ |
1283 |
|
function formSpecificContent($maj) { |
1284 |
|
|
1285 |
|
$this->listeDemandeur("dossier", $this->getVal('dossier')); |
1286 |
|
|
1287 |
|
if($maj < 2 AND !$this->correct) { |
1288 |
|
$linkable = true; |
1289 |
|
} else { |
1290 |
|
$linkable = false; |
1291 |
|
} |
1292 |
|
|
1293 |
|
// Conteneur de la listes des demandeurs |
1294 |
|
echo "<div id=\"liste_demandeur\" class=\"demande_hidden_bloc col_12\">"; |
1295 |
|
echo "<fieldset class=\"cadre ui-corner-all ui-widget-content\">"; |
1296 |
|
echo " <legend class=\"ui-corner-all ui-widget-content ui-state-active\">" |
1297 |
|
._("Petitionnaire")."</legend>"; |
1298 |
|
// Si des demandeurs sont liés à la demande |
1299 |
|
require_once "../obj/petitionnaire.class.php"; |
1300 |
|
require_once "../obj/delegataire.class.php"; |
1301 |
|
// Affichage du bloc pétitionnaire principal / délégataire |
1302 |
|
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
1303 |
|
echo "<div id=\"petitionnaire_principal_delegataire col_12\">"; |
1304 |
|
// Affichage de la synthèse |
1305 |
|
if (isset ($this->valIdDemandeur["petitionnaire_principal"]) AND |
1306 |
|
!empty($this->valIdDemandeur["petitionnaire_principal"])) { |
1307 |
|
$demandeur = new petitionnaire( |
1308 |
|
$this->valIdDemandeur["petitionnaire_principal"], |
1309 |
|
$this->f->db,false); |
1310 |
|
$demandeur -> afficherSynthese("petitionnaire_principal", $linkable); |
1311 |
|
$demandeur -> __destruct(); |
1312 |
|
} elseif ( isset ($this->postedIdDemandeur["petitionnaire_principal"]) AND |
1313 |
|
!empty($this->postedIdDemandeur["petitionnaire_principal"]) ) { |
1314 |
|
$demandeur = new petitionnaire( |
1315 |
|
$this->postedIdDemandeur["petitionnaire_principal"], |
1316 |
|
$this->f->db,false); |
1317 |
|
$demandeur -> afficherSynthese("petitionnaire_principal", $linkable); |
1318 |
|
$demandeur -> __destruct(); |
1319 |
|
} |
1320 |
|
// Si en édition de formulaire |
1321 |
|
if($maj < 2 AND $linkable) { |
1322 |
|
// Bouton d'ajout du pétitionnaire principal |
1323 |
|
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
1324 |
|
echo "<span id=\"add_petitionnaire_principal\" |
1325 |
|
class=\"om-form-button add-16\">". |
1326 |
|
_("Saisir le petitionnaire principal"). |
1327 |
|
"</span>"; |
1328 |
|
} |
1329 |
|
// Bouton d'ajout du delegataire |
1330 |
|
// L'ID DU DIV ET DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
1331 |
|
echo "<div id=\"delegataire\">"; |
1332 |
|
// Affichage de la synthèse |
1333 |
|
if (isset ($this->valIdDemandeur["delegataire"]) AND |
1334 |
|
!empty($this->valIdDemandeur["delegataire"])) { |
1335 |
|
$demandeur = new delegataire($this->valIdDemandeur["delegataire"], |
1336 |
|
$this->f->db,false); |
1337 |
|
$demandeur -> afficherSynthese("delegataire", $linkable); |
1338 |
|
$demandeur -> __destruct(); |
1339 |
|
} elseif ( isset ($this->postedIdDemandeur["delegataire"]) AND |
1340 |
|
!empty($this->postedIdDemandeur["delegataire"]) ) { |
1341 |
|
|
1342 |
|
$demandeur = new delegataire($this->postedIdDemandeur["delegataire"], |
1343 |
|
$this->f->db,false); |
1344 |
|
$demandeur -> afficherSynthese("delegataire", $linkable); |
1345 |
|
$demandeur -> __destruct(); |
1346 |
|
} |
1347 |
|
if($maj < 2 AND $linkable) { |
1348 |
|
echo "<span id=\"add_delegataire\" |
1349 |
|
class=\"om-form-button add-16\">". |
1350 |
|
_("Saisir le delegataire"). |
1351 |
|
"</span>"; |
1352 |
|
} |
1353 |
|
echo "</div>"; |
1354 |
|
echo "<div class=\"both\"></div>"; |
1355 |
|
echo "</div>"; |
1356 |
|
// Bloc des pétitionnaires secondaires |
1357 |
|
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
1358 |
|
echo "<div id=\"listePetitionnaires col_12\">"; |
1359 |
|
|
1360 |
|
// Affichage de la synthèse |
1361 |
|
if (isset ($this->valIdDemandeur["petitionnaire"]) AND |
1362 |
|
!empty($this->valIdDemandeur["petitionnaire"])) { |
1363 |
|
|
1364 |
|
foreach ($this->valIdDemandeur["petitionnaire"] as $petitionnaire) { |
1365 |
|
$demandeur = new petitionnaire($petitionnaire, |
1366 |
|
$this->f->db,false); |
1367 |
|
$demandeur -> afficherSynthese("petitionnaire", $linkable); |
1368 |
|
$demandeur -> __destruct(); |
1369 |
|
} |
1370 |
|
|
1371 |
|
} elseif ( isset ($this->postedIdDemandeur["petitionnaire"]) AND |
1372 |
|
!empty($this->postedIdDemandeur["petitionnaire"]) ) { |
1373 |
|
foreach ($this->postedIdDemandeur["petitionnaire"] as $petitionnaire) { |
1374 |
|
$demandeur = new petitionnaire($petitionnaire, |
1375 |
|
$this->f->db,false); |
1376 |
|
$demandeur -> afficherSynthese("petitionnaire", $linkable); |
1377 |
|
$demandeur -> __destruct(); |
1378 |
|
} |
1379 |
|
} |
1380 |
|
if ($maj < 2 AND $linkable) { |
1381 |
|
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
1382 |
|
echo "<span id=\"add_petitionnaire\" |
1383 |
|
class=\"om-form-button add-16\">". |
1384 |
|
_("Ajouter un petitionnaire") |
1385 |
|
."</span>"; |
1386 |
|
} |
1387 |
|
echo "</div>"; |
1388 |
|
echo "</fieldset>"; |
1389 |
|
echo "</div>"; |
1390 |
|
} |
1391 |
}// fin classe |
}// fin classe |
1392 |
?> |
?> |