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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1266 by vpihour, Mon Feb 18 12:05:00 2013 UTC revision 2130 by vpihour, Tue Aug 6 16:34:06 2013 UTC
# Line 12  class donnees_techniques extends donnees Line 12  class donnees_techniques extends donnees
12          $this->constructeur($id,$db,$debug);          $this->constructeur($id,$db,$debug);
13      }// fin constructeur      }// fin constructeur
14    
   
15      /**      /**
16       * Méthode permettant de récupérer l'id du cerfa lié au dossier       * Méthode permettant de récupérer l'id du cerfa lié au dossier
17       **/       **/
18      function getCerfa(){      function getCerfa(){
19            if($this->getParameter("retourformulaire") == "lot") {
20                $sql = "SELECT cerfa_lot FROM ".DB_PREFIXE."dossier_autorisation_type_detaille
21                    JOIN ".DB_PREFIXE."dossier_instruction_type ON dossier_instruction_type.dossier_autorisation_type_detaille=
22                                    dossier_autorisation_type_detaille.dossier_autorisation_type_detaille
23                    JOIN ".DB_PREFIXE."dossier ON dossier.dossier_instruction_type=
24                                    dossier_instruction_type.dossier_instruction_type
25                    JOIN ".DB_PREFIXE."lot ON dossier.dossier=lot.dossier
26                    WHERE lot.lot = ".$this->getParameter("idxformulaire");
27    
28          $sql = "SELECT cerfa FROM ".DB_PREFIXE."dossier_instruction_type          } elseif($this->getParameter("retourformulaire") == "dossier_autorisation"){
29                $sql = "SELECT cerfa  FROM ".DB_PREFIXE."dossier_autorisation_type_detaille
30                    JOIN ".DB_PREFIXE."dossier_instruction_type ON dossier_instruction_type.dossier_autorisation_type_detaille=
31                                    dossier_autorisation_type_detaille.dossier_autorisation_type_detaille
32                    JOIN ".DB_PREFIXE."dossier ON dossier.dossier_instruction_type=
33                                    dossier_instruction_type.dossier_instruction_type
34                    WHERE dossier_autorisation = '";
35                    $sql .= $this->getParameter("idxformulaire")."'";
36            } else {
37                $sql = "SELECT cerfa  FROM ".DB_PREFIXE."dossier_autorisation_type_detaille
38                    JOIN ".DB_PREFIXE."dossier_instruction_type ON dossier_instruction_type.dossier_autorisation_type_detaille=
39                                    dossier_autorisation_type_detaille.dossier_autorisation_type_detaille
40                  JOIN ".DB_PREFIXE."dossier ON dossier.dossier_instruction_type=                  JOIN ".DB_PREFIXE."dossier ON dossier.dossier_instruction_type=
41                                  dossier_instruction_type.dossier_instruction_type                                  dossier_instruction_type.dossier_instruction_type
42                  WHERE dossier = '".$this->getParameter("idxformulaire")."'";                  WHERE dossier = '";
43                    $sql .= $this->getParameter("idxformulaire")."'";
44            }
45    
46          $cerfa = $this->db->getOne($sql);          $cerfa = $this->db->getOne($sql);
47          $this->addToLog("db->getone(\"".$sql."\");", VERBOSE_MODE);          $this->f->addToLog("getCerfa() : db->getone(\"".$sql."\");", VERBOSE_MODE);
48          $this->f->isDatabaseError($cerfa);          if ( database::isError($cerfa)){
49                die();
50            }
51    
52          // Si le cerfa est défini dans dossier on instancie le cerfa correspondant          // Si le cerfa est défini dans dossier on instancie le cerfa correspondant
53          if(!empty($cerfa)) {          if(!empty($cerfa)) {
54              require_once ("../obj/cerfa.class.php");              require_once ("../obj/cerfa.class.php");
55              $this->cerfa = new cerfa($cerfa, $this->db, DEBUG);              $this->cerfa = new cerfa($cerfa, $this->db, DEBUG);
56                //On vérifie que le cerfa est en cours de validité
57                $date_debut = new DateTime($this->cerfa->getVal("om_validite_debut"));
58                $date_debut = $date_debut->format('Ymd');
59                
60                $date_fin = new DateTime($this->cerfa->getVal("om_validite_fin"));
61                $date_fin = $date_fin->format('Ymd');
62                
63                $date_aujourdhui = date('Ymd');
64                
65                // Teste si le cerfa est en cours de validité
66                $is_encours = true;
67                if ( $date_aujourdhui < $date_debut || $date_aujourdhui > $date_fin ){
68                    $is_encours = false;
69                }
70                
71                //Si le cerfa n'est pas en cours de validité, on affiche pas le formulaire
72                //et on affiche un message d'erreur
73                if ( $is_encours == false){
74                    $this->f->displayMessage("error", _("Aucun cerfa en cours de validite lie a ce dossier"));
75                    die();
76                }
77          } else {          } else {
78              $this->f->displayMessage("error", _("Aucun cerfa lié à ce type de dossier"));              $this->f->displayMessage("error", _("Aucun cerfa lie a ce type de dossier"));
79              die();              die();
80          }          }
81      }      }
82    
83        /**
84         * Méthode permettant de vérifier si le tableau passé en parametre est défini
85         * dans la table des cerfa
86         */
87    
88        function setTabSelect($tab, $idchamp) {
89            // Test si un tableau de surface a été défini
90            if ( $this->cerfa->getVal($idchamp) !=  "" ){
91                
92                // Configuration du tableau des surfaces
93                $contenu['column_header']=$tab[$this->cerfa->getVal($idchamp)]['column_header'];
94                $contenu['row_header']=$tab[$this->cerfa->getVal($idchamp)]['row_header'];
95        
96                foreach($tab[$this->cerfa->getVal($idchamp)]['values'] as $champ) {
97                    $contenu['values'][$champ] = $this->getVal($champ);
98                }
99        
100                $this->form->setSelect($idchamp,$contenu);
101            }
102        }
103    
104    
105      function setSelect(&$form, $maj,&$db,$debug) {      function setSelect(&$form, $maj,&$db,$debug) {
106          parent::setSelect($form, $maj,$db,$debug);          parent::setSelect($form, $maj,$db,$debug);
107          if(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc.php"))          if(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc.php"))
# Line 47  class donnees_techniques extends donnees Line 113  class donnees_techniques extends donnees
113              $this->getCerfa();              $this->getCerfa();
114          }          }
115    
116          // Configuration du tableau des surfaces          $this->setTabSelect($tab_surface, "tab_surface");
117          $contenu['column_header']=$tab_surface[$this->cerfa->getVal("tab_surface")]['column_header'];          $this->setTabSelect($tab_tax_su_princ, "tab_tax_su_princ");
118          $contenu['row_header']=$tab_surface[$this->cerfa->getVal("tab_surface")]['row_header'];          $this->setTabSelect($tab_tax_su_heber, "tab_tax_su_heber");
119            $this->setTabSelect($tab_tax_su_secon, "tab_tax_su_secon");
120          foreach($tab_surface[$this->cerfa->getVal("tab_surface")]['values'] as $champ) {          $this->setTabSelect($tab_tax_su_tot, "tab_tax_su_tot");
121              $contenu['values'][$champ] = $this->getVal($champ);          $this->setTabSelect($tab_tax_su_tot, "tab_tax_su_non_habit_surf");
122            $this->setTabSelect($tab_tax_am, "tab_tax_am");
123            
124            // Définition des champs Oui/Non/Je ne sais pas
125            $value[] = array("nesaispas","oui","non");
126            $value[] = array(_("Je ne sais pas"),_("Oui"),_("Non"));
127            
128            $form->setSelect('terr_juri_titul',$value);
129            $form->setSelect('terr_juri_lot',$value);
130            $form->setSelect('terr_juri_zac',$value);
131            $form->setSelect('terr_juri_afu',$value);
132            $form->setSelect('terr_juri_pup',$value);
133            $form->setSelect('terr_juri_oin',$value);
134            $form->setSelect('terr_juri_desc',$value);
135            $form->setSelect('terr_div_surf_etab',$value);
136            $form->setSelect('terr_div_surf_av_div',$value);
137            
138            
139            //Récupérer le nom et le prénom de l'architecte
140            $coordonneesArchitecte = $this->getPrenomNomArchitecte($this->getVal('architecte'));
141            $value = "";
142            if ($maj<2){
143                $value = array(
144                    "data" => $coordonneesArchitecte,
145                    "obj" => "architecte",
146                );
147          }          }
148            else {
149          $form->setSelect("tab_surface",$contenu);              $value[0][0]=$this->getVal('architecte');
150                $value[1][0]=$coordonneesArchitecte;// table
151            }
152            $form->setSelect('architecte', $value);
153      }      }
154    
155    
156      // XXX Créer une nouvelle méthode au même endroit que l'appel a checkAccessibility()      // XXX Créer une nouvelle méthode au même endroit que l'appel a checkAccessibility()
157      function checkAccessibility() {      function checkAccessibility() {
158            if(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php"))
159                include ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php");
160            elseif(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc"))
161                include ("../sql/".$this->db->phptype."/".$this->table.".form.inc");
162            if(empty($this->cerfa)) {
163                $this->getCerfa();
164            }
165    
166          unset($this->champs[array_search("su_avt_shon1",$this->champs)]);          $id_tab_surface = $this->cerfa->getVal("tab_surface");
167          unset($this->champs[array_search("su_avt_shon2",$this->champs)]);          $id_tab_tax_su_princ = $this->cerfa->getVal("tab_tax_su_princ");
168          unset($this->champs[array_search("su_avt_shon3",$this->champs)]);          $id_tab_tax_su_heber = $this->cerfa->getVal("tab_tax_su_heber");
169          unset($this->champs[array_search("su_avt_shon4",$this->champs)]);          $id_tab_tax_su_secon = $this->cerfa->getVal("tab_tax_su_secon");
170          unset($this->champs[array_search("su_avt_shon5",$this->champs)]);          $id_tab_tax_su_tot = $this->cerfa->getVal("tab_tax_su_tot");
171          unset($this->champs[array_search("su_avt_shon6",$this->champs)]);          $id_tab_tax_su_non_habit_surf = $this->cerfa->getVal("tab_tax_su_non_habit_surf");
172          unset($this->champs[array_search("su_avt_shon7",$this->champs)]);          $id_tab_tax_am = $this->cerfa->getVal("tab_tax_am");
173          unset($this->champs[array_search("su_avt_shon8",$this->champs)]);  
174          unset($this->champs[array_search("su_avt_shon9",$this->champs)]);          //Suppression des champs de tableaux
175          unset($this->champs[array_search("su_cstr_shon1",$this->champs)]);          if(!empty($id_tab_surface)) {
176          unset($this->champs[array_search("su_cstr_shon2",$this->champs)]);              foreach($tab_surface[$this->cerfa->getVal("tab_surface")]['values'] as $champ) {
177          unset($this->champs[array_search("su_cstr_shon3",$this->champs)]);                  unset($this->champs[array_search($champ,$this->champs)]);
178          unset($this->champs[array_search("su_cstr_shon4",$this->champs)]);              }
179          unset($this->champs[array_search("su_cstr_shon5",$this->champs)]);          }
180          unset($this->champs[array_search("su_cstr_shon6",$this->champs)]);          if(!empty($id_tab_tax_su_princ)) {
181          unset($this->champs[array_search("su_cstr_shon7",$this->champs)]);              foreach($tab_tax_su_princ[$this->cerfa->getVal("tab_tax_su_princ")]['values'] as $champ) {
182          unset($this->champs[array_search("su_cstr_shon8",$this->champs)]);                  unset($this->champs[array_search($champ,$this->champs)]);
183          unset($this->champs[array_search("su_cstr_shon9",$this->champs)]);              }
184          unset($this->champs[array_search("su_trsf_shon1",$this->champs)]);          }
185          unset($this->champs[array_search("su_trsf_shon2",$this->champs)]);          if(!empty($id_tab_tax_su_heber)) {
186          unset($this->champs[array_search("su_trsf_shon3",$this->champs)]);              foreach($tab_tax_su_heber[$this->cerfa->getVal("tab_tax_su_heber")]['values'] as $champ) {
187          unset($this->champs[array_search("su_trsf_shon4",$this->champs)]);                  unset($this->champs[array_search($champ,$this->champs)]);
188          unset($this->champs[array_search("su_trsf_shon5",$this->champs)]);              }
189          unset($this->champs[array_search("su_trsf_shon6",$this->champs)]);          }
190          unset($this->champs[array_search("su_trsf_shon7",$this->champs)]);          if(!empty($id_tab_tax_su_secon)) {
191          unset($this->champs[array_search("su_trsf_shon8",$this->champs)]);              foreach($tab_tax_su_secon[$this->cerfa->getVal("tab_tax_su_secon")]['values'] as $champ) {
192          unset($this->champs[array_search("su_trsf_shon9",$this->champs)]);                  unset($this->champs[array_search($champ,$this->champs)]);
193          unset($this->champs[array_search("su_chge_shon1",$this->champs)]);              }
194          unset($this->champs[array_search("su_chge_shon2",$this->champs)]);          }
195          unset($this->champs[array_search("su_chge_shon3",$this->champs)]);          if(!empty($id_tab_tax_su_tot)) {
196          unset($this->champs[array_search("su_chge_shon4",$this->champs)]);              foreach($tab_tax_su_tot[$this->cerfa->getVal("tab_tax_su_tot")]['values'] as $champ) {
197          unset($this->champs[array_search("su_chge_shon5",$this->champs)]);                  unset($this->champs[array_search($champ,$this->champs)]);
198          unset($this->champs[array_search("su_chge_shon6",$this->champs)]);              }
199          unset($this->champs[array_search("su_chge_shon7",$this->champs)]);          }
200          unset($this->champs[array_search("su_chge_shon8",$this->champs)]);          if(!empty($id_tab_tax_su_non_habit_surf)) {
201          unset($this->champs[array_search("su_chge_shon9",$this->champs)]);              foreach($tab_tax_su_non_habit_surf[$this->cerfa->getVal("tab_tax_su_non_habit_surf")]['values'] as $champ) {
202          unset($this->champs[array_search("su_demo_shon1",$this->champs)]);                  unset($this->champs[array_search($champ,$this->champs)]);
203          unset($this->champs[array_search("su_demo_shon2",$this->champs)]);              }
204          unset($this->champs[array_search("su_demo_shon3",$this->champs)]);          }
205          unset($this->champs[array_search("su_demo_shon4",$this->champs)]);          if(!empty($id_tab_tax_am)) {
206          unset($this->champs[array_search("su_demo_shon5",$this->champs)]);              foreach($tab_tax_am[$this->cerfa->getVal("tab_tax_am")]['values'] as $champ) {
207          unset($this->champs[array_search("su_demo_shon6",$this->champs)]);                  unset($this->champs[array_search($champ,$this->champs)]);
208          unset($this->champs[array_search("su_demo_shon7",$this->champs)]);              }
209          unset($this->champs[array_search("su_demo_shon8",$this->champs)]);          }
         unset($this->champs[array_search("su_demo_shon9",$this->champs)]);  
         unset($this->champs[array_search("su_sup_shon1",$this->champs)]);  
         unset($this->champs[array_search("su_sup_shon2",$this->champs)]);  
         unset($this->champs[array_search("su_sup_shon3",$this->champs)]);  
         unset($this->champs[array_search("su_sup_shon4",$this->champs)]);  
         unset($this->champs[array_search("su_sup_shon5",$this->champs)]);  
         unset($this->champs[array_search("su_sup_shon6",$this->champs)]);  
         unset($this->champs[array_search("su_sup_shon7",$this->champs)]);  
         unset($this->champs[array_search("su_sup_shon8",$this->champs)]);  
         unset($this->champs[array_search("su_sup_shon9",$this->champs)]);  
         unset($this->champs[array_search("su_tot_shon1",$this->champs)]);  
         unset($this->champs[array_search("su_tot_shon2",$this->champs)]);  
         unset($this->champs[array_search("su_tot_shon3",$this->champs)]);  
         unset($this->champs[array_search("su_tot_shon4",$this->champs)]);  
         unset($this->champs[array_search("su_tot_shon5",$this->champs)]);  
         unset($this->champs[array_search("su_tot_shon6",$this->champs)]);  
         unset($this->champs[array_search("su_tot_shon7",$this->champs)]);  
         unset($this->champs[array_search("su_tot_shon8",$this->champs)]);  
         unset($this->champs[array_search("su_tot_shon9",$this->champs)]);  
         unset($this->champs[array_search("su_avt_shon_tot",$this->champs)]);  
         unset($this->champs[array_search("su_cstr_shon_tot",$this->champs)]);  
         unset($this->champs[array_search("su_trsf_shon_tot",$this->champs)]);  
         unset($this->champs[array_search("su_chge_shon_tot",$this->champs)]);  
         unset($this->champs[array_search("su_demo_shon_tot",$this->champs)]);  
         unset($this->champs[array_search("su_sup_shon_tot",$this->champs)]);  
         unset($this->champs[array_search("su_tot_shon_tot",$this->champs)]);  
210          // Renumérotation          // Renumérotation
211          $this->champs = array_values($this->champs);          $this->champs = array_values($this->champs);
212            
213            $idxformulaire = $this->getParameter("idxformulaire");
214            //Si le dossier d'instruction auquel sont rattachées les données techniques
215            //est cloturé, on affiche pas le lien de modification du portlet
216            if ( $idxformulaire != '' ){
217                    
218                //On récuppère le statut du dossier d'instruction        
219                $statut = $this->f->getStatutDossier($idxformulaire);
220                if ( $this->f->isUserInstructeur() && $statut == "cloture" ){
221                    
222                    //On cache le lien de modification
223                    $this->parameters["actions"]["modifier"] = NULL;
224                }
225            }
226        }
227        
228        /**
229         * Cette methode est à surcharger elle permet de tester dans chaque classe
230         * des droits spécifiques en fonction des données
231         */
232        function canAccess() {
233            // Si l'utilisateur est un instructeur et que le dossier est cloturé
234            if ( $this->f->isUserInstructeur() &&
235                $this->f->getStatutDossier($this->getParameter("idxformulaire")) == "cloture"
236                && $this->getParameter("maj") != 3) {
237                
238                return false;
239            }
240            //
241            return true;
242        }
243        
244        /**
245         * Méthode permettant de définir le type des différents tableaux en fonction
246         * des valeurs du cerfa
247         **/
248        function setTabType($tab) {
249            // Définition du type "tableau"
250            if ( $this->cerfa->getVal($tab) !=  "" ){
251                
252                $this->form->setType($tab,'tableau');
253            }
254            //Le chache si non défini
255            else {
256                
257                $this->form->setType($tab,'hidden');
258            }
259      }      }
260    
261        /**
262         * Méthode permettant de définir le type des champs des tableaux en fonction
263         * des valeurs du cerfa
264         **/
265        function setTabChampType($tab) {
266            if(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php"))
267                include ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php");
268            elseif(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc"))
269                include ("../sql/".$this->db->phptype."/".$this->table.".form.inc");
270            // Pour chaque champ dans la liste des champs du cerfa
271            $tableau = $$tab;
272    
273            foreach ($this->champs as $champ) {
274                if(array_search($champ, $this->cerfa->champs) !== false) {
275                    // On les cache si décoché dans le formulaire de cerfa
276                    if($this->cerfa->getVal($champ) == 'f') {
277                        $this->form->setType($champ,'hidden');
278                    }
279                } else {
280                    
281                    if(!in_array($champ, $tableau[$this->cerfa->getVal($tab)]['values'])) {
282    
283                        $this->form->setType($champ,'hidden');
284                    }
285                }
286            }
287        }
288    
289    
290    
291      function setType(&$form,$maj) {      function setType(&$form,$maj) {
292          parent::setType($form,$maj);          parent::setType($form,$maj);
293    
# Line 149  class donnees_techniques extends donnees Line 299  class donnees_techniques extends donnees
299          if(empty($this->cerfa)) {          if(empty($this->cerfa)) {
300              $this->getCerfa();              $this->getCerfa();
301          }          }
302          // Définition du type "tableau"  
303          $form->setType('tab_surface','tableau');          $this->setTabType("tab_surface");
304            $this->setTabType("tab_tax_su_princ");
305            $this->setTabType("tab_tax_su_heber");
306            $this->setTabType("tab_tax_su_secon");
307            $this->setTabType("tab_tax_su_tot");
308            $this->setTabType("tab_tax_su_non_habit_surf");
309            $this->setTabType("tab_tax_am");
310    
311            //Champs select pour les liste a choix oui/non/je ne sais pas (terr_*)
312            if($maj == 0) {
313                $form->setType('terr_juri_titul','select');
314                $form->setType('terr_juri_lot','select');
315                $form->setType('terr_juri_zac','select');
316                $form->setType('terr_juri_afu','select');
317                $form->setType('terr_juri_pup','select');
318                $form->setType('terr_juri_oin','select');
319                $form->setType('architecte', 'manage_with_popup');
320    
321            } elseif($maj == 1) {
322                $form->setType('terr_juri_titul','select');
323                $form->setType('terr_juri_lot','select');
324                $form->setType('terr_juri_zac','select');
325                $form->setType('terr_juri_afu','select');
326                $form->setType('terr_juri_pup','select');
327                $form->setType('terr_juri_oin','select');
328                $form->setType('architecte', 'manage_with_popup');
329    
330            } elseif($maj == 2) {
331                $form->setType('terr_juri_titul','selectstatic');
332                $form->setType('terr_juri_lot','selectstatic');
333                $form->setType('terr_juri_zac','selectstatic');
334                $form->setType('terr_juri_afu','selectstatic');
335                $form->setType('terr_juri_pup','selectstatic');
336                $form->setType('terr_juri_oin','selectstatic');
337                $form->setType('architecte', 'selectstatic');
338    
339            } elseif($maj == 3) {
340                $form->setType('terr_juri_titul','selectstatic');
341                $form->setType('terr_juri_lot','selectstatic');
342                $form->setType('terr_juri_zac','selectstatic');
343                $form->setType('terr_juri_afu','selectstatic');
344                $form->setType('terr_juri_pup','selectstatic');
345                $form->setType('terr_juri_oin','selectstatic');
346                $form->setType('architecte', 'selectstatic');
347    
348            }
349    
350    
351          //Cache les champs des clés étrangères, elles sont renseignées automatiquement          //Cache les champs des clés étrangères, elles sont renseignées automatiquement
352          $form->setType('dossier_instruction', 'hidden');          $form->setType('dossier_instruction', 'hidden');
# Line 159  class donnees_techniques extends donnees Line 355  class donnees_techniques extends donnees
355          // Boucler sur les champs du cerfa pour cacher les données qui ne doivent          // Boucler sur les champs du cerfa pour cacher les données qui ne doivent
356          // pas être saisies          // pas être saisies
357    
358          foreach ($this->cerfa->champs as $champ) {          foreach ($this->champs as $champ) {
359              if(array_search($champ, $this->champs) !== false) {              if(array_search($champ, $this->cerfa->champs) !== false) {
360                  if($this->cerfa->getVal($champ) == 'f') {                  if($this->cerfa->getVal($champ) == 'f') {
361                      $form->setType($champ,'hidden');                      $form->setType($champ,'hidden');
362                  }                  }
363                } else {
364                    $id_tab_surface = $this->cerfa->getVal("tab_surface");
365                    $id_tab_tax_su_princ = $this->cerfa->getVal("tab_tax_su_princ");
366                    $id_tab_tax_su_heber = $this->cerfa->getVal("tab_tax_su_heber");
367                    $id_tab_tax_su_secon = $this->cerfa->getVal("tab_tax_su_secon");
368                    $id_tab_tax_su_tot = $this->cerfa->getVal("tab_tax_su_tot");
369                    $id_tab_tax_su_non_habit_surf = $this->cerfa->getVal("tab_tax_su_non_habit_surf");
370                    $id_tab_tax_am = $this->cerfa->getVal("tab_tax_am");
371                    $hidden = true;
372    
373                    // On cache tous les champs
374                    $form->setType($champ,'hidden');
375    
376                    // On défini l'affichage des champs des tableaux de configuration
377                    // Si les tableau sont définis dans le cerfa on test si les champs des données
378                    // techniques sont définis dans les tableaux de configuration des tableaux
379                    // pour chaque cerfa  alors on les affiche en type "text"
380                    if(!empty($id_tab_surface)) {
381                        if(in_array($champ, $tab_surface[$this->cerfa->getVal("tab_surface")]['values'])) {
382                            $hidden = false;
383                        }
384                    }
385                    if(!empty($id_tab_tax_su_princ)) {
386                        if(in_array($champ, $tab_tax_su_princ[$this->cerfa->getVal("tab_tax_su_princ")]['values'])) {
387                            $hidden = false;
388                        }
389                    }
390                    if(!empty($id_tab_tax_su_heber)) {
391                        if(in_array($champ, $tab_tax_su_heber[$this->cerfa->getVal("tab_tax_su_heber")]['values'])) {
392                            $hidden = false;
393                        }
394                    }
395                    if(!empty($id_tab_tax_su_secon)) {
396                        if(in_array($champ, $tab_tax_su_secon[$this->cerfa->getVal("tab_tax_su_secon")]['values'])) {
397                            $hidden = false;
398                        }
399                    }
400                    if(!empty($id_tab_tax_su_tot)) {
401                        if(in_array($champ, $tab_tax_su_tot[$this->cerfa->getVal("tab_tax_su_tot")]['values'])) {
402                            $hidden = false;
403                        }
404                    }
405                    if(!empty($id_tab_tax_su_non_habit_surf)) {
406                        if(in_array($champ, $tab_tax_su_non_habit_surf[$this->cerfa->getVal("tab_tax_su_non_habit_surf")]['values'])) {
407                            $hidden = false;
408                        }
409                    }
410                    if(!empty($id_tab_tax_am)) {
411                        if(in_array($champ, $tab_tax_am[$this->cerfa->getVal("tab_tax_am")]['values'])) {
412                            $hidden = false;
413                        }
414                    }
415    
416                    if(!$hidden){
417                        if($maj < 2) {
418                            $form->setType($champ,'text');
419                        } else {
420                            $form->setType($champ,'static');
421                        }
422                        
423                    }
424              }              }
425          }          }
426      }      }
# Line 189  class donnees_techniques extends donnees Line 446  class donnees_techniques extends donnees
446          }// fin validation          }// fin validation
447      }// fin setValsousformulaire      }// fin setValsousformulaire
448    
449      function setLayout(&$form, $maj) {      function setLib(&$form,$maj) {
450            parent::setLib($form,$maj);
451            //libelle des champs
452            $form->setLib('tab_surface', "");
453            $form->setLib('tab_tax_su_princ', "");
454            $form->setLib('tab_tax_su_heber', "");
455            $form->setLib('tab_tax_su_secon', "");
456            $form->setLib('tab_tax_su_tot', "");
457            $form->setLib('tab_tax_su_non_habit_surf', "");
458            $form->setLib('tab_tax_am', "");
459        }
460    
461        function setLayout(&$form, $maj) {
462          /*Fieldset Parametrage du cerfa */          /*Fieldset Parametrage du cerfa */
463          $form->setBloc('libelle','D',"","col_12");          $form->setBloc('cerfa','D',"","col_12");
464              $form->setFieldset('libelle','D'              $form->setFieldset('cerfa','D'
465                                 ,_("Parametrage du cerfa"));                                 ,_("Parametrage du cerfa"));
466                                $form->setBloc('cerfa','D',"", "alignFormSpec");
467                $form->setBloc('code','F');
468                $form->setBloc('om_validite_debut','D',"", "alignFormSpec-type-date");
469                $form->setBloc('om_validite_fin','F');
470    
471              $form->setFieldset('om_validite_fin','F','');              $form->setFieldset('om_validite_fin','F','');
472          $form->setBloc('om_validite_fin','F');          $form->setBloc('om_validite_fin','F');
473    
474          /*Fieldset n°4 Projet d'aménagement */          // Terrain
475            $form->setBloc('terr_juri_titul','D',"","col_12");
476                $form->setFieldset('terr_juri_titul','D'
477                                   ,_("Terrain"), "startClosed");
478    
479                    $form->setBloc('terr_juri_titul','D',_("Situation juridique du terrain"), "col_12 alignFormSpec");
480                    $form->setBloc('terr_juri_oin','F');
481                    $form->setBloc('terr_juri_desc','DF',"", "group");
482                    $form->setBloc('terr_div_surf_etab','D',_("Terrain issu d'une division de propriete"), "col_12 alignFormSpec");
483                    $form->setBloc('terr_div_surf_av_div', 'F');
484    
485                $form->setFieldset('terr_div_surf_av_div','F','');
486                
487            $form->setBloc('terr_div_surf_av_div','F');
488    
489            // Aménager
490          $form->setBloc('am_lotiss','D',"","col_12");          $form->setBloc('am_lotiss','D',"","col_12");
491              $form->setFieldset('am_lotiss','D'              $form->setFieldset('am_lotiss','D'
492                                 ,_("Projet d'amenagement"));                                         ,_("Amenager"), "startClosed");
493                  // bloc 4.1                  $form->setBloc('am_lotiss','D',"","col_12");
494                  $form->setBloc('am_lotiss','D',_("Nature des travaux, instalations                      $form->setFieldset('am_lotiss','D'
495                                 ou aménagements envisagés"),"col_12");                                         ,_("Projet d'amenagement"), "startClosed alignFormSpec");
496                            // bloc 4.1
497                            $form->setBloc('am_lotiss','DF',_("Nature des travaux, installations
498                                           ou amenagements envisages"), "group");
499                            $form->setBloc('am_div_mun','DF',"", "group");
500                            $form->setBloc('am_autre_div','DF',"", "group");
501                            $form->setBloc('am_camping','DF',"", "group");
502                            $form->setBloc('am_parc_resid_loi','DF',"", "group");
503                            $form->setBloc('am_sport_moto','DF',"", "group");
504                            $form->setBloc('am_sport_attrac','DF',"", "group");
505                            $form->setBloc('am_sport_golf','DF',"", "group");
506                            $form->setBloc('am_caravane','DF',"", "group");
507                            $form->setBloc('am_carav_duree','DF',"", "group");
508                            $form->setBloc('am_statio','DF',"", "group");
509                            $form->setBloc('am_statio_cont','DF',"", "group");
510                            $form->setBloc('am_affou_exhau','DF',"", "group");
511                            $form->setBloc('am_affou_exhau_sup','DF',"", "group");
512                            $form->setBloc('am_affou_prof','DF',"", "group");
513                            $form->setBloc('am_exhau_haut','DF',"", "group");
514                            
515                            $form->setBloc('am_chem_ouv_esp','D',_("Dans les secteurs proteges :"),"col_12");
516                                $form->setBloc('am_chem_ouv_esp','DF',_("Amenagement situe dans un espace remarquable :"), "group");
517                                $form->setBloc('am_agri_peche','DF',"", "group");
518                                
519                                $form->setBloc('am_crea_voie','DF',_("Amenagement situe dans un secteur sauvegarde :"), "group");
520                                $form->setBloc('am_modif_voie_exist','DF',"", "group");
521                                $form->setBloc('am_crea_esp_sauv','DF',"", "group");
522                                
523                                $form->setBloc('am_crea_esp_class','DF',_("Amenagement situe dans un site classe ou une reserve naturelle 1 :"), "group");
524                                $form->setBloc('am_coupe_abat','DF',"", "group");
525                                $form->setBloc('am_prot_plu','DF',"", "group");
526                                $form->setBloc('am_prot_muni','DF',"", "group");
527                                $form->setBloc('am_mobil_voyage','DF',"", "group");
528                                $form->setBloc('am_aire_voyage','DF',"", "group");
529                                $form->setBloc('am_rememb_afu','DF',"", "group");
530                            $form->setBloc('am_rememb_afu','F');
531    
532                            $form->setBloc('am_mob_art','DF',_("Dans un secteur sauvegarde, site classe ou reserve naturelle :"), "group");
533                            $form->setBloc('am_modif_voie_esp','DF',"", "group");
534                            $form->setBloc('am_plant_voie_esp','DF',"", "group");
535    
536                        $form->setFieldset('am_plant_voie_esp','F','');
537                    $form->setBloc('am_plant_voie_esp','F');
538                    $form->setBloc('am_projet_desc','D',"","col_12");
539                        $form->setFieldset('am_projet_desc','D'
540                                           ,_("Description amenagement"), "startClosed");
541    
542                            $form->setBloc('am_projet_desc','DF',"", "group");
543                            $form->setBloc('am_terr_surf','DF',"", "alignFormSpec");
544                            $form->setBloc('am_tranche_desc','DF',"", "group");
545                        $form->setFieldset('am_tranche_desc','F','');
546                  $form->setBloc('am_tranche_desc','F');                  $form->setBloc('am_tranche_desc','F');
547                                    $form->setBloc('am_lot_max_nb','D',"","col_12");
548                  // bloc 4.2                      $form->setFieldset('am_lot_max_nb','D'
549                  $form->setBloc('am_lot_max_nb','D',_("Demande concernant un lotissement"),"col_12");                                         ,_("Complement d'amenagement"), "startClosed");
550                            // bloc 4.2
551                  $form->setBloc('am_lot_vente_ant','F');                          $form->setBloc('am_lot_max_nb','D',_("Demande concernant un lotissement"),"col_12 alignFormSpec");
552                            
553                  // bloc 4.3                              $form->setBloc('am_lot_max_nb','DF',"", "group");
554                  $form->setBloc('am_empl_nb','D',_("Amenagement d'un camping ou                              $form->setBloc('am_lot_max_shon','DF',"", "group");
555                                 d'un terrain aménagé en vue de l'hébergement                          
556                                 touristique"),"col_12");                              $form->setBloc('am_lot_cstr_cos','DF',_("Comment la constructibilite globale sera-t-elle repartie ?"), "group");
557                                $form->setBloc('am_lot_cstr_plan','DF',"", "group");
558                                $form->setBloc('am_lot_cstr_vente','DF',"", "group");
559                                $form->setBloc('am_lot_fin_diff','DF',"", "group");
560                                
561                                $form->setBloc('am_lot_consign','DF',_("si oui, quelle garantie sera utilisee ?"), "group");
562                                $form->setBloc('am_lot_gar_achev','DF',"", "group");
563                                $form->setBloc('am_lot_vente_ant','DF',"", "group");
564                            $form->setBloc('am_lot_vente_ant','F');
565    
566                            // bloc 4.3
567                            $form->setBloc('am_exist_agrand','D',_("Amenagement d'un camping ou
568                                           d'un terrain amenage en vue de l'hebergement
569                                           touristique"),"col_12");
570                                          
571                                $form->setBloc('am_exist_agrand','DF',"", "alignFormSpec");
572                                    $form->setBloc('am_exist_date','DF',"", "alignFormSpec-type-date");
573                                    $form->setBloc('am_exist_num','D',"", "alignFormSpec");
574                                $form->setBloc('am_empl_nb','F',"", "");
575                                
576                                $form->setBloc('am_tente_nb','D',_("Nombre maximum d’emplacements reserves aux :"), "col_12 alignForm");
577                                $form->setBloc('am_mobil_nb','F',"", "");
578                                
579                                $form->setBloc('am_pers_nb','DF',"", "alignFormSpec group");
580                                
581                                $form->setBloc('am_empl_hll_nb','D',_("Implantation d’habitations legeres de loisirs (HLL) :"), "col_12 alignFormSpec");
582                                //$form->setBloc('am_empl_hll_nb','DF',"", "group");
583                                $form->setBloc('am_hll_shon','F');
584                                    
585                                $form->setBloc('am_periode_exploit','DF',"", "group");
586                                
587                                $form->setBloc('am_coupe_bois','D',_("Declaration de coupe et/ou abattage d’arbres :"),"col_12 cerfasubtitle");
588                                    
589                                    $form->setBloc('am_coupe_bois','D',_("Courte description du lieu :"), "cerfasubtitle alignForm");
590                                    $form->setBloc('am_coupe_align','F',"", "");
591                                    
592                                    $form->setBloc('am_coupe_ess','D',_("Nature du boisement :"),"col_12 cerfasubtitle alignForm");
593                                    $form->setBloc('am_coupe_autr','F');
594                                $form->setBloc('am_coupe_autr','F');
595                                
596                            $form->setBloc('am_coupe_autr','F');
597    
                 $form->setBloc('am_exist_agrand','F');  
598    
599                        $form->setFieldset('am_coupe_autr','F','');
600                    
601                    $form->setBloc('am_coupe_autr','F');
602              $form->setFieldset('am_coupe_autr','F','');              $form->setFieldset('am_coupe_autr','F','');
           
603          $form->setBloc('am_coupe_autr','F');          $form->setBloc('am_coupe_autr','F');
604            // Fin amménager
605          /*Fieldset n°5 Projet de construction */          // Construire
606          $form->setBloc('co_archi_recours','D',"","col_12");          $form->setBloc('co_archi_recours','D',"","col_12");
607              $form->setFieldset('co_archi_recours','D'              $form->setFieldset('co_archi_recours','D'
608                                 ,_("Projet de construction"));                                 ,_("Construire"), "startClosed");
609                  // bloc 5.1                  $form->setBloc('co_archi_recours','D', "","col_12");
610                  $form->setBloc('co_archi_recours','D',_("Architecte"),"col_12");                      $form->setFieldset('co_archi_recours','D'
611                                   ,_("Projet construction"), "startClosed");
                 $form->setBloc('co_archi_recours','F');  
612                                    
613                  // bloc 5.2                          $form->setBloc('co_archi_recours','D',_("Architecte"), "col_12");
614                  $form->setBloc('co_cstr_nouv','D',_("Nature du projet"),"col_12");                              $form->setBloc('co_archi_recours','DF',"", "alignFormSpec group");
615                                $form->setBloc('architecte','DF', "", "group");
616                  $form->setBloc('co_elec_tension','F');                          $form->setBloc('architecte','F');
617                            
618                            $form->setBloc('co_cstr_nouv','D',_("Nature du projet"), "col_12 alignFormSpec");
619                            $form->setBloc('co_cloture','F');
620                            $form->setBloc('co_projet_desc','DF',"", "group");
621                            $form->setBloc('co_elec_tension','DF', "", "alignFormSpec");
622                        $form->setFieldset('co_elec_tension','F','');
623                        $form->setFieldset('co_anx_pisc','D'
624                                   ,_("Complement construction"), "startClosed");
625                                  
626                            $form->setBloc('co_anx_pisc','D',"", "alignForm");
627                            $form->setBloc('co_anx_autr','F',"", "");
628                            $form->setBloc('co_anx_autr_desc','DF',"", "group");
629                            
630                            $form->setBloc('co_tot_log_nb','D',"", "alignForm");
631                            $form->setBloc('co_tot_coll_nb','F',"", "");
632                            
633                            $form->setBloc('co_mais_piece_nb','D',"", "alignForm");
634                            $form->setBloc('co_mais_niv_nb','F',"", "");
635                            
636                            $form->setBloc('co_fin_lls_nb','D', _("Repartition du nombre total de logement crees par type de financement :"),"col_12");
637                                $form->setBloc('co_fin_lls_nb','D',"", "alignForm");
638                                $form->setBloc('co_fin_autr_nb','F',"", "");
639                                
640                                $form->setBloc('co_fin_autr_desc','DF',"", "alignFormSpec group");
641                                $form->setBloc('co_mais_contrat_ind','DF',"", "alignFormSpec group");
642                            $form->setBloc('co_mais_contrat_ind','F');
643                            
644                            $form->setBloc('co_uti_pers','D',_("Mode d'utilisation principale des logements :"), "col_12");
645                                $form->setBloc('co_uti_pers','D', "", "alignForm");
646                                $form->setBloc('co_uti_loc','F',"", "");
647                            $form->setBloc('co_uti_loc','F',"", "");
648                            
649                            $form->setBloc('co_uti_princ','D',_("S’il s’agit d’une occupation personnelle, veuillez preciser :"), "col_12");
650                                $form->setBloc('co_uti_princ','D',"", "alignForm");
651                                $form->setBloc('co_uti_secon','F',"", "");
652                            $form->setBloc('co_uti_secon','F',"", "group");
653                            
654                            $form->setBloc('co_resid_agees','D',_("Si le projet est un foyer ou une residence, a quel titre :"), "col_12 alignForm");
655                                $form->setBloc('co_resid_agees','D',"", "alignForm");
656                                $form->setBloc('co_resid_hand','F',"", "");
657                            $form->setBloc('co_resid_hand','F',"", "group");
658                            
659                            $form->setBloc('co_resid_autr','DF',"", "group alignFormSpec");
660                            $form->setBloc('co_resid_autr_desc','DF',"", "group");
661                            $form->setBloc('co_foyer_chamb_nb','DF',"", "group alignFormSpec");
662                            
663                            $form->setBloc('co_log_1p_nb','D',_("Repartition du nombre de logements crees selon le nombre de pieces :"), "col_12");
664                                $form->setBloc('co_log_1p_nb','D', "", "alignForm");
665                                $form->setBloc('co_log_6p_nb','F',"", "group");
666                            $form->setBloc('co_log_6p_nb','F',"", "group");
667                            
668                            $form->setBloc('co_bat_niv_nb','DF',"", "alignFormSpec");
669                            
670                            $form->setBloc('co_trx_exten','D',_("Indiquez si vos travaux comprennent notamment :"), "col_12");
671                                $form->setBloc('co_trx_exten','D',"", "alignForm");
672                                $form->setBloc('co_trx_nivsup','F',"", "group");
673                            $form->setBloc('co_trx_nivsup','F',"", "group");
674    
675                        $form->setFieldset('co_trx_nivsup','F','');
676                        $form->setFieldset('tab_surface','D'
677                                   ,_("Destinations et surfaces des constructions"), "startClosed");
678                            $form->setBloc('tab_surface','D', "","col_12 group");
679                            $form->setBloc('tab_surface','F');
680                            $form->setBloc('co_sp_transport','D', _("Destination des constructions futures en cas de realisation au benefice d'un service public ou d'interet collectif :"),"col_12");
681                                $form->setBloc('co_sp_transport','D', "","alignForm");
682                                $form->setBloc('co_sp_culture','F', "","");
683                            $form->setBloc('co_sp_culture','F', "","");
684                    
685                        $form->setFieldset('co_sp_culture','F','');
686                        $form->setFieldset('co_demont_periode','D'
687                                   ,_("Divers construction"), "startClosed");
688                            
689                            $form->setBloc('co_demont_periode','DF', _("Construction periodiquement demontee et re-installee :"),"col_12 group");
690                            
691                            $form->setBloc('co_statio_avt_nb','D', _("Nombre de places de stationnement"),"col_12");
692                                $form->setBloc('co_statio_avt_nb','D', "","alignForm");
693                                $form->setBloc('co_statio_apr_nb','F', "","");
694                            $form->setBloc('co_statio_apr_nb','F', "","");
695                            
696                            $form->setBloc('co_statio_adr','D', _("Places de stationnement affectees au projet, amenagees ou reservees en dehors du terrain sur lequel est situe le projet"),"col_12");
697                                $form->setBloc('co_statio_adr','DF', "","group");
698                                
699                                $form->setBloc('co_statio_place_nb','D', "","col_12");
700                                    $form->setBloc('co_statio_place_nb','D', "","alignForm");
701                                    $form->setBloc('co_statio_tot_shob','F', "","");
702                                $form->setBloc('co_statio_tot_shob','F', "","");
703                            $form->setBloc('co_statio_tot_shob','F');
704                            $form->setBloc('co_statio_comm_cin_surf','D', _("Pour les commerces et cinemas :"),"col_12 alignFormSpec");
705                            $form->setBloc('co_perf_energ','F',"", "");
706                    
707                        $form->setFieldset('co_perf_energ','F','');
708                    $form->setBloc('co_perf_energ','F');
709    
710                  // bloc 5.3              $form->setFieldset('co_perf_energ','F','');
711                  $form->setBloc('co_tot_log_nb','D',_("Informations complementaires"),"col_12");          
712            $form->setBloc('co_perf_energ','F');
713            // Fin construire
714    
715                  $form->setBloc('co_trx_nivsup','F');          /*Fieldset n°6 Projet necessitant demolitions */
716            $form->setBloc('dm_constr_dates','D',"","col_12");
717                $form->setFieldset('dm_constr_dates','D'
718                                   ,_("Demolir"), "startClosed");
719                    $form->setBloc('dm_constr_dates','DF', "","group");
720                    $form->setBloc('dm_total','D', "","alignFormSpec");
721                    $form->setBloc('dm_partiel','F');
722                    $form->setBloc('dm_projet_desc','DF', "","group");
723                    $form->setBloc('dm_tot_log_nb','DF', "","alignFormSpec");
724                $form->setFieldset('dm_tot_log_nb','F','');
725            
726            $form->setBloc('dm_tot_log_nb','F');
727    
728                  // bloc 5.4          /*Fieldset n°4 Ouverture de chantier */
729                  $form->setBloc('co_demont_period','D',_("Construction periodiquement          $form->setBloc('doc_date','D',"","col_12");
730                                 démontee et re-installee"),"col_12");              $form->setFieldset('doc_date','D'
731                                   ,_("Ouverture de chantier"), "startClosed");
732                    $form->setBloc('doc_date','DF', "","alignFormSpec-type-date");
733                    $form->setBloc('doc_tot_trav','D', "","alignFormSpec");
734                    $form->setBloc('doc_tranche_trav','F');
735                    $form->setBloc('doc_tranche_trav_desc','DF', "","group");
736                    $form->setBloc('doc_surf','D', "","alignFormSpec");
737                    $form->setBloc('doc_nb_log_autre','F', "","group");
738                $form->setFieldset('doc_nb_log_autre','F','');
739            $form->setBloc('doc_nb_log_autre','F');
740    
741            /*Fieldset n°4  Achèvement des travaux */
742            $form->setBloc('daact_date','D',"","col_12");
743                $form->setFieldset('daact_date','D'
744                                   ,_("Achevement des travaux") , "startClosed");
745                                  
746                    $form->setBloc('daact_date','D', "","alignFormSpec-type-date");
747                    $form->setBloc('daact_date_chgmt_dest','F');
748                    
749                    $form->setBloc('daact_tot_trav','D', "","alignFormSpec");
750                    $form->setBloc('daact_tranche_trav','F');
751                    
752                    $form->setBloc('daact_tranche_trav_desc','DF', "","group");
753                    
754                    $form->setBloc('daact_surf','D', "","alignFormSpec");
755                    $form->setBloc('daact_nb_log_autre','F', "","group");
756                $form->setFieldset('daact_nb_log_autre','F','');
757            $form->setBloc('daact_nb_log_autre','F');
758    
759            $form->setBloc('code_cnil','D',"","col_12");
760                $form->setBloc('code_cnil','DF', "","alignFormSpec");
761            $form->setBloc('code_cnil','F');
762    
763            $form->setBloc('tax_surf_tot','D',"","col_12");
764                $form->setFieldset('tax_surf_tot','D'
765                                   ,_("Declaration des elements necessaires au calcul des impositions"), "startClosed");
766    
767                    $form->setBloc('tax_surf_tot','D', _("Renseignement"),"col_12");
768                        $form->setBloc('tax_surf_tot','D', "", "alignFormSpec");
769                        $form->setBloc('tax_surf_suppr_mod','F', "","");
770                    $form->setBloc('tax_surf_suppr_mod','F', "","");
771    
772                  $form->setBloc('co_demont_period','F');                  $form->setBloc('tab_tax_su_princ','D',_("Creation de locaux destines a l’habitation :"),"col_12");
773                    $form->setBloc('tab_tax_su_tot','F', "","");
774                    
775                    $form->setBloc('tax_ext_pret','DF', "","alignFormSpec");
776                    $form->setBloc('tax_ext_desc','DF', "","group");
777                    $form->setBloc('tax_surf_tax_exist_cons','D', "","alignFormSpec");
778                    $form->setBloc('tax_log_exist_nb','F');
779    
780                    $form->setBloc('tax_comm_nb','D', _("Creation ou extension de locaux non destines a l'habitation :"),"col_12");
781                        $form->setBloc('tax_comm_nb','DF', "","col_12 alignFormSpec");
782                        $form->setBloc('tax_log_exist_nb','DF');
783                    $form->setBloc('tax_log_exist_nb','F');
784    
785                    $form->setBloc('tax_trx_presc_ppr','D', _("Cas particuliers"),"col_12 alignFormSpec");
786                    $form->setBloc('tax_monu_hist','F');
787    
788                    $form->setBloc('vsd_surf_planch_smd','D', _("Versement pour sous-densite (VSD)"),"col_12");
789                        $form->setBloc('vsd_surf_planch_smd','D', "","alignFormSpec");
790                        $form->setBloc('vsd_const_sxist_non_dem_surf','F');
791                        
792                        $form->setBloc('vsd_rescr_fisc','DF',"", "alignFormSpec-type-date");
793                    $form->setBloc('vsd_rescr_fisc','F');
794                    
795                    $form->setBloc('pld_val_terr','D', _("Plafond legal de densite (PLD)"),"col_12 alignFormSpec");
796                    $form->setBloc('pld_const_exist_dem_surf','F');
797    
798                  // bloc 5.5              $form->setFieldset('pld_const_exist_dem_surf','F','');
799                  $form->setBloc('tab_surface','D',_("Destination des constructions          
800                                 et tableau des surfaces"),"col_12");          $form->setBloc('pld_const_exist_dem_surf','F');
801        }
802    
803                  $form->setBloc('tab_surface','F');      /**
804         * Surcharge de la méthode setOnChange
805         */
806        function setOnchange(&$form,$maj){
807            parent::setOnchange($form,$maj);
808    
809                  // bloc 5.6          $form->setOnchange("co_tot_ind_nb","sommeChampsCerfa('co_tot_log_nb',['co_tot_ind_nb','co_tot_coll_nb']);");
810                  $form->setBloc('co_sp_transport','D',_("Destination des constructions          $form->setOnchange("co_tot_coll_nb","sommeChampsCerfa('co_tot_log_nb',['co_tot_ind_nb','co_tot_coll_nb']);");
                                futures en cas de realisation au benefice d'un  
                                service public ou d'interet collectif"),"col_12");  
811    
812                  $form->setBloc('co_sp_culture','F');          $form->setOnchange("doc_nb_log_indiv","sommeChampsCerfa('doc_nb_log',['doc_nb_log_indiv','doc_nb_log_coll']);");
813            $form->setOnchange("doc_nb_log_coll","sommeChampsCerfa('doc_nb_log',['doc_nb_log_indiv','doc_nb_log_coll']);");
814            
815            $form->setOnchange("su_avt_shon1","calculSurfaceTotal();");
816            $form->setOnchange("su_avt_shon2","calculSurfaceTotal();");
817            $form->setOnchange("su_avt_shon3","calculSurfaceTotal();");
818            $form->setOnchange("su_avt_shon4","calculSurfaceTotal();");
819            $form->setOnchange("su_avt_shon5","calculSurfaceTotal();");
820            $form->setOnchange("su_avt_shon6","calculSurfaceTotal();");
821            $form->setOnchange("su_avt_shon7","calculSurfaceTotal();");
822            $form->setOnchange("su_avt_shon8","calculSurfaceTotal();");
823            $form->setOnchange("su_avt_shon9","calculSurfaceTotal();");
824            $form->setOnchange("su_cstr_shon1","calculSurfaceTotal();");
825            $form->setOnchange("su_cstr_shon2","calculSurfaceTotal();");
826            $form->setOnchange("su_cstr_shon3","calculSurfaceTotal();");
827            $form->setOnchange("su_cstr_shon4","calculSurfaceTotal();");
828            $form->setOnchange("su_cstr_shon5","calculSurfaceTotal();");
829            $form->setOnchange("su_cstr_shon6","calculSurfaceTotal();");
830            $form->setOnchange("su_cstr_shon7","calculSurfaceTotal();");
831            $form->setOnchange("su_cstr_shon8","calculSurfaceTotal();");
832            $form->setOnchange("su_cstr_shon9","calculSurfaceTotal();");
833            $form->setOnchange("su_trsf_shon1","calculSurfaceTotal();");
834            $form->setOnchange("su_trsf_shon2","calculSurfaceTotal();");
835            $form->setOnchange("su_trsf_shon3","calculSurfaceTotal();");
836            $form->setOnchange("su_trsf_shon4","calculSurfaceTotal();");
837            $form->setOnchange("su_trsf_shon5","calculSurfaceTotal();");
838            $form->setOnchange("su_trsf_shon6","calculSurfaceTotal();");
839            $form->setOnchange("su_trsf_shon7","calculSurfaceTotal();");
840            $form->setOnchange("su_trsf_shon8","calculSurfaceTotal();");
841            $form->setOnchange("su_trsf_shon9","calculSurfaceTotal();");
842            $form->setOnchange("su_chge_shon1","calculSurfaceTotal();");
843            $form->setOnchange("su_chge_shon2","calculSurfaceTotal();");
844            $form->setOnchange("su_chge_shon3","calculSurfaceTotal();");
845            $form->setOnchange("su_chge_shon4","calculSurfaceTotal();");
846            $form->setOnchange("su_chge_shon5","calculSurfaceTotal();");
847            $form->setOnchange("su_chge_shon6","calculSurfaceTotal();");
848            $form->setOnchange("su_chge_shon7","calculSurfaceTotal();");
849            $form->setOnchange("su_chge_shon8","calculSurfaceTotal();");
850            $form->setOnchange("su_chge_shon9","calculSurfaceTotal();");
851            $form->setOnchange("su_demo_shon1","calculSurfaceTotal();");
852            $form->setOnchange("su_demo_shon2","calculSurfaceTotal();");
853            $form->setOnchange("su_demo_shon3","calculSurfaceTotal();");
854            $form->setOnchange("su_demo_shon4","calculSurfaceTotal();");
855            $form->setOnchange("su_demo_shon5","calculSurfaceTotal();");
856            $form->setOnchange("su_demo_shon6","calculSurfaceTotal();");
857            $form->setOnchange("su_demo_shon7","calculSurfaceTotal();");
858            $form->setOnchange("su_demo_shon8","calculSurfaceTotal();");
859            $form->setOnchange("su_demo_shon9","calculSurfaceTotal();");
860            $form->setOnchange("su_sup_shon1","calculSurfaceTotal();");
861            $form->setOnchange("su_sup_shon2","calculSurfaceTotal();");
862            $form->setOnchange("su_sup_shon3","calculSurfaceTotal();");
863            $form->setOnchange("su_sup_shon4","calculSurfaceTotal();");
864            $form->setOnchange("su_sup_shon5","calculSurfaceTotal();");
865            $form->setOnchange("su_sup_shon6","calculSurfaceTotal();");
866            $form->setOnchange("su_sup_shon7","calculSurfaceTotal();");
867            $form->setOnchange("su_sup_shon8","calculSurfaceTotal();");
868            $form->setOnchange("su_sup_shon9","calculSurfaceTotal();");
869            $form->setOnchange("su_tot_shon1","calculSurfaceTotal();");
870            $form->setOnchange("su_tot_shon2","calculSurfaceTotal();");
871            $form->setOnchange("su_tot_shon3","calculSurfaceTotal();");
872            $form->setOnchange("su_tot_shon4","calculSurfaceTotal();");
873            $form->setOnchange("su_tot_shon5","calculSurfaceTotal();");
874            $form->setOnchange("su_tot_shon6","calculSurfaceTotal();");
875            $form->setOnchange("su_tot_shon7","calculSurfaceTotal();");
876            $form->setOnchange("su_tot_shon8","calculSurfaceTotal();");
877            $form->setOnchange("su_tot_shon9","calculSurfaceTotal();");
878    
879                  // bloc 5.7      }
                 $form->setBloc('co_statio_avt_nb','D',_("Stationnement"),"col_12");  
880    
881                  $form->setBloc('co_statio_comm_cin_surf','F');      
882        /**
883         * Surcharge du bouton retour afin de retourner sur le dossier d'instruction selon de cas
884         */
885        function retoursousformulaire($idxformulaire, $retourformulaire, $val,
886                                      $objsf, $premiersf, $tricolsf, $validation,
887                                      $idx, $maj, $retour) {
888    
889              $form->setFieldset('co_statio_apr_surf','F','');          $visualisation = $this->getParameter('visualisation');
890                    
891          $form->setBloc('co_statio_apr_surf','F');          if ( $visualisation == "" ){
892                
893                // Ajout et consultation, retour dossier
894                if ( ( $maj == 0 && $validation == 0 ) ||
895                    ( $maj == 3 && $validation == 0 ) ||
896                    ( $maj == 0 && $validation == 1 )  && $retourformulaire == "dossier_instruction" ){
897                
898                    echo "\n<a class=\"retour\" ";
899                        echo "href=\"#\" ";
900                        echo "onclick=\"redirectPortletAction(1,'main');\" ";
901                        echo ">";
902                        echo _("Retour");
903                    echo "</a>\n";
904                }
905                //Sinon affiche un retour normal
906                else{
907                    
908                    parent::retoursousformulaire($idxformulaire, $retourformulaire, $val,
909                                          $objsf, $premiersf, $tricolsf, $validation,
910                                          $idx, $maj, $retour);
911                }
912            }
913        }
914    
915        /**
916         * Cette variable permet de stocker le résultat de la méthode
917         * getDivisionFromDossier() afin de ne pas effectuer le recalcul à chacun de
918         * ces appels.
919         * @var string Code de la division du dossier en cours
920         */
921        var $_division_from_dossier = NULL;
922    
923        /**
924         * Cette méthode permet de récupérer le code de division correspondant
925         * au dossier sur lequel on se trouve.
926         *
927         * @return string Code de la division du dossier en cours
928         */
929        function getDivisionFromDossier() {
930    
931          /*Fieldset n°6 Projet necessitant demolitions */          // Cette méthode peut être appelée plusieurs fois lors d'une requête.
932          $form->setBloc('dm_constr_dates','D',"","col_12");          // Pour éviter de refaire le traitement de recherche de la division
933              $form->setFieldset('dm_constr_dates','D'          // alors on vérifie si nous ne l'avons pas déjà calculé.
934                                 ,_("Projet necessitant demolitions"));          if ($this->_division_from_dossier != NULL) {
935                // Logger
936                $this->addToLog("getDivisionFromDossier(): retour de la valeur déjà calculée - '".$this->_division_from_dossier."'", EXTRA_VERBOSE_MODE);
937                // On retourne la valeur déjà calculée
938                return $this->_division_from_dossier;
939            }
940    
941                  $form->setBloc('dm_constr_dates','D',"","col_12");          // Par défaut, on définit la valeur du dossier à NULL
942            $dossier = NULL;
943            // Test sur le mode et le contexte du formulaire
944            if ($this->getParameter("maj") == 0
945                && ($this->getParameter("retourformulaire") == "dossier"
946                    || $this->getParameter("retourformulaire") == "dossier_instruction"
947                    || $this->getParameter("retourformulaire") == "dossier_instruction_mes_encours"
948                    || $this->getParameter("retourformulaire") == "dossier_instruction_tous_encours"
949                    || $this->getParameter("retourformulaire") == "dossier_instruction_mes_clotures"
950                    || $this->getParameter("retourformulaire") == "dossier_instruction_tous_clotures")) {
951                // Si on se trouve en mode AJOUT (seul mode où l'enregistrement
952                // n'existe pas en base de données) ET que nous nous trouvons
953                // dans le contexte d'un dossier d'instruction alors on récupère
954                // le numéro de dossier depuis le paramètre 'idxformulaire'
955                $dossier = $this->getParameter("idxformulaire");
956            } else {
957                // Sinon on récupère le numéro de dossier dans le champs dossier de
958                // l'enregistrement (en base de données)
959                $dossier = $this->getVal("dossier");
960            }
961    
962                  $form->setBloc('dm_tot_log_nb','F');          // On appelle la méthode de la classe utils qui renvoi le code de la
963            // division d'un dossier, on la stocke pour ne pas refaire le calcul au
964            // prochain appel de cette méthode
965            $this->_division_from_dossier = $this->f->getDivisionFromDossier($dossier);
966            // Logger
967            $this->addToLog("getDivisionFromDossier(): retour de la valeur nouvellement calculée - '".$this->_division_from_dossier."'", EXTRA_VERBOSE_MODE);
968            // On retourne la valeur retournée
969            return $this->_division_from_dossier;
970    
             $form->setFieldset('dm_tot_log_nb','F','');  
           
         $form->setBloc('dm_tot_log_nb','F');  
971      }      }
972            
973      /**      /**
974       * Surcharge du bouton retour afin de retourner sur le dossier d'instruction selon de cas       * Retourne le nom et le prénom de l'architecte qui a l'identifiant $id
975         * @param integer $id
976         * @param object $db
977         * @return string
978       */       */
979      function retoursousformulaire($idxformulaire, $retourformulaire, $val,      function getPrenomNomArchitecte($id){
980                                    $objsf, $premiersf, $tricolsf, $validation,          
981                                    $idx, $maj, $retour) {          $coordonneesArchitecte = "";
982            if ( $id != '' && is_numeric($id) ){
         // Ajout et consultation, retour dossier  
         if ( ( $maj == 0 && $validation == 0 ) ||  
             ( $maj == 3 && $validation == 0 ) ||  
             ( $maj == 0 && $validation == 1 )  && $retourformulaire == "dossier_instruction" ){  
           
             echo "\n<a class=\"retour\" ";  
                 echo "href=\"#\" ";  
                 echo "onclick=\"redirectPortletAction(1,'main');\" ";  
                 echo ">";  
                 echo _("Retour");  
             echo "</a>\n";  
         }  
         //Sinon affiche un retour normal  
         else {  
983                            
984              parent::retoursousformulaire($idxformulaire, $retourformulaire, $val,              $sql = "SELECT
985                                    $objsf, $premiersf, $tricolsf, $validation,                  CONCAT(architecte.prenom, ' ', architecte.nom)
986                                    $idx, $maj, $retour);              FROM
987                    ".DB_PREFIXE."architecte
988                WHERE
989                    architecte.architecte = ".$id;
990                $coordonneesArchitecte = $this->db->getOne($sql);
991                $this->f->addToLog("setSelect() : db->getOne(\"".$sql."\")", VERBOSE_MODE);
992                if ( database::isError($coordonneesArchitecte)){
993                    $this->f->addToError("", $coordonneesArchitecte, $coordonneesArchitecte);
994                    return false;
995                }
996          }          }
997            return $coordonneesArchitecte;
998      }      }
999    
1000  }// fin classe  }// fin classe
 ?>  
1001    ?>

Legend:
Removed from v.1266  
changed lines
  Added in v.2130

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26