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