13 |
"delegataire" => "", |
"delegataire" => "", |
14 |
"petitionnaire" => array()); |
"petitionnaire" => array()); |
15 |
|
|
16 |
|
var $autreDossierEnCour; |
17 |
|
|
18 |
function demande($id,&$db,$debug) { |
function demande($id,&$db,$debug) { |
19 |
$this->constructeur($id,$db,$debug); |
$this->constructeur($id,$db,$debug); |
20 |
}// fin constructeur |
}// fin constructeur |
59 |
} |
} |
60 |
} |
} |
61 |
} |
} |
62 |
|
function getDataSubmit() { |
63 |
|
|
64 |
|
$datasubmit = parent::getDataSubmit(); |
65 |
|
if($this->getParameter("idx_dossier") != "") { |
66 |
|
$datasubmit .= "&idx_dossier=".$this->getParameter("idx_dossier"); |
67 |
|
} |
68 |
|
return $datasubmit; |
69 |
|
} |
70 |
|
|
71 |
/** |
/** |
72 |
* Méthode de verification du contenu |
* Méthode de verification du contenu |
79 |
$this->addToMessage("La saisie d'un petitionnaire principal est obligatoire."); |
$this->addToMessage("La saisie d'un petitionnaire principal est obligatoire."); |
80 |
} |
} |
81 |
} |
} |
82 |
|
|
83 |
|
/** |
84 |
|
* Méthode permettant de vérifier si un autre dossier d'instruction est en cour |
85 |
|
* pour le même dossier d'autorisation. |
86 |
|
*/ |
87 |
|
function autreDossierEnCour() { |
88 |
|
|
89 |
|
$idx_dossier = $this->getParameter("idx_dossier"); |
90 |
|
|
91 |
|
// Lorsqu'on se trouve sur un dossier existant |
92 |
|
if(isset($idx_dossier) AND $idx_dossier != "") { |
93 |
|
|
94 |
|
// Si on a pas encore défini si un autre dossier est en cours |
95 |
|
if(!isset($this->autreDossierEnCour)) { |
96 |
|
|
97 |
|
if(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php")) |
98 |
|
include ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php"); |
99 |
|
elseif(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc")) |
100 |
|
include ("../sql/".$this->db->phptype."/".$this->table.".form.inc"); |
101 |
|
$request = str_replace('<idx>', $idx_dossier, |
102 |
|
$sql_autreDossierEnCour); |
103 |
|
|
104 |
|
$nbDossier = $this->db->getOne($request); |
105 |
|
$this->f->addToLog("db->getone(\"".$request."\");", VERBOSE_MODE); |
106 |
|
$this->f->isDatabaseError($nbDossier); |
107 |
|
// Si un dossier est en cour return true |
108 |
|
if($nbDossier>0) { |
109 |
|
|
110 |
|
$this->autreDossierEnCour = true; |
111 |
|
} else { |
112 |
|
|
113 |
|
$this->autreDossierEnCour = false; |
114 |
|
} |
115 |
|
|
116 |
|
} |
117 |
|
} else { |
118 |
|
$this->autreDossierEnCour = false; |
119 |
|
} |
120 |
|
|
121 |
|
return $this->autreDossierEnCour; |
122 |
|
} |
123 |
|
|
124 |
|
/** |
125 |
|
* Configuration des select |
126 |
|
*/ |
127 |
|
function setSelect(&$form, $maj,&$db,$debug) { |
128 |
|
parent::setSelect($form, $maj,$db,$debug); |
129 |
|
|
130 |
|
if(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc.php")) |
131 |
|
include ("../sql/".$db->phptype."/".$this->table.".form.inc.php"); |
132 |
|
elseif(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc")) |
133 |
|
include ("../sql/".$db->phptype."/".$this->table.".form.inc"); |
134 |
|
|
135 |
|
//Récupération de paramètre pour le rechargement ajax du select |
136 |
|
$idx_dossier = $this->getParameter("idx_dossier"); |
137 |
|
$datd = $this->getParameter("datd"); |
138 |
|
|
139 |
|
$contenu = array(); |
140 |
|
|
141 |
|
// Ajout de filtre sur la requête (initial) |
142 |
|
if(isset($idx_dossier) AND $idx_dossier != "") { |
143 |
|
$sql_demande_type .= " WHERE demande_nature = 2 "; |
144 |
|
} else { |
145 |
|
$sql_demande_type .= " WHERE demande_nature = 1 "; |
146 |
|
} |
147 |
|
if(isset($_POST["dossier_autorisation_type_detaille"]) AND $_POST["dossier_autorisation_type_detaille"] != "") { |
148 |
|
$datd = $_POST["dossier_autorisation_type_detaille"]; |
149 |
|
} |
150 |
|
// Ajout de filtre sur la requête (dossier_autorisation_type_detaille) |
151 |
|
if(isset($datd) AND $datd != "") { |
152 |
|
$sql_demande_type .= " AND dossier_autorisation_type_detaille = ".$datd; |
153 |
|
} else { |
154 |
|
$sql_demande_type .= " AND dossier_autorisation_type_detaille = ".$this->getVal("dossier_autorisation_type_detaille"); |
155 |
|
} |
156 |
|
|
157 |
|
$res = $db->query($sql_demande_type); |
158 |
|
|
159 |
|
// logger |
160 |
|
$this->addToLog("setSelect()[gen/obj]: db->query(\"".$sql_demande_type."\");", |
161 |
|
VERBOSE_MODE); |
162 |
|
$this->f->isDatabaseError($res); |
163 |
|
|
164 |
|
$contenu[0][0] = ''; |
165 |
|
$contenu[1][0] = _('choisir')." "._("demande_type"); |
166 |
|
|
167 |
|
$k=1; |
168 |
|
while($row =& $res->fetchRow()){ |
169 |
|
$display = true; |
170 |
|
|
171 |
|
// Vérification des contraintes |
172 |
|
if($row[2] != "") { |
173 |
|
foreach(explode(";", $row[2]) as $meth) { |
174 |
|
if(method_exists($this, $row[2])) { |
175 |
|
// Si une des contrainte est validée on affiche pas l'option |
176 |
|
if($this->$row[2]() === true) { |
177 |
|
$display = false; |
178 |
|
} |
179 |
|
} |
180 |
|
} |
181 |
|
} |
182 |
|
// Affichage ou non de l'option |
183 |
|
if($display) { |
184 |
|
$contenu[0][$k] = $row[0]; |
185 |
|
$contenu[1][$k] = $row[1]; |
186 |
|
$k++; |
187 |
|
} |
188 |
|
} |
189 |
|
|
190 |
|
$form->setSelect("demande_type", $contenu); |
191 |
|
|
192 |
|
} |
193 |
/* |
/* |
194 |
* Ajout du fielset |
* Ajout du fielset |
195 |
* Add fieldset |
* Add fieldset |
222 |
$form->setBloc('terrain_superficie','F'); |
$form->setBloc('terrain_superficie','F'); |
223 |
/*Fin bloc 4*/ |
/*Fin bloc 4*/ |
224 |
|
|
|
/*Champ sur lequel s'ouvre le bloc 4 */ |
|
|
$form->setBloc('nombre_lots','D',"","lots col_12 demande_hidden_bloc"); |
|
|
$form->setFieldset('nombre_lots','D',_('Nombre de lots')); |
|
|
$form->setFieldset('nombre_lots','F',''); |
|
|
$form->setBloc('nombre_lots','F'); |
|
|
/*Fin bloc 5*/ |
|
225 |
} |
} |
226 |
} |
} |
227 |
|
|
234 |
$form->setOnchange("dossier_autorisation_type_detaille","changeDemandeType();"); |
$form->setOnchange("dossier_autorisation_type_detaille","changeDemandeType();"); |
235 |
$form->setOnchange("demande_type","showFormsDemande();"); |
$form->setOnchange("demande_type","showFormsDemande();"); |
236 |
} |
} |
237 |
|
|
238 |
|
function setLib(&$form,$maj) { |
239 |
|
parent::setLib($form,$maj); |
240 |
|
//libelle des champs |
241 |
|
|
242 |
|
$form->setLib('complement',_('terrain_adresse')); |
243 |
|
} |
244 |
/* |
/* |
245 |
* Cache le champ terrain_references_cadastrales |
* Cache le champ terrain_references_cadastrales |
246 |
* Hide the fiels terrain_references_cadastrales |
* Hide the fiels terrain_references_cadastrales |
267 |
$form->setType('terrain_adresse_bp', 'hiddenstatic'); |
$form->setType('terrain_adresse_bp', 'hiddenstatic'); |
268 |
$form->setType('terrain_adresse_cedex', 'hiddenstatic'); |
$form->setType('terrain_adresse_cedex', 'hiddenstatic'); |
269 |
$form->setType('terrain_superficie', 'hiddenstatic'); |
$form->setType('terrain_superficie', 'hiddenstatic'); |
|
$form->setType('nombre_lots', 'hiddenstatic'); |
|
270 |
} |
} |
271 |
if($maj == 1) { |
if($maj == 1) { |
272 |
$form->setType('dossier_autorisation_type_detaille', 'selecthiddenstatic'); |
$form->setType('dossier_autorisation_type_detaille', 'selecthiddenstatic'); |
289 |
$valAuto[$value] = NULL; |
$valAuto[$value] = NULL; |
290 |
} |
} |
291 |
$valAuto['dossier_autorisation']=NULL; |
$valAuto['dossier_autorisation']=NULL; |
|
$valAuto['nature']=NULL; |
|
292 |
$valAuto['exercice']=NULL; |
$valAuto['exercice']=NULL; |
293 |
$valAuto['insee']=NULL; |
$valAuto['insee']=NULL; |
294 |
$valAuto['arrondissement']=NULL; |
$valAuto['arrondissement']=NULL; |
295 |
$valAuto['etat']=NULL; |
$valAuto['etat_dossier_autorisation']=1; |
296 |
$valAuto['erp_numero_batiment']=NULL; |
$valAuto['erp_numero_batiment']=NULL; |
297 |
$valAuto['erp_ouvert']=NULL; |
$valAuto['erp_ouvert']=NULL; |
298 |
$valAuto['erp_arrete_decision']=NULL; |
$valAuto['erp_arrete_decision']=NULL; |
299 |
$valAuto['dossier_autorisation_type_detaille']=$this->valF['dossier_autorisation_type_detaille']; |
$valAuto['dossier_autorisation_type_detaille']=$this->valF['dossier_autorisation_type_detaille']; |
300 |
$valAuto['depot_initial']=$this->valF['date_demande']; |
$valAuto['depot_initial']=$this->dateDBToForm($this->valF['date_demande']); |
301 |
$valAuto['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
$valAuto['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
302 |
$valAuto['terrain_adresse_voie_numero']=$this->valF['terrain_adresse_voie_numero']; |
$valAuto['terrain_adresse_voie_numero']=$this->valF['terrain_adresse_voie_numero']; |
303 |
$valAuto['complement']=$this->valF['complement']; |
$valAuto['complement']=$this->valF['complement']; |
314 |
$this->valF['dossier_autorisation'] = $dossier_autorisation->valF['dossier_autorisation']; |
$this->valF['dossier_autorisation'] = $dossier_autorisation->valF['dossier_autorisation']; |
315 |
} |
} |
316 |
|
|
317 |
|
function getCodeDemandeType($demande_type){ |
318 |
|
|
319 |
|
$sql = "SELECT |
320 |
|
code |
321 |
|
FROM |
322 |
|
".DB_PREFIXE."demande_type |
323 |
|
WHERE |
324 |
|
demande_type = ".$demande_type; |
325 |
|
$codeDemandeType = $this->db->getOne($sql); |
326 |
|
$this->addToLog("db->getone(\"".$sql."\");", VERBOSE_MODE); |
327 |
|
|
328 |
|
return $codeDemandeType; |
329 |
|
} |
330 |
|
|
331 |
/** |
/** |
332 |
* Méthode permettant d'ajouter un dossier d'instruction |
* Méthode permettant d'ajouter un dossier d'instruction |
333 |
*/ |
*/ |
347 |
$dossier->setDossierInstructionType($dossier_instruction_type); |
$dossier->setDossierInstructionType($dossier_instruction_type); |
348 |
|
|
349 |
// Définition des valeurs à entrée dans la table |
// Définition des valeurs à entrée dans la table |
350 |
$valInstr['nature']=$datd->val[array_search("code", $datd->champs)]; |
$valInstr['dossier_instruction_type']=$dossier_instruction_type; |
|
$valInstr['dossier_autorisation_type_detaille']=$this->valF['dossier_autorisation_type_detaille']; |
|
351 |
$valInstr['date_depot']=$this->dateDBToForm($this->valF['date_demande']); |
$valInstr['date_depot']=$this->dateDBToForm($this->valF['date_demande']); |
352 |
$valInstr['date_demande']=$this->dateDBToForm($this->valF['date_demande']); |
$valInstr['date_demande']=$this->dateDBToForm($this->valF['date_demande']); |
353 |
$valInstr['depot_initial']=$this->dateDBToForm($this->valF['date_demande']); |
$valInstr['depot_initial']=$this->dateDBToForm($this->valF['date_demande']); |
362 |
$valInstr['terrain_superficie']=$this->valF['terrain_superficie']; |
$valInstr['terrain_superficie']=$this->valF['terrain_superficie']; |
363 |
$valInstr['description']=""; |
$valInstr['description']=""; |
364 |
$valInstr['dossier_autorisation']=$this->valF['dossier_autorisation']; |
$valInstr['dossier_autorisation']=$this->valF['dossier_autorisation']; |
365 |
|
|
366 |
|
/* |
367 |
|
* Gestion de la qualification |
368 |
|
* */ |
369 |
|
//Récupérer le code du type de la demande |
370 |
|
$codeDemandeType = $this->getCodeDemandeType($val['demande_type']); |
371 |
|
|
372 |
|
//Marque le dossier comme à qualifier selon le type de dossier d'instruction |
373 |
|
if ( strcasecmp($codeDemandeType, "DI") == 0 || |
374 |
|
strcasecmp($codeDemandeType, "DT") == 0 || |
375 |
|
strcasecmp($codeDemandeType, "DM") == 0 || |
376 |
|
strcasecmp($codeDemandeType, "DP") == 0 || |
377 |
|
strcasecmp($codeDemandeType, "DTP") == 0 || |
378 |
|
strcasecmp($codeDemandeType, "DAACT") == 0 || |
379 |
|
strcasecmp($codeDemandeType, "DOC") == 0 ){ |
380 |
|
|
381 |
|
$valInstr['a_qualifier'] = TRUE; |
382 |
|
} |
383 |
|
|
384 |
|
// Récupération du cerfa pour le type d'instruction sélectionnée et valide |
385 |
|
$sql = "SELECT |
386 |
|
dossier_instruction_type.cerfa |
387 |
|
FROM |
388 |
|
".DB_PREFIXE."dossier_instruction_type |
389 |
|
JOIN |
390 |
|
".DB_PREFIXE."cerfa |
391 |
|
ON |
392 |
|
dossier_instruction_type.cerfa = cerfa.cerfa |
393 |
|
WHERE |
394 |
|
now()<=om_validite_fin |
395 |
|
AND now()>=om_validite_debut |
396 |
|
AND dossier_instruction_type=".$dossier_instruction_type; |
397 |
|
$valInstr['cerfa'] = $db->getOne($sql); |
398 |
|
$this->addToLog("db->getone(\"".$sql."\");", VERBOSE_MODE); |
399 |
|
|
400 |
$dossier->ajouter($valInstr, $db, $DEBUG); |
$dossier->ajouter($valInstr, $db, $DEBUG); |
401 |
$this->f->isDatabaseError(); |
$this->f->isDatabaseError(); |
402 |
// Liaison du dossier ajouter à la demande |
// Liaison du dossier ajouter à la demande |
404 |
} |
} |
405 |
|
|
406 |
/** |
/** |
407 |
|
* Méthode permettant d'ajouter les données techniques au dossier d'instruction |
408 |
|
*/ |
409 |
|
function ajoutDonneesTechniques($id, &$db, $val, $DEBUG){ |
410 |
|
|
411 |
|
require_once '../obj/donnees_techniques.class.php'; |
412 |
|
$donnees_techniques = new donnees_techniques("]",$db,$DEBUG); |
413 |
|
|
414 |
|
// Champs tous à NULL car seul le champ concernant le dossier d'instruction sera rempli |
415 |
|
foreach($donnees_techniques->champs as $value) { |
416 |
|
$val[$value] = NULL; |
417 |
|
} |
418 |
|
|
419 |
|
// Ajout du numéro de dossier d'instruction |
420 |
|
$val['dossier_instruction']=$this->valF['dossier_instruction']; |
421 |
|
|
422 |
|
// Ajout des données techniques |
423 |
|
$donnees_techniques->ajouter($val, $db, $DEBUG); |
424 |
|
$this->f->isDatabaseError(); |
425 |
|
} |
426 |
|
|
427 |
|
/** |
428 |
* Ajout des liens demandeurs / dossier d'autorisation |
* Ajout des liens demandeurs / dossier d'autorisation |
429 |
**/ |
**/ |
430 |
function ajoutLiensDossierAutorisation($id, &$db, $val, $DEBUG) { |
function ajoutLiensDossierAutorisation($id, &$db, $val, $DEBUG) { |
563 |
if($dossier_type['dossier_instruction_type'] != NULL) { |
if($dossier_type['dossier_instruction_type'] != NULL) { |
564 |
$this->ajoutDossierInstruction($id, $db, $val, $DEBUG, $dossier_type['dossier_instruction_type']); |
$this->ajoutDossierInstruction($id, $db, $val, $DEBUG, $dossier_type['dossier_instruction_type']); |
565 |
$this -> addToMessage(_("Creation du dossier d'instruction no").$this->valF['dossier_instruction']); |
$this -> addToMessage(_("Creation du dossier d'instruction no").$this->valF['dossier_instruction']); |
566 |
|
|
567 |
|
//Ajout des données techniques au dossier d'instruction |
568 |
|
$this->ajoutDonneesTechniques($id, $db, $val, $DEBUG); |
569 |
} |
} |
570 |
|
|
571 |
/*Création du lien de téléchargement de récépissé de demande*/ |
/*Création du lien de téléchargement de récépissé de demande*/ |
585 |
$valInstr['destinataire']=$this->valF['dossier_instruction']; |
$valInstr['destinataire']=$this->valF['dossier_instruction']; |
586 |
$valInstr['dossier']=$this->valF['dossier_instruction']; |
$valInstr['dossier']=$this->valF['dossier_instruction']; |
587 |
|
|
588 |
$valInstr['datecourrier']=date("d/m/Y"); |
$valInstr['date_evenement']=date("d/m/Y"); |
589 |
$valInstr['evenement']=$evenement; |
$valInstr['evenement']=$evenement; |
590 |
$valInstr['lettretype']=$lettretype; |
$valInstr['lettretype']=$lettretype; |
591 |
$valInstr['complement']=""; |
$valInstr['complement']=""; |
623 |
$valInstr['complement14']=""; |
$valInstr['complement14']=""; |
624 |
$valInstr['complement15']=""; |
$valInstr['complement15']=""; |
625 |
$valInstr['avis_decision']=NULL; |
$valInstr['avis_decision']=NULL; |
626 |
|
$valInstr['date_finalisation_courrier']=NULL; |
627 |
|
$valInstr['date_envoi_signature']=NULL; |
628 |
|
$valInstr['date_retour_signature']=NULL; |
629 |
|
$valInstr['date_envoi_rar']=NULL; |
630 |
|
$valInstr['date_retour_rar']=NULL; |
631 |
|
$valInstr['date_envoi_controle_legalite']=NULL; |
632 |
|
$valInstr['date_retour_controle_legalite']=NULL; |
633 |
|
$valInstr['signataire_arrete']=NULL; |
634 |
|
$valInstr['numero_arrete']=NULL; |
635 |
|
|
636 |
/*Fichier requis*/ |
/*Fichier requis*/ |
637 |
require_once '../obj/instruction.class.php'; |
require_once '../obj/instruction.class.php'; |
648 |
$this->valF['instruction_recepisse'] = $instruction->valF['instruction']; |
$this->valF['instruction_recepisse'] = $instruction->valF['instruction']; |
649 |
$this -> addToMessage("<br/><a |
$this -> addToMessage("<br/><a |
650 |
class='lien' |
class='lien' |
651 |
href='../pdf/pdflettretype.php?obj=".$lettretype."&idx=".$this->valF['dossier_instruction']."' |
href='../pdf/pdflettretype.php?obj=".$lettretype."&idx=".$instruction->valF['instruction']."' |
652 |
target='_blank'> |
target='_blank'> |
653 |
<span |
<span |
654 |
class=\"om-icon om-icon-16 om-icon-fix pdf-16\" |
class=\"om-icon om-icon-16 om-icon-fix pdf-16\" |
688 |
if(!empty($this->valF['dossier_instruction'])) { |
if(!empty($this->valF['dossier_instruction'])) { |
689 |
$this->ajoutLiensDossierInstruction($id, $db, $val, $DEBUG); |
$this->ajoutLiensDossierInstruction($id, $db, $val, $DEBUG); |
690 |
} |
} |
691 |
|
|
692 |
|
// Duplication des lots et liaison au nouveau dossier_d'instruction |
693 |
|
if(!empty($this->valF['dossier_autorisation']) AND $val['dossier_autorisation'] != "" ) { |
694 |
|
$this->lienLotDossierInstruction($id, $db, $val, $DEBUG); |
695 |
|
} |
696 |
} |
} |
697 |
|
|
698 |
/*Ajout du lien demande / demandeur(s)*/ |
/*Ajout du lien demande / demandeur(s)*/ |
704 |
} |
} |
705 |
|
|
706 |
/** |
/** |
707 |
|
* Gestion des liens entre les lots du DA et le nouveau dossier |
708 |
|
**/ |
709 |
|
function lienLotDossierInstruction($id, $db, $val, $DEBUG) { |
710 |
|
require_once ("../obj/lot.class.php"); |
711 |
|
$lot = new lot("]", $db, $DEBUG); |
712 |
|
require_once ("../obj/lien_dossier_lot.class.php"); |
713 |
|
$ldl = new lien_dossier_lot("]", $db, $DEBUG); |
714 |
|
require_once ("../obj/lien_lot_demandeur.class.php"); |
715 |
|
$lld = new lien_lot_demandeur("]", $db, $DEBUG); |
716 |
|
|
717 |
|
|
718 |
|
$sqlLots = "SELECT * FROM ".DB_PREFIXE."lot |
719 |
|
WHERE dossier_autorisation = '".$this->valF['dossier_autorisation']."'"; |
720 |
|
$resLot = $db -> query($sqlLots); |
721 |
|
$this->f->addToLog("db->query(\"".$sqlLots."\");", VERBOSE_MODE); |
722 |
|
$this->f->isDatabaseError($resLot); |
723 |
|
while ($rowLot=& $resLot->fetchRow(DB_FETCHMODE_ASSOC)){ |
724 |
|
// Insertion du nouveau lot |
725 |
|
$valLot['lot'] = ""; |
726 |
|
$valLot['libelle'] = $rowLot['libelle']; |
727 |
|
$valLot['dossier_autorisation'] = NULL; |
728 |
|
$lot -> ajouter($valLot, $db, $DEBUG); |
729 |
|
|
730 |
|
//Insertion du lien entre le lot et le dossier d'instruction |
731 |
|
$valLdl['lien_dossier_lot'] = ""; |
732 |
|
$valLdl['dossier'] = $this->valF['dossier_instruction']; |
733 |
|
$valLdl['lot'] = $lot->valF['lot']; |
734 |
|
$ldl->ajouter($valLdl, $db, $DEBUG); |
735 |
|
|
736 |
|
//Insertion des liens entre dossier et les lots |
737 |
|
$sqlDemandeurs = "SELECT * FROM ".DB_PREFIXE."lien_lot_demandeur |
738 |
|
WHERE lot = ".$rowLot['lot']; |
739 |
|
$res = $db -> query($sqlDemandeurs); |
740 |
|
$this->f->addToLog("db->query(\"".$sqlDemandeurs."\");", VERBOSE_MODE); |
741 |
|
$this->f->isDatabaseError($res); |
742 |
|
|
743 |
|
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
744 |
|
$valLld["lien_lot_demandeur"] = ""; |
745 |
|
$valLld["lot"]=$lot->valF['lot']; |
746 |
|
$valLld["demandeur"] = $row['demandeur']; |
747 |
|
$valLld["petitionnaire_principal"] = $row['petitionnaire_principal']; |
748 |
|
$lld->ajouter($valLld, $db, $DEBUG); |
749 |
|
} |
750 |
|
} |
751 |
|
} |
752 |
|
|
753 |
|
/** |
754 |
* Gestion des liens entre la demande et les demandeurs recemment ajoutés |
* Gestion des liens entre la demande et les demandeurs recemment ajoutés |
755 |
**/ |
**/ |
756 |
function insertLinkDemandeDemandeur($db, $DEBUG) { |
function insertLinkDemandeDemandeur($db, $DEBUG) { |
879 |
**/ |
**/ |
880 |
function listeDemandeur($from, $id) { |
function listeDemandeur($from, $id) { |
881 |
// Récupération des demandeurs de la base |
// Récupération des demandeurs de la base |
882 |
$sql = "SELECT demandeur.demandeur, |
if(isset($this->valF['demande_type']) AND $this->getCodeDemandeType($this->valF['demande_type']) != "DT") { |
883 |
demandeur.type_demandeur, |
$sql = "SELECT demandeur.demandeur, |
884 |
lien_".$from."_demandeur.petitionnaire_principal |
demandeur.type_demandeur, |
885 |
FROM ".DB_PREFIXE."lien_".$from."_demandeur |
lien_".$from."_demandeur.petitionnaire_principal |
886 |
INNER JOIN ".DB_PREFIXE."demandeur |
FROM ".DB_PREFIXE."lien_".$from."_demandeur |
887 |
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
INNER JOIN ".DB_PREFIXE."demandeur |
888 |
WHERE ".$from." = '".$id."'"; |
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
889 |
$res = $this->f->db->query($sql); |
WHERE ".$from." = '".$id."'"; |
890 |
$this->f->addToLog("listeDemandeur() : ".$sql); |
$res = $this->f->db->query($sql); |
891 |
$this->f->isDatabaseError($res); |
$this->f->addToLog("listeDemandeur() : ".$sql); |
892 |
// Stoquage du résultat dans un tableau |
$this->f->isDatabaseError($res); |
893 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
// Stoquage du résultat dans un tableau |
894 |
if ($row['petitionnaire_principal'] == 't' AND |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
895 |
$row['type_demandeur']=="petitionnaire") { |
if ($row['petitionnaire_principal'] == 't' AND |
896 |
$this->valIdDemandeur['petitionnaire_principal']=$row['demandeur']; |
$row['type_demandeur']=="petitionnaire") { |
897 |
} elseif ($row['petitionnaire_principal'] == 'f' AND |
$this->valIdDemandeur['petitionnaire_principal']=$row['demandeur']; |
898 |
$row['type_demandeur']=="petitionnaire"){ |
} elseif ($row['petitionnaire_principal'] == 'f' AND |
899 |
$this->valIdDemandeur['petitionnaire'][]=$row['demandeur']; |
$row['type_demandeur']=="petitionnaire"){ |
900 |
} elseif ($row['type_demandeur']=="delegataire"){ |
$this->valIdDemandeur['petitionnaire'][]=$row['demandeur']; |
901 |
$this->valIdDemandeur['delegataire']=$row['demandeur']; |
} elseif ($row['type_demandeur']=="delegataire"){ |
902 |
|
$this->valIdDemandeur['delegataire']=$row['demandeur']; |
903 |
|
} |
904 |
} |
} |
905 |
} |
} |
906 |
} |
} |
975 |
require_once "../obj/delegataire.class.php"; |
require_once "../obj/delegataire.class.php"; |
976 |
// Affichage du bloc pétitionnaire principal / délégataire |
// Affichage du bloc pétitionnaire principal / délégataire |
977 |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
978 |
echo "<div id=\"petitionnaire_principal_delegataire\">"; |
echo "<div id=\"petitionnaire_principal_delegataire col_12\">"; |
979 |
// Affichage de la synthèse |
// Affichage de la synthèse |
980 |
if (isset ($this->valIdDemandeur["petitionnaire_principal"]) AND |
if (isset ($this->valIdDemandeur["petitionnaire_principal"]) AND |
981 |
!empty($this->valIdDemandeur["petitionnaire_principal"])) { |
!empty($this->valIdDemandeur["petitionnaire_principal"])) { |
1004 |
// Bouton d'ajout du delegataire |
// Bouton d'ajout du delegataire |
1005 |
// L'ID DU DIV ET DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
// L'ID DU DIV ET DE L'INPUT SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
1006 |
echo "<div id=\"delegataire\">"; |
echo "<div id=\"delegataire\">"; |
|
if ($maj < 2 OR ($maj == 3 AND !empty($this->valIdDemandeur["delegataire"]))) { |
|
|
echo " <span class=\"om-icon om-icon-16 om-icon-fix arrow-right-16\"> |
|
|
<!-- --> |
|
|
</span> "; |
|
|
} |
|
1007 |
// Affichage de la synthèse |
// Affichage de la synthèse |
1008 |
if (isset ($this->valIdDemandeur["delegataire"]) AND |
if (isset ($this->valIdDemandeur["delegataire"]) AND |
1009 |
!empty($this->valIdDemandeur["delegataire"])) { |
!empty($this->valIdDemandeur["delegataire"])) { |
1026 |
"</span>"; |
"</span>"; |
1027 |
} |
} |
1028 |
echo "</div>"; |
echo "</div>"; |
1029 |
|
echo "<div class=\"both\"></div>"; |
1030 |
echo "</div>"; |
echo "</div>"; |
1031 |
// Bloc des pétitionnaires secondaires |
// Bloc des pétitionnaires secondaires |
1032 |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
1033 |
echo "<div id=\"listePetitionnaires\">"; |
echo "<div id=\"listePetitionnaires col_12\">"; |
1034 |
|
|
1035 |
// Affichage de la synthèse |
// Affichage de la synthèse |
1036 |
if (isset ($this->valIdDemandeur["petitionnaire"]) AND |
if (isset ($this->valIdDemandeur["petitionnaire"]) AND |
1074 |
function setValIdDemandeur($valIdDemandeur) { |
function setValIdDemandeur($valIdDemandeur) { |
1075 |
$this->valIdDemandeur = $valIdDemandeur; |
$this->valIdDemandeur = $valIdDemandeur; |
1076 |
} |
} |
1077 |
|
|
1078 |
|
//Supression du lien entre la demandeur et le(s) demandeur(s) |
1079 |
|
function triggerSupprimer($id, &$db, $val, $DEBUG){ |
1080 |
|
|
1081 |
|
//Création de la requête |
1082 |
|
$sql = "DELETE FROM |
1083 |
|
".DB_PREFIXE."lien_demande_demandeur |
1084 |
|
WHERE |
1085 |
|
demande = $id"; |
1086 |
|
|
1087 |
|
$res = $this->f->db->query($sql); |
1088 |
|
$this->f->addToLog("triggerSupprimer() : ".$sql); |
1089 |
|
$this->f->isDatabaseError($res); |
1090 |
|
} |
1091 |
|
|
1092 |
// }}} |
// }}} |
1093 |
}// fin classe |
}// fin classe |
1094 |
?> |
?> |