1 |
vpihour |
633 |
<?php |
2 |
|
|
//$Id$ |
3 |
nhaye |
792 |
//gen openMairie le 21/11/2012 15:09 |
4 |
vpihour |
633 |
|
5 |
|
|
require_once ("../obj/om_dbform.class.php"); |
6 |
|
|
|
7 |
|
|
class demandeur_gen extends om_dbform { |
8 |
|
|
var $table="demandeur"; |
9 |
|
|
var $clePrimaire="demandeur"; |
10 |
|
|
var $typeCle="N"; |
11 |
|
|
var $required_field=array( |
12 |
|
|
"demandeur" |
13 |
|
|
); |
14 |
|
|
var $retourformulaire; |
15 |
|
|
|
16 |
|
|
function setvalF($val) { |
17 |
|
|
//affectation valeur formulaire |
18 |
|
|
if (!is_numeric($val['demandeur'])) { |
19 |
|
|
$this->valF['demandeur'] = ""; // -> requis |
20 |
|
|
} else { |
21 |
|
|
$this->valF['demandeur'] = $val['demandeur']; |
22 |
|
|
} |
23 |
|
|
if ($val['type_demandeur'] == "") { |
24 |
|
|
$this->valF['type_demandeur'] = NULL; |
25 |
|
|
} else { |
26 |
|
|
$this->valF['type_demandeur'] = $val['type_demandeur']; |
27 |
|
|
} |
28 |
nhaye |
792 |
if ($val['role'] == "") { |
29 |
|
|
$this->valF['role'] = NULL; |
30 |
|
|
} else { |
31 |
|
|
$this->valF['role'] = $val['role']; |
32 |
|
|
} |
33 |
vpihour |
633 |
if ($val['particulier_nom'] == "") { |
34 |
|
|
$this->valF['particulier_nom'] = NULL; |
35 |
|
|
} else { |
36 |
|
|
$this->valF['particulier_nom'] = $val['particulier_nom']; |
37 |
|
|
} |
38 |
|
|
if ($val['particulier_prenom'] == "") { |
39 |
|
|
$this->valF['particulier_prenom'] = NULL; |
40 |
|
|
} else { |
41 |
|
|
$this->valF['particulier_prenom'] = $val['particulier_prenom']; |
42 |
|
|
} |
43 |
|
|
if ($val['particulier_date_naissance'] != "") { |
44 |
|
|
$this->valF['particulier_date_naissance'] = $this->dateDB($val['particulier_date_naissance']); |
45 |
|
|
} else { |
46 |
|
|
$this->valF['particulier_date_naissance'] = NULL; |
47 |
|
|
} |
48 |
|
|
if ($val['particulier_commune_naissance'] == "") { |
49 |
|
|
$this->valF['particulier_commune_naissance'] = NULL; |
50 |
|
|
} else { |
51 |
|
|
$this->valF['particulier_commune_naissance'] = $val['particulier_commune_naissance']; |
52 |
|
|
} |
53 |
|
|
if ($val['particulier_departement_naissance'] == "") { |
54 |
|
|
$this->valF['particulier_departement_naissance'] = NULL; |
55 |
|
|
} else { |
56 |
|
|
$this->valF['particulier_departement_naissance'] = $val['particulier_departement_naissance']; |
57 |
|
|
} |
58 |
|
|
if ($val['personne_morale_denomination'] == "") { |
59 |
|
|
$this->valF['personne_morale_denomination'] = NULL; |
60 |
|
|
} else { |
61 |
|
|
$this->valF['personne_morale_denomination'] = $val['personne_morale_denomination']; |
62 |
|
|
} |
63 |
|
|
if ($val['personne_morale_raison_sociale'] == "") { |
64 |
|
|
$this->valF['personne_morale_raison_sociale'] = NULL; |
65 |
|
|
} else { |
66 |
|
|
$this->valF['personne_morale_raison_sociale'] = $val['personne_morale_raison_sociale']; |
67 |
|
|
} |
68 |
|
|
if ($val['personne_morale_siret'] == "") { |
69 |
|
|
$this->valF['personne_morale_siret'] = NULL; |
70 |
|
|
} else { |
71 |
|
|
$this->valF['personne_morale_siret'] = $val['personne_morale_siret']; |
72 |
|
|
} |
73 |
|
|
if ($val['personne_morale_categorie_juridique'] == "") { |
74 |
|
|
$this->valF['personne_morale_categorie_juridique'] = NULL; |
75 |
|
|
} else { |
76 |
|
|
$this->valF['personne_morale_categorie_juridique'] = $val['personne_morale_categorie_juridique']; |
77 |
|
|
} |
78 |
|
|
if ($val['personne_morale_nom'] == "") { |
79 |
|
|
$this->valF['personne_morale_nom'] = NULL; |
80 |
|
|
} else { |
81 |
|
|
$this->valF['personne_morale_nom'] = $val['personne_morale_nom']; |
82 |
|
|
} |
83 |
|
|
if ($val['personne_morale_prenom'] == "") { |
84 |
|
|
$this->valF['personne_morale_prenom'] = NULL; |
85 |
|
|
} else { |
86 |
|
|
$this->valF['personne_morale_prenom'] = $val['personne_morale_prenom']; |
87 |
|
|
} |
88 |
|
|
if ($val['numero'] == "") { |
89 |
|
|
$this->valF['numero'] = NULL; |
90 |
|
|
} else { |
91 |
|
|
$this->valF['numero'] = $val['numero']; |
92 |
|
|
} |
93 |
|
|
if ($val['voie'] == "") { |
94 |
|
|
$this->valF['voie'] = NULL; |
95 |
|
|
} else { |
96 |
|
|
$this->valF['voie'] = $val['voie']; |
97 |
|
|
} |
98 |
|
|
if ($val['complement'] == "") { |
99 |
|
|
$this->valF['complement'] = NULL; |
100 |
|
|
} else { |
101 |
|
|
$this->valF['complement'] = $val['complement']; |
102 |
|
|
} |
103 |
|
|
if ($val['lieu_dit'] == "") { |
104 |
|
|
$this->valF['lieu_dit'] = NULL; |
105 |
|
|
} else { |
106 |
|
|
$this->valF['lieu_dit'] = $val['lieu_dit']; |
107 |
|
|
} |
108 |
|
|
if ($val['localite'] == "") { |
109 |
|
|
$this->valF['localite'] = NULL; |
110 |
|
|
} else { |
111 |
|
|
$this->valF['localite'] = $val['localite']; |
112 |
|
|
} |
113 |
|
|
if ($val['code_postal'] == "") { |
114 |
|
|
$this->valF['code_postal'] = NULL; |
115 |
|
|
} else { |
116 |
|
|
$this->valF['code_postal'] = $val['code_postal']; |
117 |
|
|
} |
118 |
|
|
if ($val['bp'] == "") { |
119 |
|
|
$this->valF['bp'] = NULL; |
120 |
|
|
} else { |
121 |
|
|
$this->valF['bp'] = $val['bp']; |
122 |
|
|
} |
123 |
|
|
if ($val['cedex'] == "") { |
124 |
|
|
$this->valF['cedex'] = NULL; |
125 |
|
|
} else { |
126 |
|
|
$this->valF['cedex'] = $val['cedex']; |
127 |
|
|
} |
128 |
|
|
if ($val['pays'] == "") { |
129 |
|
|
$this->valF['pays'] = NULL; |
130 |
|
|
} else { |
131 |
|
|
$this->valF['pays'] = $val['pays']; |
132 |
|
|
} |
133 |
|
|
if ($val['division_territoriale'] == "") { |
134 |
|
|
$this->valF['division_territoriale'] = NULL; |
135 |
|
|
} else { |
136 |
|
|
$this->valF['division_territoriale'] = $val['division_territoriale']; |
137 |
|
|
} |
138 |
|
|
if ($val['telephone_fixe'] == "") { |
139 |
|
|
$this->valF['telephone_fixe'] = NULL; |
140 |
|
|
} else { |
141 |
|
|
$this->valF['telephone_fixe'] = $val['telephone_fixe']; |
142 |
|
|
} |
143 |
|
|
if ($val['telephone_mobile'] == "") { |
144 |
|
|
$this->valF['telephone_mobile'] = NULL; |
145 |
|
|
} else { |
146 |
|
|
$this->valF['telephone_mobile'] = $val['telephone_mobile']; |
147 |
|
|
} |
148 |
|
|
if ($val['indicatif'] == "") { |
149 |
|
|
$this->valF['indicatif'] = NULL; |
150 |
|
|
} else { |
151 |
|
|
$this->valF['indicatif'] = $val['indicatif']; |
152 |
|
|
} |
153 |
|
|
if ($val['courriel'] == "") { |
154 |
|
|
$this->valF['courriel'] = NULL; |
155 |
|
|
} else { |
156 |
|
|
$this->valF['courriel'] = $val['courriel']; |
157 |
|
|
} |
158 |
|
|
if ($val['notification'] == 1 || $val['notification'] == "t" || $val['notification'] == "Oui") { |
159 |
|
|
$this->valF['notification'] = true; |
160 |
|
|
} else { |
161 |
|
|
$this->valF['notification'] = false; |
162 |
|
|
} |
163 |
|
|
if ($val['frequent'] == 1 || $val['frequent'] == "t" || $val['frequent'] == "Oui") { |
164 |
|
|
$this->valF['frequent'] = true; |
165 |
|
|
} else { |
166 |
|
|
$this->valF['frequent'] = false; |
167 |
|
|
} |
168 |
vpihour |
693 |
if (!is_numeric($val['particulier_civilite'])) { |
169 |
|
|
$this->valF['particulier_civilite'] = NULL; |
170 |
|
|
} else { |
171 |
|
|
$this->valF['particulier_civilite'] = $val['particulier_civilite']; |
172 |
|
|
} |
173 |
|
|
if (!is_numeric($val['personne_morale_civilite'])) { |
174 |
|
|
$this->valF['personne_morale_civilite'] = NULL; |
175 |
|
|
} else { |
176 |
|
|
$this->valF['personne_morale_civilite'] = $val['personne_morale_civilite']; |
177 |
|
|
} |
178 |
vpihour |
633 |
} |
179 |
|
|
|
180 |
|
|
//================================================= |
181 |
|
|
//cle primaire automatique [automatic primary key] |
182 |
|
|
//================================================== |
183 |
|
|
|
184 |
|
|
function setId(&$db) { |
185 |
|
|
//numero automatique |
186 |
|
|
$this->valF[$this->clePrimaire] = $db->nextId(DB_PREFIXE.$this->table); |
187 |
|
|
} |
188 |
|
|
|
189 |
|
|
function setValFAjout($val) { |
190 |
|
|
//numero automatique -> pas de controle ajout cle primaire |
191 |
|
|
} |
192 |
|
|
|
193 |
|
|
function verifierAjout() { |
194 |
|
|
//numero automatique -> pas de verfication de cle primaire |
195 |
|
|
} |
196 |
|
|
|
197 |
|
|
//========================== |
198 |
|
|
// Formulaire [form] |
199 |
|
|
//========================== |
200 |
|
|
|
201 |
|
|
function setType(&$form,$maj) { |
202 |
|
|
//type |
203 |
|
|
if ($maj==0){ //ajout |
204 |
|
|
$form->setType('demandeur','hidden');// cle automatique |
205 |
|
|
$form->setType('type_demandeur','text'); |
206 |
nhaye |
792 |
$form->setType('role','text'); |
207 |
vpihour |
633 |
$form->setType('particulier_nom','text'); |
208 |
|
|
$form->setType('particulier_prenom','text'); |
209 |
|
|
if($this->retourformulaire=='') |
210 |
|
|
$form->setType('particulier_date_naissance','date'); |
211 |
|
|
else |
212 |
|
|
$form->setType('particulier_date_naissance','date2'); |
213 |
|
|
$form->setType('particulier_commune_naissance','text'); |
214 |
|
|
$form->setType('particulier_departement_naissance','text'); |
215 |
|
|
$form->setType('personne_morale_denomination','text'); |
216 |
|
|
$form->setType('personne_morale_raison_sociale','text'); |
217 |
|
|
$form->setType('personne_morale_siret','text'); |
218 |
|
|
$form->setType('personne_morale_categorie_juridique','text'); |
219 |
|
|
$form->setType('personne_morale_nom','text'); |
220 |
|
|
$form->setType('personne_morale_prenom','text'); |
221 |
|
|
$form->setType('numero','text'); |
222 |
|
|
$form->setType('voie','text'); |
223 |
|
|
$form->setType('complement','text'); |
224 |
|
|
$form->setType('lieu_dit','text'); |
225 |
|
|
$form->setType('localite','text'); |
226 |
|
|
$form->setType('code_postal','text'); |
227 |
|
|
$form->setType('bp','text'); |
228 |
|
|
$form->setType('cedex','text'); |
229 |
|
|
$form->setType('pays','text'); |
230 |
|
|
$form->setType('division_territoriale','text'); |
231 |
|
|
$form->setType('telephone_fixe','text'); |
232 |
|
|
$form->setType('telephone_mobile','text'); |
233 |
|
|
$form->setType('indicatif','text'); |
234 |
|
|
$form->setType('courriel','text'); |
235 |
|
|
$form->setType('notification','checkbox'); |
236 |
|
|
$form->setType('frequent','checkbox'); |
237 |
|
|
|
238 |
|
|
if($this->retourformulaire=='civilite' |
239 |
|
|
and $form->val['particulier_civilite'] == $this->getParameter('idxformulaire')) { |
240 |
|
|
$form->setType('particulier_civilite','selecthiddenstatic'); |
241 |
|
|
} else { |
242 |
|
|
$form->setType('particulier_civilite','select'); |
243 |
|
|
} |
244 |
vpihour |
693 |
|
245 |
|
|
if($this->retourformulaire=='civilite' |
246 |
|
|
and $form->val['personne_morale_civilite'] == $this->getParameter('idxformulaire')) { |
247 |
|
|
$form->setType('personne_morale_civilite','selecthiddenstatic'); |
248 |
|
|
} else { |
249 |
|
|
$form->setType('personne_morale_civilite','select'); |
250 |
|
|
} |
251 |
|
|
}// fin ajout |
252 |
|
|
if ($maj==1){ //modifier |
253 |
|
|
$form->setType('demandeur','hiddenstatic'); |
254 |
|
|
$form->setType('type_demandeur','text'); |
255 |
nhaye |
792 |
$form->setType('role','text'); |
256 |
vpihour |
633 |
$form->setType('particulier_nom','text'); |
257 |
|
|
$form->setType('particulier_prenom','text'); |
258 |
|
|
if($this->retourformulaire=='') |
259 |
|
|
$form->setType('particulier_date_naissance','date'); |
260 |
|
|
else |
261 |
|
|
$form->setType('particulier_date_naissance','date2'); |
262 |
|
|
$form->setType('particulier_commune_naissance','text'); |
263 |
|
|
$form->setType('particulier_departement_naissance','text'); |
264 |
|
|
$form->setType('personne_morale_denomination','text'); |
265 |
|
|
$form->setType('personne_morale_raison_sociale','text'); |
266 |
|
|
$form->setType('personne_morale_siret','text'); |
267 |
|
|
$form->setType('personne_morale_categorie_juridique','text'); |
268 |
|
|
$form->setType('personne_morale_nom','text'); |
269 |
|
|
$form->setType('personne_morale_prenom','text'); |
270 |
|
|
$form->setType('numero','text'); |
271 |
|
|
$form->setType('voie','text'); |
272 |
|
|
$form->setType('complement','text'); |
273 |
|
|
$form->setType('lieu_dit','text'); |
274 |
|
|
$form->setType('localite','text'); |
275 |
|
|
$form->setType('code_postal','text'); |
276 |
|
|
$form->setType('bp','text'); |
277 |
|
|
$form->setType('cedex','text'); |
278 |
|
|
$form->setType('pays','text'); |
279 |
|
|
$form->setType('division_territoriale','text'); |
280 |
|
|
$form->setType('telephone_fixe','text'); |
281 |
|
|
$form->setType('telephone_mobile','text'); |
282 |
|
|
$form->setType('indicatif','text'); |
283 |
|
|
$form->setType('courriel','text'); |
284 |
|
|
$form->setType('notification','checkbox'); |
285 |
|
|
$form->setType('frequent','checkbox'); |
286 |
vpihour |
693 |
|
287 |
|
|
if($this->retourformulaire=='civilite' |
288 |
|
|
and $form->val['particulier_civilite'] == $this->getParameter('idxformulaire')) { |
289 |
|
|
$form->setType('particulier_civilite','selecthiddenstatic'); |
290 |
|
|
} else { |
291 |
|
|
$form->setType('particulier_civilite','select'); |
292 |
|
|
} |
293 |
|
|
|
294 |
|
|
if($this->retourformulaire=='civilite' |
295 |
|
|
and $form->val['personne_morale_civilite'] == $this->getParameter('idxformulaire')) { |
296 |
|
|
$form->setType('personne_morale_civilite','selecthiddenstatic'); |
297 |
|
|
} else { |
298 |
|
|
$form->setType('personne_morale_civilite','select'); |
299 |
|
|
} |
300 |
vpihour |
633 |
}// fin modifier |
301 |
|
|
if ($maj==2){ //supprimer |
302 |
|
|
$form->setType('demandeur','hiddenstatic'); |
303 |
|
|
$form->setType('type_demandeur','hiddenstatic'); |
304 |
nhaye |
792 |
$form->setType('role','hiddenstatic'); |
305 |
vpihour |
633 |
$form->setType('particulier_nom','hiddenstatic'); |
306 |
|
|
$form->setType('particulier_prenom','hiddenstatic'); |
307 |
|
|
$form->setType('particulier_date_naissance','hiddenstatic'); |
308 |
|
|
$form->setType('particulier_commune_naissance','hiddenstatic'); |
309 |
|
|
$form->setType('particulier_departement_naissance','hiddenstatic'); |
310 |
|
|
$form->setType('personne_morale_denomination','hiddenstatic'); |
311 |
|
|
$form->setType('personne_morale_raison_sociale','hiddenstatic'); |
312 |
|
|
$form->setType('personne_morale_siret','hiddenstatic'); |
313 |
|
|
$form->setType('personne_morale_categorie_juridique','hiddenstatic'); |
314 |
|
|
$form->setType('personne_morale_nom','hiddenstatic'); |
315 |
|
|
$form->setType('personne_morale_prenom','hiddenstatic'); |
316 |
|
|
$form->setType('numero','hiddenstatic'); |
317 |
|
|
$form->setType('voie','hiddenstatic'); |
318 |
|
|
$form->setType('complement','hiddenstatic'); |
319 |
|
|
$form->setType('lieu_dit','hiddenstatic'); |
320 |
|
|
$form->setType('localite','hiddenstatic'); |
321 |
|
|
$form->setType('code_postal','hiddenstatic'); |
322 |
|
|
$form->setType('bp','hiddenstatic'); |
323 |
|
|
$form->setType('cedex','hiddenstatic'); |
324 |
|
|
$form->setType('pays','hiddenstatic'); |
325 |
|
|
$form->setType('division_territoriale','hiddenstatic'); |
326 |
|
|
$form->setType('telephone_fixe','hiddenstatic'); |
327 |
|
|
$form->setType('telephone_mobile','hiddenstatic'); |
328 |
|
|
$form->setType('indicatif','hiddenstatic'); |
329 |
|
|
$form->setType('courriel','hiddenstatic'); |
330 |
|
|
$form->setType('notification','hiddenstatic'); |
331 |
|
|
$form->setType('frequent','hiddenstatic'); |
332 |
vpihour |
693 |
$form->setType('particulier_civilite','selectstatic'); |
333 |
|
|
$form->setType('personne_morale_civilite','selectstatic'); |
334 |
vpihour |
633 |
}//fin supprimer |
335 |
|
|
if ($maj==3){ //consulter |
336 |
|
|
$form->setType('demandeur','static'); |
337 |
|
|
$form->setType('type_demandeur','static'); |
338 |
nhaye |
792 |
$form->setType('role','static'); |
339 |
vpihour |
633 |
$form->setType('particulier_nom','static'); |
340 |
|
|
$form->setType('particulier_prenom','static'); |
341 |
|
|
$form->setType('particulier_date_naissance','datestatic'); |
342 |
|
|
$form->setType('particulier_commune_naissance','static'); |
343 |
|
|
$form->setType('particulier_departement_naissance','static'); |
344 |
|
|
$form->setType('personne_morale_denomination','static'); |
345 |
|
|
$form->setType('personne_morale_raison_sociale','static'); |
346 |
|
|
$form->setType('personne_morale_siret','static'); |
347 |
|
|
$form->setType('personne_morale_categorie_juridique','static'); |
348 |
|
|
$form->setType('personne_morale_nom','static'); |
349 |
|
|
$form->setType('personne_morale_prenom','static'); |
350 |
|
|
$form->setType('numero','static'); |
351 |
|
|
$form->setType('voie','static'); |
352 |
|
|
$form->setType('complement','static'); |
353 |
|
|
$form->setType('lieu_dit','static'); |
354 |
|
|
$form->setType('localite','static'); |
355 |
|
|
$form->setType('code_postal','static'); |
356 |
|
|
$form->setType('bp','static'); |
357 |
|
|
$form->setType('cedex','static'); |
358 |
|
|
$form->setType('pays','static'); |
359 |
|
|
$form->setType('division_territoriale','static'); |
360 |
|
|
$form->setType('telephone_fixe','static'); |
361 |
|
|
$form->setType('telephone_mobile','static'); |
362 |
|
|
$form->setType('indicatif','static'); |
363 |
|
|
$form->setType('courriel','static'); |
364 |
|
|
$form->setType('notification','checkboxstatic'); |
365 |
|
|
$form->setType('frequent','checkboxstatic'); |
366 |
vpihour |
693 |
$form->setType('particulier_civilite','selectstatic'); |
367 |
|
|
$form->setType('personne_morale_civilite','selectstatic'); |
368 |
vpihour |
633 |
}//fin consulter |
369 |
|
|
} |
370 |
|
|
|
371 |
|
|
function setOnchange(&$form,$maj) { |
372 |
|
|
//javascript controle client |
373 |
|
|
$form->setOnchange('demandeur','VerifNum(this)'); |
374 |
|
|
$form->setOnchange('particulier_date_naissance','fdate(this)'); |
375 |
vpihour |
693 |
$form->setOnchange('particulier_civilite','VerifNum(this)'); |
376 |
|
|
$form->setOnchange('personne_morale_civilite','VerifNum(this)'); |
377 |
vpihour |
633 |
} |
378 |
|
|
/** |
379 |
|
|
* Methode setTaille |
380 |
|
|
*/ |
381 |
|
|
function setTaille(&$form, $maj) { |
382 |
|
|
$form->setTaille("demandeur", 11); |
383 |
|
|
$form->setTaille("type_demandeur", 30); |
384 |
nhaye |
792 |
$form->setTaille("role", 30); |
385 |
vpihour |
633 |
$form->setTaille("particulier_nom", 30); |
386 |
|
|
$form->setTaille("particulier_prenom", 30); |
387 |
|
|
$form->setTaille("particulier_date_naissance", 12); |
388 |
|
|
$form->setTaille("particulier_commune_naissance", 30); |
389 |
|
|
$form->setTaille("particulier_departement_naissance", 30); |
390 |
|
|
$form->setTaille("personne_morale_denomination", 15); |
391 |
|
|
$form->setTaille("personne_morale_raison_sociale", 15); |
392 |
|
|
$form->setTaille("personne_morale_siret", 15); |
393 |
|
|
$form->setTaille("personne_morale_categorie_juridique", 15); |
394 |
|
|
$form->setTaille("personne_morale_nom", 30); |
395 |
|
|
$form->setTaille("personne_morale_prenom", 30); |
396 |
|
|
$form->setTaille("numero", 10); |
397 |
|
|
$form->setTaille("voie", 30); |
398 |
|
|
$form->setTaille("complement", 30); |
399 |
|
|
$form->setTaille("lieu_dit", 30); |
400 |
|
|
$form->setTaille("localite", 30); |
401 |
|
|
$form->setTaille("code_postal", 10); |
402 |
|
|
$form->setTaille("bp", 10); |
403 |
|
|
$form->setTaille("cedex", 10); |
404 |
|
|
$form->setTaille("pays", 30); |
405 |
|
|
$form->setTaille("division_territoriale", 30); |
406 |
|
|
$form->setTaille("telephone_fixe", 14); |
407 |
|
|
$form->setTaille("telephone_mobile", 14); |
408 |
|
|
$form->setTaille("indicatif", 10); |
409 |
|
|
$form->setTaille("courriel", 30); |
410 |
|
|
$form->setTaille("notification", 1); |
411 |
|
|
$form->setTaille("frequent", 1); |
412 |
vpihour |
693 |
$form->setTaille("particulier_civilite", 11); |
413 |
|
|
$form->setTaille("personne_morale_civilite", 11); |
414 |
vpihour |
633 |
} |
415 |
|
|
|
416 |
|
|
/** |
417 |
|
|
* Methode setMax |
418 |
|
|
*/ |
419 |
|
|
function setMax(&$form, $maj) { |
420 |
|
|
$form->setMax("demandeur", 11); |
421 |
|
|
$form->setMax("type_demandeur", 40); |
422 |
nhaye |
792 |
$form->setMax("role", 40); |
423 |
vpihour |
633 |
$form->setMax("particulier_nom", 40); |
424 |
|
|
$form->setMax("particulier_prenom", 40); |
425 |
|
|
$form->setMax("particulier_date_naissance", 12); |
426 |
|
|
$form->setMax("particulier_commune_naissance", 30); |
427 |
|
|
$form->setMax("particulier_departement_naissance", 80); |
428 |
|
|
$form->setMax("personne_morale_denomination", 15); |
429 |
|
|
$form->setMax("personne_morale_raison_sociale", 15); |
430 |
|
|
$form->setMax("personne_morale_siret", 15); |
431 |
|
|
$form->setMax("personne_morale_categorie_juridique", 15); |
432 |
|
|
$form->setMax("personne_morale_nom", 40); |
433 |
|
|
$form->setMax("personne_morale_prenom", 40); |
434 |
|
|
$form->setMax("numero", 5); |
435 |
|
|
$form->setMax("voie", 40); |
436 |
|
|
$form->setMax("complement", 39); |
437 |
|
|
$form->setMax("lieu_dit", 39); |
438 |
|
|
$form->setMax("localite", 30); |
439 |
|
|
$form->setMax("code_postal", 5); |
440 |
|
|
$form->setMax("bp", 5); |
441 |
|
|
$form->setMax("cedex", 5); |
442 |
|
|
$form->setMax("pays", 40); |
443 |
|
|
$form->setMax("division_territoriale", 40); |
444 |
|
|
$form->setMax("telephone_fixe", 14); |
445 |
|
|
$form->setMax("telephone_mobile", 14); |
446 |
|
|
$form->setMax("indicatif", 5); |
447 |
|
|
$form->setMax("courriel", 40); |
448 |
|
|
$form->setMax("notification", 1); |
449 |
|
|
$form->setMax("frequent", 1); |
450 |
vpihour |
693 |
$form->setMax("particulier_civilite", 11); |
451 |
|
|
$form->setMax("personne_morale_civilite", 11); |
452 |
vpihour |
633 |
} |
453 |
|
|
|
454 |
|
|
|
455 |
|
|
function setLib(&$form,$maj) { |
456 |
|
|
//libelle des champs |
457 |
|
|
$form->setLib('demandeur',_('demandeur')); |
458 |
|
|
$form->setLib('type_demandeur',_('type_demandeur')); |
459 |
nhaye |
792 |
$form->setLib('role',_('role')); |
460 |
vpihour |
633 |
$form->setLib('particulier_nom',_('particulier_nom')); |
461 |
|
|
$form->setLib('particulier_prenom',_('particulier_prenom')); |
462 |
|
|
$form->setLib('particulier_date_naissance',_('particulier_date_naissance')); |
463 |
|
|
$form->setLib('particulier_commune_naissance',_('particulier_commune_naissance')); |
464 |
|
|
$form->setLib('particulier_departement_naissance',_('particulier_departement_naissance')); |
465 |
|
|
$form->setLib('personne_morale_denomination',_('personne_morale_denomination')); |
466 |
|
|
$form->setLib('personne_morale_raison_sociale',_('personne_morale_raison_sociale')); |
467 |
|
|
$form->setLib('personne_morale_siret',_('personne_morale_siret')); |
468 |
|
|
$form->setLib('personne_morale_categorie_juridique',_('personne_morale_categorie_juridique')); |
469 |
|
|
$form->setLib('personne_morale_nom',_('personne_morale_nom')); |
470 |
|
|
$form->setLib('personne_morale_prenom',_('personne_morale_prenom')); |
471 |
|
|
$form->setLib('numero',_('numero')); |
472 |
|
|
$form->setLib('voie',_('voie')); |
473 |
|
|
$form->setLib('complement',_('complement')); |
474 |
|
|
$form->setLib('lieu_dit',_('lieu_dit')); |
475 |
|
|
$form->setLib('localite',_('localite')); |
476 |
|
|
$form->setLib('code_postal',_('code_postal')); |
477 |
|
|
$form->setLib('bp',_('bp')); |
478 |
|
|
$form->setLib('cedex',_('cedex')); |
479 |
|
|
$form->setLib('pays',_('pays')); |
480 |
|
|
$form->setLib('division_territoriale',_('division_territoriale')); |
481 |
|
|
$form->setLib('telephone_fixe',_('telephone_fixe')); |
482 |
|
|
$form->setLib('telephone_mobile',_('telephone_mobile')); |
483 |
|
|
$form->setLib('indicatif',_('indicatif')); |
484 |
|
|
$form->setLib('courriel',_('courriel')); |
485 |
|
|
$form->setLib('notification',_('notification')); |
486 |
|
|
$form->setLib('frequent',_('frequent')); |
487 |
vpihour |
693 |
$form->setLib('particulier_civilite',_('particulier_civilite')); |
488 |
|
|
$form->setLib('personne_morale_civilite',_('personne_morale_civilite')); |
489 |
vpihour |
633 |
} |
490 |
|
|
|
491 |
|
|
function setSelect(&$form, $maj,&$db,$debug) { |
492 |
|
|
if(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc.php")) |
493 |
|
|
include ("../sql/".$db->phptype."/".$this->table.".form.inc.php"); |
494 |
|
|
elseif(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc")) |
495 |
|
|
include ("../sql/".$db->phptype."/".$this->table.".form.inc"); |
496 |
|
|
|
497 |
|
|
// particulier_civilite |
498 |
|
|
$this->init_select($form, $db, $maj, $debug, "particulier_civilite", |
499 |
vpihour |
693 |
$sql_particulier_civilite, $sql_particulier_civilite_by_id, true); |
500 |
vpihour |
633 |
|
501 |
|
|
// personne_morale_civilite |
502 |
|
|
$this->init_select($form, $db, $maj, $debug, "personne_morale_civilite", |
503 |
vpihour |
693 |
$sql_personne_morale_civilite, $sql_personne_morale_civilite_by_id, true); |
504 |
vpihour |
633 |
}// fin select |
505 |
|
|
|
506 |
|
|
//================================== |
507 |
|
|
// sous Formulaire [subform] |
508 |
|
|
//================================== |
509 |
|
|
|
510 |
|
|
function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire,&$db,$DEBUG=null){ |
511 |
|
|
$this->retourformulaire = $retourformulaire; |
512 |
|
|
if ($validation == 0 and $maj == 0) { |
513 |
|
|
if($retourformulaire =='civilite') |
514 |
|
|
$form->setVal('particulier_civilite', $idxformulaire); |
515 |
|
|
if($retourformulaire =='civilite') |
516 |
|
|
$form->setVal('personne_morale_civilite', $idxformulaire); |
517 |
|
|
}// fin validation |
518 |
|
|
}// fin setValsousformulaire |
519 |
|
|
|
520 |
|
|
//================================== |
521 |
|
|
// cle secondaire [secondary key] |
522 |
|
|
//================================== |
523 |
|
|
/** |
524 |
|
|
* Methode clesecondaire |
525 |
|
|
*/ |
526 |
|
|
function cleSecondaire($id, &$db = NULL, $val = array(), $DEBUG = false) { |
527 |
|
|
// On appelle la methode de la classe parent |
528 |
|
|
parent::cleSecondaire($id, $db, $val, $DEBUG); |
529 |
vpihour |
690 |
// Verification de la cle secondaire : lien_demande_demandeur |
530 |
|
|
$this->rechercheTable($db, "lien_demande_demandeur", "demandeur", $id); |
531 |
nhaye |
721 |
// Verification de la cle secondaire : lien_dossier_autorisation_demandeur |
532 |
|
|
$this->rechercheTable($db, "lien_dossier_autorisation_demandeur", "demandeur", $id); |
533 |
vpihour |
633 |
// Verification de la cle secondaire : lien_lot_demandeur |
534 |
|
|
$this->rechercheTable($db, "lien_lot_demandeur", "demandeur", $id); |
535 |
|
|
} |
536 |
|
|
|
537 |
|
|
|
538 |
|
|
}// fin classe |
539 |
|
|
?> |