16 |
function demande($id,&$db,$debug) { |
function demande($id,&$db,$debug) { |
17 |
$this->constructeur($id,$db,$debug); |
$this->constructeur($id,$db,$debug); |
18 |
}// fin constructeur |
}// fin constructeur |
19 |
|
|
20 |
|
function setValF($val) { |
21 |
|
parent::setValF($val); |
22 |
|
// Récupération des id demandeurs postés |
23 |
|
$this->getPostedValues(); |
24 |
|
//$this->valIdDemandeur=$this->postedIdDemandeur; |
25 |
|
} |
26 |
|
|
27 |
|
/** |
28 |
|
* Méthode permettant de récupérer les valeurs du dossier d'autorisation |
29 |
|
* correspondant à la nouvelle demande |
30 |
|
*/ |
31 |
|
function getValFromDossier($dossier_autorisation) { |
32 |
|
include "../sql/pgsql/demande.form.inc.php"; |
33 |
|
$sql=str_replace("<idx>",$this->getParameter("idx_dossier"), |
34 |
|
$sql_infos_dossier); |
35 |
|
$res = $this->db->query($sql); |
36 |
|
$this->addToLog("demande -> getValFromDossier() : ".$sql); |
37 |
|
$this->f->isDatabaseError(); |
38 |
|
$row = & $res->fetchRow(DB_FETCHMODE_ASSOC); |
39 |
|
return $row; |
40 |
|
} |
41 |
|
|
42 |
/* |
/* |
43 |
* La date du jour par défaut dans le champs date_demande |
* La date du jour par défaut dans le champs date_demande |
45 |
*/ |
*/ |
46 |
function setVal(&$form, $maj, $validation, &$db) { |
function setVal(&$form, $maj, $validation, &$db) { |
47 |
if($maj == 0) { |
if($maj == 0) { |
48 |
$form->setVal("date_demande",date('d/m/Y')); |
$form->setVal("date_demande",date('d/m/Y')); |
49 |
|
|
50 |
|
// Récupération des valeurs du dossier d'autorisation correspondant |
51 |
|
if($this->getParameter("idx_dossier") != "") { |
52 |
|
$val_autorisation = $this->getValFromDossier( |
53 |
|
$this->getParameter("idx_dossier")); |
54 |
|
foreach($val_autorisation as $champ => $value) { |
55 |
|
$form->setVal($champ,$value); |
56 |
|
} |
57 |
|
} |
58 |
} |
} |
59 |
} |
} |
60 |
|
|
63 |
*/ |
*/ |
64 |
function verifier($val, &$db, $DEBUG) { |
function verifier($val, &$db, $DEBUG) { |
65 |
parent::verifier($val, $db, $DEBUG); |
parent::verifier($val, $db, $DEBUG); |
|
$this->getPostedValues(); |
|
66 |
if(!isset($this->postedIdDemandeur["petitionnaire_principal"]) OR |
if(!isset($this->postedIdDemandeur["petitionnaire_principal"]) OR |
67 |
empty($this->postedIdDemandeur["petitionnaire_principal"])) { |
empty($this->postedIdDemandeur["petitionnaire_principal"])) { |
68 |
$this->correct = false; |
$this->correct = false; |
69 |
$this->addToMessage("La saisie d'un petitionnaire principal est obligatoire."); |
$this->addToMessage("La saisie d'un petitionnaire principal est obligatoire."); |
|
$this->valIdDemandeur=$this->postedIdDemandeur; |
|
70 |
} |
} |
71 |
} |
} |
72 |
/* |
/* |
76 |
function setLayout(&$form, $maj){ |
function setLayout(&$form, $maj){ |
77 |
if ( $maj < 2 OR $maj == 3 ) { |
if ( $maj < 2 OR $maj == 3 ) { |
78 |
|
|
79 |
//Champs sur lequel s'ouvre le fieldset |
/*Champ sur lequel s'ouvre le bloc 1 */ |
80 |
$form->setBloc('dossier_autorisation_type_detaille','D',"","dossier_type col_8"); |
$form->setBloc('dossier_autorisation_type_detaille','D',"","dossier_type col_8"); |
81 |
|
|
82 |
$form->setFieldset('dossier_autorisation_type_detaille','D' |
$form->setFieldset('dossier_autorisation_type_detaille','D' |
83 |
,_('Type de dossier/demande')); |
,_('Type de dossier/demande')); |
84 |
$form->setFieldset('demande_type','F',''); |
$form->setFieldset('demande_type','F',''); |
85 |
|
|
86 |
$form->setBloc('demande_type','F'); |
$form->setBloc('demande_type','F'); |
87 |
|
/*Fin bloc 1*/ |
88 |
|
|
89 |
|
/*Champ sur lequel s'ouvre le bloc 2 */ |
90 |
$form->setBloc('date_demande','D',"","col_4 demande_hidden_bloc"); |
$form->setBloc('date_demande','D',"","col_4 demande_hidden_bloc"); |
91 |
$form->setFieldset('date_demande','D',_('Date de la demande')); |
$form->setFieldset('date_demande','D',_('Date de la demande')); |
92 |
$form->setFieldset('date_demande','F',''); |
$form->setFieldset('date_demande','F',''); |
93 |
$form->setBloc('date_demande','F'); |
$form->setBloc('date_demande','F'); |
94 |
|
/*Fin bloc 2*/ |
95 |
|
|
96 |
|
/*Champ sur lequel s'ouvre le bloc 3 */ |
97 |
$form->setBloc('terrain_references_cadastrales','D',"", |
$form->setBloc('terrain_references_cadastrales','D',"", |
98 |
"localisation col_12 demande_hidden_bloc"); |
"localisation col_12 demande_hidden_bloc"); |
99 |
$form->setFieldset('terrain_references_cadastrales','D',_('Localisation du terrain')); |
$form->setFieldset('terrain_references_cadastrales','D',_('Localisation du terrain')); |
100 |
$form->setFieldset('terrain_superficie','F',''); |
$form->setFieldset('terrain_superficie','F',''); |
101 |
$form->setBloc('terrain_superficie','F'); |
$form->setBloc('terrain_superficie','F'); |
102 |
|
/*Fin bloc 4*/ |
103 |
|
|
104 |
|
/*Champ sur lequel s'ouvre le bloc 4 */ |
105 |
$form->setBloc('nombre_lots','D',"","lots col_12 demande_hidden_bloc"); |
$form->setBloc('nombre_lots','D',"","lots col_12 demande_hidden_bloc"); |
106 |
$form->setFieldset('nombre_lots','D',_('Nombre de lots')); |
$form->setFieldset('nombre_lots','D',_('Nombre de lots')); |
107 |
$form->setFieldset('nombre_lots','F',''); |
$form->setFieldset('nombre_lots','F',''); |
108 |
$form->setBloc('nombre_lots','F'); |
$form->setBloc('nombre_lots','F'); |
109 |
|
/*Fin bloc 5*/ |
110 |
} |
} |
111 |
} |
} |
112 |
|
|
129 |
|
|
130 |
$form->setType('dossier_instruction', 'hidden'); |
$form->setType('dossier_instruction', 'hidden'); |
131 |
$form->setType('dossier_autorisation', 'hidden'); |
$form->setType('dossier_autorisation', 'hidden'); |
132 |
|
|
133 |
|
$form->setType('instruction_recepisse', 'hidden'); |
134 |
|
$form->setType('arrondissement', 'hidden'); |
135 |
|
|
136 |
|
// Si il s'agit d'une demande sur dossier existant on desactive tous les champs |
137 |
|
// sauf demande_type |
138 |
|
if(($maj == 0 AND $this-> getParameter("idx_dossier"))) { |
139 |
|
$form->setType('dossier_autorisation_type_detaille', 'selecthiddenstatic'); |
140 |
|
$form->setType('terrain_references_cadastrales', 'hiddenstatic'); |
141 |
|
$form->setType('terrain_adresse_voie_numero', 'hiddenstatic'); |
142 |
|
$form->setType('complement', 'hiddenstatic'); |
143 |
|
$form->setType('terrain_adresse_lieu_dit', 'hiddenstatic'); |
144 |
|
$form->setType('terrain_adresse_localite', 'hiddenstatic'); |
145 |
|
$form->setType('terrain_adresse_code_postal', 'hiddenstatic'); |
146 |
|
$form->setType('terrain_adresse_bp', 'hiddenstatic'); |
147 |
|
$form->setType('terrain_adresse_cedex', 'hiddenstatic'); |
148 |
|
$form->setType('terrain_superficie', 'hiddenstatic'); |
149 |
|
$form->setType('nombre_lots', 'hiddenstatic'); |
150 |
|
} |
151 |
|
if($maj == 1) { |
152 |
|
$form->setType('dossier_autorisation_type_detaille', 'selecthiddenstatic'); |
153 |
|
$form->setType('demande_type', 'selecthiddenstatic'); |
154 |
|
} |
155 |
|
if($maj == 3) { |
156 |
|
$form->setType('terrain_references_cadastrales', 'referencescadastralesstatic'); |
157 |
|
} |
158 |
|
|
159 |
} |
} |
160 |
|
|
161 |
/** |
/** |
162 |
* Méthode permettant la création de dossiers |
* Méthode permettant d'ajouter un dossier d'autorisation |
163 |
|
*/ |
164 |
|
function ajoutDossierAutorisation($id, &$db, $val, $DEBUG){ |
165 |
|
require_once '../obj/dossier_autorisation.class.php'; |
166 |
|
$dossier_autorisation = new dossier_autorisation("]",$db,$DEBUG); |
167 |
|
// Création du dossier |
168 |
|
foreach($dossier_autorisation->champs as $value) { |
169 |
|
$valAuto[$value] = NULL; |
170 |
|
} |
171 |
|
$valAuto['dossier_autorisation']=NULL; |
172 |
|
$valAuto['nature']=NULL; |
173 |
|
$valAuto['exercice']=NULL; |
174 |
|
$valAuto['insee']=NULL; |
175 |
|
$valAuto['arrondissement']=NULL; |
176 |
|
$valAuto['etat']=NULL; |
177 |
|
$valAuto['erp_numero_batiment']=NULL; |
178 |
|
$valAuto['erp_ouvert']=NULL; |
179 |
|
$valAuto['erp_arrete_decision']=NULL; |
180 |
|
$valAuto['dossier_autorisation_type_detaille']=$this->valF['dossier_autorisation_type_detaille']; |
181 |
|
$valAuto['depot_initial']=$this->valF['date_demande']; |
182 |
|
$valAuto['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
183 |
|
$valAuto['terrain_adresse_voie_numero']=$this->valF['terrain_adresse_voie_numero']; |
184 |
|
$valAuto['complement']=$this->valF['complement']; |
185 |
|
$valAuto['terrain_adresse_lieu_dit']=$this->valF['terrain_adresse_lieu_dit']; |
186 |
|
$valAuto['terrain_adresse_localite']=$this->valF['terrain_adresse_localite']; |
187 |
|
$valAuto['terrain_adresse_code_postal']=$this->valF['terrain_adresse_code_postal']; |
188 |
|
$valAuto['terrain_adresse_bp']=$this->valF['terrain_adresse_bp']; |
189 |
|
$valAuto['terrain_adresse_cedex']=$this->valF['terrain_adresse_cedex']; |
190 |
|
$valAuto['terrain_superficie']=$this->valF['terrain_superficie']; |
191 |
|
$valAuto['numero_version']=-1; |
192 |
|
// Ajout du dossier dans la base |
193 |
|
$dossier_autorisation->ajouter($valAuto, $db, $DEBUG); |
194 |
|
// Liaison du dossier ajouter à la demande |
195 |
|
$this->valF['dossier_autorisation'] = $dossier_autorisation->valF['dossier_autorisation']; |
196 |
|
} |
197 |
|
|
198 |
|
/** |
199 |
|
* Méthode permettant d'ajouter un dossier d'instruction |
200 |
|
*/ |
201 |
|
function ajoutDossierInstruction($id, &$db, $val, $DEBUG, $dossier_instruction_type){ |
202 |
|
require_once '../obj/dossier.class.php'; |
203 |
|
$dossier = new dossier("]",$db,$DEBUG); |
204 |
|
foreach($dossier->champs as $value) { |
205 |
|
$valInstr[$value] = NULL; |
206 |
|
} |
207 |
|
require_once '../obj/dossier_autorisation_type_detaille.class.php'; |
208 |
|
$datd = new dossier_autorisation_type_detaille( |
209 |
|
$this->valF['dossier_autorisation_type_detaille'],$db,$DEBUG); |
210 |
|
|
211 |
|
/*Ajout de la variable dossier_instruction_type à l'objet dossier pour le |
212 |
|
* versionning |
213 |
|
*/ |
214 |
|
$dossier->setDossierInstructionType($dossier_instruction_type); |
215 |
|
|
216 |
|
// Définition des valeurs à entrée dans la table |
217 |
|
$valInstr['nature']=$datd->val[array_search("code", $datd->champs)]; |
218 |
|
$valInstr['dossier_autorisation_type_detaille']=$this->valF['dossier_autorisation_type_detaille']; |
219 |
|
$valInstr['date_depot']=$this->dateDBToForm($this->valF['date_demande']); |
220 |
|
$valInstr['date_demande']=$this->dateDBToForm($this->valF['date_demande']); |
221 |
|
$valInstr['depot_initial']=$this->dateDBToForm($this->valF['date_demande']); |
222 |
|
$valInstr['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
223 |
|
$valInstr['terrain_adresse_voie_numero']=$this->valF['terrain_adresse_voie_numero']; |
224 |
|
$valInstr['complement']=$this->valF['complement']; |
225 |
|
$valInstr['terrain_adresse_lieu_dit']=$this->valF['terrain_adresse_lieu_dit']; |
226 |
|
$valInstr['terrain_adresse_localite']=$this->valF['terrain_adresse_localite']; |
227 |
|
$valInstr['terrain_adresse_code_postal']=$this->valF['terrain_adresse_code_postal']; |
228 |
|
$valInstr['terrain_adresse_bp']=$this->valF['terrain_adresse_bp']; |
229 |
|
$valInstr['terrain_adresse_cedex']=$this->valF['terrain_adresse_cedex']; |
230 |
|
$valInstr['terrain_superficie']=$this->valF['terrain_superficie']; |
231 |
|
$valInstr['description']=""; |
232 |
|
$valInstr['dossier_autorisation']=$this->valF['dossier_autorisation']; |
233 |
|
$dossier->ajouter($valInstr, $db, $DEBUG); |
234 |
|
$this->f->isDatabaseError(); |
235 |
|
// Liaison du dossier ajouter à la demande |
236 |
|
$this->valF['dossier_instruction'] = $dossier->valF['dossier']; |
237 |
|
} |
238 |
|
|
239 |
|
/** |
240 |
|
* Ajout des liens demandeurs / dossier d'autorisation |
241 |
|
**/ |
242 |
|
function ajoutLiensDossierAutorisation($id, &$db, $val, $DEBUG) { |
243 |
|
// Création des liens entre le dossier autorisation et les demandeurs |
244 |
|
include '../sql/pgsql/demande.form.inc.php'; |
245 |
|
require_once '../obj/lien_dossier_autorisation_demandeur.class.php'; |
246 |
|
$ldad = new lien_dossier_autorisation_demandeur("]",$db,$DEBUG); |
247 |
|
// Recupération des demandeurs liés à la demande |
248 |
|
$sql = str_replace("<demande>",$this->valF['demande'],$sql_lien_demande_demandeur); |
249 |
|
$res = $db->query($sql); |
250 |
|
$this->f->addToLog("demande.class.php: db->query(\"".$sql."\");", VERBOSE_MODE); |
251 |
|
$this->f->isDatabaseError(); |
252 |
|
while($row = &$res->fetchRow(DB_FETCHMODE_ASSOC)) { |
253 |
|
$row['lien_dossier_autorisation_demandeur'] = NULL; |
254 |
|
$row['dossier_autorisation'] = $this->valF['dossier_autorisation']; |
255 |
|
$ldad->ajouter($row, $db, $DEBUG); |
256 |
|
} |
257 |
|
} |
258 |
|
|
259 |
|
/** |
260 |
|
* Ajout des liens demandeurs / dossier d'autorisation |
261 |
|
**/ |
262 |
|
function ajoutLiensDossierInstruction($id, &$db, $val, $DEBUG) { |
263 |
|
// Création des liens entre le dossier instruction et les demandeurs |
264 |
|
include '../sql/pgsql/demande.form.inc.php'; |
265 |
|
require_once '../obj/lien_dossier_demandeur.class.php'; |
266 |
|
$ldd = new lien_dossier_demandeur("]",$db,$DEBUG); |
267 |
|
// Recupération des demandeurs liés à la demande |
268 |
|
$sql = str_replace("<demande>",$this->valF['demande'],$sql_lien_demande_demandeur); |
269 |
|
$res = $db->query($sql); |
270 |
|
$this->f->addToLog("demande.class.php: db->query(\"".$sql."\");", VERBOSE_MODE); |
271 |
|
$this->f->isDatabaseError(); |
272 |
|
while($row = &$res->fetchRow(DB_FETCHMODE_ASSOC)) { |
273 |
|
$row['lien_dossier_demandeur'] = NULL; |
274 |
|
$row['dossier'] = $this->valF['dossier_instruction']; |
275 |
|
$ldd->ajouter($row, $db, $DEBUG); |
276 |
|
} |
277 |
|
} |
278 |
|
|
279 |
|
/* |
280 |
|
* Récupère l'identifiant d'un arrondissement à partir d'un code postal |
281 |
|
*/ |
282 |
|
function getArrondissement($terrain_adresse_code_postal){ |
283 |
|
|
284 |
|
$arrondissement = NULL; |
285 |
|
|
286 |
|
$sql = "SELECT |
287 |
|
arrondissement |
288 |
|
FROM |
289 |
|
".DB_PREFIXE."arrondissement |
290 |
|
WHERE |
291 |
|
code_postal = '$terrain_adresse_code_postal' "; |
292 |
|
$this->addToLog("demande.class.php : ".$sql." execute <br>", EXTRA_VERBOSE_MODE); |
293 |
|
|
294 |
|
$res = $this->db->query($sql); |
295 |
|
$this->f->isDatabaseError($res); |
296 |
|
|
297 |
|
if( $res->numrows() > 0 ) { |
298 |
|
|
299 |
|
$row=& $res->fetchRow(DB_FETCHMODE_ASSOC); |
300 |
|
$arrondissement = $row['arrondissement']; |
301 |
|
} |
302 |
|
|
303 |
|
return $arrondissement; |
304 |
|
} |
305 |
|
|
306 |
|
/* |
307 |
|
* Récupère l'évènement lié à un type de demande |
308 |
|
*/ |
309 |
|
function getEvenement($demande_type){ |
310 |
|
|
311 |
|
$evenement = NULL; |
312 |
|
|
313 |
|
$sql = |
314 |
|
"SELECT |
315 |
|
evenement |
316 |
|
FROM |
317 |
|
".DB_PREFIXE."demande_type |
318 |
|
WHERE |
319 |
|
demande_type = $demande_type"; |
320 |
|
|
321 |
|
$res = $this->db->query($sql); |
322 |
|
$this->f->isDatabaseError($res); |
323 |
|
|
324 |
|
if ( $res->numrows() > 0 ){ |
325 |
|
|
326 |
|
$row=& $res->fetchRow(DB_FETCHMODE_ASSOC); |
327 |
|
$evenement = $row['evenement']; |
328 |
|
} |
329 |
|
|
330 |
|
return $evenement; |
331 |
|
} |
332 |
|
|
333 |
|
/* |
334 |
|
* Récupère la lettre type lié à un événement |
335 |
|
*/ |
336 |
|
function getLettreType($evenement){ |
337 |
|
|
338 |
|
$lettretype = NULL; |
339 |
|
|
340 |
|
$sql = |
341 |
|
"SELECT |
342 |
|
lettretype |
343 |
|
FROM |
344 |
|
".DB_PREFIXE."evenement |
345 |
|
WHERE |
346 |
|
evenement = $evenement"; |
347 |
|
|
348 |
|
$res = $this->db->query($sql); |
349 |
|
$this->f->isDatabaseError($res); |
350 |
|
|
351 |
|
if ( $res->numrows() > 0 ){ |
352 |
|
|
353 |
|
$row=& $res->fetchRow(DB_FETCHMODE_ASSOC); |
354 |
|
$lettretype = $row['lettretype']; |
355 |
|
} |
356 |
|
|
357 |
|
return $lettretype; |
358 |
|
} |
359 |
|
|
360 |
|
/** |
361 |
|
* Ajout des dossiers |
362 |
**/ |
**/ |
363 |
function triggerAjoutDossier($id, &$db, $val, $DEBUG){ |
function triggerAjouter($id, &$db, $val, $DEBUG){ |
364 |
include '../sql/pgsql/demande.form.inc.php'; |
include '../sql/pgsql/demande.form.inc.php'; |
365 |
if($this->valF["demande_type"] != NULL) { |
if($this->valF["demande_type"] != NULL) { |
366 |
$res = $db->query(str_replace('<idx>', $this->valF['demande_type'], $sql_demande_type_details_by_id)); |
$res = $db->query(str_replace('<idx>', $this->valF['demande_type'], $sql_demande_type_details_by_id)); |
367 |
$this->f->isDatabaseError(); |
$this->f->isDatabaseError(); |
368 |
$row = $res->fetchRow(DB_FETCHMODE_ASSOC); |
$dossier_type = $res->fetchRow(DB_FETCHMODE_ASSOC); |
369 |
// Création du dossier_autorisation |
// Création du dossier_autorisation |
370 |
if($row ['dossier_autorisation_type_detaille'] != NULL) { |
if($this->valF['dossier_autorisation'] == "") { |
371 |
// Création du dossier |
$this->ajoutDossierAutorisation($id, $db, $val, $DEBUG); |
|
$valAuto['dossier_autorisation']=NULL; |
|
|
$valAuto['nature']=NULL; |
|
|
$valAuto['exercice']=NULL; |
|
|
$valAuto['insee']=NULL; |
|
|
$valAuto['arrondissement']=NULL; |
|
|
$valAuto['etat']=NULL; |
|
|
$valAuto['erp_numero_batiment']=NULL; |
|
|
$valAuto['erp_ouvert']=NULL; |
|
|
$valAuto['erp_arrete_decision']=NULL; |
|
|
$valAuto['dossier_autorisation_type_detaille']=$this->valF['dossier_autorisation_type_detaille']; |
|
|
$valAuto['depot_initial']=$this->valF['date_demande']; |
|
|
$valAuto['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
|
|
$valAuto['terrain_adresse_voie_numero']=$this->valF['terrain_adresse_voie_numero']; |
|
|
$valAuto['complement']=$this->valF['complement']; |
|
|
$valAuto['terrain_adresse_lieu_dit']=$this->valF['terrain_adresse_lieu_dit']; |
|
|
$valAuto['terrain_adresse_localite']=$this->valF['terrain_adresse_localite']; |
|
|
$valAuto['terrain_adresse_code_postal']=$this->valF['terrain_adresse_code_postal']; |
|
|
$valAuto['terrain_adresse_bp']=$this->valF['terrain_adresse_bp']; |
|
|
$valAuto['terrain_adresse_cedex']=$this->valF['terrain_adresse_cedex']; |
|
|
$valAuto['terrain_superficie']=$this->valF['terrain_superficie']; |
|
|
require_once '../obj/dossier_autorisation.class.php'; |
|
|
$dossier_autorisation = new dossier_autorisation("]",$db,$DEBUG); |
|
|
$dossier_autorisation->ajouter($valAuto, $db, $DEBUG); |
|
|
$this->valF['dossier_autorisation'] = $dossier_autorisation->valF['dossier_autorisation']; |
|
|
// Création des liens entre le dossier et les demandeurs |
|
|
require_once '../obj/lien_dossier_autorisation_demandeur.class.php'; |
|
|
$ldad = new lien_dossier_autorisation_demandeur("]",$db,$DEBUG); |
|
|
$sql = str_replace("<demande>",$this->valF['demande'],$sql_lien_demande_demandeur); |
|
|
$res = $db->query($sql); |
|
|
$this->f->addToLog("demande.class.php: db->query(\"".$sql."\");", VERBOSE_MODE); |
|
|
$this->f->isDatabaseError(); |
|
|
print_r($sql); |
|
|
while($row = &$res->fetchRow(DB_FETCHMODE_ASSOC)) { |
|
|
$row['lien_dossier_autorisation_demandeur'] = NULL; |
|
|
$row['dossier_autorisation'] = $this->valF['dossier_autorisation']; |
|
|
$ldad->ajouter($row, $db, $DEBUG); |
|
|
} |
|
372 |
$this -> addToMessage(_("Creation du dossier d'autorisation no").$this->valF['dossier_autorisation']); |
$this -> addToMessage(_("Creation du dossier d'autorisation no").$this->valF['dossier_autorisation']); |
373 |
} |
} |
374 |
/* |
// Création du dossier d'instruction |
375 |
if($row ['dossier_instruction_type'] != NULL) { |
if($dossier_type['dossier_instruction_type'] != NULL) { |
376 |
$valInstr['dossier_autorisation_type_detaille']=$this->valF['dossier_autorisation_type_detaille']; |
$this->ajoutDossierInstruction($id, $db, $val, $DEBUG, $dossier_type['dossier_instruction_type']); |
377 |
|
$this -> addToMessage(_("Creation du dossier d'instruction no").$this->valF['dossier_instruction']); |
378 |
|
} |
379 |
|
|
380 |
|
/*Création du lien de téléchargement de récépissé de demande*/ |
381 |
|
if ( $this->valF['demande_type'] != "" && is_numeric($this->valF['demande_type']) |
382 |
|
&& isset($this->valF['dossier_instruction']) && $this->valF['dossier_instruction'] !== "" ){ |
383 |
|
|
384 |
|
/*Récupérer l'événement lié à ce type de demande*/ |
385 |
|
$evenement = $this->getEvenement($this->valF['demande_type']); |
386 |
|
|
387 |
|
/*Récupération de la lettre type de l'événement*/ |
388 |
|
$lettretype = $this->getLettreType($evenement); |
389 |
|
|
390 |
|
/*Création d'une nouvelle instruction avec cet événement*/ |
391 |
|
/*Données*/ |
392 |
|
$valInstr['instruction']=NULL; |
393 |
|
|
394 |
|
$valInstr['destinataire']=$this->valF['dossier_instruction']; |
395 |
|
$valInstr['dossier']=$this->valF['dossier_instruction']; |
396 |
|
|
397 |
|
$valInstr['datecourrier']=date("d/m/Y"); |
398 |
|
$valInstr['evenement']=$evenement; |
399 |
|
$valInstr['lettretype']=$lettretype; |
400 |
|
$valInstr['complement']=""; |
401 |
|
$valInstr['complement2']=""; |
402 |
|
|
403 |
|
$valInstr['action']="initialisation"; |
404 |
|
$valInstr['delai']="2"; |
405 |
|
$valInstr['etat']="notifier"; |
406 |
|
$valInstr['accord_tacite']="Oui"; |
407 |
|
$valInstr['delai_notification']="1"; |
408 |
|
$valInstr['archive_delai']="0"; |
409 |
|
$valInstr['archive_date_complet']=NULL; |
410 |
|
$valInstr['archive_date_rejet']=NULL; |
411 |
|
$valInstr['archive_date_limite']=NULL; |
412 |
|
$valInstr['archive_date_notification_delai']=NULL; |
413 |
|
$valInstr['archive_accord_tacite']="Non"; |
414 |
|
$valInstr['archive_etat']="initialiser"; |
415 |
|
$valInstr['archive_date_decision']=NULL; |
416 |
|
$valInstr['archive_avis']=""; |
417 |
|
$valInstr['archive_date_validite']=NULL; |
418 |
|
$valInstr['archive_date_achevement']=NULL; |
419 |
|
$valInstr['archive_date_chantier']=NULL; |
420 |
|
$valInstr['archive_date_conformite']=NULL; |
421 |
|
$valInstr['complement3']=""; |
422 |
|
$valInstr['complement4']=""; |
423 |
|
$valInstr['complement5']=""; |
424 |
|
$valInstr['complement6']=""; |
425 |
|
$valInstr['complement7']=""; |
426 |
|
$valInstr['complement8']=""; |
427 |
|
$valInstr['complement9']=""; |
428 |
|
$valInstr['complement10']=""; |
429 |
|
$valInstr['complement11']=""; |
430 |
|
$valInstr['complement12']=""; |
431 |
|
$valInstr['complement13']=""; |
432 |
|
$valInstr['complement14']=""; |
433 |
|
$valInstr['complement15']=""; |
434 |
|
$valInstr['avis_decision']=NULL; |
435 |
|
|
436 |
|
/*Fichier requis*/ |
437 |
|
require_once '../obj/instruction.class.php'; |
438 |
|
|
439 |
|
/*Création d'un nouveau dossier*/ |
440 |
|
$instruction = new instruction("]",$db,$DEBUG); |
441 |
|
$instruction->valF = ""; |
442 |
|
$instruction->ajouter($valInstr, $db, $DEBUG); |
443 |
|
|
444 |
|
/*Si la création a réussie*/ |
445 |
|
if ( $instruction->valF['instruction'] != "" ){ |
446 |
|
|
447 |
|
/*Affichage du récépissé de la demande*/ |
448 |
|
$this->valF['instruction_recepisse'] = $instruction->valF['instruction']; |
449 |
|
$this -> addToMessage("<br/><a |
450 |
|
class='lien' |
451 |
|
href='../pdf/pdflettretype.php?obj=".$lettretype."&idx=".$this->valF['dossier_instruction']."' |
452 |
|
target='_blank'> |
453 |
|
<span |
454 |
|
class=\"om-icon om-icon-16 om-icon-fix pdf-16\" |
455 |
|
title=\""._("Telecharger le recepisse de la demande")."\">". |
456 |
|
_("Telecharger le recepisse de la demande"). |
457 |
|
"</span> |
458 |
|
". |
459 |
|
_("Telecharger le recepisse de la demande")." |
460 |
|
</a><br/>"); |
461 |
|
} |
462 |
|
/*Sinon affiche un message d'erreur*/ |
463 |
|
else { |
464 |
|
|
465 |
|
$this -> addToMessage(_("Une erreur s'est produite lors de la creation du recepisse")); |
466 |
|
} |
467 |
|
} |
468 |
|
|
469 |
|
/*Ajout de l'arrondissement à partir du code postal*/ |
470 |
|
if ( !is_null($this->valF["terrain_adresse_code_postal"]) && is_numeric($this->valF["terrain_adresse_code_postal"]) ){ |
471 |
|
|
472 |
$valInstr['depot_initial']=$this->valF['date_demande']; |
$this->valF["arrondissement"] = $this->getArrondissement($this->valF["terrain_adresse_code_postal"]); |
|
$valInstr['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
|
|
$valInstr['terrain_adresse_voie_numero']=$this->valF['terrain_adresse_voie_numero']; |
|
|
$valInstr['complement']=$this->valF['complement']; |
|
|
$valInstr['terrain_adresse_lieu_dit']=$this->valF['terrain_adresse_lieu_dit']; |
|
|
$valInstr['terrain_adresse_localite']=$this->valF['terrain_adresse_localite']; |
|
|
$valInstr['terrain_adresse_code_postal']=$this->valF['terrain_adresse_code_postal']; |
|
|
$valInstr['terrain_adresse_bp']=$this->valF['terrain_adresse_bp']; |
|
|
$valInstr['terrain_adresse_cedex']=$this->valF['terrain_adresse_cedex']; |
|
|
$valInstr['terrain_superficie']=$this->valF['terrain_superficie']; |
|
|
|
|
|
require_once '../obj/dossier.class.php'; |
|
|
$dossier_instruction = new dossier("]",$db,$DEBUG); |
|
|
$dossier_instruction->ajouter($valInstr, $db, $DEBUG); |
|
|
$this->valF['dossier_instruction'] = $dossier_instruction->valF['dossier']; |
|
473 |
} |
} |
|
*/ |
|
474 |
} |
} |
475 |
} |
} |
476 |
|
|
479 |
**/ |
**/ |
480 |
function triggerAjouterApres($id, &$db, $val, $DEBUG){ |
function triggerAjouterApres($id, &$db, $val, $DEBUG){ |
481 |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
482 |
$this->valIdDemandeur=$this->postedIdDemandeur; |
|
483 |
$this->triggerAjoutDossier($id, $db, $val, $DEBUG); |
// Ajout des lliens entre dossier_autorisation et demandeur |
484 |
|
if(!empty($this->valF['dossier_autorisation']) AND $val['dossier_autorisation'] == "" ) { |
485 |
|
$this->ajoutLiensDossierAutorisation($id, $db, $val, $DEBUG); |
486 |
|
} |
487 |
|
// Ajout des lliens entre dossier et demandeur |
488 |
|
if(!empty($this->valF['dossier_instruction'])) { |
489 |
|
$this->ajoutLiensDossierInstruction($id, $db, $val, $DEBUG); |
490 |
|
} |
491 |
} |
} |
492 |
|
|
493 |
|
/*Ajout du lien demande / demandeur(s)*/ |
494 |
function triggerModifierApres($id, &$db, $val, $DEBUG){ |
function triggerModifierApres($id, &$db, $val, $DEBUG){ |
495 |
$this->listeDemandeur(); |
$this->listeDemandeur("demande",$this->val[array_search('demande', $this->champs)]); |
496 |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
497 |
$this->valIdDemandeur=$this->postedIdDemandeur; |
$this->valIdDemandeur=$this->postedIdDemandeur; |
498 |
|
|
499 |
} |
} |
500 |
|
|
501 |
/** |
/** |
502 |
* Gestion des liens entre la demande et les demendeurs recement ajoutés |
* Gestion des liens entre la demande et les demandeurs recemment ajoutés |
503 |
**/ |
**/ |
504 |
function insertLinkDemandeDemandeur($db, $DEBUG) { |
function insertLinkDemandeDemandeur($db, $DEBUG) { |
505 |
// |
// |
506 |
require_once "../obj/lien_demande_demandeur.class.php"; |
require_once "../obj/lien_demande_demandeur.class.php"; |
|
|
|
507 |
// Comparaison de l'id petitionnaire principal |
// Comparaison de l'id petitionnaire principal |
508 |
if(isset($this->postedIdDemandeur['petitionnaire_principal']) AND |
if(isset($this->postedIdDemandeur['petitionnaire_principal']) AND |
509 |
!empty($this->postedIdDemandeur['petitionnaire_principal']) AND |
!empty($this->postedIdDemandeur['petitionnaire_principal']) AND |
580 |
|
|
581 |
} |
} |
582 |
|
|
583 |
|
/* |
584 |
|
* Teste si le lien entre une demande et un demandeur existe |
585 |
|
* */ |
586 |
function isLinkDemandeDemandeurExist($idDemandeur) { |
function isLinkDemandeDemandeurExist($idDemandeur) { |
587 |
$sql = "SELECT count(*) |
$sql = "SELECT count(*) |
588 |
FROM ".DB_PREFIXE."lien_demande_demandeur |
FROM ".DB_PREFIXE."lien_demande_demandeur |
622 |
} |
} |
623 |
} |
} |
624 |
/** |
/** |
625 |
* Méthode permettant de récupérer les id des demandeur lié à la demande |
* Méthode permettant de récupérer les id des demandeur liés à la demande ou |
626 |
|
* liés au dossier d'autorisation |
627 |
**/ |
**/ |
628 |
function listeDemandeur() { |
function listeDemandeur($from, $id) { |
629 |
// Récupération des demandeurs de la base |
// Récupération des demandeurs de la base |
630 |
$sql = "SELECT demandeur.demandeur, |
$sql = "SELECT demandeur.demandeur, |
631 |
demandeur.type_demandeur, |
demandeur.type_demandeur, |
632 |
lien_demande_demandeur.petitionnaire_principal |
lien_".$from."_demandeur.petitionnaire_principal |
633 |
FROM ".DB_PREFIXE."lien_demande_demandeur |
FROM ".DB_PREFIXE."lien_".$from."_demandeur |
634 |
INNER JOIN ".DB_PREFIXE."demandeur |
INNER JOIN ".DB_PREFIXE."demandeur |
635 |
ON demandeur.demandeur=lien_demande_demandeur.demandeur |
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
636 |
WHERE demande = ".$this->val[array_search('demande', $this->champs)]; |
WHERE ".$from." = '".$id."'"; |
637 |
$res = $this->f->db->query($sql); |
$res = $this->f->db->query($sql); |
638 |
$this->f->addToLog("listeDemandeur() : ".$sql); |
$this->f->addToLog("listeDemandeur() : ".$sql); |
639 |
$this->f->isDatabaseError($res); |
$this->f->isDatabaseError($res); |
651 |
} |
} |
652 |
} |
} |
653 |
|
|
654 |
|
|
655 |
|
/** |
656 |
|
* Surcharge du bouton retour afin de retourner sur la recherche de dossiers |
657 |
|
* d'instruction existant |
658 |
|
*/ |
659 |
|
function retour($premier = 0, $recherche = "", $tricol = "") { |
660 |
|
|
661 |
|
echo "\n<a class=\"retour\" "; |
662 |
|
echo "href=\""; |
663 |
|
// |
664 |
|
if($this->getParameter("idx_dossier") != "") { |
665 |
|
echo "tab.php?"; |
666 |
|
echo "obj=recherche_dossier"; |
667 |
|
|
668 |
|
} else { |
669 |
|
if($this->getParameter("retour")=="form" AND !($this->getParameter("validation")>0 AND $this->getParameter("maj")==2 AND $this->correct)) { |
670 |
|
echo "form.php?"; |
671 |
|
} else { |
672 |
|
echo "tab.php?"; |
673 |
|
} |
674 |
|
echo "obj=".get_class($this); |
675 |
|
if($this->getParameter("retour")=="form") { |
676 |
|
echo "&idx=".$this->getParameter("idx"); |
677 |
|
echo "&action=3"; |
678 |
|
} |
679 |
|
} |
680 |
|
echo "&premier=".$this->getParameter("premier"); |
681 |
|
echo "&tricol=".$this->getParameter("tricol"); |
682 |
|
echo "&recherche=".$this->getParameter("recherche"); |
683 |
|
echo "&selectioncol=".$this->getParameter("selectioncol"); |
684 |
|
echo "&advs_id=".$this->getParameter("advs_id"); |
685 |
|
echo "&valide=".$this->getParameter("valide"); |
686 |
|
// |
687 |
|
echo "\""; |
688 |
|
echo ">"; |
689 |
|
// |
690 |
|
echo _("Retour"); |
691 |
|
// |
692 |
|
echo "</a>\n"; |
693 |
|
|
694 |
|
} |
695 |
|
|
696 |
|
|
697 |
/** |
/** |
698 |
* Ajout de la liste des demandeurs |
* Ajout de la liste des demandeurs |
699 |
*/ |
*/ |
700 |
function formSpecificContent($maj) { |
function formSpecificContent($maj) { |
701 |
if(!$this->correct AND $maj != 0) { |
if(!$this->correct AND $maj != 0) { |
702 |
$this->listeDemandeur(); |
$this->listeDemandeur("demande", $this->val[array_search('demande', $this->champs)]); |
703 |
|
} |
704 |
|
// Si le paramètre idx_dossier est défini on récupère les demandeurs liés au dossier d'instruction |
705 |
|
if($this->getParameter("idx_dossier") != "") { |
706 |
|
$this->listeDemandeur("dossier", $this->getParameter("idx_dossier")); |
707 |
} |
} |
708 |
if($maj < 2 AND !$this->correct) { |
if($maj < 2 AND !$this->correct) { |
709 |
$linkable = true; |
$linkable = true; |
710 |
} else { |
} else { |
711 |
$linkable = false; |
$linkable = false; |
712 |
} |
} |
713 |
|
|
714 |
// Conteneur de la listes des demandeurs |
// Conteneur de la listes des demandeurs |
715 |
echo "<div class=\"demande_hidden_bloc col_12\">"; |
echo "<div id=\"liste_demandeur\" class=\"demande_hidden_bloc col_12\">"; |
716 |
echo "<fieldset class=\"cadre ui-corner-all ui-widget-content\">"; |
echo "<fieldset class=\"cadre ui-corner-all ui-widget-content\">"; |
717 |
echo " <legend class=\"ui-corner-all ui-widget-content ui-state-active\">" |
echo " <legend class=\"ui-corner-all ui-widget-content ui-state-active\">" |
718 |
._("Petitionnaire")."</legend>"; |
._("Petitionnaire")."</legend>"; |
719 |
// Si des demandeurs sont liés à la demande |
// Si des demandeurs sont liés à la demande |
720 |
require_once "../obj/petitionnaire.class.php"; |
require_once "../obj/petitionnaire.class.php"; |
721 |
require_once "../obj/delegataire.class.php"; |
require_once "../obj/delegataire.class.php"; |
722 |
|
// Affichage du bloc pétitionnaire principal / délégataire |
723 |
// Affichage du bloc pétitionnaire principal / délégataire |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
724 |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
echo "<div id=\"petitionnaire_principal_delegataire\">"; |
725 |
echo "<div id=\"petitionnaire_principal_delegataire\">"; |
// Affichage de la synthèse |
726 |
// Affichage de la synthèse |
if (isset ($this->valIdDemandeur["petitionnaire_principal"]) AND |
727 |
if (isset ($this->valIdDemandeur["petitionnaire_principal"]) AND |
!empty($this->valIdDemandeur["petitionnaire_principal"])) { |
728 |
!empty($this->valIdDemandeur["petitionnaire_principal"])) { |
$demandeur = new petitionnaire( |
729 |
$demandeur = new petitionnaire( |
$this->valIdDemandeur["petitionnaire_principal"], |
730 |
$this->valIdDemandeur["petitionnaire_principal"], |
$this->f->db,false); |
731 |
$this->f->db,false); |
$demandeur -> afficherSynthese("petitionnaire_principal", $linkable); |
732 |
$demandeur -> afficherSynthese("petitionnaire_principal", $linkable); |
$demandeur -> __destruct(); |
733 |
$demandeur -> __destruct(); |
} elseif ( isset ($this->postedIdDemandeur["petitionnaire_principal"]) AND |
734 |
} |
!empty($this->postedIdDemandeur["petitionnaire_principal"]) ) { |
735 |
// Si en édition de formulaire |
$demandeur = new petitionnaire( |
736 |
if($maj < 2 AND $this->correct != true) { |
$this->postedIdDemandeur["petitionnaire_principal"], |
737 |
// Bouton d'ajout du pétitionnaire principal |
$this->f->db,false); |
738 |
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
$demandeur -> afficherSynthese("petitionnaire_principal", $linkable); |
739 |
echo "<input id=\"add_petitionnaire_principal\" |
$demandeur -> __destruct(); |
740 |
class=\"ui-button ui-widget ui-state-default ui-corner-all\" |
} |
741 |
type=\"button\" value=\""._("Saisir le petitionnaire principal")."\"/>"; |
// Si en édition de formulaire |
742 |
echo " <span class=\"om-icon om-icon-16 om-icon-fix arrow-right-16\">></span> "; |
if($maj < 2) { |
743 |
// Bouton d'ajout du delegataire |
// Bouton d'ajout du pétitionnaire principal |
744 |
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
745 |
echo "<input id=\"add_delegataire\" |
echo "<span id=\"add_petitionnaire_principal\" |
746 |
class=\"ui-button ui-widget ui-state-default ui-corner-all\" |
class=\"om-form-button add-16\">". |
747 |
type=\"button\" value=\""._("Saisir le delegataire")."\"/>"; |
_("Saisir le petitionnaire principal"). |
748 |
} |
"</span>"; |
749 |
// Affichage de la synthèse |
} |
750 |
if (isset ($this->valIdDemandeur["delegataire"]) AND |
// Bouton d'ajout du delegataire |
751 |
!empty($this->valIdDemandeur["delegataire"])) { |
// L'ID DU DIV ET DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
752 |
$demandeur = new delegataire($this->valIdDemandeur["delegataire"], |
echo "<div id=\"delegataire\">"; |
753 |
$this->f->db,false); |
if ($maj < 2 OR ($maj == 3 AND !empty($this->valIdDemandeur["delegataire"]))) { |
754 |
$demandeur -> afficherSynthese("delegataire", $linkable); |
echo " <span class=\"om-icon om-icon-16 om-icon-fix arrow-right-16\"> |
755 |
|
<!-- --> |
756 |
|
</span> "; |
757 |
|
} |
758 |
|
// Affichage de la synthèse |
759 |
|
if (isset ($this->valIdDemandeur["delegataire"]) AND |
760 |
|
!empty($this->valIdDemandeur["delegataire"])) { |
761 |
|
$demandeur = new delegataire($this->valIdDemandeur["delegataire"], |
762 |
|
$this->f->db,false); |
763 |
|
$demandeur -> afficherSynthese("delegataire", $linkable); |
764 |
|
$demandeur -> __destruct(); |
765 |
|
} elseif ( isset ($this->postedIdDemandeur["delegataire"]) AND |
766 |
|
!empty($this->postedIdDemandeur["delegataire"]) ) { |
767 |
|
|
768 |
|
$demandeur = new delegataire($this->postedIdDemandeur["delegataire"], |
769 |
|
$this->f->db,false); |
770 |
|
$demandeur -> afficherSynthese("delegataire", $linkable); |
771 |
|
$demandeur -> __destruct(); |
772 |
|
} |
773 |
|
if($maj < 2) { |
774 |
|
echo "<span id=\"add_delegataire\" |
775 |
|
class=\"om-form-button add-16\">". |
776 |
|
_("Saisir le delegataire"). |
777 |
|
"</span>"; |
778 |
|
} |
779 |
|
echo "</div>"; |
780 |
|
|
781 |
|
echo "</div>"; |
782 |
|
// Bloc des pétitionnaires secondaires |
783 |
|
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
784 |
|
echo "<div id=\"listePetitionnaires\">"; |
785 |
|
|
786 |
|
// Affichage de la synthèse |
787 |
|
if (isset ($this->valIdDemandeur["petitionnaire"]) AND |
788 |
|
!empty($this->valIdDemandeur["petitionnaire"])) { |
789 |
|
|
790 |
|
foreach ($this->valIdDemandeur["petitionnaire"] as $petitionnaire) { |
791 |
|
$demandeur = new petitionnaire($petitionnaire, |
792 |
|
$this->f->db,false); |
793 |
|
$demandeur -> afficherSynthese("petitionnaire", $linkable); |
794 |
$demandeur -> __destruct(); |
$demandeur -> __destruct(); |
795 |
} |
} |
796 |
|
|
797 |
echo "</div>"; |
} elseif ( isset ($this->postedIdDemandeur["petitionnaire"]) AND |
798 |
|
!empty($this->postedIdDemandeur["petitionnaire"]) ) { |
799 |
// Bloc des pétitionnaires secondaires |
foreach ($this->postedIdDemandeur["petitionnaire"] as $petitionnaire) { |
800 |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
$demandeur = new petitionnaire($petitionnaire, |
801 |
echo "<div id=\"listePetitionnaires\">"; |
$this->f->db,false); |
802 |
|
$demandeur -> afficherSynthese("petitionnaire", $linkable); |
803 |
// Affichage de la synthèse |
$demandeur -> __destruct(); |
|
if (isset ($this->valIdDemandeur["petitionnaire"]) AND |
|
|
!empty($this->valIdDemandeur["petitionnaire"])) { |
|
|
|
|
|
foreach ($this->valIdDemandeur["petitionnaire"] as $petitionnaire) { |
|
|
$demandeur = new petitionnaire($petitionnaire, |
|
|
$this->f->db,false); |
|
|
$demandeur -> afficherSynthese("petitionnaire", $linkable); |
|
|
$demandeur -> __destruct(); |
|
|
} |
|
|
|
|
|
} |
|
|
if ($maj < 2 AND !$this->correct) { |
|
|
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
|
|
echo "<input id=\"add_petitionnaire\" |
|
|
class=\"ui-button ui-widget ui-state-default ui-corner-all\" |
|
|
type=\"button\" value=\""._("Ajouter un petitionnaire")."\"/>"; |
|
804 |
} |
} |
805 |
echo "</div>"; |
} |
806 |
|
if ($maj < 2) { |
807 |
|
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
808 |
|
echo "<span id=\"add_petitionnaire\" |
809 |
|
class=\"om-form-button add-16\">". |
810 |
|
_("Ajouter un petitionnaire") |
811 |
|
."</span>"; |
812 |
|
} |
813 |
|
echo "</div>"; |
814 |
echo "</fieldset>"; |
echo "</fieldset>"; |
815 |
echo "</div>"; |
echo "</div>"; |
816 |
} |
} |
817 |
|
|
818 |
|
// {{{ |
819 |
|
|
820 |
|
// getter |
821 |
|
function getValIdDemandeur() { |
822 |
|
return $this->valIdDemandeur; |
823 |
|
} |
824 |
|
// setter |
825 |
|
function setValIdDemandeur($valIdDemandeur) { |
826 |
|
$this->valIdDemandeur = $valIdDemandeur; |
827 |
|
} |
828 |
|
|
829 |
|
//Supression du lien entre la demandeur et le(s) demandeur(s) |
830 |
|
function triggerSupprimer($id, &$db, $val, $DEBUG){ |
831 |
|
|
832 |
|
//Création de la requête |
833 |
|
$sql = "DELETE FROM |
834 |
|
".DB_PREFIXE."lien_demande_demandeur |
835 |
|
WHERE |
836 |
|
demande = $id"; |
837 |
|
|
838 |
|
$res = $this->f->db->query($sql); |
839 |
|
$this->f->addToLog("triggerSupprimer() : ".$sql); |
840 |
|
$this->f->isDatabaseError($res); |
841 |
|
} |
842 |
|
|
843 |
|
// }}} |
844 |
}// fin classe |
}// fin classe |
|
?> |
|
845 |
|
?> |