/[openfoncier]/trunk/obj/donnees_techniques.class.php
ViewVC logotype

Annotation of /trunk/obj/donnees_techniques.class.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2109 - (hide annotations)
Mon Jul 22 14:13:01 2013 UTC (11 years, 6 months ago) by vpihour
File size: 31930 byte(s)
Correction d'un bug lors de la saisie des données techniques

1 vpihour 1249 <?php
2     //$Id$
3     //gen openMairie le 13/02/2013 14:41
4    
5     require_once ("../gen/obj/donnees_techniques.class.php");
6    
7     class donnees_techniques extends donnees_techniques_gen {
8    
9 nhaye 1262 var $cerfa; // Instance de la classe cerfa
10    
11 vpihour 1249 function donnees_techniques($id,&$db,$debug) {
12     $this->constructeur($id,$db,$debug);
13     }// fin constructeur
14    
15 nhaye 1262 /**
16     * Méthode permettant de récupérer l'id du cerfa lié au dossier
17     **/
18     function getCerfa(){
19 nhaye 1270 if($this->getParameter("retourformulaire") == "lot") {
20     $sql = "SELECT cerfa_lot FROM ".DB_PREFIXE."dossier_instruction_type
21     JOIN ".DB_PREFIXE."dossier ON dossier.dossier_instruction_type=
22     dossier_instruction_type.dossier_instruction_type
23 nhaye 2082 JOIN ".DB_PREFIXE."lot ON dossier.dossier=lot.dossier
24     WHERE lot.lot = ".$this->getParameter("idxformulaire");
25 nhaye 1263
26 nhaye 1268 } else {
27 nhaye 1270 $sql = "SELECT cerfa FROM ".DB_PREFIXE."dossier_instruction_type
28 nhaye 1263 JOIN ".DB_PREFIXE."dossier ON dossier.dossier_instruction_type=
29     dossier_instruction_type.dossier_instruction_type
30 nhaye 1270 WHERE dossier = '";
31     $sql .= $this->getParameter("idxformulaire")."'";
32     }
33 nhaye 1268
34 nhaye 1262 $cerfa = $this->db->getOne($sql);
35 vpihour 1777 $this->f->addToLog("getCerfa() : db->getone(\"".$sql."\");", VERBOSE_MODE);
36     if ( database::isError($cerfa)){
37     die();
38     }
39 nhaye 1262
40     // Si le cerfa est défini dans dossier on instancie le cerfa correspondant
41     if(!empty($cerfa)) {
42     require_once ("../obj/cerfa.class.php");
43     $this->cerfa = new cerfa($cerfa, $this->db, DEBUG);
44 vpihour 2042 //On vérifie que le cerfa est en cours de validité
45     $date_debut = new DateTime($this->cerfa->getVal("om_validite_debut"));
46     $date_debut = $date_debut->format('Ymd');
47    
48     $date_fin = new DateTime($this->cerfa->getVal("om_validite_fin"));
49     $date_fin = $date_fin->format('Ymd');
50    
51     $date_aujourdhui = date('Ymd');
52    
53     // Teste si le cerfa est en cours de validité
54 vpihour 2109 $is_encours = true;
55 vpihour 2042 if ( $date_aujourdhui < $date_debut || $date_aujourdhui > $date_fin ){
56 vpihour 2109 $is_encours = false;
57 vpihour 2042 }
58    
59     //Si le cerfa n'est pas en cours de validité, on affiche pas le formulaire
60     //et on affiche un message d'erreur
61 vpihour 2109 if ( $is_encours == false){
62 vpihour 2042 $this->f->displayMessage("error", _("Aucun cerfa en cours de validite lie a ce dossier"));
63     die();
64     }
65 nhaye 1263 } else {
66 fmichon 1316 $this->f->displayMessage("error", _("Aucun cerfa lie a ce type de dossier"));
67 nhaye 1263 die();
68 nhaye 1262 }
69     }
70    
71 nhaye 1268 /**
72     * Méthode permettant de vérifier si le tableau passé en parametre est défini
73     * dans la table des cerfa
74     */
75    
76     function setTabSelect($tab, $idchamp) {
77     // Test si un tableau de surface a été défini
78     if ( $this->cerfa->getVal($idchamp) != "" ){
79    
80     // Configuration du tableau des surfaces
81     $contenu['column_header']=$tab[$this->cerfa->getVal($idchamp)]['column_header'];
82     $contenu['row_header']=$tab[$this->cerfa->getVal($idchamp)]['row_header'];
83    
84     foreach($tab[$this->cerfa->getVal($idchamp)]['values'] as $champ) {
85     $contenu['values'][$champ] = $this->getVal($champ);
86     }
87    
88     $this->form->setSelect($idchamp,$contenu);
89     }
90     }
91    
92    
93 nhaye 1262 function setSelect(&$form, $maj,&$db,$debug) {
94     parent::setSelect($form, $maj,$db,$debug);
95     if(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc.php"))
96     include ("../sql/".$db->phptype."/".$this->table.".form.inc.php");
97     elseif(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc"))
98     include ("../sql/".$db->phptype."/".$this->table.".form.inc");
99    
100     if(empty($this->cerfa)) {
101     $this->getCerfa();
102     }
103    
104 nhaye 1268 $this->setTabSelect($tab_surface, "tab_surface");
105     $this->setTabSelect($tab_tax_su_princ, "tab_tax_su_princ");
106     $this->setTabSelect($tab_tax_su_heber, "tab_tax_su_heber");
107     $this->setTabSelect($tab_tax_su_secon, "tab_tax_su_secon");
108     $this->setTabSelect($tab_tax_su_tot, "tab_tax_su_tot");
109 nhaye 1269 $this->setTabSelect($tab_tax_su_tot, "tab_tax_su_non_habit_surf");
110 nhaye 1268 $this->setTabSelect($tab_tax_am, "tab_tax_am");
111 nhaye 1616
112     // Définition des champs Oui/Non/Je ne sais pas
113     $value[] = array("nesaispas","oui","non");
114     $value[] = array(_("Je ne sais pas"),_("Oui"),_("Non"));
115    
116     $form->setSelect('terr_juri_titul',$value);
117     $form->setSelect('terr_juri_lot',$value);
118     $form->setSelect('terr_juri_zac',$value);
119     $form->setSelect('terr_juri_afu',$value);
120     $form->setSelect('terr_juri_pup',$value);
121     $form->setSelect('terr_juri_oin',$value);
122     $form->setSelect('terr_juri_desc',$value);
123     $form->setSelect('terr_div_surf_etab',$value);
124     $form->setSelect('terr_div_surf_av_div',$value);
125 nhaye 1262
126     }
127    
128    
129     // XXX Créer une nouvelle méthode au même endroit que l'appel a checkAccessibility()
130     function checkAccessibility() {
131 nhaye 1268 if(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php"))
132     include ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php");
133     elseif(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc"))
134     include ("../sql/".$this->db->phptype."/".$this->table.".form.inc");
135     if(empty($this->cerfa)) {
136     $this->getCerfa();
137     }
138 nhaye 1262
139 nhaye 1397 $id_tab_surface = $this->cerfa->getVal("tab_surface");
140     $id_tab_tax_su_princ = $this->cerfa->getVal("tab_tax_su_princ");
141     $id_tab_tax_su_heber = $this->cerfa->getVal("tab_tax_su_heber");
142     $id_tab_tax_su_secon = $this->cerfa->getVal("tab_tax_su_secon");
143     $id_tab_tax_su_tot = $this->cerfa->getVal("tab_tax_su_tot");
144     $id_tab_tax_su_non_habit_surf = $this->cerfa->getVal("tab_tax_su_non_habit_surf");
145     $id_tab_tax_am = $this->cerfa->getVal("tab_tax_am");
146    
147 nhaye 1268 //Suppression des champs de tableaux
148 nhaye 1397 if(!empty($id_tab_surface)) {
149     foreach($tab_surface[$this->cerfa->getVal("tab_surface")]['values'] as $champ) {
150     unset($this->champs[array_search($champ,$this->champs)]);
151     }
152 nhaye 1268 }
153 nhaye 1397 if(!empty($id_tab_tax_su_princ)) {
154     foreach($tab_tax_su_princ[$this->cerfa->getVal("tab_tax_su_princ")]['values'] as $champ) {
155     unset($this->champs[array_search($champ,$this->champs)]);
156     }
157 nhaye 1394 }
158 nhaye 1397 if(!empty($id_tab_tax_su_heber)) {
159     foreach($tab_tax_su_heber[$this->cerfa->getVal("tab_tax_su_heber")]['values'] as $champ) {
160     unset($this->champs[array_search($champ,$this->champs)]);
161     }
162 nhaye 1394 }
163 nhaye 1397 if(!empty($id_tab_tax_su_secon)) {
164     foreach($tab_tax_su_secon[$this->cerfa->getVal("tab_tax_su_secon")]['values'] as $champ) {
165     unset($this->champs[array_search($champ,$this->champs)]);
166     }
167 nhaye 1394 }
168 nhaye 1397 if(!empty($id_tab_tax_su_tot)) {
169     foreach($tab_tax_su_tot[$this->cerfa->getVal("tab_tax_su_tot")]['values'] as $champ) {
170     unset($this->champs[array_search($champ,$this->champs)]);
171     }
172 nhaye 1394 }
173 nhaye 1397 if(!empty($id_tab_tax_su_non_habit_surf)) {
174     foreach($tab_tax_su_non_habit_surf[$this->cerfa->getVal("tab_tax_su_non_habit_surf")]['values'] as $champ) {
175     unset($this->champs[array_search($champ,$this->champs)]);
176     }
177 nhaye 1394 }
178 nhaye 1397 if(!empty($id_tab_tax_am)) {
179     foreach($tab_tax_am[$this->cerfa->getVal("tab_tax_am")]['values'] as $champ) {
180     unset($this->champs[array_search($champ,$this->champs)]);
181     }
182 nhaye 1394 }
183 nhaye 1262 // Renumérotation
184     $this->champs = array_values($this->champs);
185 vpihour 1978
186     $idxformulaire = $this->getParameter("idxformulaire");
187     //Si le dossier d'instruction auquel sont rattachées les données techniques
188     //est cloturé, on affiche pas le lien de modification du portlet
189     if ( $idxformulaire != '' ){
190    
191     //On récuppère le statut du dossier d'instruction
192 vpihour 2039 $statut = $this->f->getStatutDossier($idxformulaire);
193 vpihour 1978 if ( $this->f->isUserInstructeur() && $statut == "cloture" ){
194    
195     //On cache le lien de modification
196     $this->parameters["actions"]["modifier"] = NULL;
197     }
198     }
199 nhaye 1262 }
200 vpihour 1978
201 nhaye 1269 /**
202 vpihour 1978 * Cette methode est à surcharger elle permet de tester dans chaque classe
203     * des droits spécifiques en fonction des données
204     */
205     function canAccess() {
206     // Si l'utilisateur est un instructeur et que le dossier est cloturé
207     if ( $this->f->isUserInstructeur() &&
208 vpihour 2039 $this->f->getStatutDossier($this->getParameter("idxformulaire")) == "cloture"
209 vpihour 1978 && $this->getParameter("maj") != 3) {
210    
211     return false;
212     }
213     //
214     return true;
215     }
216    
217     /**
218 nhaye 1269 * Méthode permettant de définir le type des différents tableaux en fonction
219     * des valeurs du cerfa
220     **/
221     function setTabType($tab) {
222     // Définition du type "tableau"
223     if ( $this->cerfa->getVal($tab) != "" ){
224    
225     $this->form->setType($tab,'tableau');
226     }
227     //Le chache si non défini
228     else {
229    
230     $this->form->setType($tab,'hidden');
231     }
232     }
233    
234 nhaye 1394 /**
235     * Méthode permettant de définir le type des champs des tableaux en fonction
236     * des valeurs du cerfa
237     **/
238     function setTabChampType($tab) {
239     if(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php"))
240     include ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php");
241     elseif(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc"))
242     include ("../sql/".$this->db->phptype."/".$this->table.".form.inc");
243     // Pour chaque champ dans la liste des champs du cerfa
244     $tableau = $$tab;
245 nhaye 1566
246 nhaye 1394 foreach ($this->champs as $champ) {
247     if(array_search($champ, $this->cerfa->champs) !== false) {
248     // On les cache si décoché dans le formulaire de cerfa
249     if($this->cerfa->getVal($champ) == 'f') {
250     $this->form->setType($champ,'hidden');
251     }
252     } else {
253    
254     if(!in_array($champ, $tableau[$this->cerfa->getVal($tab)]['values'])) {
255    
256     $this->form->setType($champ,'hidden');
257     }
258     }
259     }
260     }
261    
262    
263    
264 nhaye 1262 function setType(&$form,$maj) {
265     parent::setType($form,$maj);
266    
267     if(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php"))
268     include ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php");
269     elseif(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc"))
270     include ("../sql/".$this->db->phptype."/".$this->table.".form.inc");
271    
272     if(empty($this->cerfa)) {
273     $this->getCerfa();
274     }
275    
276 nhaye 1269 $this->setTabType("tab_surface");
277     $this->setTabType("tab_tax_su_princ");
278     $this->setTabType("tab_tax_su_heber");
279     $this->setTabType("tab_tax_su_secon");
280     $this->setTabType("tab_tax_su_tot");
281     $this->setTabType("tab_tax_su_non_habit_surf");
282     $this->setTabType("tab_tax_am");
283    
284 nhaye 1616 //Champs select pour les liste a choix oui/non/je ne sais pas (terr_*)
285     if($maj == 0) {
286     $form->setType('terr_juri_titul','select');
287     $form->setType('terr_juri_lot','select');
288     $form->setType('terr_juri_zac','select');
289     $form->setType('terr_juri_afu','select');
290     $form->setType('terr_juri_pup','select');
291     $form->setType('terr_juri_oin','select');
292 nhaye 1269
293 nhaye 1616 } elseif($maj == 1) {
294     $form->setType('terr_juri_titul','select');
295     $form->setType('terr_juri_lot','select');
296     $form->setType('terr_juri_zac','select');
297     $form->setType('terr_juri_afu','select');
298     $form->setType('terr_juri_pup','select');
299     $form->setType('terr_juri_oin','select');
300    
301     } elseif($maj == 2) {
302     $form->setType('terr_juri_titul','selectstatic');
303     $form->setType('terr_juri_lot','selectstatic');
304     $form->setType('terr_juri_zac','selectstatic');
305     $form->setType('terr_juri_afu','selectstatic');
306     $form->setType('terr_juri_pup','selectstatic');
307     $form->setType('terr_juri_oin','selectstatic');
308    
309     } elseif($maj == 3) {
310     $form->setType('terr_juri_titul','selectstatic');
311     $form->setType('terr_juri_lot','selectstatic');
312     $form->setType('terr_juri_zac','selectstatic');
313     $form->setType('terr_juri_afu','selectstatic');
314     $form->setType('terr_juri_pup','selectstatic');
315     $form->setType('terr_juri_oin','selectstatic');
316    
317     }
318    
319    
320 vpihour 1266 //Cache les champs des clés étrangères, elles sont renseignées automatiquement
321 nhaye 1262 $form->setType('dossier_instruction', 'hidden');
322 vpihour 1266 $form->setType('lot', 'hidden');
323    
324 nhaye 1262 // Boucler sur les champs du cerfa pour cacher les données qui ne doivent
325     // pas être saisies
326    
327 nhaye 1268 foreach ($this->champs as $champ) {
328     if(array_search($champ, $this->cerfa->champs) !== false) {
329 nhaye 1262 if($this->cerfa->getVal($champ) == 'f') {
330     $form->setType($champ,'hidden');
331     }
332 nhaye 1268 } else {
333 nhaye 1397 $id_tab_surface = $this->cerfa->getVal("tab_surface");
334     $id_tab_tax_su_princ = $this->cerfa->getVal("tab_tax_su_princ");
335     $id_tab_tax_su_heber = $this->cerfa->getVal("tab_tax_su_heber");
336     $id_tab_tax_su_secon = $this->cerfa->getVal("tab_tax_su_secon");
337     $id_tab_tax_su_tot = $this->cerfa->getVal("tab_tax_su_tot");
338     $id_tab_tax_su_non_habit_surf = $this->cerfa->getVal("tab_tax_su_non_habit_surf");
339     $id_tab_tax_am = $this->cerfa->getVal("tab_tax_am");
340 nhaye 1560 $hidden = true;
341 nhaye 1394
342 nhaye 1560 // On cache tous les champs
343     $form->setType($champ,'hidden');
344    
345     // On défini l'affichage des champs des tableaux de configuration
346     // Si les tableau sont définis dans le cerfa on test si les champs des données
347     // techniques sont définis dans les tableaux de configuration des tableaux
348     // pour chaque cerfa alors on les affiche en type "text"
349 nhaye 1397 if(!empty($id_tab_surface)) {
350 nhaye 1560 if(in_array($champ, $tab_surface[$this->cerfa->getVal("tab_surface")]['values'])) {
351     $hidden = false;
352 nhaye 1397 }
353     }
354     if(!empty($id_tab_tax_su_princ)) {
355 nhaye 1560 if(in_array($champ, $tab_tax_su_princ[$this->cerfa->getVal("tab_tax_su_princ")]['values'])) {
356     $hidden = false;
357 nhaye 1397 }
358     }
359     if(!empty($id_tab_tax_su_heber)) {
360 nhaye 1560 if(in_array($champ, $tab_tax_su_heber[$this->cerfa->getVal("tab_tax_su_heber")]['values'])) {
361     $hidden = false;
362 nhaye 1397 }
363     }
364     if(!empty($id_tab_tax_su_secon)) {
365 nhaye 1560 if(in_array($champ, $tab_tax_su_secon[$this->cerfa->getVal("tab_tax_su_secon")]['values'])) {
366     $hidden = false;
367 nhaye 1397 }
368     }
369     if(!empty($id_tab_tax_su_tot)) {
370 nhaye 1560 if(in_array($champ, $tab_tax_su_tot[$this->cerfa->getVal("tab_tax_su_tot")]['values'])) {
371     $hidden = false;
372 nhaye 1397 }
373     }
374     if(!empty($id_tab_tax_su_non_habit_surf)) {
375 nhaye 1560 if(in_array($champ, $tab_tax_su_non_habit_surf[$this->cerfa->getVal("tab_tax_su_non_habit_surf")]['values'])) {
376     $hidden = false;
377 nhaye 1397 }
378     }
379     if(!empty($id_tab_tax_am)) {
380 nhaye 1560 if(in_array($champ, $tab_tax_am[$this->cerfa->getVal("tab_tax_am")]['values'])) {
381     $hidden = false;
382 nhaye 1397 }
383     }
384 nhaye 1560
385     if(!$hidden){
386 nhaye 1566 if($maj < 2) {
387     $form->setType($champ,'text');
388     } else {
389     $form->setType($champ,'static');
390     }
391    
392 nhaye 1268 }
393 nhaye 1262 }
394     }
395     }
396    
397 vpihour 1266 // Ajout des clés étrangères
398 nhaye 1263 function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire,&$db,$DEBUG=null){
399     $this->retourformulaire = $retourformulaire;
400     if($validation == 0) {
401 vpihour 1266
402     //Si on est dans le dossier
403     if($retourformulaire =='dossier' || $retourformulaire =='dossier_instruction' ) {
404    
405 nhaye 1263 $form->setVal('dossier_instruction', $idxformulaire);
406 vpihour 1266 $form->setVal('lot', "");
407     }
408    
409     //Si on est dans le lot
410     if($retourformulaire =='lot') {
411    
412     $form->setVal('dossier_instruction', "");
413 nhaye 1263 $form->setVal('lot', $idxformulaire);
414 vpihour 1266 }
415 nhaye 1263 }// fin validation
416     }// fin setValsousformulaire
417    
418 nhaye 1570 function setLib(&$form,$maj) {
419     parent::setLib($form,$maj);
420     //libelle des champs
421     $form->setLib('tab_surface', "");
422     $form->setLib('tab_tax_su_princ', "");
423     $form->setLib('tab_tax_su_heber', "");
424     $form->setLib('tab_tax_su_secon', "");
425     $form->setLib('tab_tax_su_tot', "");
426     $form->setLib('tab_tax_su_non_habit_surf', "");
427     $form->setLib('tab_tax_am', "");
428     }
429    
430 nhaye 1264 function setLayout(&$form, $maj) {
431 nhaye 1268 /*Fieldset Parametrage du cerfa */
432     $form->setBloc('cerfa','D',"","col_12");
433     $form->setFieldset('cerfa','D'
434 nhaye 1264 ,_("Parametrage du cerfa"));
435    
436    
437     $form->setFieldset('om_validite_fin','F','');
438     $form->setBloc('om_validite_fin','F');
439    
440 nhaye 1616 $form->setBloc('terr_juri_titul','D',"","col_12");
441     $form->setFieldset('terr_juri_titul','D'
442     ,_("Terrain"));
443     $form->setBloc('terr_juri_titul','D',_("Situation juridique du terrain"),"col_12");
444     $form->setBloc('terr_juri_desc','F');
445     $form->setBloc('terr_div_surf_etab','D',_("Terrain issu d'une division de propriete"),"col_12");
446     $form->setBloc('terr_div_surf_av_div','F');
447    
448     $form->setFieldset('terr_div_surf_av_div','F','');
449     $form->setBloc('terr_div_surf_av_div','F');
450    
451 nhaye 1268 $form->setBloc('avap_co_elt_pro','D',"","col_12");
452     $form->setFieldset('avap_co_elt_pro','D'
453     ,_("Projet"));
454    
455    
456     $form->setFieldset('avap_aut_auv_elec','F','');
457     $form->setBloc('avap_aut_auv_elec','F');
458    
459    
460     $form->setBloc('tr_total','D',"","col_12");
461     $form->setFieldset('tr_total','D'
462     ,_("Projet"));
463    
464    
465     $form->setFieldset('tr_desc','F','');
466     $form->setBloc('tr_desc','F');
467    
468 nhaye 1828 /*Fieldset n°4 Ouverture de chantier */
469 nhaye 1829 $form->setBloc('doc_date','D',"","col_12");
470     $form->setFieldset('doc_date','D'
471 nhaye 1828 ,_("Ouverture de chantier"));
472 nhaye 1268
473 nhaye 1828 $form->setFieldset('doc_nb_log_autre','F','');
474     $form->setBloc('doc_nb_log_autre','F');
475 nhaye 1268
476 nhaye 1828 /*Fieldset n°4 Achèvement des travaux */
477 nhaye 1829 $form->setBloc('daact_date','D',"","col_12");
478     $form->setFieldset('daact_date','D'
479 nhaye 1828 ,_("Achevement des travaux"));
480    
481     $form->setFieldset('daact_nb_log_autre','F','');
482     $form->setBloc('daact_nb_log_autre','F');
483    
484 nhaye 1264 /*Fieldset n°4 Projet d'aménagement */
485     $form->setBloc('am_lotiss','D',"","col_12");
486     $form->setFieldset('am_lotiss','D'
487     ,_("Projet d'amenagement"));
488     // bloc 4.1
489     $form->setBloc('am_lotiss','D',_("Nature des travaux, instalations
490 fmichon 1316 ou amenagements envisages"),"col_12");
491 nhaye 1264
492     $form->setBloc('am_tranche_desc','F');
493    
494     // bloc 4.2
495     $form->setBloc('am_lot_max_nb','D',_("Demande concernant un lotissement"),"col_12");
496    
497     $form->setBloc('am_lot_vente_ant','F');
498    
499     // bloc 4.3
500     $form->setBloc('am_empl_nb','D',_("Amenagement d'un camping ou
501 fmichon 1316 d'un terrain amenage en vue de l'hebergement
502 nhaye 1264 touristique"),"col_12");
503    
504     $form->setBloc('am_exist_agrand','F');
505    
506     $form->setFieldset('am_coupe_autr','F','');
507    
508     $form->setBloc('am_coupe_autr','F');
509    
510     /*Fieldset n°5 Projet de construction */
511     $form->setBloc('co_archi_recours','D',"","col_12");
512     $form->setFieldset('co_archi_recours','D'
513     ,_("Projet de construction"));
514     // bloc 5.1
515     $form->setBloc('co_archi_recours','D',_("Architecte"),"col_12");
516 nhaye 1615
517     $form->setBloc('co_archi_recours','DF', "","group");
518    
519     $form->setBloc('co_archi_nom','D', "","group");
520     $form->setBloc('co_archi_prenom','F');
521    
522     $form->setBloc('co_archi_adr_num','D', "","group");
523     $form->setBloc('co_archi_adr_voie','F');
524 nhaye 1264
525 nhaye 1615 $form->setBloc('co_archi_adr_lieu_dit','D', "","group");
526     $form->setBloc('co_archi_adr_localite','F');
527    
528     $form->setBloc('co_archi_adr_cp','D', "","group");
529     $form->setBloc('co_archi_adr_cedex','F');
530    
531     $form->setBloc('co_archi_no_incri','DF', "","group");
532    
533     $form->setBloc('co_archi_cg','DF', "","group");
534    
535     $form->setBloc('co_archi_tel1','D', "","group");
536     $form->setBloc('co_archi_tel2','F');
537    
538     $form->setBloc('co_archi_mail','DF', "","group");
539    
540     $form->setBloc('co_archi_mail','F');
541 nhaye 1264
542     // bloc 5.2
543     $form->setBloc('co_cstr_nouv','D',_("Nature du projet"),"col_12");
544    
545     $form->setBloc('co_elec_tension','F');
546    
547     // bloc 5.3
548     $form->setBloc('co_tot_log_nb','D',_("Informations complementaires"),"col_12");
549    
550     $form->setBloc('co_trx_nivsup','F');
551    
552     // bloc 5.4
553     $form->setBloc('co_demont_period','D',_("Construction periodiquement
554 fmichon 1316 demontee et re-installee"),"col_12");
555 nhaye 1264
556     $form->setBloc('co_demont_period','F');
557    
558     // bloc 5.5
559     $form->setBloc('tab_surface','D',_("Destination des constructions
560     et tableau des surfaces"),"col_12");
561    
562     $form->setBloc('tab_surface','F');
563    
564     // bloc 5.6
565     $form->setBloc('co_sp_transport','D',_("Destination des constructions
566     futures en cas de realisation au benefice d'un
567     service public ou d'interet collectif"),"col_12");
568    
569     $form->setBloc('co_sp_culture','F');
570    
571     // bloc 5.7
572     $form->setBloc('co_statio_avt_nb','D',_("Stationnement"),"col_12");
573    
574     $form->setBloc('co_statio_comm_cin_surf','F');
575    
576     $form->setFieldset('co_statio_apr_surf','F','');
577    
578     $form->setBloc('co_statio_apr_surf','F');
579    
580 nhaye 1854 // Description de modification
581     $form->setBloc('mod_desc','D',"","col_12");
582     $form->setFieldset('mod_desc','D'
583     ,_("Objet de la modification"));
584     $form->setFieldset('mod_desc','F','');
585     $form->setBloc('mod_desc','F');
586    
587 nhaye 1264 /*Fieldset n°6 Projet necessitant demolitions */
588     $form->setBloc('dm_constr_dates','D',"","col_12");
589     $form->setFieldset('dm_constr_dates','D'
590     ,_("Projet necessitant demolitions"));
591    
592     $form->setBloc('dm_constr_dates','D',"","col_12");
593    
594     $form->setBloc('dm_tot_log_nb','F');
595    
596     $form->setFieldset('dm_tot_log_nb','F','');
597    
598     $form->setBloc('dm_tot_log_nb','F');
599 nhaye 1268
600     $form->setBloc('tax_surf_tot','D',_("Declaration des elements necessaires au calcul des impositions"),"col_12");
601     $form->setBloc('tax_surf_tot','D',"","col_12");
602     $form->setFieldset('tax_surf_tot','D'
603     ,_("Renseignement"));
604    
605     $form->setBloc('tax_surf_tot','D',"","col_12");
606    
607     $form->setBloc('tax_dest_loc_tr','F');
608    
609     $form->setBloc('tab_tax_su_princ','D',_("Locaux a usage d'habitation principale"),"col_12");
610     $form->setBloc('tab_tax_su_princ','F');
611    
612     $form->setBloc('tab_tax_su_heber','D',_("Locaux a usage d'hebergement"),"col_12");
613     $form->setBloc('tab_tax_su_heber','F');
614    
615     $form->setBloc('tab_tax_su_secon','D',_("Locaux a usage d'habitation secondaire"),"col_12");
616     $form->setBloc('tab_tax_su_secon','F');
617    
618     $form->setBloc('tab_tax_su_tot','D',_("Total de logement"),"col_12");
619     $form->setBloc('tab_tax_su_tot','F');
620    
621     $form->setBloc('tax_ext_pret','D',"","col_12");
622     $form->setBloc('tax_log_exist_nb','F');
623    
624     $form->setBloc('tax_comm_nb','D',_("Creation ou extension de locaux non destines a l'habitation"),"col_12");
625     $form->setBloc('tab_tax_su_non_habit_surf','F');
626    
627     $form->setBloc('tab_tax_am','D',_("Autres elements soumis a la taxe d'amenagement"),"col_12");
628     $form->setBloc('tab_tax_am','F');
629    
630     $form->setBloc('tax_trx_presc_ppr','D',_("Cas particuliers"),"col_12");
631     $form->setBloc('tax_monu_hist','F');
632    
633     $form->setFieldset('tax_monu_hist','F','');
634    
635     $form->setBloc('tax_monu_hist','F');
636    
637     $form->setBloc('vsd_surf_planch_smd','D',"","col_12");
638     $form->setFieldset('vsd_surf_planch_smd','D'
639     ,_("Autres renseignements"));
640    
641     $form->setBloc('vsd_surf_planch_smd','D',_("Versement pour sous-densite (VSD)"),"col_12");
642     $form->setBloc('vsd_rescr_fisc','F');
643    
644     $form->setBloc('pld_val_terr','D',_("Plafond legal de densite (PLD)"),"col_12");
645     $form->setBloc('pld_const_exist_dem_surf','F');
646    
647     $form->setFieldset('pld_const_exist_dem_surf','F','');
648    
649     $form->setBloc('pld_const_exist_dem_surf','F');
650    
651     $form->setBloc('pld_const_exist_dem_surf','F');
652 nhaye 1264 }
653 nhaye 1268
654    
655 vpihour 1266
656     /**
657     * Surcharge du bouton retour afin de retourner sur le dossier d'instruction selon de cas
658     */
659     function retoursousformulaire($idxformulaire, $retourformulaire, $val,
660     $objsf, $premiersf, $tricolsf, $validation,
661     $idx, $maj, $retour) {
662    
663 vpihour 1301 $visualisation = $this->getParameter('visualisation');
664    
665     if ( $visualisation == "" ){
666 vpihour 1266
667 vpihour 1301 // Ajout et consultation, retour dossier
668     if ( ( $maj == 0 && $validation == 0 ) ||
669     ( $maj == 3 && $validation == 0 ) ||
670     ( $maj == 0 && $validation == 1 ) && $retourformulaire == "dossier_instruction" ){
671    
672     echo "\n<a class=\"retour\" ";
673     echo "href=\"#\" ";
674     echo "onclick=\"redirectPortletAction(1,'main');\" ";
675     echo ">";
676     echo _("Retour");
677     echo "</a>\n";
678     }
679     //Sinon affiche un retour normal
680     else{
681    
682     parent::retoursousformulaire($idxformulaire, $retourformulaire, $val,
683     $objsf, $premiersf, $tricolsf, $validation,
684     $idx, $maj, $retour);
685     }
686 vpihour 1266 }
687     }
688 vpihour 2104
689     /**
690     * Cette variable permet de stocker le résultat de la méthode
691     * getDivisionFromDossier() afin de ne pas effectuer le recalcul à chacun de
692     * ces appels.
693     * @var string Code de la division du dossier en cours
694     */
695     var $_division_from_dossier = NULL;
696    
697     /**
698     * Cette méthode permet de récupérer le code de division correspondant
699     * au dossier sur lequel on se trouve.
700     *
701     * @return string Code de la division du dossier en cours
702     */
703     function getDivisionFromDossier() {
704    
705     // Cette méthode peut être appelée plusieurs fois lors d'une requête.
706     // Pour éviter de refaire le traitement de recherche de la division
707     // alors on vérifie si nous ne l'avons pas déjà calculé.
708     if ($this->_division_from_dossier != NULL) {
709     // Logger
710     $this->addToLog("getDivisionFromDossier(): retour de la valeur déjà calculée - '".$this->_division_from_dossier."'", EXTRA_VERBOSE_MODE);
711     // On retourne la valeur déjà calculée
712     return $this->_division_from_dossier;
713     }
714    
715     // Par défaut, on définit la valeur du dossier à NULL
716     $dossier = NULL;
717     // Test sur le mode et le contexte du formulaire
718     if ($this->getParameter("maj") == 0
719     && ($this->getParameter("retourformulaire") == "dossier"
720     || $this->getParameter("retourformulaire") == "dossier_instruction"
721     || $this->getParameter("retourformulaire") == "dossier_instruction_mes_encours"
722     || $this->getParameter("retourformulaire") == "dossier_instruction_tous_encours"
723     || $this->getParameter("retourformulaire") == "dossier_instruction_mes_clotures"
724     || $this->getParameter("retourformulaire") == "dossier_instruction_tous_clotures")) {
725     // Si on se trouve en mode AJOUT (seul mode où l'enregistrement
726     // n'existe pas en base de données) ET que nous nous trouvons
727     // dans le contexte d'un dossier d'instruction alors on récupère
728     // le numéro de dossier depuis le paramètre 'idxformulaire'
729     $dossier = $this->getParameter("idxformulaire");
730     } else {
731     // Sinon on récupère le numéro de dossier dans le champs dossier de
732     // l'enregistrement (en base de données)
733     $dossier = $this->getVal("dossier");
734     }
735    
736     // On appelle la méthode de la classe utils qui renvoi le code de la
737     // division d'un dossier, on la stocke pour ne pas refaire le calcul au
738     // prochain appel de cette méthode
739     $this->_division_from_dossier = $this->f->getDivisionFromDossier($dossier);
740     // Logger
741     $this->addToLog("getDivisionFromDossier(): retour de la valeur nouvellement calculée - '".$this->_division_from_dossier."'", EXTRA_VERBOSE_MODE);
742     // On retourne la valeur retournée
743     return $this->_division_from_dossier;
744    
745     }
746 vpihour 1249 }// fin classe
747 nhaye 1268 ?>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26