/[openfoncier]/branches/5.0.0-develop/gen/obj/demande.class.php
ViewVC logotype

Annotation of /branches/5.0.0-develop/gen/obj/demande.class.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9814 - (hide annotations)
Mon Jan 4 15:34:21 2021 UTC (4 years ago) by softime
Original Path: branches/4.14.0-develop/gen/obj/demande.class.php
File size: 35280 byte(s)
* Merge de la branche d'intégration intermédiaire 4.14.0-develop_demat dans la branche d'intégration pricipale 4.14.0-develop

1 mbroquet 3730 <?php
2 softime 6565 //$Id$
3 softime 9814 //gen openMairie le 22/10/2020 12:41
4 mbroquet 3730
5     require_once "../obj/om_dbform.class.php";
6    
7     class demande_gen extends om_dbform {
8    
9 softime 7996 protected $_absolute_class_name = "demande";
10    
11 mbroquet 3730 var $table = "demande";
12     var $clePrimaire = "demande";
13     var $typeCle = "N";
14     var $required_field = array(
15     "date_demande",
16     "demande",
17     "demande_type",
18     "dossier_autorisation_type_detaille",
19     "om_collectivite"
20     );
21    
22     var $foreign_keys_extended = array(
23     "arrondissement" => array("arrondissement", ),
24 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", ),
25 softime 9560 "commune" => array("commune", ),
26 mbroquet 3730 "demande_type" => array("demande_type", ),
27     "dossier_autorisation" => array("dossier_autorisation", ),
28     "dossier_autorisation_type_detaille" => array("dossier_autorisation_type_detaille", ),
29     "instruction" => array("instruction", ),
30     "om_collectivite" => array("om_collectivite", ),
31     );
32 softime 7996
33     /**
34     *
35     * @return string
36     */
37     function get_default_libelle() {
38     return $this->getVal($this->clePrimaire)."&nbsp;".$this->getVal("dossier_autorisation_type_detaille");
39     }
40 mbroquet 3730
41 softime 7996 /**
42     *
43     * @return array
44     */
45     function get_var_sql_forminc__champs() {
46     return array(
47     "demande",
48     "dossier_autorisation_type_detaille",
49     "demande_type",
50     "dossier_instruction",
51     "dossier_autorisation",
52     "date_demande",
53     "terrain_references_cadastrales",
54     "terrain_adresse_voie_numero",
55     "terrain_adresse_voie",
56     "terrain_adresse_lieu_dit",
57     "terrain_adresse_localite",
58     "terrain_adresse_code_postal",
59     "terrain_adresse_bp",
60     "terrain_adresse_cedex",
61     "terrain_superficie",
62     "instruction_recepisse",
63     "arrondissement",
64     "om_collectivite",
65     "autorisation_contestee",
66 softime 8329 "depot_electronique",
67     "parcelle_temporaire",
68 softime 9560 "commune",
69 softime 7996 );
70     }
71 mbroquet 3730
72 softime 7996 /**
73     *
74     * @return string
75     */
76     function get_var_sql_forminc__sql_arrondissement() {
77     return "SELECT arrondissement.arrondissement, arrondissement.libelle FROM ".DB_PREFIXE."arrondissement ORDER BY arrondissement.libelle ASC";
78     }
79 mbroquet 3730
80 softime 7996 /**
81     *
82     * @return string
83     */
84     function get_var_sql_forminc__sql_arrondissement_by_id() {
85     return "SELECT arrondissement.arrondissement, arrondissement.libelle FROM ".DB_PREFIXE."arrondissement WHERE arrondissement = <idx>";
86     }
87    
88     /**
89     *
90     * @return string
91     */
92     function get_var_sql_forminc__sql_autorisation_contestee() {
93     return "SELECT dossier.dossier, dossier.annee FROM ".DB_PREFIXE."dossier ORDER BY dossier.annee ASC";
94     }
95    
96     /**
97     *
98     * @return string
99     */
100     function get_var_sql_forminc__sql_autorisation_contestee_by_id() {
101     return "SELECT dossier.dossier, dossier.annee FROM ".DB_PREFIXE."dossier WHERE dossier = '<idx>'";
102     }
103    
104     /**
105     *
106     * @return string
107     */
108 softime 9560 function get_var_sql_forminc__sql_commune() {
109     return "SELECT commune.commune, commune.libelle FROM ".DB_PREFIXE."commune WHERE ((commune.om_validite_debut IS NULL AND (commune.om_validite_fin IS NULL OR commune.om_validite_fin > CURRENT_DATE)) OR (commune.om_validite_debut <= CURRENT_DATE AND (commune.om_validite_fin IS NULL OR commune.om_validite_fin > CURRENT_DATE))) ORDER BY commune.libelle ASC";
110     }
111    
112     /**
113     *
114     * @return string
115     */
116     function get_var_sql_forminc__sql_commune_by_id() {
117     return "SELECT commune.commune, commune.libelle FROM ".DB_PREFIXE."commune WHERE commune = <idx>";
118     }
119    
120     /**
121     *
122     * @return string
123     */
124 softime 7996 function get_var_sql_forminc__sql_demande_type() {
125     return "SELECT demande_type.demande_type, demande_type.libelle FROM ".DB_PREFIXE."demande_type ORDER BY demande_type.libelle ASC";
126     }
127    
128     /**
129     *
130     * @return string
131     */
132     function get_var_sql_forminc__sql_demande_type_by_id() {
133     return "SELECT demande_type.demande_type, demande_type.libelle FROM ".DB_PREFIXE."demande_type WHERE demande_type = <idx>";
134     }
135    
136     /**
137     *
138     * @return string
139     */
140     function get_var_sql_forminc__sql_dossier_autorisation() {
141     return "SELECT dossier_autorisation.dossier_autorisation, dossier_autorisation.dossier_autorisation_type_detaille FROM ".DB_PREFIXE."dossier_autorisation ORDER BY dossier_autorisation.dossier_autorisation_type_detaille ASC";
142     }
143    
144     /**
145     *
146     * @return string
147     */
148     function get_var_sql_forminc__sql_dossier_autorisation_by_id() {
149     return "SELECT dossier_autorisation.dossier_autorisation, dossier_autorisation.dossier_autorisation_type_detaille FROM ".DB_PREFIXE."dossier_autorisation WHERE dossier_autorisation = '<idx>'";
150     }
151    
152     /**
153     *
154     * @return string
155     */
156     function get_var_sql_forminc__sql_dossier_autorisation_type_detaille() {
157     return "SELECT dossier_autorisation_type_detaille.dossier_autorisation_type_detaille, dossier_autorisation_type_detaille.libelle FROM ".DB_PREFIXE."dossier_autorisation_type_detaille ORDER BY dossier_autorisation_type_detaille.libelle ASC";
158     }
159    
160     /**
161     *
162     * @return string
163     */
164     function get_var_sql_forminc__sql_dossier_autorisation_type_detaille_by_id() {
165     return "SELECT dossier_autorisation_type_detaille.dossier_autorisation_type_detaille, dossier_autorisation_type_detaille.libelle FROM ".DB_PREFIXE."dossier_autorisation_type_detaille WHERE dossier_autorisation_type_detaille = <idx>";
166     }
167    
168     /**
169     *
170     * @return string
171     */
172     function get_var_sql_forminc__sql_dossier_instruction() {
173     return "SELECT dossier.dossier, dossier.annee FROM ".DB_PREFIXE."dossier ORDER BY dossier.annee ASC";
174     }
175    
176     /**
177     *
178     * @return string
179     */
180     function get_var_sql_forminc__sql_dossier_instruction_by_id() {
181     return "SELECT dossier.dossier, dossier.annee FROM ".DB_PREFIXE."dossier WHERE dossier = '<idx>'";
182     }
183    
184     /**
185     *
186     * @return string
187     */
188     function get_var_sql_forminc__sql_instruction_recepisse() {
189     return "SELECT instruction.instruction, instruction.destinataire FROM ".DB_PREFIXE."instruction ORDER BY instruction.destinataire ASC";
190     }
191    
192     /**
193     *
194     * @return string
195     */
196     function get_var_sql_forminc__sql_instruction_recepisse_by_id() {
197     return "SELECT instruction.instruction, instruction.destinataire FROM ".DB_PREFIXE."instruction WHERE instruction = <idx>";
198     }
199    
200     /**
201     *
202     * @return string
203     */
204     function get_var_sql_forminc__sql_om_collectivite() {
205     return "SELECT om_collectivite.om_collectivite, om_collectivite.libelle FROM ".DB_PREFIXE."om_collectivite ORDER BY om_collectivite.libelle ASC";
206     }
207    
208     /**
209     *
210     * @return string
211     */
212     function get_var_sql_forminc__sql_om_collectivite_by_id() {
213     return "SELECT om_collectivite.om_collectivite, om_collectivite.libelle FROM ".DB_PREFIXE."om_collectivite WHERE om_collectivite = <idx>";
214     }
215    
216    
217    
218    
219 softime 6929 function setvalF($val = array()) {
220 mbroquet 3730 //affectation valeur formulaire
221     if (!is_numeric($val['demande'])) {
222     $this->valF['demande'] = ""; // -> requis
223     } else {
224     $this->valF['demande'] = $val['demande'];
225     }
226     if (!is_numeric($val['dossier_autorisation_type_detaille'])) {
227     $this->valF['dossier_autorisation_type_detaille'] = ""; // -> requis
228     } else {
229     $this->valF['dossier_autorisation_type_detaille'] = $val['dossier_autorisation_type_detaille'];
230     }
231     if (!is_numeric($val['demande_type'])) {
232     $this->valF['demande_type'] = ""; // -> requis
233     } else {
234     $this->valF['demande_type'] = $val['demande_type'];
235     }
236     if ($val['dossier_instruction'] == "") {
237     $this->valF['dossier_instruction'] = NULL;
238     } else {
239     $this->valF['dossier_instruction'] = $val['dossier_instruction'];
240     }
241     if ($val['dossier_autorisation'] == "") {
242     $this->valF['dossier_autorisation'] = NULL;
243     } else {
244     $this->valF['dossier_autorisation'] = $val['dossier_autorisation'];
245     }
246     if ($val['date_demande'] != "") {
247     $this->valF['date_demande'] = $this->dateDB($val['date_demande']);
248     }
249     $this->valF['terrain_references_cadastrales'] = $val['terrain_references_cadastrales'];
250     if ($val['terrain_adresse_voie_numero'] == "") {
251     $this->valF['terrain_adresse_voie_numero'] = NULL;
252     } else {
253     $this->valF['terrain_adresse_voie_numero'] = $val['terrain_adresse_voie_numero'];
254     }
255     if ($val['terrain_adresse_voie'] == "") {
256     $this->valF['terrain_adresse_voie'] = NULL;
257     } else {
258     $this->valF['terrain_adresse_voie'] = $val['terrain_adresse_voie'];
259     }
260     if ($val['terrain_adresse_lieu_dit'] == "") {
261     $this->valF['terrain_adresse_lieu_dit'] = NULL;
262     } else {
263     $this->valF['terrain_adresse_lieu_dit'] = $val['terrain_adresse_lieu_dit'];
264     }
265     if ($val['terrain_adresse_localite'] == "") {
266     $this->valF['terrain_adresse_localite'] = NULL;
267     } else {
268     $this->valF['terrain_adresse_localite'] = $val['terrain_adresse_localite'];
269     }
270     if ($val['terrain_adresse_code_postal'] == "") {
271     $this->valF['terrain_adresse_code_postal'] = NULL;
272     } else {
273     $this->valF['terrain_adresse_code_postal'] = $val['terrain_adresse_code_postal'];
274     }
275     if ($val['terrain_adresse_bp'] == "") {
276     $this->valF['terrain_adresse_bp'] = NULL;
277     } else {
278     $this->valF['terrain_adresse_bp'] = $val['terrain_adresse_bp'];
279     }
280     if ($val['terrain_adresse_cedex'] == "") {
281     $this->valF['terrain_adresse_cedex'] = NULL;
282     } else {
283     $this->valF['terrain_adresse_cedex'] = $val['terrain_adresse_cedex'];
284     }
285     if (!is_numeric($val['terrain_superficie'])) {
286     $this->valF['terrain_superficie'] = NULL;
287     } else {
288     $this->valF['terrain_superficie'] = $val['terrain_superficie'];
289     }
290     if (!is_numeric($val['instruction_recepisse'])) {
291     $this->valF['instruction_recepisse'] = NULL;
292     } else {
293     $this->valF['instruction_recepisse'] = $val['instruction_recepisse'];
294     }
295     if (!is_numeric($val['arrondissement'])) {
296     $this->valF['arrondissement'] = NULL;
297     } else {
298     $this->valF['arrondissement'] = $val['arrondissement'];
299     }
300     if (!is_numeric($val['om_collectivite'])) {
301     $this->valF['om_collectivite'] = ""; // -> requis
302     } else {
303     if($_SESSION['niveau']==1) {
304     $this->valF['om_collectivite'] = $_SESSION['collectivite'];
305     } else {
306     $this->valF['om_collectivite'] = $val['om_collectivite'];
307     }
308     }
309 softime 6565 if ($val['autorisation_contestee'] == "") {
310     $this->valF['autorisation_contestee'] = NULL;
311     } else {
312     $this->valF['autorisation_contestee'] = $val['autorisation_contestee'];
313     }
314 softime 8329 if ($val['depot_electronique'] == 1 || $val['depot_electronique'] == "t" || $val['depot_electronique'] == "Oui") {
315     $this->valF['depot_electronique'] = true;
316     } else {
317     $this->valF['depot_electronique'] = false;
318     }
319     if ($val['parcelle_temporaire'] == 1 || $val['parcelle_temporaire'] == "t" || $val['parcelle_temporaire'] == "Oui") {
320     $this->valF['parcelle_temporaire'] = true;
321     } else {
322     $this->valF['parcelle_temporaire'] = false;
323     }
324 softime 9560 if (!is_numeric($val['commune'])) {
325     $this->valF['commune'] = NULL;
326     } else {
327     $this->valF['commune'] = $val['commune'];
328     }
329 mbroquet 3730 }
330    
331     //=================================================
332     //cle primaire automatique [automatic primary key]
333     //==================================================
334    
335 softime 7685 function setId(&$dnu1 = null) {
336 mbroquet 3730 //numero automatique
337     $this->valF[$this->clePrimaire] = $this->f->db->nextId(DB_PREFIXE.$this->table);
338     }
339    
340 softime 7685 function setValFAjout($val = array()) {
341 mbroquet 3730 //numero automatique -> pas de controle ajout cle primaire
342     }
343    
344 softime 7685 function verifierAjout($val = array(), &$dnu1 = null) {
345 mbroquet 3730 //numero automatique -> pas de verfication de cle primaire
346     }
347    
348     //==========================
349     // Formulaire [form]
350     //==========================
351     /**
352     *
353     */
354     function setType(&$form, $maj) {
355     // Récupération du mode de l'action
356     $crud = $this->get_action_crud($maj);
357    
358     // MODE AJOUTER
359     if ($maj == 0 || $crud == 'create') {
360     $form->setType("demande", "hidden");
361     if ($this->is_in_context_of_foreign_key("dossier_autorisation_type_detaille", $this->retourformulaire)) {
362     $form->setType("dossier_autorisation_type_detaille", "selecthiddenstatic");
363     } else {
364     $form->setType("dossier_autorisation_type_detaille", "select");
365     }
366     if ($this->is_in_context_of_foreign_key("demande_type", $this->retourformulaire)) {
367     $form->setType("demande_type", "selecthiddenstatic");
368     } else {
369     $form->setType("demande_type", "select");
370     }
371     if ($this->is_in_context_of_foreign_key("dossier", $this->retourformulaire)) {
372     $form->setType("dossier_instruction", "selecthiddenstatic");
373     } else {
374     $form->setType("dossier_instruction", "select");
375     }
376     if ($this->is_in_context_of_foreign_key("dossier_autorisation", $this->retourformulaire)) {
377     $form->setType("dossier_autorisation", "selecthiddenstatic");
378     } else {
379     $form->setType("dossier_autorisation", "select");
380     }
381     $form->setType("date_demande", "date");
382     $form->setType("terrain_references_cadastrales", "textarea");
383     $form->setType("terrain_adresse_voie_numero", "text");
384     $form->setType("terrain_adresse_voie", "text");
385     $form->setType("terrain_adresse_lieu_dit", "text");
386     $form->setType("terrain_adresse_localite", "text");
387     $form->setType("terrain_adresse_code_postal", "text");
388     $form->setType("terrain_adresse_bp", "text");
389     $form->setType("terrain_adresse_cedex", "text");
390     $form->setType("terrain_superficie", "text");
391     if ($this->is_in_context_of_foreign_key("instruction", $this->retourformulaire)) {
392     $form->setType("instruction_recepisse", "selecthiddenstatic");
393     } else {
394     $form->setType("instruction_recepisse", "select");
395     }
396     if ($this->is_in_context_of_foreign_key("arrondissement", $this->retourformulaire)) {
397     $form->setType("arrondissement", "selecthiddenstatic");
398     } else {
399     $form->setType("arrondissement", "select");
400     }
401     if ($this->is_in_context_of_foreign_key("om_collectivite", $this->retourformulaire)) {
402     if($_SESSION["niveau"] == 2) {
403     $form->setType("om_collectivite", "selecthiddenstatic");
404     } else {
405     $form->setType("om_collectivite", "hidden");
406     }
407     } else {
408     if($_SESSION["niveau"] == 2) {
409     $form->setType("om_collectivite", "select");
410     } else {
411     $form->setType("om_collectivite", "hidden");
412     }
413     }
414 softime 6565 if ($this->is_in_context_of_foreign_key("dossier", $this->retourformulaire)) {
415     $form->setType("autorisation_contestee", "selecthiddenstatic");
416     } else {
417     $form->setType("autorisation_contestee", "select");
418     }
419 softime 8329 $form->setType("depot_electronique", "checkbox");
420     $form->setType("parcelle_temporaire", "checkbox");
421 softime 9560 if ($this->is_in_context_of_foreign_key("commune", $this->retourformulaire)) {
422     $form->setType("commune", "selecthiddenstatic");
423     } else {
424     $form->setType("commune", "select");
425     }
426 mbroquet 3730 }
427    
428     // MDOE MODIFIER
429     if ($maj == 1 || $crud == 'update') {
430     $form->setType("demande", "hiddenstatic");
431     if ($this->is_in_context_of_foreign_key("dossier_autorisation_type_detaille", $this->retourformulaire)) {
432     $form->setType("dossier_autorisation_type_detaille", "selecthiddenstatic");
433     } else {
434     $form->setType("dossier_autorisation_type_detaille", "select");
435     }
436     if ($this->is_in_context_of_foreign_key("demande_type", $this->retourformulaire)) {
437     $form->setType("demande_type", "selecthiddenstatic");
438     } else {
439     $form->setType("demande_type", "select");
440     }
441     if ($this->is_in_context_of_foreign_key("dossier", $this->retourformulaire)) {
442     $form->setType("dossier_instruction", "selecthiddenstatic");
443     } else {
444     $form->setType("dossier_instruction", "select");
445     }
446     if ($this->is_in_context_of_foreign_key("dossier_autorisation", $this->retourformulaire)) {
447     $form->setType("dossier_autorisation", "selecthiddenstatic");
448     } else {
449     $form->setType("dossier_autorisation", "select");
450     }
451     $form->setType("date_demande", "date");
452     $form->setType("terrain_references_cadastrales", "textarea");
453     $form->setType("terrain_adresse_voie_numero", "text");
454     $form->setType("terrain_adresse_voie", "text");
455     $form->setType("terrain_adresse_lieu_dit", "text");
456     $form->setType("terrain_adresse_localite", "text");
457     $form->setType("terrain_adresse_code_postal", "text");
458     $form->setType("terrain_adresse_bp", "text");
459     $form->setType("terrain_adresse_cedex", "text");
460     $form->setType("terrain_superficie", "text");
461     if ($this->is_in_context_of_foreign_key("instruction", $this->retourformulaire)) {
462     $form->setType("instruction_recepisse", "selecthiddenstatic");
463     } else {
464     $form->setType("instruction_recepisse", "select");
465     }
466     if ($this->is_in_context_of_foreign_key("arrondissement", $this->retourformulaire)) {
467     $form->setType("arrondissement", "selecthiddenstatic");
468     } else {
469     $form->setType("arrondissement", "select");
470     }
471     if ($this->is_in_context_of_foreign_key("om_collectivite", $this->retourformulaire)) {
472     if($_SESSION["niveau"] == 2) {
473     $form->setType("om_collectivite", "selecthiddenstatic");
474     } else {
475     $form->setType("om_collectivite", "hidden");
476     }
477     } else {
478     if($_SESSION["niveau"] == 2) {
479     $form->setType("om_collectivite", "select");
480     } else {
481     $form->setType("om_collectivite", "hidden");
482     }
483     }
484 softime 6565 if ($this->is_in_context_of_foreign_key("dossier", $this->retourformulaire)) {
485     $form->setType("autorisation_contestee", "selecthiddenstatic");
486     } else {
487     $form->setType("autorisation_contestee", "select");
488     }
489 softime 8329 $form->setType("depot_electronique", "checkbox");
490     $form->setType("parcelle_temporaire", "checkbox");
491 softime 9560 if ($this->is_in_context_of_foreign_key("commune", $this->retourformulaire)) {
492     $form->setType("commune", "selecthiddenstatic");
493     } else {
494     $form->setType("commune", "select");
495     }
496 mbroquet 3730 }
497    
498     // MODE SUPPRIMER
499     if ($maj == 2 || $crud == 'delete') {
500     $form->setType("demande", "hiddenstatic");
501     $form->setType("dossier_autorisation_type_detaille", "selectstatic");
502     $form->setType("demande_type", "selectstatic");
503     $form->setType("dossier_instruction", "selectstatic");
504     $form->setType("dossier_autorisation", "selectstatic");
505     $form->setType("date_demande", "hiddenstatic");
506     $form->setType("terrain_references_cadastrales", "hiddenstatic");
507     $form->setType("terrain_adresse_voie_numero", "hiddenstatic");
508     $form->setType("terrain_adresse_voie", "hiddenstatic");
509     $form->setType("terrain_adresse_lieu_dit", "hiddenstatic");
510     $form->setType("terrain_adresse_localite", "hiddenstatic");
511     $form->setType("terrain_adresse_code_postal", "hiddenstatic");
512     $form->setType("terrain_adresse_bp", "hiddenstatic");
513     $form->setType("terrain_adresse_cedex", "hiddenstatic");
514     $form->setType("terrain_superficie", "hiddenstatic");
515     $form->setType("instruction_recepisse", "selectstatic");
516     $form->setType("arrondissement", "selectstatic");
517     if ($_SESSION["niveau"] == 2) {
518     $form->setType("om_collectivite", "selectstatic");
519     } else {
520     $form->setType("om_collectivite", "hidden");
521     }
522 softime 6565 $form->setType("autorisation_contestee", "selectstatic");
523 softime 8329 $form->setType("depot_electronique", "hiddenstatic");
524     $form->setType("parcelle_temporaire", "hiddenstatic");
525 softime 9560 $form->setType("commune", "selectstatic");
526 mbroquet 3730 }
527    
528     // MODE CONSULTER
529     if ($maj == 3 || $crud == 'read') {
530     $form->setType("demande", "static");
531     $form->setType("dossier_autorisation_type_detaille", "selectstatic");
532     $form->setType("demande_type", "selectstatic");
533     $form->setType("dossier_instruction", "selectstatic");
534     $form->setType("dossier_autorisation", "selectstatic");
535     $form->setType("date_demande", "datestatic");
536     $form->setType("terrain_references_cadastrales", "textareastatic");
537     $form->setType("terrain_adresse_voie_numero", "static");
538     $form->setType("terrain_adresse_voie", "static");
539     $form->setType("terrain_adresse_lieu_dit", "static");
540     $form->setType("terrain_adresse_localite", "static");
541     $form->setType("terrain_adresse_code_postal", "static");
542     $form->setType("terrain_adresse_bp", "static");
543     $form->setType("terrain_adresse_cedex", "static");
544     $form->setType("terrain_superficie", "static");
545     $form->setType("instruction_recepisse", "selectstatic");
546     $form->setType("arrondissement", "selectstatic");
547     if ($this->is_in_context_of_foreign_key("om_collectivite", $this->retourformulaire)) {
548     if($_SESSION["niveau"] == 2) {
549     $form->setType("om_collectivite", "selectstatic");
550     } else {
551     $form->setType("om_collectivite", "hidden");
552     }
553     } else {
554     if($_SESSION["niveau"] == 2) {
555     $form->setType("om_collectivite", "selectstatic");
556     } else {
557     $form->setType("om_collectivite", "hidden");
558     }
559     }
560 softime 6565 $form->setType("autorisation_contestee", "selectstatic");
561 softime 8329 $form->setType("depot_electronique", "checkboxstatic");
562     $form->setType("parcelle_temporaire", "checkboxstatic");
563 softime 9560 $form->setType("commune", "selectstatic");
564 mbroquet 3730 }
565    
566     }
567    
568    
569     function setOnchange(&$form, $maj) {
570     //javascript controle client
571     $form->setOnchange('demande','VerifNum(this)');
572     $form->setOnchange('dossier_autorisation_type_detaille','VerifNum(this)');
573     $form->setOnchange('demande_type','VerifNum(this)');
574     $form->setOnchange('date_demande','fdate(this)');
575     $form->setOnchange('terrain_superficie','VerifFloat(this)');
576     $form->setOnchange('instruction_recepisse','VerifNum(this)');
577     $form->setOnchange('arrondissement','VerifNum(this)');
578     $form->setOnchange('om_collectivite','VerifNum(this)');
579 softime 9560 $form->setOnchange('commune','VerifNum(this)');
580 mbroquet 3730 }
581     /**
582     * Methode setTaille
583     */
584     function setTaille(&$form, $maj) {
585     $form->setTaille("demande", 11);
586     $form->setTaille("dossier_autorisation_type_detaille", 11);
587     $form->setTaille("demande_type", 11);
588     $form->setTaille("dossier_instruction", 30);
589 softime 9814 $form->setTaille("dossier_autorisation", 30);
590 mbroquet 3730 $form->setTaille("date_demande", 12);
591     $form->setTaille("terrain_references_cadastrales", 80);
592     $form->setTaille("terrain_adresse_voie_numero", 20);
593     $form->setTaille("terrain_adresse_voie", 30);
594     $form->setTaille("terrain_adresse_lieu_dit", 30);
595     $form->setTaille("terrain_adresse_localite", 30);
596     $form->setTaille("terrain_adresse_code_postal", 10);
597     $form->setTaille("terrain_adresse_bp", 15);
598     $form->setTaille("terrain_adresse_cedex", 15);
599     $form->setTaille("terrain_superficie", 20);
600     $form->setTaille("instruction_recepisse", 11);
601     $form->setTaille("arrondissement", 11);
602     $form->setTaille("om_collectivite", 11);
603 softime 6565 $form->setTaille("autorisation_contestee", 30);
604 softime 8329 $form->setTaille("depot_electronique", 1);
605     $form->setTaille("parcelle_temporaire", 1);
606 softime 9560 $form->setTaille("commune", 11);
607 mbroquet 3730 }
608    
609     /**
610     * Methode setMax
611     */
612     function setMax(&$form, $maj) {
613     $form->setMax("demande", 11);
614     $form->setMax("dossier_autorisation_type_detaille", 11);
615     $form->setMax("demande_type", 11);
616 softime 9814 $form->setMax("dossier_instruction", 255);
617     $form->setMax("dossier_autorisation", 255);
618 mbroquet 3730 $form->setMax("date_demande", 12);
619     $form->setMax("terrain_references_cadastrales", 6);
620     $form->setMax("terrain_adresse_voie_numero", 20);
621     $form->setMax("terrain_adresse_voie", 30);
622     $form->setMax("terrain_adresse_lieu_dit", 30);
623     $form->setMax("terrain_adresse_localite", 30);
624     $form->setMax("terrain_adresse_code_postal", 5);
625     $form->setMax("terrain_adresse_bp", 15);
626     $form->setMax("terrain_adresse_cedex", 15);
627     $form->setMax("terrain_superficie", 20);
628     $form->setMax("instruction_recepisse", 11);
629     $form->setMax("arrondissement", 11);
630     $form->setMax("om_collectivite", 11);
631 softime 6565 $form->setMax("autorisation_contestee", 30);
632 softime 8329 $form->setMax("depot_electronique", 1);
633     $form->setMax("parcelle_temporaire", 1);
634 softime 9560 $form->setMax("commune", 11);
635 mbroquet 3730 }
636    
637    
638     function setLib(&$form, $maj) {
639     //libelle des champs
640 softime 7996 $form->setLib('demande', __('demande'));
641     $form->setLib('dossier_autorisation_type_detaille', __('dossier_autorisation_type_detaille'));
642     $form->setLib('demande_type', __('demande_type'));
643     $form->setLib('dossier_instruction', __('dossier_instruction'));
644     $form->setLib('dossier_autorisation', __('dossier_autorisation'));
645     $form->setLib('date_demande', __('date_demande'));
646     $form->setLib('terrain_references_cadastrales', __('terrain_references_cadastrales'));
647     $form->setLib('terrain_adresse_voie_numero', __('terrain_adresse_voie_numero'));
648     $form->setLib('terrain_adresse_voie', __('terrain_adresse_voie'));
649     $form->setLib('terrain_adresse_lieu_dit', __('terrain_adresse_lieu_dit'));
650     $form->setLib('terrain_adresse_localite', __('terrain_adresse_localite'));
651     $form->setLib('terrain_adresse_code_postal', __('terrain_adresse_code_postal'));
652     $form->setLib('terrain_adresse_bp', __('terrain_adresse_bp'));
653     $form->setLib('terrain_adresse_cedex', __('terrain_adresse_cedex'));
654     $form->setLib('terrain_superficie', __('terrain_superficie'));
655     $form->setLib('instruction_recepisse', __('instruction_recepisse'));
656     $form->setLib('arrondissement', __('arrondissement'));
657     $form->setLib('om_collectivite', __('om_collectivite'));
658     $form->setLib('autorisation_contestee', __('autorisation_contestee'));
659 softime 8329 $form->setLib('depot_electronique', __('depot_electronique'));
660     $form->setLib('parcelle_temporaire', __('parcelle_temporaire'));
661 softime 9560 $form->setLib('commune', __('commune'));
662 mbroquet 3730 }
663     /**
664     *
665     */
666     function setSelect(&$form, $maj, &$dnu1 = null, $dnu2 = null) {
667    
668     // arrondissement
669 softime 7996 $this->init_select(
670     $form,
671     $this->f->db,
672     $maj,
673     null,
674     "arrondissement",
675     $this->get_var_sql_forminc__sql("arrondissement"),
676     $this->get_var_sql_forminc__sql("arrondissement_by_id"),
677     false
678     );
679 softime 6565 // autorisation_contestee
680 softime 7996 $this->init_select(
681     $form,
682     $this->f->db,
683     $maj,
684     null,
685     "autorisation_contestee",
686     $this->get_var_sql_forminc__sql("autorisation_contestee"),
687     $this->get_var_sql_forminc__sql("autorisation_contestee_by_id"),
688     false
689     );
690 softime 9560 // commune
691     $this->init_select(
692     $form,
693     $this->f->db,
694     $maj,
695     null,
696     "commune",
697     $this->get_var_sql_forminc__sql("commune"),
698     $this->get_var_sql_forminc__sql("commune_by_id"),
699     true
700     );
701 mbroquet 3730 // demande_type
702 softime 7996 $this->init_select(
703     $form,
704     $this->f->db,
705     $maj,
706     null,
707     "demande_type",
708     $this->get_var_sql_forminc__sql("demande_type"),
709     $this->get_var_sql_forminc__sql("demande_type_by_id"),
710     false
711     );
712 mbroquet 3730 // dossier_autorisation
713 softime 7996 $this->init_select(
714     $form,
715     $this->f->db,
716     $maj,
717     null,
718     "dossier_autorisation",
719     $this->get_var_sql_forminc__sql("dossier_autorisation"),
720     $this->get_var_sql_forminc__sql("dossier_autorisation_by_id"),
721     false
722     );
723 mbroquet 3730 // dossier_autorisation_type_detaille
724 softime 7996 $this->init_select(
725     $form,
726     $this->f->db,
727     $maj,
728     null,
729     "dossier_autorisation_type_detaille",
730     $this->get_var_sql_forminc__sql("dossier_autorisation_type_detaille"),
731     $this->get_var_sql_forminc__sql("dossier_autorisation_type_detaille_by_id"),
732     false
733     );
734 mbroquet 3730 // dossier_instruction
735 softime 7996 $this->init_select(
736     $form,
737     $this->f->db,
738     $maj,
739     null,
740     "dossier_instruction",
741     $this->get_var_sql_forminc__sql("dossier_instruction"),
742     $this->get_var_sql_forminc__sql("dossier_instruction_by_id"),
743     false
744     );
745 mbroquet 3730 // instruction_recepisse
746 softime 7996 $this->init_select(
747     $form,
748     $this->f->db,
749     $maj,
750     null,
751     "instruction_recepisse",
752     $this->get_var_sql_forminc__sql("instruction_recepisse"),
753     $this->get_var_sql_forminc__sql("instruction_recepisse_by_id"),
754     false
755     );
756 mbroquet 3730 // om_collectivite
757 softime 7996 $this->init_select(
758     $form,
759     $this->f->db,
760     $maj,
761     null,
762     "om_collectivite",
763     $this->get_var_sql_forminc__sql("om_collectivite"),
764     $this->get_var_sql_forminc__sql("om_collectivite_by_id"),
765     false
766     );
767 mbroquet 3730 }
768    
769    
770 softime 7685 function setVal(&$form, $maj, $validation, &$dnu1 = null, $dnu2 = null) {
771 mbroquet 3730 if($validation==0 and $maj==0 and $_SESSION['niveau']==1) {
772     $form->setVal('om_collectivite', $_SESSION['collectivite']);
773     }// fin validation
774     $this->set_form_default_values($form, $maj, $validation);
775     }// fin setVal
776    
777     //==================================
778 softime 7685 // sous Formulaire
779 mbroquet 3730 //==================================
780    
781    
782 softime 7685 function setValsousformulaire(&$form, $maj, $validation, $idxformulaire, $retourformulaire, $typeformulaire, &$dnu1 = null, $dnu2 = null) {
783 mbroquet 3730 $this->retourformulaire = $retourformulaire;
784     if($validation==0 and $maj==0 and $_SESSION['niveau']==1) {
785     $form->setVal('om_collectivite', $_SESSION['collectivite']);
786     }// fin validation
787     if($validation == 0) {
788     if($this->is_in_context_of_foreign_key('arrondissement', $this->retourformulaire))
789     $form->setVal('arrondissement', $idxformulaire);
790 softime 9560 if($this->is_in_context_of_foreign_key('commune', $this->retourformulaire))
791     $form->setVal('commune', $idxformulaire);
792 mbroquet 3730 if($this->is_in_context_of_foreign_key('demande_type', $this->retourformulaire))
793     $form->setVal('demande_type', $idxformulaire);
794     if($this->is_in_context_of_foreign_key('dossier_autorisation', $this->retourformulaire))
795     $form->setVal('dossier_autorisation', $idxformulaire);
796     if($this->is_in_context_of_foreign_key('dossier_autorisation_type_detaille', $this->retourformulaire))
797     $form->setVal('dossier_autorisation_type_detaille', $idxformulaire);
798     if($this->is_in_context_of_foreign_key('instruction', $this->retourformulaire))
799     $form->setVal('instruction_recepisse', $idxformulaire);
800     if($this->is_in_context_of_foreign_key('om_collectivite', $this->retourformulaire))
801     $form->setVal('om_collectivite', $idxformulaire);
802     }// fin validation
803 softime 6565 if ($validation == 0 and $maj == 0) {
804     if($this->is_in_context_of_foreign_key('dossier', $this->retourformulaire))
805     $form->setVal('autorisation_contestee', $idxformulaire);
806     if($this->is_in_context_of_foreign_key('dossier', $this->retourformulaire))
807     $form->setVal('dossier_instruction', $idxformulaire);
808     }// fin validation
809 mbroquet 3730 $this->set_form_default_values($form, $maj, $validation);
810     }// fin setValsousformulaire
811    
812     //==================================
813 softime 7685 // cle secondaire
814 mbroquet 3730 //==================================
815    
816     /**
817     * Methode clesecondaire
818     */
819 softime 7685 function cleSecondaire($id, &$dnu1 = null, $val = array(), $dnu2 = null) {
820 mbroquet 3730 // On appelle la methode de la classe parent
821     parent::cleSecondaire($id);
822     // Verification de la cle secondaire : lien_demande_demandeur
823     $this->rechercheTable($this->f->db, "lien_demande_demandeur", "demande", $id);
824     }
825    
826    
827     }

Properties

Name Value
svn:keywords "Id"

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26