/[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 1393 by fmichon, Wed Mar 6 13:32:46 2013 UTC revision 1394 by nhaye, Wed Mar 13 15:55:10 2013 UTC
# Line 104  class donnees_techniques extends donnees Line 104  class donnees_techniques extends donnees
104          foreach($tab_surface[$this->cerfa->getVal("tab_surface")]['values'] as $champ) {          foreach($tab_surface[$this->cerfa->getVal("tab_surface")]['values'] as $champ) {
105              unset($this->champs[array_search($champ,$this->champs)]);              unset($this->champs[array_search($champ,$this->champs)]);
106          }          }
107            foreach($tab_tax_su_princ[$this->cerfa->getVal("tab_tax_su_princ")]['values'] as $champ) {
108                unset($this->champs[array_search($champ,$this->champs)]);
109            }
110            foreach($tab_tax_su_heber[$this->cerfa->getVal("tab_tax_su_heber")]['values'] as $champ) {
111                unset($this->champs[array_search($champ,$this->champs)]);
112            }
113            foreach($tab_tax_su_secon[$this->cerfa->getVal("tab_tax_su_secon")]['values'] as $champ) {
114                unset($this->champs[array_search($champ,$this->champs)]);
115            }
116            foreach($tab_tax_su_tot[$this->cerfa->getVal("tab_tax_su_tot")]['values'] as $champ) {
117                unset($this->champs[array_search($champ,$this->champs)]);
118            }
119            foreach($tab_tax_su_non_habit_surf[$this->cerfa->getVal("tab_tax_su_non_habit_surf")]['values'] as $champ) {
120                unset($this->champs[array_search($champ,$this->champs)]);
121            }
122            foreach($tab_tax_am[$this->cerfa->getVal("tab_tax_am")]['values'] as $champ) {
123                unset($this->champs[array_search($champ,$this->champs)]);
124            }
125          // Renumérotation          // Renumérotation
126          $this->champs = array_values($this->champs);          $this->champs = array_values($this->champs);
127      }      }
# Line 125  class donnees_techniques extends donnees Line 143  class donnees_techniques extends donnees
143          }          }
144      }      }
145    
146        /**
147         * Méthode permettant de définir le type des champs des tableaux en fonction
148         * des valeurs du cerfa
149         **/
150        function setTabChampType($tab) {
151            if(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php"))
152                include ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php");
153            elseif(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc"))
154                include ("../sql/".$this->db->phptype."/".$this->table.".form.inc");
155            // Pour chaque champ dans la liste des champs du cerfa
156            $tableau = $$tab;
157            print_r($tableau[$this->cerfa->getVal($tab)]['values']);
158            foreach ($this->champs as $champ) {
159                if(array_search($champ, $this->cerfa->champs) !== false) {
160                    // On les cache si décoché dans le formulaire de cerfa
161                    if($this->cerfa->getVal($champ) == 'f') {
162                        $this->form->setType($champ,'hidden');
163                    }
164                } else {
165                    
166                    if(!in_array($champ, $tableau[$this->cerfa->getVal($tab)]['values'])) {
167    
168                        $this->form->setType($champ,'hidden');
169                    }
170                }
171            }
172        }
173    
174    
175    
176      function setType(&$form,$maj) {      function setType(&$form,$maj) {
177          parent::setType($form,$maj);          parent::setType($form,$maj);
178    
# Line 159  class donnees_techniques extends donnees Line 207  class donnees_techniques extends donnees
207                      $form->setType($champ,'hidden');                      $form->setType($champ,'hidden');
208                  }                  }
209              } else {              } else {
210                  if(!in_array($champ, $tab_surface[$this->cerfa->getVal("tab_surface")]['values'])) {  
211                    if(!in_array($champ, $tab_surface[$this->cerfa->getVal("tab_surface")]['values']) AND
212                       !in_array($champ, $tab_tax_su_princ[$this->cerfa->getVal("tab_tax_su_princ")]['values']) AND
213                       !in_array($champ, $tab_tax_su_heber[$this->cerfa->getVal("tab_tax_su_heber")]['values']) AND
214                       !in_array($champ, $tab_tax_su_secon[$this->cerfa->getVal("tab_tax_su_secon")]['values']) AND
215                       !in_array($champ, $tab_tax_su_tot[$this->cerfa->getVal("tab_tax_su_tot")]['values'])AND
216                       !in_array($champ, $tab_tax_su_non_habit_surf[$this->cerfa->getVal("tab_tax_su_non_habit_surf")]['values']) AND
217                       !in_array($champ, $tab_tax_am[$this->cerfa->getVal("tab_tax_am")]['values'])) {
218                      $form->setType($champ,'hidden');                      $form->setType($champ,'hidden');
219                  }                  }
220              }              }

Legend:
Removed from v.1393  
changed lines
  Added in v.1394

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26