1 |
<?php |
2 |
//$Id$ |
3 |
//gen openMairie le 08/11/2012 14:00 |
4 |
|
5 |
require_once ("../gen/obj/demande.class.php"); |
6 |
|
7 |
class demande extends demande_gen { |
8 |
|
9 |
var $valIdDemandeur = array("petitionnaire_principal" => "", |
10 |
"delegataire" => "", |
11 |
"petitionnaire" => array()); |
12 |
var $postedIdDemandeur = array("petitionnaire_principal" => "", |
13 |
"delegataire" => "", |
14 |
"petitionnaire" => array()); |
15 |
|
16 |
function demande($id,&$db,$debug) { |
17 |
$this->constructeur($id,$db,$debug); |
18 |
}// fin constructeur |
19 |
|
20 |
/* |
21 |
* La date du jour par défaut dans le champs date_demande |
22 |
* Put the date of the day by default into the field date_demande |
23 |
*/ |
24 |
function setVal(&$form, $maj, $validation, &$db) { |
25 |
if($maj == 0) { |
26 |
$form->setVal("date_demande",date('d/m/Y')); |
27 |
} |
28 |
} |
29 |
|
30 |
/** |
31 |
* Méthode de verification du contenu |
32 |
*/ |
33 |
function verifier($val, &$db, $DEBUG) { |
34 |
parent::verifier($val, $db, $DEBUG); |
35 |
$this->getPostedValues(); |
36 |
if(!isset($this->postedIdDemandeur["petitionnaire_principal"]) OR |
37 |
empty($this->postedIdDemandeur["petitionnaire_principal"])) { |
38 |
$this->correct = false; |
39 |
$this->addToMessage("La saisie d'un petitionnaire principal est obligatoire."); |
40 |
$this->valIdDemandeur=$this->postedIdDemandeur; |
41 |
} |
42 |
} |
43 |
/* |
44 |
* Ajout du fielset |
45 |
* Add fieldset |
46 |
*/ |
47 |
function setLayout(&$form, $maj){ |
48 |
if ( $maj < 2 OR $maj == 3 ) { |
49 |
|
50 |
//Champs sur lequel s'ouvre le fieldset |
51 |
$form->setBloc('dossier_autorisation_type_detaille','D',"","dossier_type col_8"); |
52 |
|
53 |
$form->setFieldset('dossier_autorisation_type_detaille','D' |
54 |
,_('Type de dossier/demande')); |
55 |
$form->setFieldset('demande_type','F',''); |
56 |
|
57 |
$form->setBloc('demande_type','F'); |
58 |
|
59 |
$form->setBloc('date_demande','D',"","col_4 demande_hidden_bloc"); |
60 |
$form->setFieldset('date_demande','D',_('Date de la demande')); |
61 |
$form->setFieldset('date_demande','F',''); |
62 |
$form->setBloc('date_demande','F'); |
63 |
|
64 |
$form->setBloc('terrain_references_cadastrales','D',"", |
65 |
"localisation col_12 demande_hidden_bloc"); |
66 |
$form->setFieldset('terrain_references_cadastrales','D',_('Localisation du terrain')); |
67 |
$form->setFieldset('terrain_superficie','F',''); |
68 |
$form->setBloc('terrain_superficie','F'); |
69 |
|
70 |
$form->setBloc('nombre_lots','D',"","lots col_12 demande_hidden_bloc"); |
71 |
$form->setFieldset('nombre_lots','D',_('Nombre de lots')); |
72 |
$form->setFieldset('nombre_lots','F',''); |
73 |
$form->setBloc('nombre_lots','F'); |
74 |
} |
75 |
} |
76 |
|
77 |
/* |
78 |
* Ajoute des actions sur les deux premiers select |
79 |
* Add actions on the two first select |
80 |
*/ |
81 |
function setOnchange(&$form,$maj){ |
82 |
parent::setOnchange($form,$maj); |
83 |
$form->setOnchange("dossier_autorisation_type_detaille","changeDemandeType();"); |
84 |
$form->setOnchange("demande_type","showFormsDemande();"); |
85 |
} |
86 |
|
87 |
/* |
88 |
* Cache le champ terrain_references_cadastrales |
89 |
* Hide the fiels terrain_references_cadastrales |
90 |
*/ |
91 |
function setType(&$form,$maj) { |
92 |
parent::setType($form,$maj); |
93 |
|
94 |
$form->setType('dossier_instruction', 'hidden'); |
95 |
$form->setType('dossier_autorisation', 'hidden'); |
96 |
} |
97 |
|
98 |
/** |
99 |
* Méthode permettant d'ajouter un dossier d'autorisation |
100 |
*/ |
101 |
function ajoutDossierAutorisation($id, &$db, $val, $DEBUG){ |
102 |
require_once '../obj/dossier_autorisation.class.php'; |
103 |
$dossier_autorisation = new dossier_autorisation("]",$db,$DEBUG); |
104 |
// Création du dossier |
105 |
foreach($dossier_autorisation->champs as $value) { |
106 |
$valAuto[$value] = NULL; |
107 |
} |
108 |
$valAuto['dossier_autorisation']=NULL; |
109 |
$valAuto['nature']=NULL; |
110 |
$valAuto['exercice']=NULL; |
111 |
$valAuto['insee']=NULL; |
112 |
$valAuto['arrondissement']=NULL; |
113 |
$valAuto['etat']=NULL; |
114 |
$valAuto['erp_numero_batiment']=NULL; |
115 |
$valAuto['erp_ouvert']=NULL; |
116 |
$valAuto['erp_arrete_decision']=NULL; |
117 |
$valAuto['dossier_autorisation_type_detaille']=$this->valF['dossier_autorisation_type_detaille']; |
118 |
$valAuto['depot_initial']=$this->valF['date_demande']; |
119 |
$valAuto['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
120 |
$valAuto['terrain_adresse_voie_numero']=$this->valF['terrain_adresse_voie_numero']; |
121 |
$valAuto['complement']=$this->valF['complement']; |
122 |
$valAuto['terrain_adresse_lieu_dit']=$this->valF['terrain_adresse_lieu_dit']; |
123 |
$valAuto['terrain_adresse_localite']=$this->valF['terrain_adresse_localite']; |
124 |
$valAuto['terrain_adresse_code_postal']=$this->valF['terrain_adresse_code_postal']; |
125 |
$valAuto['terrain_adresse_bp']=$this->valF['terrain_adresse_bp']; |
126 |
$valAuto['terrain_adresse_cedex']=$this->valF['terrain_adresse_cedex']; |
127 |
$valAuto['terrain_superficie']=$this->valF['terrain_superficie']; |
128 |
// Ajout du dossier dans la base |
129 |
$dossier_autorisation->ajouter($valAuto, $db, $DEBUG); |
130 |
// Liaison du dossier ajouter à la demande |
131 |
$this->valF['dossier_autorisation'] = $dossier_autorisation->valF['dossier_autorisation']; |
132 |
} |
133 |
|
134 |
/** |
135 |
* Méthode permettant d'ajouter un dossier d'instruction |
136 |
*/ |
137 |
function ajoutDossierInstruction($id, &$db, $val, $DEBUG){ |
138 |
require_once '../obj/dossier.class.php'; |
139 |
$dossier = new dossier("]",$db,$DEBUG); |
140 |
foreach($dossier->champs as $value) { |
141 |
$valInstr[$value] = NULL; |
142 |
} |
143 |
require_once '../obj/dossier_autorisation_type_detaille.class.php'; |
144 |
$datd = new dossier_autorisation_type_detaille( |
145 |
$this->valF['dossier_autorisation_type_detaille'],$db,$DEBUG); |
146 |
// Définition des valeurs à entrée dans la table |
147 |
$valInstr['nature']=$datd->val[array_search("code", $datd->champs)]; |
148 |
$valInstr['dossier_autorisation_type_detaille']=$this->valF['dossier_autorisation_type_detaille']; |
149 |
$valInstr['date_depot']=$this->dateDBToForm($this->valF['date_demande']); |
150 |
$valInstr['depot_initial']=$this->dateDBToForm($this->valF['date_demande']); |
151 |
$valInstr['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
152 |
$valInstr['terrain_adresse_voie_numero']=$this->valF['terrain_adresse_voie_numero']; |
153 |
$valInstr['complement']=$this->valF['complement']; |
154 |
$valInstr['terrain_adresse_lieu_dit']=$this->valF['terrain_adresse_lieu_dit']; |
155 |
$valInstr['terrain_adresse_localite']=$this->valF['terrain_adresse_localite']; |
156 |
$valInstr['terrain_adresse_code_postal']=$this->valF['terrain_adresse_code_postal']; |
157 |
$valInstr['terrain_adresse_bp']=$this->valF['terrain_adresse_bp']; |
158 |
$valInstr['terrain_adresse_cedex']=$this->valF['terrain_adresse_cedex']; |
159 |
$valInstr['terrain_superficie']=$this->valF['terrain_superficie']; |
160 |
$valInstr['description']=""; |
161 |
$dossier->ajouter($valInstr, $db, $DEBUG); |
162 |
$this->f->isDatabaseError(); |
163 |
// Liaison du dossier ajouter à la demande |
164 |
$this->valF['dossier_instruction'] = $dossier->valF['dossier']; |
165 |
} |
166 |
|
167 |
/** |
168 |
* Ajout des liens demandeurs / dossier d'autorisation |
169 |
**/ |
170 |
function ajoutLiensDossierAutorisation($id, &$db, $val, $DEBUG) { |
171 |
// Création des liens entre le dossier autorisation et les demandeurs |
172 |
include '../sql/pgsql/demande.form.inc.php'; |
173 |
require_once '../obj/lien_dossier_autorisation_demandeur.class.php'; |
174 |
$ldad = new lien_dossier_autorisation_demandeur("]",$db,$DEBUG); |
175 |
// Recupération des demandeurs liés à la demande |
176 |
$sql = str_replace("<demande>",$this->valF['demande'],$sql_lien_demande_demandeur); |
177 |
$res = $db->query($sql); |
178 |
$this->f->addToLog("demande.class.php: db->query(\"".$sql."\");", VERBOSE_MODE); |
179 |
$this->f->isDatabaseError(); |
180 |
while($row = &$res->fetchRow(DB_FETCHMODE_ASSOC)) { |
181 |
$row['lien_dossier_autorisation_demandeur'] = NULL; |
182 |
$row['dossier_autorisation'] = $this->valF['dossier_autorisation']; |
183 |
$ldad->ajouter($row, $db, $DEBUG); |
184 |
} |
185 |
} |
186 |
|
187 |
/** |
188 |
* Ajout des liens demandeurs / dossier d'autorisation |
189 |
**/ |
190 |
function ajoutLiensDossierInstruction($id, &$db, $val, $DEBUG) { |
191 |
// Création des liens entre le dossier instruction et les demandeurs |
192 |
include '../sql/pgsql/demande.form.inc.php'; |
193 |
require_once '../obj/lien_dossier_demandeur.class.php'; |
194 |
$ldd = new lien_dossier_demandeur("]",$db,$DEBUG); |
195 |
// Recupération des demandeurs liés à la demande |
196 |
$sql = str_replace("<demande>",$this->valF['demande'],$sql_lien_demande_demandeur); |
197 |
$res = $db->query($sql); |
198 |
$this->f->addToLog("demande.class.php: db->query(\"".$sql."\");", VERBOSE_MODE); |
199 |
$this->f->isDatabaseError(); |
200 |
while($row = &$res->fetchRow(DB_FETCHMODE_ASSOC)) { |
201 |
$row['lien_dossier_demandeur'] = NULL; |
202 |
$row['dossier'] = $this->valF['dossier_instruction']; |
203 |
$ldd->ajouter($row, $db, $DEBUG); |
204 |
} |
205 |
} |
206 |
|
207 |
/** |
208 |
* Ajout des dossiers |
209 |
**/ |
210 |
function triggerAjouter($id, &$db, $val, $DEBUG){ |
211 |
include '../sql/pgsql/demande.form.inc.php'; |
212 |
if($this->valF["demande_type"] != NULL) { |
213 |
$res = $db->query(str_replace('<idx>', $this->valF['demande_type'], $sql_demande_type_details_by_id)); |
214 |
$this->f->isDatabaseError(); |
215 |
$dossier_type = $res->fetchRow(DB_FETCHMODE_ASSOC); |
216 |
// Création du dossier_autorisation |
217 |
if($dossier_type['dossier_autorisation_type_detaille'] != NULL) { |
218 |
$this->ajoutDossierAutorisation($id, $db, $val, $DEBUG); |
219 |
$this -> addToMessage(_("Creation du dossier d'autorisation no").$this->valF['dossier_autorisation']); |
220 |
} |
221 |
// Création du dossier d'instruction |
222 |
if($dossier_type['dossier_instruction_type'] != NULL) { |
223 |
$this->ajoutDossierInstruction($id, $db, $val, $DEBUG); |
224 |
$this -> addToMessage(_("Creation du dossier d'instruction no".$this->valF['dossier_instruction'])); |
225 |
} |
226 |
} |
227 |
} |
228 |
|
229 |
/** |
230 |
* Ajout des délégataires et pétitionnaires |
231 |
**/ |
232 |
function triggerAjouterApres($id, &$db, $val, $DEBUG){ |
233 |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
234 |
$this->valIdDemandeur=$this->postedIdDemandeur; |
235 |
// Ajout des lliens entre dossier_autorisation et demandeur |
236 |
if(!empty($this->valF['dossier_autorisation'])) { |
237 |
$this->ajoutLiensDossierAutorisation($id, $db, $val, $DEBUG); |
238 |
} |
239 |
// Ajout des lliens entre dossier et demandeur |
240 |
if(!empty($this->valF['dossier_instruction'])) { |
241 |
$this->ajoutLiensDossierInstruction($id, $db, $val, $DEBUG); |
242 |
} |
243 |
} |
244 |
function triggerModifierApres($id, &$db, $val, $DEBUG){ |
245 |
$this->listeDemandeur(); |
246 |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
247 |
$this->valIdDemandeur=$this->postedIdDemandeur; |
248 |
|
249 |
} |
250 |
|
251 |
/** |
252 |
* Gestion des liens entre la demande et les demendeurs recement ajoutés |
253 |
**/ |
254 |
function insertLinkDemandeDemandeur($db, $DEBUG) { |
255 |
// |
256 |
require_once "../obj/lien_demande_demandeur.class.php"; |
257 |
|
258 |
// Comparaison de l'id petitionnaire principal |
259 |
if(isset($this->postedIdDemandeur['petitionnaire_principal']) AND |
260 |
!empty($this->postedIdDemandeur['petitionnaire_principal']) AND |
261 |
$this->valIdDemandeur['petitionnaire_principal'] != |
262 |
$this->postedIdDemandeur['petitionnaire_principal']) { |
263 |
// Ajout du nouveau lien |
264 |
$this->addLinkDemandeDemandeur($this->postedIdDemandeur['petitionnaire_principal'], true, $db, $DEBUG); |
265 |
if(!empty($this->valIdDemandeur['petitionnaire_principal'])) { |
266 |
$this->deleteLinkDemandeDemandeur($this->valIdDemandeur['petitionnaire_principal'], $db, $DEBUG); |
267 |
} |
268 |
} |
269 |
|
270 |
// Comparaison du delegataire |
271 |
if(isset($this->postedIdDemandeur['delegataire']) AND |
272 |
!empty($this->postedIdDemandeur['delegataire']) AND |
273 |
$this->valIdDemandeur['delegataire'] != |
274 |
$this->postedIdDemandeur['delegataire']) { |
275 |
// Ajout du nouveau lien |
276 |
$this->addLinkDemandeDemandeur($this->postedIdDemandeur['delegataire'], false, $db, $DEBUG); |
277 |
if(!empty($this->valIdDemandeur['delegataire'])) { |
278 |
$this->deleteLinkDemandeDemandeur($this->valIdDemandeur['delegataire'], $db, $DEBUG); |
279 |
} |
280 |
} |
281 |
|
282 |
// Comparaison des different petitionnaires |
283 |
if(isset($this->postedIdDemandeur['petitionnaire'])) { |
284 |
// Suppression des liens non valides |
285 |
foreach ($this->valIdDemandeur['petitionnaire'] as $petitionnaire) { |
286 |
if(!in_array($petitionnaire, $this->postedIdDemandeur['petitionnaire'])) { |
287 |
$this->deleteLinkDemandeDemandeur($petitionnaire, $db, $DEBUG); |
288 |
} |
289 |
} |
290 |
// Ajout des nouveaux liens |
291 |
foreach ($this->postedIdDemandeur['petitionnaire'] as $petitionnaire) { |
292 |
if(!in_array($petitionnaire, $this->valIdDemandeur['petitionnaire'])) { |
293 |
$this->addLinkDemandeDemandeur($petitionnaire, false, $db, $DEBUG); |
294 |
} |
295 |
} |
296 |
} |
297 |
} |
298 |
|
299 |
|
300 |
/** |
301 |
* Fonction permettant d'ajouter un lien |
302 |
* entre la table demande et demandeur |
303 |
**/ |
304 |
function addLinkDemandeDemandeur($id, $principal, $db, $DEBUG) { |
305 |
$lienAjout = new lien_demande_demandeur( |
306 |
"]", |
307 |
$db, |
308 |
$DEBUG); |
309 |
$lien = array('lien_demande_demandeur' => "", |
310 |
'petitionnaire_principal' => (($principal)?"t":"f"), |
311 |
'demande' => $this->valF['demande'], |
312 |
'demandeur' => $id); |
313 |
$lienAjout->ajouter($lien, $db, $DEBUG); |
314 |
$lienAjout->__destruct(); |
315 |
} |
316 |
|
317 |
/** |
318 |
* Fonction permettant de supprimer un lien |
319 |
* entre la table demande et demandeur |
320 |
**/ |
321 |
function deleteLinkDemandeDemandeur($id, $db, $DEBUG) { |
322 |
// Suppression |
323 |
$sql = "DELETE FROM ".DB_PREFIXE."lien_demande_demandeur ". |
324 |
"WHERE demande=".$this->valF['demande']. |
325 |
" AND demandeur=".$id; |
326 |
// Execution de la requete de suppression de l'objet |
327 |
$res = $db->query($sql); |
328 |
// Logger |
329 |
$this->f->addToLog("supprimer(): db->query(\"".$sql."\");", VERBOSE_MODE); |
330 |
$this->f->isDatabaseError(); |
331 |
|
332 |
} |
333 |
|
334 |
function isLinkDemandeDemandeurExist($idDemandeur) { |
335 |
$sql = "SELECT count(*) |
336 |
FROM ".DB_PREFIXE."lien_demande_demandeur |
337 |
WHERE demande = ".$this->valF['demande']. |
338 |
"AND demandeur = ".$idDemandeur; |
339 |
$count = $this->f->db->getOne($sql); |
340 |
$this->f->addToLog("db->getone(\"".$sql."\");", VERBOSE_MODE); |
341 |
$this->f->isDatabaseError($count); |
342 |
if ($count === 0) { |
343 |
return false; |
344 |
} else { |
345 |
return true; |
346 |
} |
347 |
|
348 |
} |
349 |
|
350 |
/** |
351 |
* Methode de recupération des valeurs postées |
352 |
**/ |
353 |
function getPostedValues() { |
354 |
// Récupération des demandeurs dans POST |
355 |
if (isset($_POST['petitionnaire_principal']) OR |
356 |
isset($_POST['delegataire']) OR |
357 |
isset($_POST['petitionnaire'])) { |
358 |
if( isset($_POST['petitionnaire_principal']) AND |
359 |
!empty($_POST['petitionnaire_principal'])) { |
360 |
$this->postedIdDemandeur['petitionnaire_principal'] = $_POST['petitionnaire_principal']; |
361 |
} |
362 |
if( isset($_POST['delegataire']) AND |
363 |
!empty($_POST['delegataire'])) { |
364 |
$this->postedIdDemandeur['delegataire'] = $_POST['delegataire']; |
365 |
} |
366 |
if( isset($_POST['petitionnaire']) AND |
367 |
!empty($_POST['petitionnaire'])) { |
368 |
$this->postedIdDemandeur['petitionnaire'] = $_POST['petitionnaire']; |
369 |
} |
370 |
} |
371 |
} |
372 |
/** |
373 |
* Méthode permettant de récupérer les id des demandeur lié à la demande |
374 |
**/ |
375 |
function listeDemandeur() { |
376 |
// Récupération des demandeurs de la base |
377 |
$sql = "SELECT demandeur.demandeur, |
378 |
demandeur.type_demandeur, |
379 |
lien_demande_demandeur.petitionnaire_principal |
380 |
FROM ".DB_PREFIXE."lien_demande_demandeur |
381 |
INNER JOIN ".DB_PREFIXE."demandeur |
382 |
ON demandeur.demandeur=lien_demande_demandeur.demandeur |
383 |
WHERE demande = ".$this->val[array_search('demande', $this->champs)]; |
384 |
$res = $this->f->db->query($sql); |
385 |
$this->f->addToLog("listeDemandeur() : ".$sql); |
386 |
$this->f->isDatabaseError($res); |
387 |
// Stoquage du résultat dans un tableau |
388 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
389 |
if ($row['petitionnaire_principal'] == 't' AND |
390 |
$row['type_demandeur']=="petitionnaire") { |
391 |
$this->valIdDemandeur['petitionnaire_principal']=$row['demandeur']; |
392 |
} elseif ($row['petitionnaire_principal'] == 'f' AND |
393 |
$row['type_demandeur']=="petitionnaire"){ |
394 |
$this->valIdDemandeur['petitionnaire'][]=$row['demandeur']; |
395 |
} elseif ($row['type_demandeur']=="delegataire"){ |
396 |
$this->valIdDemandeur['delegataire']=$row['demandeur']; |
397 |
} |
398 |
} |
399 |
} |
400 |
|
401 |
/** |
402 |
* Ajout de la liste des demandeurs |
403 |
*/ |
404 |
function formSpecificContent($maj) { |
405 |
if(!$this->correct AND $maj != 0) { |
406 |
$this->listeDemandeur(); |
407 |
} |
408 |
if($maj < 2 AND !$this->correct) { |
409 |
$linkable = true; |
410 |
} else { |
411 |
$linkable = false; |
412 |
} |
413 |
// Conteneur de la listes des demandeurs |
414 |
echo "<div class=\"demande_hidden_bloc col_12\">"; |
415 |
echo "<fieldset class=\"cadre ui-corner-all ui-widget-content\">"; |
416 |
echo " <legend class=\"ui-corner-all ui-widget-content ui-state-active\">" |
417 |
._("Petitionnaire")."</legend>"; |
418 |
// Si des demandeurs sont liés à la demande |
419 |
require_once "../obj/petitionnaire.class.php"; |
420 |
require_once "../obj/delegataire.class.php"; |
421 |
|
422 |
// Affichage du bloc pétitionnaire principal / délégataire |
423 |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
424 |
echo "<div id=\"petitionnaire_principal_delegataire\">"; |
425 |
// Affichage de la synthèse |
426 |
if (isset ($this->valIdDemandeur["petitionnaire_principal"]) AND |
427 |
!empty($this->valIdDemandeur["petitionnaire_principal"])) { |
428 |
$demandeur = new petitionnaire( |
429 |
$this->valIdDemandeur["petitionnaire_principal"], |
430 |
$this->f->db,false); |
431 |
$demandeur -> afficherSynthese("petitionnaire_principal", $linkable); |
432 |
$demandeur -> __destruct(); |
433 |
} |
434 |
// Si en édition de formulaire |
435 |
if($maj < 2 AND $this->correct != true) { |
436 |
// Bouton d'ajout du pétitionnaire principal |
437 |
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
438 |
echo "<input id=\"add_petitionnaire_principal\" |
439 |
class=\"ui-button ui-widget ui-state-default ui-corner-all\" |
440 |
type=\"button\" value=\""._("Saisir le petitionnaire principal")."\"/>"; |
441 |
echo " <span class=\"om-icon om-icon-16 om-icon-fix arrow-right-16\">></span> "; |
442 |
// Bouton d'ajout du delegataire |
443 |
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
444 |
echo "<input id=\"add_delegataire\" |
445 |
class=\"ui-button ui-widget ui-state-default ui-corner-all\" |
446 |
type=\"button\" value=\""._("Saisir le delegataire")."\"/>"; |
447 |
} |
448 |
// Affichage de la synthèse |
449 |
if (isset ($this->valIdDemandeur["delegataire"]) AND |
450 |
!empty($this->valIdDemandeur["delegataire"])) { |
451 |
$demandeur = new delegataire($this->valIdDemandeur["delegataire"], |
452 |
$this->f->db,false); |
453 |
$demandeur -> afficherSynthese("delegataire", $linkable); |
454 |
$demandeur -> __destruct(); |
455 |
} |
456 |
|
457 |
echo "</div>"; |
458 |
|
459 |
// Bloc des pétitionnaires secondaires |
460 |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
461 |
echo "<div id=\"listePetitionnaires\">"; |
462 |
|
463 |
// Affichage de la synthèse |
464 |
if (isset ($this->valIdDemandeur["petitionnaire"]) AND |
465 |
!empty($this->valIdDemandeur["petitionnaire"])) { |
466 |
|
467 |
foreach ($this->valIdDemandeur["petitionnaire"] as $petitionnaire) { |
468 |
$demandeur = new petitionnaire($petitionnaire, |
469 |
$this->f->db,false); |
470 |
$demandeur -> afficherSynthese("petitionnaire", $linkable); |
471 |
$demandeur -> __destruct(); |
472 |
} |
473 |
|
474 |
} |
475 |
if ($maj < 2 AND !$this->correct) { |
476 |
// L'ID DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
477 |
echo "<input id=\"add_petitionnaire\" |
478 |
class=\"ui-button ui-widget ui-state-default ui-corner-all\" |
479 |
type=\"button\" value=\""._("Ajouter un petitionnaire")."\"/>"; |
480 |
} |
481 |
echo "</div>"; |
482 |
echo "</fieldset>"; |
483 |
echo "</div>"; |
484 |
} |
485 |
|
486 |
}// fin classe |
487 |
?> |