1 |
mbroquet |
3730 |
<?php |
2 |
softime |
6565 |
//$Id$ |
3 |
|
|
//gen openMairie le 09/12/2016 18:06 |
4 |
mbroquet |
3730 |
|
5 |
|
|
require_once "../obj/om_dbform.class.php"; |
6 |
|
|
|
7 |
|
|
class demande_gen extends om_dbform { |
8 |
|
|
|
9 |
|
|
var $table = "demande"; |
10 |
|
|
var $clePrimaire = "demande"; |
11 |
|
|
var $typeCle = "N"; |
12 |
|
|
var $required_field = array( |
13 |
|
|
"date_demande", |
14 |
|
|
"demande", |
15 |
|
|
"demande_type", |
16 |
|
|
"dossier_autorisation_type_detaille", |
17 |
|
|
"om_collectivite" |
18 |
|
|
); |
19 |
|
|
|
20 |
|
|
var $foreign_keys_extended = array( |
21 |
|
|
"arrondissement" => array("arrondissement", ), |
22 |
softime |
6565 |
"dossier" => array("dossier", "dossier_instruction", "dossier_instruction_mes_encours", "dossier_instruction_tous_encours", "dossier_instruction_mes_clotures", "dossier_instruction_tous_clotures", "dossier_contentieux", "dossier_contentieux_mes_infractions", "dossier_contentieux_toutes_infractions", "dossier_contentieux_mes_recours", "dossier_contentieux_tous_recours", ), |
23 |
mbroquet |
3730 |
"demande_type" => array("demande_type", ), |
24 |
|
|
"dossier_autorisation" => array("dossier_autorisation", ), |
25 |
|
|
"dossier_autorisation_type_detaille" => array("dossier_autorisation_type_detaille", ), |
26 |
|
|
"instruction" => array("instruction", ), |
27 |
|
|
"om_collectivite" => array("om_collectivite", ), |
28 |
|
|
); |
29 |
|
|
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
function setvalF($val) { |
33 |
|
|
//affectation valeur formulaire |
34 |
|
|
if (!is_numeric($val['demande'])) { |
35 |
|
|
$this->valF['demande'] = ""; // -> requis |
36 |
|
|
} else { |
37 |
|
|
$this->valF['demande'] = $val['demande']; |
38 |
|
|
} |
39 |
|
|
if (!is_numeric($val['dossier_autorisation_type_detaille'])) { |
40 |
|
|
$this->valF['dossier_autorisation_type_detaille'] = ""; // -> requis |
41 |
|
|
} else { |
42 |
|
|
$this->valF['dossier_autorisation_type_detaille'] = $val['dossier_autorisation_type_detaille']; |
43 |
|
|
} |
44 |
|
|
if (!is_numeric($val['demande_type'])) { |
45 |
|
|
$this->valF['demande_type'] = ""; // -> requis |
46 |
|
|
} else { |
47 |
|
|
$this->valF['demande_type'] = $val['demande_type']; |
48 |
|
|
} |
49 |
|
|
if ($val['dossier_instruction'] == "") { |
50 |
|
|
$this->valF['dossier_instruction'] = NULL; |
51 |
|
|
} else { |
52 |
|
|
$this->valF['dossier_instruction'] = $val['dossier_instruction']; |
53 |
|
|
} |
54 |
|
|
if ($val['dossier_autorisation'] == "") { |
55 |
|
|
$this->valF['dossier_autorisation'] = NULL; |
56 |
|
|
} else { |
57 |
|
|
$this->valF['dossier_autorisation'] = $val['dossier_autorisation']; |
58 |
|
|
} |
59 |
|
|
if ($val['date_demande'] != "") { |
60 |
|
|
$this->valF['date_demande'] = $this->dateDB($val['date_demande']); |
61 |
|
|
} |
62 |
|
|
$this->valF['terrain_references_cadastrales'] = $val['terrain_references_cadastrales']; |
63 |
|
|
if ($val['terrain_adresse_voie_numero'] == "") { |
64 |
|
|
$this->valF['terrain_adresse_voie_numero'] = NULL; |
65 |
|
|
} else { |
66 |
|
|
$this->valF['terrain_adresse_voie_numero'] = $val['terrain_adresse_voie_numero']; |
67 |
|
|
} |
68 |
|
|
if ($val['terrain_adresse_voie'] == "") { |
69 |
|
|
$this->valF['terrain_adresse_voie'] = NULL; |
70 |
|
|
} else { |
71 |
|
|
$this->valF['terrain_adresse_voie'] = $val['terrain_adresse_voie']; |
72 |
|
|
} |
73 |
|
|
if ($val['terrain_adresse_lieu_dit'] == "") { |
74 |
|
|
$this->valF['terrain_adresse_lieu_dit'] = NULL; |
75 |
|
|
} else { |
76 |
|
|
$this->valF['terrain_adresse_lieu_dit'] = $val['terrain_adresse_lieu_dit']; |
77 |
|
|
} |
78 |
|
|
if ($val['terrain_adresse_localite'] == "") { |
79 |
|
|
$this->valF['terrain_adresse_localite'] = NULL; |
80 |
|
|
} else { |
81 |
|
|
$this->valF['terrain_adresse_localite'] = $val['terrain_adresse_localite']; |
82 |
|
|
} |
83 |
|
|
if ($val['terrain_adresse_code_postal'] == "") { |
84 |
|
|
$this->valF['terrain_adresse_code_postal'] = NULL; |
85 |
|
|
} else { |
86 |
|
|
$this->valF['terrain_adresse_code_postal'] = $val['terrain_adresse_code_postal']; |
87 |
|
|
} |
88 |
|
|
if ($val['terrain_adresse_bp'] == "") { |
89 |
|
|
$this->valF['terrain_adresse_bp'] = NULL; |
90 |
|
|
} else { |
91 |
|
|
$this->valF['terrain_adresse_bp'] = $val['terrain_adresse_bp']; |
92 |
|
|
} |
93 |
|
|
if ($val['terrain_adresse_cedex'] == "") { |
94 |
|
|
$this->valF['terrain_adresse_cedex'] = NULL; |
95 |
|
|
} else { |
96 |
|
|
$this->valF['terrain_adresse_cedex'] = $val['terrain_adresse_cedex']; |
97 |
|
|
} |
98 |
|
|
if (!is_numeric($val['terrain_superficie'])) { |
99 |
|
|
$this->valF['terrain_superficie'] = NULL; |
100 |
|
|
} else { |
101 |
|
|
$this->valF['terrain_superficie'] = $val['terrain_superficie']; |
102 |
|
|
} |
103 |
|
|
if (!is_numeric($val['instruction_recepisse'])) { |
104 |
|
|
$this->valF['instruction_recepisse'] = NULL; |
105 |
|
|
} else { |
106 |
|
|
$this->valF['instruction_recepisse'] = $val['instruction_recepisse']; |
107 |
|
|
} |
108 |
|
|
if (!is_numeric($val['arrondissement'])) { |
109 |
|
|
$this->valF['arrondissement'] = NULL; |
110 |
|
|
} else { |
111 |
|
|
$this->valF['arrondissement'] = $val['arrondissement']; |
112 |
|
|
} |
113 |
|
|
if (!is_numeric($val['om_collectivite'])) { |
114 |
|
|
$this->valF['om_collectivite'] = ""; // -> requis |
115 |
|
|
} else { |
116 |
|
|
if($_SESSION['niveau']==1) { |
117 |
|
|
$this->valF['om_collectivite'] = $_SESSION['collectivite']; |
118 |
|
|
} else { |
119 |
|
|
$this->valF['om_collectivite'] = $val['om_collectivite']; |
120 |
|
|
} |
121 |
|
|
} |
122 |
softime |
6565 |
if ($val['autorisation_contestee'] == "") { |
123 |
|
|
$this->valF['autorisation_contestee'] = NULL; |
124 |
|
|
} else { |
125 |
|
|
$this->valF['autorisation_contestee'] = $val['autorisation_contestee']; |
126 |
|
|
} |
127 |
mbroquet |
3730 |
} |
128 |
|
|
|
129 |
|
|
//================================================= |
130 |
|
|
//cle primaire automatique [automatic primary key] |
131 |
|
|
//================================================== |
132 |
|
|
|
133 |
|
|
function setId(&$dnu1 = null) { |
134 |
|
|
//numero automatique |
135 |
|
|
$this->valF[$this->clePrimaire] = $this->f->db->nextId(DB_PREFIXE.$this->table); |
136 |
|
|
} |
137 |
|
|
|
138 |
|
|
function setValFAjout($val) { |
139 |
|
|
//numero automatique -> pas de controle ajout cle primaire |
140 |
|
|
} |
141 |
|
|
|
142 |
|
|
function verifierAjout() { |
143 |
|
|
//numero automatique -> pas de verfication de cle primaire |
144 |
|
|
} |
145 |
|
|
|
146 |
|
|
//========================== |
147 |
|
|
// Formulaire [form] |
148 |
|
|
//========================== |
149 |
|
|
/** |
150 |
|
|
* |
151 |
|
|
*/ |
152 |
|
|
function setType(&$form, $maj) { |
153 |
|
|
// Récupération du mode de l'action |
154 |
|
|
$crud = $this->get_action_crud($maj); |
155 |
|
|
|
156 |
|
|
// MODE AJOUTER |
157 |
|
|
if ($maj == 0 || $crud == 'create') { |
158 |
|
|
$form->setType("demande", "hidden"); |
159 |
|
|
if ($this->is_in_context_of_foreign_key("dossier_autorisation_type_detaille", $this->retourformulaire)) { |
160 |
|
|
$form->setType("dossier_autorisation_type_detaille", "selecthiddenstatic"); |
161 |
|
|
} else { |
162 |
|
|
$form->setType("dossier_autorisation_type_detaille", "select"); |
163 |
|
|
} |
164 |
|
|
if ($this->is_in_context_of_foreign_key("demande_type", $this->retourformulaire)) { |
165 |
|
|
$form->setType("demande_type", "selecthiddenstatic"); |
166 |
|
|
} else { |
167 |
|
|
$form->setType("demande_type", "select"); |
168 |
|
|
} |
169 |
|
|
if ($this->is_in_context_of_foreign_key("dossier", $this->retourformulaire)) { |
170 |
|
|
$form->setType("dossier_instruction", "selecthiddenstatic"); |
171 |
|
|
} else { |
172 |
|
|
$form->setType("dossier_instruction", "select"); |
173 |
|
|
} |
174 |
|
|
if ($this->is_in_context_of_foreign_key("dossier_autorisation", $this->retourformulaire)) { |
175 |
|
|
$form->setType("dossier_autorisation", "selecthiddenstatic"); |
176 |
|
|
} else { |
177 |
|
|
$form->setType("dossier_autorisation", "select"); |
178 |
|
|
} |
179 |
|
|
$form->setType("date_demande", "date"); |
180 |
|
|
$form->setType("terrain_references_cadastrales", "textarea"); |
181 |
|
|
$form->setType("terrain_adresse_voie_numero", "text"); |
182 |
|
|
$form->setType("terrain_adresse_voie", "text"); |
183 |
|
|
$form->setType("terrain_adresse_lieu_dit", "text"); |
184 |
|
|
$form->setType("terrain_adresse_localite", "text"); |
185 |
|
|
$form->setType("terrain_adresse_code_postal", "text"); |
186 |
|
|
$form->setType("terrain_adresse_bp", "text"); |
187 |
|
|
$form->setType("terrain_adresse_cedex", "text"); |
188 |
|
|
$form->setType("terrain_superficie", "text"); |
189 |
|
|
if ($this->is_in_context_of_foreign_key("instruction", $this->retourformulaire)) { |
190 |
|
|
$form->setType("instruction_recepisse", "selecthiddenstatic"); |
191 |
|
|
} else { |
192 |
|
|
$form->setType("instruction_recepisse", "select"); |
193 |
|
|
} |
194 |
|
|
if ($this->is_in_context_of_foreign_key("arrondissement", $this->retourformulaire)) { |
195 |
|
|
$form->setType("arrondissement", "selecthiddenstatic"); |
196 |
|
|
} else { |
197 |
|
|
$form->setType("arrondissement", "select"); |
198 |
|
|
} |
199 |
|
|
if ($this->is_in_context_of_foreign_key("om_collectivite", $this->retourformulaire)) { |
200 |
|
|
if($_SESSION["niveau"] == 2) { |
201 |
|
|
$form->setType("om_collectivite", "selecthiddenstatic"); |
202 |
|
|
} else { |
203 |
|
|
$form->setType("om_collectivite", "hidden"); |
204 |
|
|
} |
205 |
|
|
} else { |
206 |
|
|
if($_SESSION["niveau"] == 2) { |
207 |
|
|
$form->setType("om_collectivite", "select"); |
208 |
|
|
} else { |
209 |
|
|
$form->setType("om_collectivite", "hidden"); |
210 |
|
|
} |
211 |
|
|
} |
212 |
softime |
6565 |
if ($this->is_in_context_of_foreign_key("dossier", $this->retourformulaire)) { |
213 |
|
|
$form->setType("autorisation_contestee", "selecthiddenstatic"); |
214 |
|
|
} else { |
215 |
|
|
$form->setType("autorisation_contestee", "select"); |
216 |
|
|
} |
217 |
mbroquet |
3730 |
} |
218 |
|
|
|
219 |
|
|
// MDOE MODIFIER |
220 |
|
|
if ($maj == 1 || $crud == 'update') { |
221 |
|
|
$form->setType("demande", "hiddenstatic"); |
222 |
|
|
if ($this->is_in_context_of_foreign_key("dossier_autorisation_type_detaille", $this->retourformulaire)) { |
223 |
|
|
$form->setType("dossier_autorisation_type_detaille", "selecthiddenstatic"); |
224 |
|
|
} else { |
225 |
|
|
$form->setType("dossier_autorisation_type_detaille", "select"); |
226 |
|
|
} |
227 |
|
|
if ($this->is_in_context_of_foreign_key("demande_type", $this->retourformulaire)) { |
228 |
|
|
$form->setType("demande_type", "selecthiddenstatic"); |
229 |
|
|
} else { |
230 |
|
|
$form->setType("demande_type", "select"); |
231 |
|
|
} |
232 |
|
|
if ($this->is_in_context_of_foreign_key("dossier", $this->retourformulaire)) { |
233 |
|
|
$form->setType("dossier_instruction", "selecthiddenstatic"); |
234 |
|
|
} else { |
235 |
|
|
$form->setType("dossier_instruction", "select"); |
236 |
|
|
} |
237 |
|
|
if ($this->is_in_context_of_foreign_key("dossier_autorisation", $this->retourformulaire)) { |
238 |
|
|
$form->setType("dossier_autorisation", "selecthiddenstatic"); |
239 |
|
|
} else { |
240 |
|
|
$form->setType("dossier_autorisation", "select"); |
241 |
|
|
} |
242 |
|
|
$form->setType("date_demande", "date"); |
243 |
|
|
$form->setType("terrain_references_cadastrales", "textarea"); |
244 |
|
|
$form->setType("terrain_adresse_voie_numero", "text"); |
245 |
|
|
$form->setType("terrain_adresse_voie", "text"); |
246 |
|
|
$form->setType("terrain_adresse_lieu_dit", "text"); |
247 |
|
|
$form->setType("terrain_adresse_localite", "text"); |
248 |
|
|
$form->setType("terrain_adresse_code_postal", "text"); |
249 |
|
|
$form->setType("terrain_adresse_bp", "text"); |
250 |
|
|
$form->setType("terrain_adresse_cedex", "text"); |
251 |
|
|
$form->setType("terrain_superficie", "text"); |
252 |
|
|
if ($this->is_in_context_of_foreign_key("instruction", $this->retourformulaire)) { |
253 |
|
|
$form->setType("instruction_recepisse", "selecthiddenstatic"); |
254 |
|
|
} else { |
255 |
|
|
$form->setType("instruction_recepisse", "select"); |
256 |
|
|
} |
257 |
|
|
if ($this->is_in_context_of_foreign_key("arrondissement", $this->retourformulaire)) { |
258 |
|
|
$form->setType("arrondissement", "selecthiddenstatic"); |
259 |
|
|
} else { |
260 |
|
|
$form->setType("arrondissement", "select"); |
261 |
|
|
} |
262 |
|
|
if ($this->is_in_context_of_foreign_key("om_collectivite", $this->retourformulaire)) { |
263 |
|
|
if($_SESSION["niveau"] == 2) { |
264 |
|
|
$form->setType("om_collectivite", "selecthiddenstatic"); |
265 |
|
|
} else { |
266 |
|
|
$form->setType("om_collectivite", "hidden"); |
267 |
|
|
} |
268 |
|
|
} else { |
269 |
|
|
if($_SESSION["niveau"] == 2) { |
270 |
|
|
$form->setType("om_collectivite", "select"); |
271 |
|
|
} else { |
272 |
|
|
$form->setType("om_collectivite", "hidden"); |
273 |
|
|
} |
274 |
|
|
} |
275 |
softime |
6565 |
if ($this->is_in_context_of_foreign_key("dossier", $this->retourformulaire)) { |
276 |
|
|
$form->setType("autorisation_contestee", "selecthiddenstatic"); |
277 |
|
|
} else { |
278 |
|
|
$form->setType("autorisation_contestee", "select"); |
279 |
|
|
} |
280 |
mbroquet |
3730 |
} |
281 |
|
|
|
282 |
|
|
// MODE SUPPRIMER |
283 |
|
|
if ($maj == 2 || $crud == 'delete') { |
284 |
|
|
$form->setType("demande", "hiddenstatic"); |
285 |
|
|
$form->setType("dossier_autorisation_type_detaille", "selectstatic"); |
286 |
|
|
$form->setType("demande_type", "selectstatic"); |
287 |
|
|
$form->setType("dossier_instruction", "selectstatic"); |
288 |
|
|
$form->setType("dossier_autorisation", "selectstatic"); |
289 |
|
|
$form->setType("date_demande", "hiddenstatic"); |
290 |
|
|
$form->setType("terrain_references_cadastrales", "hiddenstatic"); |
291 |
|
|
$form->setType("terrain_adresse_voie_numero", "hiddenstatic"); |
292 |
|
|
$form->setType("terrain_adresse_voie", "hiddenstatic"); |
293 |
|
|
$form->setType("terrain_adresse_lieu_dit", "hiddenstatic"); |
294 |
|
|
$form->setType("terrain_adresse_localite", "hiddenstatic"); |
295 |
|
|
$form->setType("terrain_adresse_code_postal", "hiddenstatic"); |
296 |
|
|
$form->setType("terrain_adresse_bp", "hiddenstatic"); |
297 |
|
|
$form->setType("terrain_adresse_cedex", "hiddenstatic"); |
298 |
|
|
$form->setType("terrain_superficie", "hiddenstatic"); |
299 |
|
|
$form->setType("instruction_recepisse", "selectstatic"); |
300 |
|
|
$form->setType("arrondissement", "selectstatic"); |
301 |
|
|
if ($_SESSION["niveau"] == 2) { |
302 |
|
|
$form->setType("om_collectivite", "selectstatic"); |
303 |
|
|
} else { |
304 |
|
|
$form->setType("om_collectivite", "hidden"); |
305 |
|
|
} |
306 |
softime |
6565 |
$form->setType("autorisation_contestee", "selectstatic"); |
307 |
mbroquet |
3730 |
} |
308 |
|
|
|
309 |
|
|
// MODE CONSULTER |
310 |
|
|
if ($maj == 3 || $crud == 'read') { |
311 |
|
|
$form->setType("demande", "static"); |
312 |
|
|
$form->setType("dossier_autorisation_type_detaille", "selectstatic"); |
313 |
|
|
$form->setType("demande_type", "selectstatic"); |
314 |
|
|
$form->setType("dossier_instruction", "selectstatic"); |
315 |
|
|
$form->setType("dossier_autorisation", "selectstatic"); |
316 |
|
|
$form->setType("date_demande", "datestatic"); |
317 |
|
|
$form->setType("terrain_references_cadastrales", "textareastatic"); |
318 |
|
|
$form->setType("terrain_adresse_voie_numero", "static"); |
319 |
|
|
$form->setType("terrain_adresse_voie", "static"); |
320 |
|
|
$form->setType("terrain_adresse_lieu_dit", "static"); |
321 |
|
|
$form->setType("terrain_adresse_localite", "static"); |
322 |
|
|
$form->setType("terrain_adresse_code_postal", "static"); |
323 |
|
|
$form->setType("terrain_adresse_bp", "static"); |
324 |
|
|
$form->setType("terrain_adresse_cedex", "static"); |
325 |
|
|
$form->setType("terrain_superficie", "static"); |
326 |
|
|
$form->setType("instruction_recepisse", "selectstatic"); |
327 |
|
|
$form->setType("arrondissement", "selectstatic"); |
328 |
|
|
if ($this->is_in_context_of_foreign_key("om_collectivite", $this->retourformulaire)) { |
329 |
|
|
if($_SESSION["niveau"] == 2) { |
330 |
|
|
$form->setType("om_collectivite", "selectstatic"); |
331 |
|
|
} else { |
332 |
|
|
$form->setType("om_collectivite", "hidden"); |
333 |
|
|
} |
334 |
|
|
} else { |
335 |
|
|
if($_SESSION["niveau"] == 2) { |
336 |
|
|
$form->setType("om_collectivite", "selectstatic"); |
337 |
|
|
} else { |
338 |
|
|
$form->setType("om_collectivite", "hidden"); |
339 |
|
|
} |
340 |
|
|
} |
341 |
softime |
6565 |
$form->setType("autorisation_contestee", "selectstatic"); |
342 |
mbroquet |
3730 |
} |
343 |
|
|
|
344 |
|
|
} |
345 |
|
|
|
346 |
|
|
|
347 |
|
|
function setOnchange(&$form, $maj) { |
348 |
|
|
//javascript controle client |
349 |
|
|
$form->setOnchange('demande','VerifNum(this)'); |
350 |
|
|
$form->setOnchange('dossier_autorisation_type_detaille','VerifNum(this)'); |
351 |
|
|
$form->setOnchange('demande_type','VerifNum(this)'); |
352 |
|
|
$form->setOnchange('date_demande','fdate(this)'); |
353 |
|
|
$form->setOnchange('terrain_superficie','VerifFloat(this)'); |
354 |
|
|
$form->setOnchange('instruction_recepisse','VerifNum(this)'); |
355 |
|
|
$form->setOnchange('arrondissement','VerifNum(this)'); |
356 |
|
|
$form->setOnchange('om_collectivite','VerifNum(this)'); |
357 |
|
|
} |
358 |
|
|
/** |
359 |
|
|
* Methode setTaille |
360 |
|
|
*/ |
361 |
|
|
function setTaille(&$form, $maj) { |
362 |
|
|
$form->setTaille("demande", 11); |
363 |
|
|
$form->setTaille("dossier_autorisation_type_detaille", 11); |
364 |
|
|
$form->setTaille("demande_type", 11); |
365 |
|
|
$form->setTaille("dossier_instruction", 30); |
366 |
|
|
$form->setTaille("dossier_autorisation", 20); |
367 |
|
|
$form->setTaille("date_demande", 12); |
368 |
|
|
$form->setTaille("terrain_references_cadastrales", 80); |
369 |
|
|
$form->setTaille("terrain_adresse_voie_numero", 20); |
370 |
|
|
$form->setTaille("terrain_adresse_voie", 30); |
371 |
|
|
$form->setTaille("terrain_adresse_lieu_dit", 30); |
372 |
|
|
$form->setTaille("terrain_adresse_localite", 30); |
373 |
|
|
$form->setTaille("terrain_adresse_code_postal", 10); |
374 |
|
|
$form->setTaille("terrain_adresse_bp", 15); |
375 |
|
|
$form->setTaille("terrain_adresse_cedex", 15); |
376 |
|
|
$form->setTaille("terrain_superficie", 20); |
377 |
|
|
$form->setTaille("instruction_recepisse", 11); |
378 |
|
|
$form->setTaille("arrondissement", 11); |
379 |
|
|
$form->setTaille("om_collectivite", 11); |
380 |
softime |
6565 |
$form->setTaille("autorisation_contestee", 30); |
381 |
mbroquet |
3730 |
} |
382 |
|
|
|
383 |
|
|
/** |
384 |
|
|
* Methode setMax |
385 |
|
|
*/ |
386 |
|
|
function setMax(&$form, $maj) { |
387 |
|
|
$form->setMax("demande", 11); |
388 |
|
|
$form->setMax("dossier_autorisation_type_detaille", 11); |
389 |
|
|
$form->setMax("demande_type", 11); |
390 |
|
|
$form->setMax("dossier_instruction", 30); |
391 |
|
|
$form->setMax("dossier_autorisation", 20); |
392 |
|
|
$form->setMax("date_demande", 12); |
393 |
|
|
$form->setMax("terrain_references_cadastrales", 6); |
394 |
|
|
$form->setMax("terrain_adresse_voie_numero", 20); |
395 |
|
|
$form->setMax("terrain_adresse_voie", 30); |
396 |
|
|
$form->setMax("terrain_adresse_lieu_dit", 30); |
397 |
|
|
$form->setMax("terrain_adresse_localite", 30); |
398 |
|
|
$form->setMax("terrain_adresse_code_postal", 5); |
399 |
|
|
$form->setMax("terrain_adresse_bp", 15); |
400 |
|
|
$form->setMax("terrain_adresse_cedex", 15); |
401 |
|
|
$form->setMax("terrain_superficie", 20); |
402 |
|
|
$form->setMax("instruction_recepisse", 11); |
403 |
|
|
$form->setMax("arrondissement", 11); |
404 |
|
|
$form->setMax("om_collectivite", 11); |
405 |
softime |
6565 |
$form->setMax("autorisation_contestee", 30); |
406 |
mbroquet |
3730 |
} |
407 |
|
|
|
408 |
|
|
|
409 |
|
|
function setLib(&$form, $maj) { |
410 |
|
|
//libelle des champs |
411 |
|
|
$form->setLib('demande',_('demande')); |
412 |
|
|
$form->setLib('dossier_autorisation_type_detaille',_('dossier_autorisation_type_detaille')); |
413 |
|
|
$form->setLib('demande_type',_('demande_type')); |
414 |
|
|
$form->setLib('dossier_instruction',_('dossier_instruction')); |
415 |
|
|
$form->setLib('dossier_autorisation',_('dossier_autorisation')); |
416 |
|
|
$form->setLib('date_demande',_('date_demande')); |
417 |
|
|
$form->setLib('terrain_references_cadastrales',_('terrain_references_cadastrales')); |
418 |
|
|
$form->setLib('terrain_adresse_voie_numero',_('terrain_adresse_voie_numero')); |
419 |
|
|
$form->setLib('terrain_adresse_voie',_('terrain_adresse_voie')); |
420 |
|
|
$form->setLib('terrain_adresse_lieu_dit',_('terrain_adresse_lieu_dit')); |
421 |
|
|
$form->setLib('terrain_adresse_localite',_('terrain_adresse_localite')); |
422 |
|
|
$form->setLib('terrain_adresse_code_postal',_('terrain_adresse_code_postal')); |
423 |
|
|
$form->setLib('terrain_adresse_bp',_('terrain_adresse_bp')); |
424 |
|
|
$form->setLib('terrain_adresse_cedex',_('terrain_adresse_cedex')); |
425 |
|
|
$form->setLib('terrain_superficie',_('terrain_superficie')); |
426 |
|
|
$form->setLib('instruction_recepisse',_('instruction_recepisse')); |
427 |
|
|
$form->setLib('arrondissement',_('arrondissement')); |
428 |
|
|
$form->setLib('om_collectivite',_('om_collectivite')); |
429 |
softime |
6565 |
$form->setLib('autorisation_contestee',_('autorisation_contestee')); |
430 |
mbroquet |
3730 |
} |
431 |
|
|
/** |
432 |
|
|
* |
433 |
|
|
*/ |
434 |
|
|
function setSelect(&$form, $maj, &$dnu1 = null, $dnu2 = null) { |
435 |
|
|
|
436 |
|
|
// Inclusion du fichier de requĂȘtes |
437 |
|
|
if (file_exists("../sql/".OM_DB_PHPTYPE."/".$this->table.".form.inc.php")) { |
438 |
|
|
include "../sql/".OM_DB_PHPTYPE."/".$this->table.".form.inc.php"; |
439 |
|
|
} elseif (file_exists("../sql/".OM_DB_PHPTYPE."/".$this->table.".form.inc")) { |
440 |
|
|
include "../sql/".OM_DB_PHPTYPE."/".$this->table.".form.inc"; |
441 |
|
|
} |
442 |
|
|
|
443 |
|
|
// arrondissement |
444 |
|
|
$this->init_select($form, $this->f->db, $maj, null, "arrondissement", $sql_arrondissement, $sql_arrondissement_by_id, false); |
445 |
softime |
6565 |
// autorisation_contestee |
446 |
|
|
$this->init_select($form, $this->f->db, $maj, null, "autorisation_contestee", $sql_autorisation_contestee, $sql_autorisation_contestee_by_id, false); |
447 |
mbroquet |
3730 |
// demande_type |
448 |
|
|
$this->init_select($form, $this->f->db, $maj, null, "demande_type", $sql_demande_type, $sql_demande_type_by_id, false); |
449 |
|
|
// dossier_autorisation |
450 |
|
|
$this->init_select($form, $this->f->db, $maj, null, "dossier_autorisation", $sql_dossier_autorisation, $sql_dossier_autorisation_by_id, false); |
451 |
|
|
// dossier_autorisation_type_detaille |
452 |
|
|
$this->init_select($form, $this->f->db, $maj, null, "dossier_autorisation_type_detaille", $sql_dossier_autorisation_type_detaille, $sql_dossier_autorisation_type_detaille_by_id, false); |
453 |
|
|
// dossier_instruction |
454 |
|
|
$this->init_select($form, $this->f->db, $maj, null, "dossier_instruction", $sql_dossier_instruction, $sql_dossier_instruction_by_id, false); |
455 |
|
|
// instruction_recepisse |
456 |
|
|
$this->init_select($form, $this->f->db, $maj, null, "instruction_recepisse", $sql_instruction_recepisse, $sql_instruction_recepisse_by_id, false); |
457 |
|
|
// om_collectivite |
458 |
|
|
$this->init_select($form, $this->f->db, $maj, null, "om_collectivite", $sql_om_collectivite, $sql_om_collectivite_by_id, false); |
459 |
|
|
} |
460 |
|
|
|
461 |
|
|
|
462 |
|
|
function setVal(&$form, $maj, $validation, &$dnu1 = null, $dnu2 = null) { |
463 |
|
|
if($validation==0 and $maj==0 and $_SESSION['niveau']==1) { |
464 |
|
|
$form->setVal('om_collectivite', $_SESSION['collectivite']); |
465 |
|
|
}// fin validation |
466 |
|
|
$this->set_form_default_values($form, $maj, $validation); |
467 |
|
|
}// fin setVal |
468 |
|
|
|
469 |
|
|
//================================== |
470 |
|
|
// sous Formulaire |
471 |
|
|
//================================== |
472 |
|
|
|
473 |
|
|
|
474 |
|
|
function setValsousformulaire(&$form, $maj, $validation, $idxformulaire, $retourformulaire, $typeformulaire, &$dnu1 = null, $dnu2 = null) { |
475 |
|
|
$this->retourformulaire = $retourformulaire; |
476 |
|
|
if($validation==0 and $maj==0 and $_SESSION['niveau']==1) { |
477 |
|
|
$form->setVal('om_collectivite', $_SESSION['collectivite']); |
478 |
|
|
}// fin validation |
479 |
|
|
if($validation == 0) { |
480 |
|
|
if($this->is_in_context_of_foreign_key('arrondissement', $this->retourformulaire)) |
481 |
|
|
$form->setVal('arrondissement', $idxformulaire); |
482 |
|
|
if($this->is_in_context_of_foreign_key('demande_type', $this->retourformulaire)) |
483 |
|
|
$form->setVal('demande_type', $idxformulaire); |
484 |
|
|
if($this->is_in_context_of_foreign_key('dossier_autorisation', $this->retourformulaire)) |
485 |
|
|
$form->setVal('dossier_autorisation', $idxformulaire); |
486 |
|
|
if($this->is_in_context_of_foreign_key('dossier_autorisation_type_detaille', $this->retourformulaire)) |
487 |
|
|
$form->setVal('dossier_autorisation_type_detaille', $idxformulaire); |
488 |
|
|
if($this->is_in_context_of_foreign_key('instruction', $this->retourformulaire)) |
489 |
|
|
$form->setVal('instruction_recepisse', $idxformulaire); |
490 |
|
|
if($this->is_in_context_of_foreign_key('om_collectivite', $this->retourformulaire)) |
491 |
|
|
$form->setVal('om_collectivite', $idxformulaire); |
492 |
|
|
}// fin validation |
493 |
softime |
6565 |
if ($validation == 0 and $maj == 0) { |
494 |
|
|
if($this->is_in_context_of_foreign_key('dossier', $this->retourformulaire)) |
495 |
|
|
$form->setVal('autorisation_contestee', $idxformulaire); |
496 |
|
|
if($this->is_in_context_of_foreign_key('dossier', $this->retourformulaire)) |
497 |
|
|
$form->setVal('dossier_instruction', $idxformulaire); |
498 |
|
|
}// fin validation |
499 |
mbroquet |
3730 |
$this->set_form_default_values($form, $maj, $validation); |
500 |
|
|
}// fin setValsousformulaire |
501 |
|
|
|
502 |
|
|
//================================== |
503 |
|
|
// cle secondaire |
504 |
|
|
//================================== |
505 |
|
|
|
506 |
|
|
/** |
507 |
|
|
* Methode clesecondaire |
508 |
|
|
*/ |
509 |
|
|
function cleSecondaire($id, &$dnu1 = null, $val = array(), $dnu2 = null) { |
510 |
|
|
// On appelle la methode de la classe parent |
511 |
|
|
parent::cleSecondaire($id); |
512 |
|
|
// Verification de la cle secondaire : lien_demande_demandeur |
513 |
|
|
$this->rechercheTable($this->f->db, "lien_demande_demandeur", "demande", $id); |
514 |
|
|
} |
515 |
|
|
|
516 |
|
|
|
517 |
|
|
} |
518 |
|
|
|
519 |
|
|
?> |