1 |
fraynaud |
3 |
<?php |
2 |
|
|
//$Id$ |
3 |
|
|
//gen openMairie le 10/02/2011 20:39 |
4 |
|
|
require_once ("../gen/obj/dossier.class.php"); |
5 |
fraynaud |
12 |
//require_once ("../sig/strategyDynmap.class.php"); //specific |
6 |
fraynaud |
3 |
|
7 |
|
|
class dossier extends dossier_gen { |
8 |
|
|
|
9 |
fraynaud |
20 |
var $maj; |
10 |
fraynaud |
3 |
|
11 |
fraynaud |
11 |
function setvalF($val){ |
12 |
|
|
parent::setvalF($val); |
13 |
fraynaud |
20 |
|
14 |
|
|
// cles secondaires numerique (contrainte integrite pgsql) |
15 |
|
|
if(!is_numeric($val['instructeur'])) $this->valF['instructeur']= null; |
16 |
|
|
if(!is_numeric($val['architecte'])) $this->valF['architecte']= null; |
17 |
|
|
if(!is_numeric($val['travaux'])) $this->valF['travaux']= null; |
18 |
|
|
if(!is_numeric($val['demandeur_categorie'])) $this->valF['demandeur_categorie']= null; |
19 |
|
|
|
20 |
fraynaud |
44 |
// cle secondaire alpha vide (contrainte integrite pgsql) |
21 |
fraynaud |
20 |
if($val['demandeur_civilite']=='') $this->valF['demandeur_civilite']= null; |
22 |
|
|
if($val['delegataire_civilite']=='') $this->valF['delegataire_civilite']= null; |
23 |
|
|
|
24 |
fraynaud |
44 |
// zone numerique non valorisée a 0 |
25 |
fraynaud |
20 |
if(!is_numeric($val['delai'])) unset ($this->valF['delai']); |
26 |
|
|
if(!is_numeric($val['terrain_surface'])) unset ($this->valF['terrain_surface']); |
27 |
|
|
if(!is_numeric($val['batiment_nombre'])) unset ($this->valF['batiment_nombre']); |
28 |
|
|
if(!is_numeric($val['logement_nombre'])) unset ($this->valF['logement_nombre']); |
29 |
|
|
if(!is_numeric($val['shon'])) unset ($this->valF['shon']); |
30 |
|
|
if(!is_numeric($val['shob'])) unset ($this->valF['shob']); |
31 |
|
|
if(!is_numeric($val['lot'])) unset ($this->valF['lot']); |
32 |
|
|
if(!is_numeric($val['hauteur'])) unset ($this->valF['hauteur']); |
33 |
|
|
if(!is_numeric($val['piece_nombre'])) unset ($this->valF['piece_nombre']); |
34 |
fraynaud |
11 |
|
35 |
|
|
|
36 |
fraynaud |
44 |
// enlever les valeurs a ne pas saisir -> recherche en trigger ajouter et modifier |
37 |
|
|
// $sig = 1 |
38 |
fraynaud |
20 |
unset ($this->valF['geom']); |
39 |
|
|
|
40 |
|
|
// valeurs hiddenstatic (calcule) |
41 |
|
|
if($this->maj==1){ |
42 |
|
|
// par defaut |
43 |
|
|
unset ($this->valF['etat']); |
44 |
|
|
unset ($this->valF['delai']); |
45 |
|
|
unset ($this->valF['accord_tacite']); |
46 |
|
|
unset ($this->valF['types']); |
47 |
|
|
} |
48 |
|
|
unset ($this->valF['avis']); // avis + libelle avis |
49 |
|
|
unset ($this->valF['terrain_surface_calcul']); |
50 |
|
|
unset ($this->valF['shon_calcul']); |
51 |
|
|
unset ($this->valF['parcelle_archive']); |
52 |
|
|
unset ($this->valF['date_notification_delai']); |
53 |
|
|
unset ($this->valF['date_decision']); |
54 |
|
|
unset ($this->valF['date_limite']); |
55 |
|
|
unset ($this->valF['date_validite']); |
56 |
|
|
unset ($this->valF['date_chantier']); |
57 |
|
|
unset ($this->valF['date_achevement']); |
58 |
|
|
unset ($this->valF['date_conformite']); |
59 |
fraynaud |
11 |
} |
60 |
|
|
|
61 |
fraynaud |
20 |
// specifique |
62 |
fraynaud |
11 |
function setId($db){ |
63 |
|
|
// id automatique nextid |
64 |
|
|
// departement 13 |
65 |
|
|
// ville 004 |
66 |
|
|
// nature 2 caracteres |
67 |
|
|
// lettre R arles F vitrolles |
68 |
|
|
// numero sur 6 caracteres |
69 |
fraynaud |
44 |
if (file_exists ("../dyn/var.inc")) |
70 |
|
|
include ("../dyn/var.inc"); |
71 |
fraynaud |
11 |
if($numero_unique==1){ |
72 |
fraynaud |
44 |
// numero unique (voir dyn/var.inc) |
73 |
fraynaud |
11 |
$temp=$db->nextId($this->table); |
74 |
|
|
}else{ |
75 |
|
|
// numero suivant nature |
76 |
|
|
$temp=$db->nextId("dossier_".$this->nature); |
77 |
|
|
} |
78 |
|
|
$temp=str_pad($temp,4,"0", STR_PAD_LEFT); |
79 |
|
|
$this->valF['dossier'] = $this->valF['nature'].$this->valF['annee']. |
80 |
|
|
$lettre.$temp; |
81 |
|
|
} |
82 |
|
|
|
83 |
fraynaud |
20 |
// fonction a surcharger car utilisation d un nextID alpha |
84 |
fraynaud |
11 |
function verifierAjout(){ |
85 |
|
|
} |
86 |
|
|
|
87 |
|
|
function verifier($val,&$db,$DEBUG){ |
88 |
|
|
$this->correct=True; |
89 |
|
|
// obligatoire |
90 |
|
|
if($val['date_depot']!=""){ |
91 |
|
|
$this->valF['date_depot'] = $this->dateDB($val['date_depot']); |
92 |
|
|
}else{ |
93 |
|
|
$this->correct=false; |
94 |
|
|
$this->msg= $this->msg."<br>date_depot obligatoire"; |
95 |
|
|
} |
96 |
|
|
if($val['parcelle']!="" and $val['sig']!='Oui'){ |
97 |
|
|
if (!preg_match('/^[A-Z]{2}[0-9]{4}$/', $val['parcelle'])){ |
98 |
|
|
$this->correct=false; |
99 |
|
|
$this->msg= $this->msg."<br>format parcelle AANNNN"; |
100 |
|
|
} |
101 |
|
|
} |
102 |
|
|
// regles travaux verification |
103 |
|
|
if ($this->valF['travaux']!=""){ |
104 |
|
|
$sql= "select * from regle where id = '".$this->valF['travaux']. |
105 |
|
|
"' and controle = 'travaux' order by ordre"; |
106 |
|
|
$res = $db->query($sql); |
107 |
|
|
if (DB :: isError($res)) |
108 |
|
|
die($res->getMessage().$sql); |
109 |
|
|
else{ |
110 |
|
|
if ($DEBUG == 1) |
111 |
|
|
echo " la requete ".$sql." est executee<br>"; |
112 |
|
|
$regle=0; |
113 |
|
|
$msg=""; |
114 |
|
|
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
115 |
|
|
switch ($row['operateur']) { |
116 |
|
|
case ">" : |
117 |
|
|
if($row['sens']=="plus"){ |
118 |
|
|
if($this->valF[$row['champ']] > $row['valeur']) |
119 |
|
|
$condition = 1; |
120 |
|
|
else |
121 |
|
|
$condition = 0; |
122 |
|
|
if($regle==1 or $condition == 1) |
123 |
|
|
$regle=1; |
124 |
|
|
else |
125 |
|
|
$regle=0; |
126 |
|
|
$msg=$msg."<br> + ".$row['message']." [".$row['champ']." = ". |
127 |
|
|
$this->valF[$row['champ']]."]"; |
128 |
|
|
}else{ |
129 |
|
|
if($this->valF[$row['champ']] > $row['valeur']){ |
130 |
|
|
$condition = 0; |
131 |
|
|
}else{ |
132 |
|
|
$condition = 1; |
133 |
|
|
$regle=0; |
134 |
|
|
} |
135 |
|
|
$msg=$msg."<br> ou ".$row['message']." [".$row['champ']." = ". |
136 |
|
|
$this->valF[$row['champ']]."]"; |
137 |
|
|
} |
138 |
|
|
break; |
139 |
|
|
case ">=": |
140 |
|
|
if($row['sens']=="plus"){ |
141 |
|
|
if($this->valF[$row['champ']] >= $row['valeur']) |
142 |
|
|
$condition = 1; |
143 |
|
|
else |
144 |
|
|
$condition = 0; |
145 |
|
|
if($regle==1 or $condition == 1) |
146 |
|
|
$regle=1; |
147 |
|
|
else |
148 |
|
|
$regle=0; |
149 |
|
|
$msg=$msg."<br> + ".$row['message']." [".$row['champ']." = ". |
150 |
|
|
$this->valF[$row['champ']]."]"; |
151 |
|
|
}else{ |
152 |
|
|
if($this->valF[$row['champ']] >= $row['valeur']){ |
153 |
|
|
$condition = 0; |
154 |
|
|
|
155 |
|
|
}else{ |
156 |
|
|
$condition = 1; |
157 |
|
|
$regle=0; |
158 |
|
|
} |
159 |
|
|
$msg=$msg."<br> ou ".$row['message']." [".$row['champ']." = ". |
160 |
|
|
$this->valF[$row['champ']]."]"; |
161 |
|
|
} |
162 |
|
|
break; |
163 |
|
|
case "<" : |
164 |
|
|
if($row['sens']=="plus"){ |
165 |
|
|
if($this->valF[$row['champ']] < $row['valeur']) |
166 |
|
|
$condition = 1; |
167 |
|
|
else |
168 |
|
|
$condition = 0; |
169 |
|
|
if($regle==1 or $condition == 1) |
170 |
|
|
$regle=1; |
171 |
|
|
else |
172 |
|
|
$regle=0; |
173 |
|
|
$msg=$msg."<br> + ".$row['message']." [".$row['champ']." = ". |
174 |
|
|
$this->valF[$row['champ']]."]"; |
175 |
|
|
}else{ |
176 |
|
|
if($this->valF[$row['champ']] < $row['valeur']){ |
177 |
|
|
$condition = 0; |
178 |
|
|
}else{ |
179 |
|
|
$condition = 1; |
180 |
|
|
$regle=0; |
181 |
|
|
} |
182 |
|
|
$msg=$msg."<br> et ".$row['message']." [".$row['champ']." = ". |
183 |
|
|
$this->valF[$row['champ']]."]"; |
184 |
|
|
} |
185 |
|
|
break; |
186 |
|
|
case "==": |
187 |
|
|
if($row['sens']=="plus"){ |
188 |
|
|
if($this->valF[$row['champ']] == $row['valeur']) |
189 |
|
|
$condition = 1; |
190 |
|
|
else |
191 |
|
|
$condition = 0; |
192 |
|
|
if($regle==1 or $condition == 1) |
193 |
|
|
$regle=1; |
194 |
|
|
else |
195 |
|
|
$regle=0; |
196 |
|
|
$msg=$msg."<br> + ".$row['message']." [".$row['champ']." = ". |
197 |
|
|
$this->valF[$row['champ']]."]"; |
198 |
|
|
}else{ |
199 |
|
|
if($this->valF[$row['champ']] == $row['valeur']){ |
200 |
|
|
$condition = 0; |
201 |
|
|
|
202 |
|
|
}else{ |
203 |
|
|
$condition = 1; |
204 |
|
|
$regle=0; |
205 |
|
|
} |
206 |
|
|
$msg=$msg."<br> ou ".$row['message']." [".$row['champ']." = ". |
207 |
|
|
$this->valF[$row['champ']]."]"; |
208 |
|
|
} |
209 |
|
|
break; |
210 |
|
|
break; |
211 |
|
|
} // switch |
212 |
|
|
} |
213 |
|
|
if($regle==0) |
214 |
|
|
$this->msg= $this->msg.$msg." <br><br>"; |
215 |
|
|
} |
216 |
|
|
} |
217 |
|
|
}//verifier |
218 |
|
|
|
219 |
|
|
|
220 |
|
|
function setType(&$form,$maj) { |
221 |
fraynaud |
20 |
//parent::setType($form,$maj); |
222 |
fraynaud |
11 |
if ($maj < 2) { //ajouter et modifier |
223 |
fraynaud |
20 |
// cache |
224 |
|
|
if($maj==0) $form->setType('dossier', 'hidden'); |
225 |
fraynaud |
11 |
$form->setType('annee', 'hidden'); |
226 |
|
|
$form->setType('nature', 'hidden'); |
227 |
fraynaud |
20 |
$form->setType('parcelle_archive','hidden'); |
228 |
|
|
$form->setType('objet_dossier','hidden'); // PC |
229 |
|
|
$form->setType('amenagement','hidden'); // PC |
230 |
|
|
|
231 |
fraynaud |
44 |
// a voir a quoi cela peut servir |
232 |
|
|
$form->setType('sig','hidden'); // PC |
233 |
|
|
$form->setType('siglien','hidden'); // PC |
234 |
fraynaud |
20 |
|
235 |
|
|
// date |
236 |
|
|
$form->setType('date_depot','date'); |
237 |
|
|
$form->setType('date_demande','date'); |
238 |
|
|
|
239 |
fraynaud |
11 |
//select |
240 |
|
|
$form->setType('travaux','select'); |
241 |
|
|
$form->setType('instructeur','select'); |
242 |
|
|
$form->setType('terrain_numero_complement','select'); |
243 |
fraynaud |
20 |
$form->setType('delegataire_civilite','select'); |
244 |
|
|
$form->setType('demandeur_civilite','select'); |
245 |
|
|
$form->setType('demandeur_categorie','select'); |
246 |
fraynaud |
11 |
|
247 |
|
|
// combo |
248 |
|
|
$form->setType('rivoli','comboD'); |
249 |
|
|
$form->setType('terrain_adresse','comboG'); |
250 |
fraynaud |
20 |
//$form->setType('architecte','comboD'); |
251 |
|
|
//$form->setType('architecte','textdisabled'); // ne valorise pas |
252 |
fraynaud |
11 |
$form->setType('architecte_nom','comboG'); |
253 |
|
|
|
254 |
|
|
// hiddenstatic |
255 |
fraynaud |
20 |
if($maj==1) $form->setType('dossier', 'hiddenstatic'); |
256 |
|
|
$form->setType('etat','hiddenstatic'); |
257 |
|
|
$form->setType('avis','hiddenstatic'); |
258 |
fraynaud |
11 |
$form->setType('delai','hiddenstatic'); |
259 |
|
|
$form->setType('terrain_surface_calcul','hiddenstatic'); |
260 |
fraynaud |
20 |
$form->setType('shon_calcul','hiddenstatic'); |
261 |
fraynaud |
11 |
|
262 |
fraynaud |
20 |
$form->setType('accord_tacite','hiddenstatic'); |
263 |
|
|
$form->setType('types', 'hiddenstatic'); // transfert modificatif |
264 |
fraynaud |
11 |
|
265 |
fraynaud |
20 |
|
266 |
|
|
// hiddenstaticdate |
267 |
|
|
$form->setType('date_notification_delai','hiddenstaticdate'); |
268 |
|
|
$form->setType('date_decision','hiddenstaticdate'); |
269 |
|
|
$form->setType('date_limite','hiddenstaticdate'); |
270 |
|
|
$form->setType('date_rejet','hiddenstaticdate'); |
271 |
|
|
$form->setType('date_complet','hiddenstaticdate'); |
272 |
|
|
$form->setType('date_limite','hiddenstaticdate'); |
273 |
|
|
$form->setType('date_validite','hiddenstaticdate'); |
274 |
|
|
$form->setType('date_chantier','hiddenstaticdate'); |
275 |
|
|
$form->setType('date_achevement','hiddenstaticdate'); |
276 |
|
|
$form->setType('date_conformite','hiddenstaticdate'); |
277 |
|
|
|
278 |
|
|
// checkbox |
279 |
fraynaud |
44 |
//$form->setType('sig','checkbox'); |
280 |
fraynaud |
20 |
$form->setType('delegataire','checkbox'); |
281 |
|
|
|
282 |
|
|
// http |
283 |
fraynaud |
44 |
//$form->setType('siglien','http'); |
284 |
fraynaud |
11 |
$form->setType('saisie_architecte', 'httpclick'); |
285 |
fraynaud |
20 |
|
286 |
|
|
// mail |
287 |
|
|
$form->setType('delegataire_email','mail'); |
288 |
|
|
$form->setType('demandeur_email','mail'); |
289 |
|
|
|
290 |
fraynaud |
11 |
// zones temp et strategysig |
291 |
|
|
include ("../dyn/var.inc"); |
292 |
|
|
if(!isset($sauvegardeDossier)) $sauvegardeDossier=''; |
293 |
|
|
if($sauvegardeDossier != '') // strategie sig |
294 |
|
|
$form->setType('pos','hiddenstatic'); |
295 |
|
|
else |
296 |
|
|
$form->setType('pos','select'); |
297 |
|
|
// temp |
298 |
|
|
$form->setType('temp1',$temp1_type); |
299 |
|
|
$form->setType('temp2',$temp2_type); |
300 |
|
|
$form->setType('temp3',$temp3_type); |
301 |
|
|
$form->setType('temp4',$temp4_type); |
302 |
|
|
$form->setType('temp5',$temp5_type); |
303 |
|
|
}else{ // supprimer |
304 |
|
|
$form->setType('dossier', 'hiddenstatic'); |
305 |
|
|
$form->setType('sig', 'hiddenstatic'); |
306 |
|
|
} |
307 |
|
|
} |
308 |
|
|
|
309 |
fraynaud |
20 |
|
310 |
fraynaud |
11 |
function setMax(&$form,$maj){ |
311 |
|
|
$form->setMax('architecte_nom', 30); |
312 |
fraynaud |
20 |
|
313 |
fraynaud |
11 |
$form->setMax('demandeur_nom', 80); |
314 |
|
|
$form->setMax('demandeur_societe', 80); |
315 |
|
|
$form->setMax('demandeur_adresse', 40); |
316 |
|
|
$form->setMax('demandeur_cp', 5); |
317 |
|
|
$form->setMax('demandeur_ville', 30); |
318 |
|
|
$form->setMax('demandeur_pays', 40); |
319 |
|
|
$form->setMax('demandeur_telephone', 14); |
320 |
|
|
$form->setMax('demandeur_email', 40); |
321 |
|
|
|
322 |
|
|
$form->setMax('delegataire_societe', 80); |
323 |
|
|
$form->setMax('delegataire_nom', 80); |
324 |
|
|
$form->setMax('delegataire_adresse', 80); |
325 |
|
|
$form->setMax('delegataire_pays', 40); |
326 |
|
|
$form->setMax('delegataire_cp', 5); |
327 |
|
|
$form->setMax('delegataire_ville', 30); |
328 |
|
|
$form->setMax('delegataire_telephone', 14); |
329 |
|
|
$form->setMax('delegataire_email', 40); |
330 |
|
|
|
331 |
|
|
$form->setMax('terrain_adresse', 80); |
332 |
|
|
$form->setMax('terrain_numero', 4); |
333 |
|
|
$form->setMax('terrain_adresse_complement', 80); |
334 |
|
|
$form->setMax('rivoli', 4); |
335 |
fraynaud |
20 |
$form->setMax('terrain_cp', 5); |
336 |
|
|
$form->setMax('terrain_ville', 30); |
337 |
|
|
|
338 |
fraynaud |
11 |
$form->setMax('parcelle', 20); |
339 |
|
|
|
340 |
|
|
$form->setMax('temp1', 100); |
341 |
|
|
$form->setMax('temp2', 100); |
342 |
|
|
$form->setMax('temp3', 100); |
343 |
|
|
$form->setMax('temp4', 100); |
344 |
|
|
$form->setMax('temp5', 100); |
345 |
|
|
} |
346 |
|
|
|
347 |
|
|
function setTaille(&$form,$maj){ |
348 |
|
|
// date |
349 |
|
|
$form->setTaille('date_demande', 12); |
350 |
|
|
$form->setTaille('date_notification_delai', 12); |
351 |
|
|
$form->setTaille('date_decision', 12); |
352 |
|
|
$form->setTaille('date_limite', 12); |
353 |
|
|
$form->setTaille('date_depot', 12); |
354 |
|
|
// demandeur |
355 |
fraynaud |
20 |
$form->setTaille('demandeur_nom', 20); |
356 |
|
|
$form->setTaille('demandeur_societe', 20); |
357 |
|
|
$form->setTaille('demandeur_adresse', 30); |
358 |
fraynaud |
11 |
$form->setTaille('demandeur_cp', 5); |
359 |
fraynaud |
20 |
$form->setTaille('demandeur_ville', 20); |
360 |
|
|
$form->setTaille('demandeur_pays', 20); |
361 |
fraynaud |
11 |
$form->setTaille('demandeur_telephone', 14); |
362 |
fraynaud |
20 |
$form->setTaille('demandeur_email', 20); |
363 |
fraynaud |
11 |
// delegataire |
364 |
fraynaud |
20 |
$form->setTaille('delegataire_societe', 20); |
365 |
|
|
$form->setTaille('delegataire_nom', 20); |
366 |
|
|
$form->setTaille('delegataire_adresse', 30); |
367 |
fraynaud |
11 |
$form->setTaille('delegataire_pays', 20); |
368 |
|
|
$form->setTaille('delegataire_cp', 5); |
369 |
fraynaud |
20 |
$form->setTaille('delegataire_ville', 20); |
370 |
fraynaud |
11 |
$form->setTaille('delegataire_telephone', 14); |
371 |
fraynaud |
20 |
$form->setTaille('delegataire_email', 20); |
372 |
fraynaud |
11 |
// terrain |
373 |
|
|
$form->setTaille('terrain_surface', 6); |
374 |
|
|
$form->setTaille('terrain_surface_calcul', 6); |
375 |
fraynaud |
20 |
$form->setTaille('terrain_adresse', 20); |
376 |
|
|
$form->setTaille('terrain_adresse_complement', 20); |
377 |
fraynaud |
11 |
$form->setTaille('terrain_numero', 4); |
378 |
fraynaud |
20 |
$form->setTaille('terrain_cp', 5); |
379 |
|
|
$form->setTaille('terrain_ville', 20); |
380 |
fraynaud |
11 |
$form->setTaille('rivoli', 4); |
381 |
|
|
$form->setTaille('parcelle', 20); |
382 |
|
|
// |
383 |
|
|
$form->setTaille('architecte_nom', 30); |
384 |
|
|
$form->setTaille('architecte', 3); |
385 |
fraynaud |
20 |
// description |
386 |
|
|
$form->setTaille('hauteur','3'); |
387 |
fraynaud |
11 |
|
388 |
|
|
$form->setTaille('temp1', 100); |
389 |
|
|
$form->setTaille('temp2', 100); |
390 |
|
|
$form->setTaille('temp3', 100); |
391 |
|
|
$form->setTaille('temp4', 100); |
392 |
|
|
$form->setTaille('temp5', 100); |
393 |
|
|
} |
394 |
|
|
|
395 |
|
|
function setVal(&$form,$maj,$validation){ |
396 |
fraynaud |
20 |
$this->maj=$maj; |
397 |
fraynaud |
11 |
if ($validation==0) { |
398 |
|
|
if ($maj == 0){ |
399 |
|
|
include ("../dyn/var.inc"); |
400 |
|
|
$form->setVal('nature', $this->nature); |
401 |
|
|
|
402 |
|
|
$form->setVal('annee', date('y')); |
403 |
|
|
$form->setVal('date_demande', date('Y-m-d')); |
404 |
|
|
$form->setVal('date_depot', date('Y-m-d')); |
405 |
|
|
|
406 |
|
|
$form->setVal('demandeur_cp', $dossier_cp); |
407 |
|
|
$form->setVal('demandeur_ville', $dossier_ville); |
408 |
|
|
|
409 |
|
|
$form->setVal('delegataire_cp', $dossier_cp); |
410 |
|
|
$form->setVal('delegataire_ville', $dossier_ville); |
411 |
|
|
|
412 |
|
|
$form->setVal('terrain_cp', $dossier_cp); |
413 |
|
|
$form->setVal('terrain_ville', $dossier_ville); |
414 |
|
|
|
415 |
|
|
$form->setVal('accord_tacite', 'Non'); |
416 |
|
|
$form->setVal('etat', 'initialiser'); |
417 |
|
|
$form->setVal('types', 'Initial'); |
418 |
fraynaud |
20 |
$form->setVal("saisie_architecte","saisie3()"); |
419 |
fraynaud |
11 |
}else{ |
420 |
|
|
$form->setVal("saisie_architecte","saisie3()"); |
421 |
fraynaud |
20 |
} |
422 |
fraynaud |
11 |
} |
423 |
|
|
} |
424 |
|
|
|
425 |
|
|
function setSelect(&$form, $maj,&$db,$debug) { |
426 |
fraynaud |
20 |
//optimisation sur table importante parcelle -> pas d appel methode parent |
427 |
fraynaud |
48 |
if(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc")) |
428 |
|
|
include ("../sql/".$db->phptype."/".$this->table.".form.inc"); |
429 |
fraynaud |
11 |
if($maj<2){ |
430 |
|
|
// travaux |
431 |
|
|
$contenu=array(); |
432 |
fraynaud |
20 |
// prise en compte du solde en ajout |
433 |
|
|
if($maj==0) |
434 |
|
|
$sql_travaux = $sql_travaux. |
435 |
|
|
" and solde = 'Non' order by libelle"; |
436 |
|
|
else |
437 |
|
|
$sql_travaux = $sql_travaux. |
438 |
|
|
" order by libelle"; |
439 |
fraynaud |
11 |
$res = $db->query($sql_travaux); |
440 |
fraynaud |
20 |
if (database::isError($res)) |
441 |
|
|
die($res->getMessage()); |
442 |
fraynaud |
11 |
else{ |
443 |
|
|
if ($debug == 1) |
444 |
|
|
echo " la requete ".$sql_travaux." est executee<br>"; |
445 |
fraynaud |
20 |
$contenu[0][0]=""; |
446 |
fraynaud |
11 |
$contenu[1][0]=_('choisir')." "._('travaux'); |
447 |
|
|
$k=1; |
448 |
|
|
while ($row=& $res->fetchRow()){ |
449 |
|
|
$contenu[0][$k]=$row[0]; |
450 |
|
|
$contenu[1][$k]=$row[1]; |
451 |
|
|
$k++; |
452 |
|
|
} |
453 |
|
|
$form->setSelect("travaux",$contenu); |
454 |
|
|
} |
455 |
fraynaud |
20 |
|
456 |
|
|
// instructeur |
457 |
|
|
$contenu=array(); |
458 |
|
|
$res = $db->query($sql_instructeur); |
459 |
|
|
if (DB :: isError($res)) |
460 |
|
|
die($res->getMessage().$sql_instructeur); |
461 |
|
|
else{ |
462 |
|
|
if ($debug == 1) |
463 |
|
|
echo " la requete ".$sql_instructeur." est executee<br>"; |
464 |
|
|
$contenu[0][0]=""; |
465 |
|
|
$contenu[1][0]=$this->lang('choisir')." ".$this->lang('instructeur'); |
466 |
|
|
$k=1; |
467 |
|
|
while ($row=& $res->fetchRow()){ |
468 |
|
|
$contenu[0][$k]=$row[0]; |
469 |
|
|
$contenu[1][$k]=$row[1]; |
470 |
|
|
$k++; |
471 |
|
|
} |
472 |
|
|
$form->setSelect("instructeur",$contenu); |
473 |
|
|
} |
474 |
|
|
// demandeur et delegataire civilite |
475 |
|
|
$contenu=array(); |
476 |
|
|
$res = $db->query($sql_civilite); |
477 |
|
|
if (database::isError($res)) |
478 |
|
|
die($res->getMessage().$sql_travaux); |
479 |
|
|
else{ |
480 |
|
|
if ($debug == 1) |
481 |
|
|
echo " la requete ".$sql_civilite." est execute<br>"; |
482 |
|
|
$contenu[0][0]=""; |
483 |
|
|
$contenu[1][0]=_('choisir')." "._('civilite'); |
484 |
|
|
$k=1; |
485 |
|
|
while ($row=& $res->fetchRow()){ |
486 |
|
|
$contenu[0][$k]=$row[0]; |
487 |
|
|
$contenu[1][$k]=$row[1]; |
488 |
|
|
$k++; |
489 |
|
|
} |
490 |
|
|
$form->setSelect("demandeur_civilite",$contenu); |
491 |
|
|
$form->setSelect("delegataire_civilite",$contenu); |
492 |
|
|
} |
493 |
|
|
// demandeur categorie |
494 |
|
|
$contenu=array(); |
495 |
|
|
$res = $db->query($sql_categorie_demandeur); |
496 |
|
|
if (database::isError($res)) |
497 |
|
|
die($res->getMessage().$sql_categorie_demandeur); |
498 |
|
|
else{ |
499 |
|
|
if ($debug == 1) |
500 |
|
|
echo " la requete ".$sql_categorie_demandeur." est execute<br>"; |
501 |
|
|
$contenu[0][0]=""; |
502 |
|
|
$contenu[1][0]=_('choisir')." "._('categorie'); |
503 |
|
|
$k=1; |
504 |
|
|
while ($row=& $res->fetchRow()){ |
505 |
|
|
$contenu[0][$k]=$row[0]; |
506 |
|
|
$contenu[1][$k]=$row[1]; |
507 |
|
|
$k++; |
508 |
|
|
} |
509 |
|
|
$form->setSelect("demandeur_categorie",$contenu); |
510 |
|
|
} |
511 |
|
|
// pos |
512 |
|
|
$contenu=array(); |
513 |
|
|
$res = $db->query($sql_pos); |
514 |
|
|
if (database::isError($res)) |
515 |
|
|
die($res->getMessage().$sql_pos); |
516 |
|
|
else{ |
517 |
|
|
if ($debug == 1) |
518 |
|
|
echo " la requete ".$sql_architecte." est execute<br>"; |
519 |
|
|
$contenu[0][0]=""; |
520 |
|
|
$contenu[1][0]=$this->lang('choisir')." ".$this->lang('pos'); |
521 |
|
|
$k=1; |
522 |
|
|
while ($row=& $res->fetchRow()){ |
523 |
|
|
$contenu[0][$k]=$row[0]; |
524 |
|
|
$contenu[1][$k]=$row[1]; |
525 |
|
|
$k++; |
526 |
|
|
} |
527 |
|
|
$form->setSelect("pos",$contenu); |
528 |
|
|
} |
529 |
fraynaud |
11 |
// lien sig |
530 |
|
|
include ("../dyn/var.inc"); |
531 |
|
|
$contenu=array(); |
532 |
|
|
$contenu[0]="<img src='".$image_sig."'>"; |
533 |
|
|
$form->setSelect("siglien",$contenu); |
534 |
|
|
// code et libelle voie |
535 |
|
|
$contenu=""; |
536 |
|
|
$contenu[0][0]="rivoli";// table |
537 |
|
|
$contenu[0][1]="rivoli"; // zone origine |
538 |
|
|
$contenu[1][0]="libelle"; |
539 |
|
|
$contenu[1][1]="terrain_adresse"; |
540 |
|
|
$form->setSelect("rivoli",$contenu); |
541 |
|
|
$contenu=""; |
542 |
|
|
$contenu[0][0]="rivoli";// table |
543 |
|
|
$contenu[0][1]="libelle"; // zone origine |
544 |
|
|
$contenu[1][0]="rivoli"; |
545 |
|
|
$contenu[1][1]="rivoli"; |
546 |
|
|
$form->setSelect("terrain_adresse",$contenu); |
547 |
|
|
// code et libelle architecte |
548 |
|
|
$contenu=""; |
549 |
|
|
$contenu[0][0]="architecte";// table |
550 |
|
|
$contenu[0][1]="architecte"; // zone origine |
551 |
|
|
$contenu[1][0]="nom"; |
552 |
|
|
$contenu[1][1]="architecte_nom"; |
553 |
|
|
$form->setSelect("architecte",$contenu); |
554 |
|
|
$contenu=""; |
555 |
|
|
$contenu[0][0]="architecte";// table |
556 |
|
|
$contenu[0][1]="nom"; // zone origine |
557 |
|
|
$contenu[1][0]="architecte"; |
558 |
|
|
$contenu[1][1]="architecte"; |
559 |
|
|
$form->setSelect("architecte_nom",$contenu); |
560 |
|
|
// accord tacite |
561 |
|
|
$contenu=array(); |
562 |
|
|
$contenu[0]=array('Non','Oui'); |
563 |
|
|
$contenu[1]=array('Non','Oui'); |
564 |
|
|
$form->setSelect("etat",$contenu); |
565 |
|
|
$form->setSelect("accord_tacite",$contenu); |
566 |
|
|
// terrain_numero_complement |
567 |
|
|
$contenu=array(); |
568 |
|
|
$contenu[0]=array('','bis','ter','quater'); |
569 |
|
|
$contenu[1]=array('','bis','ter','quater'); |
570 |
|
|
$form->setSelect("terrain_numero_complement",$contenu); |
571 |
|
|
// lien demandeur |
572 |
|
|
$contenu=array(); |
573 |
|
|
$contenu[0]=" <img src='../img/modifier.gif' border ='0'> "; |
574 |
|
|
$form->setSelect("saisie_demandeur",$contenu); |
575 |
|
|
// lien demandeur |
576 |
|
|
$contenu=array(); |
577 |
|
|
$contenu[0]=" <img src='../img/modifier.gif' border ='0'> "; |
578 |
|
|
$form->setSelect("saisie_delegataire",$contenu); |
579 |
|
|
// lien architecte |
580 |
|
|
$contenu=array(); |
581 |
|
|
$contenu[0]=" <img src='../img/ajouter.gif' border ='0'> "; |
582 |
|
|
$form->setSelect("saisie_architecte",$contenu); |
583 |
|
|
} |
584 |
|
|
} |
585 |
|
|
|
586 |
|
|
function setGroupe(&$form,$maj){ |
587 |
|
|
If ($maj==0){ |
588 |
|
|
$form->setGroupe('date_demande','D'); |
589 |
|
|
$form->setGroupe('date_depot','G'); |
590 |
|
|
$form->setGroupe('instructeur','F'); |
591 |
|
|
}else{ |
592 |
|
|
$form->setGroupe('dossier','D'); |
593 |
fraynaud |
20 |
$form->setGroupe('nature','G'); |
594 |
|
|
$form->setGroupe('annee','G'); |
595 |
fraynaud |
11 |
$form->setGroupe('date_demande','G'); |
596 |
|
|
$form->setGroupe('date_depot','G'); |
597 |
|
|
$form->setGroupe('instructeur','F'); |
598 |
|
|
} |
599 |
fraynaud |
20 |
$form->setGroupe('demandeur_categorie','D'); |
600 |
|
|
$form->setGroupe('demandeur_civilite','G'); |
601 |
|
|
$form->setGroupe('demandeur_nom','G'); |
602 |
|
|
$form->setGroupe('demandeur_societe','F'); |
603 |
|
|
|
604 |
|
|
$form->setGroupe('demandeur_adresse','D'); |
605 |
|
|
$form->setGroupe('demandeur_cp','G'); |
606 |
|
|
$form->setGroupe('demandeur_ville','G'); |
607 |
|
|
$form->setGroupe('demandeur_pays','F'); |
608 |
|
|
|
609 |
|
|
$form->setGroupe('demandeur_email','D'); |
610 |
|
|
$form->setGroupe('demandeur_telephone','F'); |
611 |
|
|
|
612 |
|
|
$form->setGroupe('delegataire','D'); |
613 |
|
|
$form->setGroupe('delegataire_civilite','G'); |
614 |
|
|
$form->setGroupe('delegataire_nom','G'); |
615 |
|
|
$form->setGroupe('delegataire_societe','F'); |
616 |
|
|
|
617 |
|
|
$form->setGroupe('delegataire_adresse','D'); |
618 |
|
|
$form->setGroupe('delegataire_cp','G'); |
619 |
|
|
$form->setGroupe('delegataire_ville','G'); |
620 |
|
|
$form->setGroupe('delegataire_pays','F'); |
621 |
|
|
|
622 |
|
|
$form->setGroupe('delegataire_email','D'); |
623 |
|
|
$form->setGroupe('delegataire_telephone','F'); |
624 |
|
|
|
625 |
|
|
$form->setGroupe('architecte','D'); |
626 |
|
|
$form->setGroupe('architecte_nom','G'); |
627 |
|
|
$form->setGroupe('saisie_architecte','G'); |
628 |
|
|
$form->setGroupe('travaux','F'); |
629 |
|
|
|
630 |
fraynaud |
11 |
// terrain |
631 |
|
|
$form->setGroupe('terrain_numero','D'); |
632 |
|
|
$form->setGroupe('terrain_numero_complement','G'); |
633 |
|
|
$form->setGroupe('rivoli','G'); |
634 |
|
|
$form->setGroupe('terrain_adresse','G'); |
635 |
fraynaud |
20 |
$form->setGroupe('terrain_adresse_complement','F'); |
636 |
|
|
|
637 |
|
|
$form->setGroupe('terrain_cp','D'); |
638 |
|
|
$form->setGroupe('terrain_ville','F'); |
639 |
|
|
|
640 |
|
|
// surface |
641 |
|
|
$form->setGroupe('terrain_surface','D'); |
642 |
fraynaud |
11 |
$form->setGroupe('terrain_surface_calcul','F'); |
643 |
|
|
|
644 |
fraynaud |
20 |
// instruction |
645 |
fraynaud |
11 |
$form->setGroupe('date_complet','D'); |
646 |
|
|
$form->setGroupe('date_rejet','G'); |
647 |
|
|
$form->setGroupe('rejet','G'); |
648 |
|
|
$form->setGroupe('delai','F'); |
649 |
|
|
|
650 |
|
|
$form->setGroupe('date_limite','D'); |
651 |
|
|
$form->setGroupe('date_notification_delai','G'); |
652 |
|
|
$form->setGroupe('accord_tacite','G'); |
653 |
|
|
$form->setGroupe('etat','F'); |
654 |
|
|
|
655 |
|
|
$form->setGroupe('date_decision','D'); |
656 |
|
|
$form->setGroupe('avis','G'); |
657 |
|
|
$form->setGroupe('date_validite','G'); |
658 |
|
|
$form->setGroupe('types','F'); |
659 |
|
|
|
660 |
fraynaud |
20 |
$form->setGroupe('date_chantier','D'); |
661 |
|
|
$form->setGroupe('date_achevement','G'); |
662 |
fraynaud |
11 |
$form->setGroupe('date_conformite','F'); |
663 |
fraynaud |
20 |
// localisation |
664 |
fraynaud |
11 |
$form->setGroupe('parcelle','D'); |
665 |
fraynaud |
44 |
$form->setGroupe('pos','F'); |
666 |
|
|
//$form->setGroupe('sig','G'); |
667 |
|
|
//$form->setGroupe('siglien','F'); |
668 |
fraynaud |
20 |
|
669 |
|
|
// description |
670 |
|
|
$form->setGroupe('batiment_nombre','D'); |
671 |
|
|
$form->setGroupe('logement_nombre','G'); |
672 |
|
|
$form->setGroupe('hauteur','G'); |
673 |
|
|
$form->setGroupe('piece_nombre','F'); |
674 |
|
|
|
675 |
|
|
$form->setGroupe('shon','D'); |
676 |
|
|
$form->setGroupe('shon_calcul','G'); |
677 |
|
|
$form->setGroupe('shob','G'); |
678 |
|
|
$form->setGroupe('lot','F'); |
679 |
fraynaud |
11 |
} |
680 |
|
|
|
681 |
|
|
|
682 |
|
|
|
683 |
fraynaud |
20 |
function setLib(&$form,$maj) { |
684 |
|
|
$col = " "; |
685 |
|
|
$form->setLib('dossier',''); |
686 |
|
|
$form->setLib('date_demande',$col._('demande le').' : '); |
687 |
|
|
$form->setLib('date_depot',$col._('depose le ')." : "); |
688 |
|
|
$form->setLib('instructeur',$col._('instructeur')." "); |
689 |
|
|
$form->setLib('date_complet',_('complet le').' : '); |
690 |
|
|
$form->setLib('date_rejet',_('rejette le').' : '); |
691 |
|
|
$form->setLib('date_notification_delai',$col._('date notification').' : '); |
692 |
|
|
$form->setLib('delai',$col._('delai (mois)').' : '); |
693 |
fraynaud |
11 |
$form->setLib('siglien',' '); |
694 |
fraynaud |
20 |
|
695 |
|
|
$form->setLib('demandeur_categorie',''); |
696 |
|
|
$form->setLib('demandeur_civilite',''); |
697 |
|
|
$form->setLib('demandeur_nom',''); |
698 |
|
|
$form->setLib('demandeur_societe',_('societe').' '); |
699 |
|
|
$form->setLib('demandeur_adresse',''); |
700 |
|
|
$form->setLib('demandeur_cp',_('cp')); |
701 |
|
|
$form->setLib('demandeur_ville',_('ville')); |
702 |
|
|
$form->setLib('demandeur_pays',' '._('pays').' '); |
703 |
|
|
$form->setLib('demandeur_telephone',' '._('tel').' '); |
704 |
|
|
$form->setLib('demandeur_email',''); |
705 |
|
|
|
706 |
|
|
$form->setLib('delegataire',''); |
707 |
|
|
$form->setLib('delegataire_civilite',''); |
708 |
|
|
$form->setLib('delegataire_nom',''); |
709 |
|
|
$form->setLib('delegataire_societe',_('societe').': '); |
710 |
|
|
$form->setLib('delegataire_adresse',''); |
711 |
|
|
$form->setLib('delegataire_cp',_('cp')); |
712 |
|
|
$form->setLib('delegataire_ville',_('ville')); |
713 |
|
|
$form->setLib('delegataire_pays',' '._('pays').': '); |
714 |
|
|
$form->setLib('delegataire_telephone',' '._('tel').': '); |
715 |
|
|
$form->setLib('delegataire_email',''); |
716 |
|
|
|
717 |
|
|
$form->setLib('types',''); |
718 |
|
|
|
719 |
|
|
$form->setLib('terrain_numero',_('adresse')); |
720 |
fraynaud |
11 |
$form->setLib('terrain_numero_complement',''); |
721 |
|
|
$form->setLib('terrain_adresse',''); |
722 |
|
|
$form->setLib('terrain_adresse_complement',''); |
723 |
|
|
$form->setLib('rivoli',''); |
724 |
fraynaud |
20 |
$form->setLib('terrain_cp','cp'); |
725 |
|
|
$form->setLib('terrain_ville','ville'); |
726 |
fraynaud |
11 |
|
727 |
fraynaud |
20 |
$form->setLib('terrain_surface',' '._('surface').' : '); |
728 |
|
|
$form->setLib('terrain_surface_calcul',' '._('calcul').' : '); |
729 |
|
|
$form->setLib('parcelle',' '._('parcelle').' : '); |
730 |
|
|
|
731 |
|
|
$form->setLib('date_decision',' '._('decide le').' : '); |
732 |
|
|
$form->setLib('date_validite',$col._('valide jusqu au').' : '); |
733 |
|
|
$form->setLib('date_achevement',$col._('acheve le').' : '); |
734 |
|
|
$form->setLib('avis',$col._('avec avis').' : '); |
735 |
|
|
$form->setLib('date_limite',''._('limite le').' : '); |
736 |
|
|
$form->setLib('date_chantier',''._('chantier le').' : '); |
737 |
|
|
$form->setLib('date_conformite',$col._('conforme le').' : '); |
738 |
|
|
$form->setLib('etat',$col._('etat').' : '); |
739 |
|
|
$form->setLib('accord_tacite',$col._('accord tacite').' : '); |
740 |
|
|
$form->setLib('date_rejet',$col._("DPC")." : "); |
741 |
|
|
|
742 |
|
|
|
743 |
|
|
// travaux |
744 |
fraynaud |
11 |
$form->setLib('objet_dossier',''); |
745 |
|
|
$form->setLib('travaux',''); |
746 |
fraynaud |
20 |
$form->setLib('saisie_architecte',""); // *** |
747 |
fraynaud |
11 |
$form->setLib('architecte_nom',""); |
748 |
fraynaud |
20 |
$form->setLib('architecte',''); |
749 |
|
|
|
750 |
|
|
// description |
751 |
|
|
$form->setLib('batiment_nombre',' '._('nombre de batiment').' : '); |
752 |
|
|
$form->setLib('logement_nombre',' '._('nombre de logement').' : '); |
753 |
|
|
$form->setLib('hauteur',' '._('hauteur').' : '); |
754 |
|
|
$form->setLib('piece_nombre',' '._('nombre de piece(s)').' : '); |
755 |
|
|
$form->setLib('shon',' '._('shon').' : '); |
756 |
|
|
$form->setLib('shon_calcul',' '._('calcul shon').' : '); |
757 |
|
|
$form->setLib('shob',' '._('shob').' : '); |
758 |
|
|
$form->setLib('amenagement',' '._('amenagement').' : '); |
759 |
|
|
|
760 |
fraynaud |
11 |
// zones temp |
761 |
|
|
include ("../dyn/var.inc"); |
762 |
|
|
$form->setLib('temp1',$temp1_lib); |
763 |
|
|
$form->setLib('temp2',$temp2_lib); |
764 |
|
|
$form->setLib('temp3',$temp3_lib); |
765 |
|
|
$form->setLib('temp4',$temp4_lib); |
766 |
|
|
$form->setLib('temp5',$temp5_lib); |
767 |
|
|
} |
768 |
|
|
|
769 |
|
|
function setOnchange(&$form,$maj){ |
770 |
|
|
parent::setOnchange($form,$maj); |
771 |
|
|
// mise en majuscule |
772 |
|
|
$form->setOnchange("demandeur_nom","this.value=this.value.toUpperCase()"); |
773 |
|
|
$form->setOnchange("demandeur_societe","this.value=this.value.toUpperCase()"); |
774 |
|
|
$form->setOnchange("delegataire_nom","this.value=this.value.toUpperCase()"); |
775 |
|
|
$form->setOnchange("delegataire_societe","this.value=this.value.toUpperCase()"); |
776 |
fraynaud |
20 |
$form->setOnchange("architecte_nom","this.value=this.value.toUpperCase()"); |
777 |
fraynaud |
89 |
$form->setOnchange("terrain_adresse","this.value=this.value.toUpperCase()"); |
778 |
fraynaud |
20 |
|
779 |
fraynaud |
11 |
} |
780 |
|
|
|
781 |
|
|
function setRegroupe(&$form,$maj){ |
782 |
fraynaud |
15 |
// depot |
783 |
|
|
If ($maj==0){ |
784 |
fraynaud |
20 |
$form->setRegroupe('date_demande','D',_(Depot),$this->aff_depot ); |
785 |
fraynaud |
15 |
} |
786 |
fraynaud |
11 |
If ($maj==1){ |
787 |
fraynaud |
20 |
$form->setRegroupe('dossier','D',_(Depot), $this->aff_depot); |
788 |
fraynaud |
15 |
$form->setRegroupe('date_demande','G',''); |
789 |
|
|
} |
790 |
|
|
$form->setRegroupe('date_depot','G',''); |
791 |
|
|
$form->setRegroupe('instructeur','F',''); |
792 |
|
|
|
793 |
fraynaud |
20 |
// travaux |
794 |
|
|
$form->setRegroupe('architecte','D',_('Architecte')." / "._("Travaux"), $this->aff_travaux); |
795 |
|
|
$form->setRegroupe('architecte_nom','G',''); |
796 |
|
|
$form->setRegroupe('saisie_architecte','G',''); |
797 |
|
|
$form->setRegroupe('travaux','F',''); |
798 |
fraynaud |
15 |
|
799 |
fraynaud |
20 |
// instruction |
800 |
|
|
$form->setRegroupe('date_complet','D',_('Instruction'), $this->aff_instruction); |
801 |
|
|
$form->setRegroupe('date_rejet','G',''); |
802 |
|
|
$form->setRegroupe('date_notification_delai','G',''); |
803 |
|
|
$form->setRegroupe('delai','G',''); |
804 |
|
|
$form->setRegroupe('date_limite','G','Decision '); |
805 |
|
|
$form->setRegroupe('accord_tacite','G',''); |
806 |
|
|
$form->setRegroupe('etat','G',''); |
807 |
|
|
$form->setRegroupe('date_decision','G',''); |
808 |
|
|
$form->setRegroupe('avis','G',''); |
809 |
|
|
$form->setRegroupe('date_validite','G',''); |
810 |
|
|
$form->setRegroupe('types','G',''); |
811 |
|
|
$form->setRegroupe('date_chantier','G',''); |
812 |
|
|
$form->setRegroupe('date_achevement','G',''); |
813 |
|
|
$form->setRegroupe('date_conformite','F',''); |
814 |
fraynaud |
15 |
|
815 |
fraynaud |
20 |
// demandeur |
816 |
|
|
$form->setRegroupe('demandeur_categorie','D',_('Demandeur'), $this->aff_demandeur); |
817 |
|
|
$form->setRegroupe('demandeur_civilite','G',''); |
818 |
|
|
$form->setRegroupe('demandeur_nom','G',''); |
819 |
|
|
$form->setRegroupe('demandeur_societe','G',''); |
820 |
|
|
$form->setRegroupe('demandeur_adresse','G','Decision '); |
821 |
|
|
$form->setRegroupe('demandeur_cp','G',''); |
822 |
|
|
$form->setRegroupe('demandeur_ville','G',''); |
823 |
|
|
$form->setRegroupe('demandeur_pays','G',''); |
824 |
|
|
$form->setRegroupe('demandeur_email','G',''); |
825 |
|
|
$form->setRegroupe('demandeur_telephone','F',''); |
826 |
|
|
|
827 |
|
|
|
828 |
|
|
// delegataire |
829 |
|
|
$form->setRegroupe('delegataire','D',_('delegataire'), $this->aff_delegataire); |
830 |
|
|
$form->setRegroupe('delegataire_civilite','G',''); |
831 |
|
|
$form->setRegroupe('delegataire_nom','G',''); |
832 |
|
|
$form->setRegroupe('delegataire_societe','G',''); |
833 |
|
|
$form->setRegroupe('delegataire_adresse','G','Decision '); |
834 |
|
|
$form->setRegroupe('delegataire_cp','G',''); |
835 |
|
|
$form->setRegroupe('delegataire_ville','G',''); |
836 |
|
|
$form->setRegroupe('delegataire_pays','G',''); |
837 |
|
|
$form->setRegroupe('delegataire_email','G',''); |
838 |
|
|
$form->setRegroupe('delegataire_telephone','F',''); |
839 |
fraynaud |
15 |
|
840 |
|
|
// terrain |
841 |
fraynaud |
20 |
$form->setRegroupe('terrain_numero','D',_('terrain'), $this->aff_terrain); |
842 |
fraynaud |
12 |
$form->setRegroupe('terrain_numero_complement','G',''); |
843 |
|
|
$form->setRegroupe('rivoli','G',''); |
844 |
|
|
$form->setRegroupe('terrain_adresse','G',''); |
845 |
|
|
$form->setRegroupe('terrain_adresse_complement','G',''); |
846 |
fraynaud |
20 |
$form->setRegroupe('terrain_cp','G',''); |
847 |
|
|
$form->setRegroupe('terrain_ville','G',''); |
848 |
|
|
$form->setRegroupe('terrain_surface','G',_('surface'),'');// $this->aff_surface); |
849 |
fraynaud |
12 |
$form->setRegroupe('terrain_surface_calcul','F',''); |
850 |
fraynaud |
20 |
|
851 |
|
|
// localisation |
852 |
|
|
$form->setRegroupe('parcelle','D',_('localisation'), $this->aff_localisation); |
853 |
fraynaud |
44 |
$form->setRegroupe('pos','F',''); |
854 |
|
|
//$form->setRegroupe('sig','G',''); |
855 |
|
|
//$form->setRegroupe('siglien','F',''); |
856 |
fraynaud |
20 |
|
857 |
|
|
// description |
858 |
|
|
$form->setRegroupe('batiment_nombre','D',_('description'), $this->aff_description); |
859 |
|
|
$form->setRegroupe('logement_nombre','G',''); |
860 |
|
|
$form->setRegroupe('hauteur','G',''); |
861 |
|
|
$form->setRegroupe('piece_nombre','G',''); |
862 |
|
|
$form->setRegroupe('shon','G',''); |
863 |
|
|
$form->setRegroupe('shon_calcul','G',''); |
864 |
|
|
$form->setRegroupe('shob','G',''); |
865 |
|
|
$form->setRegroupe('lot','F',''); |
866 |
|
|
// temp |
867 |
fraynaud |
11 |
} |
868 |
|
|
|
869 |
|
|
|
870 |
|
|
|
871 |
fraynaud |
15 |
/* ============================================================= |
872 |
|
|
* fonction trigger relative a la connexion SIG |
873 |
fraynaud |
44 |
* $sig = 1 dans dyn/var.inc |
874 |
fraynaud |
15 |
* =============================================================== |
875 |
|
|
*/ |
876 |
fraynaud |
11 |
|
877 |
|
|
|
878 |
|
|
function triggerajouterapres($id,&$db,$val,$DEBUG) { |
879 |
|
|
if (file_exists ("../dyn/var.inc")) |
880 |
|
|
include ("../dyn/var.inc"); |
881 |
|
|
if(!isset($sig)) $sig=0; |
882 |
fraynaud |
44 |
if(!isset($auto_pos)) $auto_pos=0; |
883 |
fraynaud |
103 |
$this->addToLog("trigger valeur sig :".$sig, EXTRA_VERBOSE_MODE); |
884 |
|
|
$this->addToLog("trigger valeur auto_pos :".$auto_pos, EXTRA_VERBOSE_MODE); |
885 |
fraynaud |
44 |
$id=$this->valF['dossier']; // id n est pas valorise en ajout |
886 |
|
|
if($sig==1 ){ |
887 |
|
|
if($val['parcelle']!='') |
888 |
|
|
$this->sig_interne($id,&$db,$val,$DEBUG,$auto_pos); |
889 |
|
|
else |
890 |
|
|
$this->msg = $this->msg."<br>"._("Parcelle non renseignee dans dossier")." ".$id." <br>"; |
891 |
fraynaud |
11 |
} |
892 |
|
|
} |
893 |
|
|
|
894 |
fraynaud |
44 |
function triggermodifierapres($id,&$db,$val,$DEBUG) { |
895 |
fraynaud |
11 |
if (file_exists ("../dyn/var.inc")) |
896 |
|
|
include ("../dyn/var.inc"); |
897 |
fraynaud |
44 |
if(!isset($sig)) $sig=0; |
898 |
|
|
if(!isset($auto_pos)) $auto_pos=0; |
899 |
fraynaud |
103 |
$this->addToLog("trigger valeur sig :".$sig, EXTRA_VERBOSE_MODE); |
900 |
|
|
$this->addToLog("trigger valeur auto_pos :".$auto_pos, EXTRA_VERBOSE_MODE); |
901 |
fraynaud |
44 |
// si la parcelle est changée |
902 |
|
|
if($sig==1 and $val['parcelle']!=$val['parcelle_archive']){ |
903 |
|
|
if($val['parcelle']!='') |
904 |
|
|
$this->sig_interne($this->valF['dossier'],&$db,$val,$DEBUG,$auto_pos); |
905 |
fraynaud |
11 |
} |
906 |
|
|
} |
907 |
|
|
|
908 |
fraynaud |
44 |
function sig_interne($id,&$db,$val,$DEBUG,$auto_pos){ |
909 |
fraynaud |
12 |
// Strategy interne dans var.inc |
910 |
|
|
// si la parcelle existe, il est cree un point au milieu de la parcelle |
911 |
|
|
// de maniere automatique |
912 |
fraynaud |
44 |
$projection = $db -> getOne("select srid from geometry_columns where f_table_name='dossier'"); |
913 |
|
|
$sql= "select astext(centroid(geom)) from parcelle where parcelle ='".$val["parcelle"]."'"; |
914 |
fraynaud |
103 |
$this->addToLog("recherche centroid parcelle :".$sql, VERBOSE_MODE); |
915 |
fraynaud |
44 |
$geom = $db -> getOne($sql); |
916 |
|
|
if($geom!=''){ // la parcelle est exitante dans la table / vue parcelle |
917 |
|
|
$sql ="update dossier set geom =geometryfromtext('".$geom."', ".$projection." ) where dossier ='".$id."'"; |
918 |
fraynaud |
103 |
$this->addToLog("sig_interne maj geom :".$sql, VERBOSE_MODE); |
919 |
fraynaud |
11 |
$res = $db -> query($sql); |
920 |
fraynaud |
44 |
if (database :: isError($res)){ |
921 |
fraynaud |
11 |
die($res->getMessage()."erreur ".$sql); |
922 |
|
|
}else{ |
923 |
fraynaud |
44 |
$this->msg = $this->msg."<br>"._("centroid de parcelle calculé")." ".$val["parcelle"]. |
924 |
|
|
" "._("dossier")." ".$id."<br>"; |
925 |
|
|
} |
926 |
|
|
if($auto_pos==1) // recherche du pos |
927 |
|
|
$this->auto_pos($id,$db,$geom,$projection); |
928 |
|
|
}else{ // parcelle inexistante |
929 |
|
|
if($this->maj ==1){ // en maj mettre a null la geometrie si parcelle changée inexistante |
930 |
|
|
$sql ="update dossier set geom = null where dossier ='".$id."'"; |
931 |
|
|
$res = $db -> query($sql); |
932 |
fraynaud |
103 |
$this->addToLog("requete sig_interne maj parcelle inexistante :".$sql, VERBOSE_MODE); |
933 |
fraynaud |
44 |
if (database :: isError($res)) |
934 |
|
|
die($res->getMessage()."erreur ".$sql); |
935 |
|
|
} |
936 |
|
|
$this->msg = $this->msg."<br> parcelle ".$val["parcelle"]." "._("inexistante")." ".$id."<br>"; |
937 |
fraynaud |
11 |
} |
938 |
|
|
} |
939 |
|
|
|
940 |
fraynaud |
44 |
function auto_pos($id,&$db,$geom,$projection){ |
941 |
|
|
// recherche du pos automatique dans le geom de la table / vue pos |
942 |
|
|
$sql="select pos from pos WHERE ST_contains(geom, geometryfromtext('".$geom."', ".$projection."))"; |
943 |
|
|
$pos = $db -> getOne($sql); |
944 |
fraynaud |
103 |
$this->addToLog("recherche auto_pos :".$sql, VERBOSE_MODE); |
945 |
fraynaud |
44 |
if($pos!=''){ |
946 |
|
|
$sql1 ="update dossier set pos = '".$pos."' where dossier = '".$id."'"; |
947 |
|
|
$res1 = $db -> query($sql1); |
948 |
fraynaud |
103 |
$this->addToLog("maj auto_pos :".$sql1, VERBOSE_MODE); |
949 |
fraynaud |
44 |
if (database:: isError($res1)){ // ok |
950 |
|
|
die($res1->getMessage()."erreur ".$sql1); |
951 |
|
|
}else{ |
952 |
|
|
$this->msg = $this->msg."<br>"._("POS/PLU renseignee automatiquement dans dossier")." ".$id." -> ".$pos."<br>"; |
953 |
|
|
} |
954 |
|
|
}else{ |
955 |
|
|
$this->msg = $this->msg."<br>"._("POS/PLU non trouvé pour dossier")." ".$id."<br>"; |
956 |
|
|
} |
957 |
|
|
} |
958 |
|
|
|
959 |
|
|
|
960 |
fraynaud |
3 |
}// fin classe |
961 |
|
|
?> |