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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2316 - (show annotations)
Thu Sep 19 12:26:53 2013 UTC (11 years, 4 months ago) by nhaye
File size: 53484 byte(s)
Modification de l'ordre de tri des listes déroulantes dans l'application

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26