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