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 |
|
|
/** |
17 |
|
|
* Méthode permettant de récupérer l'id du cerfa lié au dossier |
18 |
|
|
**/ |
19 |
|
|
function getCerfa(){ |
20 |
nhaye |
1263 |
|
21 |
|
|
$sql = "SELECT cerfa FROM ".DB_PREFIXE."dossier_instruction_type |
22 |
|
|
JOIN ".DB_PREFIXE."dossier ON dossier.dossier_instruction_type= |
23 |
|
|
dossier_instruction_type.dossier_instruction_type |
24 |
nhaye |
1262 |
WHERE dossier = '".$this->getParameter("idxformulaire")."'"; |
25 |
|
|
$cerfa = $this->db->getOne($sql); |
26 |
|
|
$this->addToLog("db->getone(\"".$sql."\");", VERBOSE_MODE); |
27 |
|
|
$this->f->isDatabaseError($cerfa); |
28 |
|
|
|
29 |
|
|
// Si le cerfa est défini dans dossier on instancie le cerfa correspondant |
30 |
|
|
if(!empty($cerfa)) { |
31 |
|
|
require_once ("../obj/cerfa.class.php"); |
32 |
|
|
$this->cerfa = new cerfa($cerfa, $this->db, DEBUG); |
33 |
nhaye |
1263 |
} else { |
34 |
|
|
$this->f->displayMessage("error", _("Aucun cerfa lié à ce type de dossier")); |
35 |
|
|
die(); |
36 |
nhaye |
1262 |
} |
37 |
|
|
} |
38 |
|
|
|
39 |
|
|
function setSelect(&$form, $maj,&$db,$debug) { |
40 |
|
|
parent::setSelect($form, $maj,$db,$debug); |
41 |
|
|
if(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc.php")) |
42 |
|
|
include ("../sql/".$db->phptype."/".$this->table.".form.inc.php"); |
43 |
|
|
elseif(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc")) |
44 |
|
|
include ("../sql/".$db->phptype."/".$this->table.".form.inc"); |
45 |
|
|
|
46 |
|
|
if(empty($this->cerfa)) { |
47 |
|
|
$this->getCerfa(); |
48 |
|
|
} |
49 |
|
|
|
50 |
|
|
// Configuration du tableau des surfaces |
51 |
|
|
$contenu['column_header']=$tab_surface[$this->cerfa->getVal("tab_surface")]['column_header']; |
52 |
|
|
$contenu['row_header']=$tab_surface[$this->cerfa->getVal("tab_surface")]['row_header']; |
53 |
|
|
|
54 |
|
|
foreach($tab_surface[$this->cerfa->getVal("tab_surface")]['values'] as $champ) { |
55 |
|
|
$contenu['values'][$champ] = $this->getVal($champ); |
56 |
|
|
} |
57 |
|
|
|
58 |
|
|
$form->setSelect("tab_surface",$contenu); |
59 |
|
|
|
60 |
|
|
|
61 |
|
|
} |
62 |
|
|
|
63 |
|
|
|
64 |
|
|
// XXX Créer une nouvelle méthode au même endroit que l'appel a checkAccessibility() |
65 |
|
|
function checkAccessibility() { |
66 |
|
|
|
67 |
|
|
unset($this->champs[array_search("su_avt_shon1",$this->champs)]); |
68 |
|
|
unset($this->champs[array_search("su_avt_shon2",$this->champs)]); |
69 |
|
|
unset($this->champs[array_search("su_avt_shon3",$this->champs)]); |
70 |
|
|
unset($this->champs[array_search("su_avt_shon4",$this->champs)]); |
71 |
|
|
unset($this->champs[array_search("su_avt_shon5",$this->champs)]); |
72 |
|
|
unset($this->champs[array_search("su_avt_shon6",$this->champs)]); |
73 |
|
|
unset($this->champs[array_search("su_avt_shon7",$this->champs)]); |
74 |
|
|
unset($this->champs[array_search("su_avt_shon8",$this->champs)]); |
75 |
|
|
unset($this->champs[array_search("su_avt_shon9",$this->champs)]); |
76 |
|
|
unset($this->champs[array_search("su_cstr_shon1",$this->champs)]); |
77 |
|
|
unset($this->champs[array_search("su_cstr_shon2",$this->champs)]); |
78 |
|
|
unset($this->champs[array_search("su_cstr_shon3",$this->champs)]); |
79 |
|
|
unset($this->champs[array_search("su_cstr_shon4",$this->champs)]); |
80 |
|
|
unset($this->champs[array_search("su_cstr_shon5",$this->champs)]); |
81 |
|
|
unset($this->champs[array_search("su_cstr_shon6",$this->champs)]); |
82 |
|
|
unset($this->champs[array_search("su_cstr_shon7",$this->champs)]); |
83 |
|
|
unset($this->champs[array_search("su_cstr_shon8",$this->champs)]); |
84 |
|
|
unset($this->champs[array_search("su_cstr_shon9",$this->champs)]); |
85 |
|
|
unset($this->champs[array_search("su_trsf_shon1",$this->champs)]); |
86 |
|
|
unset($this->champs[array_search("su_trsf_shon2",$this->champs)]); |
87 |
|
|
unset($this->champs[array_search("su_trsf_shon3",$this->champs)]); |
88 |
|
|
unset($this->champs[array_search("su_trsf_shon4",$this->champs)]); |
89 |
|
|
unset($this->champs[array_search("su_trsf_shon5",$this->champs)]); |
90 |
|
|
unset($this->champs[array_search("su_trsf_shon6",$this->champs)]); |
91 |
|
|
unset($this->champs[array_search("su_trsf_shon7",$this->champs)]); |
92 |
|
|
unset($this->champs[array_search("su_trsf_shon8",$this->champs)]); |
93 |
|
|
unset($this->champs[array_search("su_trsf_shon9",$this->champs)]); |
94 |
|
|
unset($this->champs[array_search("su_chge_shon1",$this->champs)]); |
95 |
|
|
unset($this->champs[array_search("su_chge_shon2",$this->champs)]); |
96 |
|
|
unset($this->champs[array_search("su_chge_shon3",$this->champs)]); |
97 |
|
|
unset($this->champs[array_search("su_chge_shon4",$this->champs)]); |
98 |
|
|
unset($this->champs[array_search("su_chge_shon5",$this->champs)]); |
99 |
|
|
unset($this->champs[array_search("su_chge_shon6",$this->champs)]); |
100 |
|
|
unset($this->champs[array_search("su_chge_shon7",$this->champs)]); |
101 |
|
|
unset($this->champs[array_search("su_chge_shon8",$this->champs)]); |
102 |
|
|
unset($this->champs[array_search("su_chge_shon9",$this->champs)]); |
103 |
|
|
unset($this->champs[array_search("su_demo_shon1",$this->champs)]); |
104 |
|
|
unset($this->champs[array_search("su_demo_shon2",$this->champs)]); |
105 |
|
|
unset($this->champs[array_search("su_demo_shon3",$this->champs)]); |
106 |
|
|
unset($this->champs[array_search("su_demo_shon4",$this->champs)]); |
107 |
|
|
unset($this->champs[array_search("su_demo_shon5",$this->champs)]); |
108 |
|
|
unset($this->champs[array_search("su_demo_shon6",$this->champs)]); |
109 |
|
|
unset($this->champs[array_search("su_demo_shon7",$this->champs)]); |
110 |
|
|
unset($this->champs[array_search("su_demo_shon8",$this->champs)]); |
111 |
|
|
unset($this->champs[array_search("su_demo_shon9",$this->champs)]); |
112 |
|
|
unset($this->champs[array_search("su_sup_shon1",$this->champs)]); |
113 |
|
|
unset($this->champs[array_search("su_sup_shon2",$this->champs)]); |
114 |
|
|
unset($this->champs[array_search("su_sup_shon3",$this->champs)]); |
115 |
|
|
unset($this->champs[array_search("su_sup_shon4",$this->champs)]); |
116 |
|
|
unset($this->champs[array_search("su_sup_shon5",$this->champs)]); |
117 |
|
|
unset($this->champs[array_search("su_sup_shon6",$this->champs)]); |
118 |
|
|
unset($this->champs[array_search("su_sup_shon7",$this->champs)]); |
119 |
|
|
unset($this->champs[array_search("su_sup_shon8",$this->champs)]); |
120 |
|
|
unset($this->champs[array_search("su_sup_shon9",$this->champs)]); |
121 |
|
|
unset($this->champs[array_search("su_tot_shon1",$this->champs)]); |
122 |
|
|
unset($this->champs[array_search("su_tot_shon2",$this->champs)]); |
123 |
|
|
unset($this->champs[array_search("su_tot_shon3",$this->champs)]); |
124 |
|
|
unset($this->champs[array_search("su_tot_shon4",$this->champs)]); |
125 |
|
|
unset($this->champs[array_search("su_tot_shon5",$this->champs)]); |
126 |
|
|
unset($this->champs[array_search("su_tot_shon6",$this->champs)]); |
127 |
|
|
unset($this->champs[array_search("su_tot_shon7",$this->champs)]); |
128 |
|
|
unset($this->champs[array_search("su_tot_shon8",$this->champs)]); |
129 |
|
|
unset($this->champs[array_search("su_tot_shon9",$this->champs)]); |
130 |
|
|
unset($this->champs[array_search("su_avt_shon_tot",$this->champs)]); |
131 |
|
|
unset($this->champs[array_search("su_cstr_shon_tot",$this->champs)]); |
132 |
|
|
unset($this->champs[array_search("su_trsf_shon_tot",$this->champs)]); |
133 |
|
|
unset($this->champs[array_search("su_chge_shon_tot",$this->champs)]); |
134 |
|
|
unset($this->champs[array_search("su_demo_shon_tot",$this->champs)]); |
135 |
|
|
unset($this->champs[array_search("su_sup_shon_tot",$this->champs)]); |
136 |
|
|
unset($this->champs[array_search("su_tot_shon_tot",$this->champs)]); |
137 |
|
|
// Renumérotation |
138 |
|
|
$this->champs = array_values($this->champs); |
139 |
|
|
} |
140 |
|
|
|
141 |
|
|
function setType(&$form,$maj) { |
142 |
|
|
parent::setType($form,$maj); |
143 |
|
|
|
144 |
|
|
if(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php")) |
145 |
|
|
include ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php"); |
146 |
|
|
elseif(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc")) |
147 |
|
|
include ("../sql/".$this->db->phptype."/".$this->table.".form.inc"); |
148 |
|
|
|
149 |
|
|
if(empty($this->cerfa)) { |
150 |
|
|
$this->getCerfa(); |
151 |
|
|
} |
152 |
|
|
// Définition du type "tableau" |
153 |
|
|
$form->setType('tab_surface','tableau'); |
154 |
|
|
|
155 |
|
|
$form->setType('dossier_instruction', 'hidden'); |
156 |
|
|
|
157 |
|
|
// Boucler sur les champs du cerfa pour cacher les données qui ne doivent |
158 |
|
|
// pas être saisies |
159 |
|
|
|
160 |
|
|
foreach ($this->cerfa->champs as $champ) { |
161 |
|
|
if(array_search($champ, $this->champs) !== false) { |
162 |
|
|
if($this->cerfa->getVal($champ) == 'f') { |
163 |
|
|
$form->setType($champ,'hidden'); |
164 |
|
|
} |
165 |
|
|
} |
166 |
|
|
} |
167 |
|
|
} |
168 |
|
|
|
169 |
nhaye |
1263 |
function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire,&$db,$DEBUG=null){ |
170 |
|
|
$this->retourformulaire = $retourformulaire; |
171 |
|
|
if($validation == 0) { |
172 |
|
|
if($retourformulaire =='dossier') |
173 |
|
|
$form->setVal('dossier_instruction', $idxformulaire); |
174 |
|
|
if($retourformulaire =='dossier_instruction') |
175 |
|
|
$form->setVal('dossier_instruction', $idxformulaire); |
176 |
|
|
if($retourformulaire =='lot') |
177 |
|
|
$form->setVal('lot', $idxformulaire); |
178 |
|
|
}// fin validation |
179 |
|
|
}// fin setValsousformulaire |
180 |
|
|
|
181 |
vpihour |
1249 |
}// fin classe |
182 |
|
|
?> |