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 |
35 |
$sql=str_replace("<idx>",$this->getParameter("idx_dossier"), |
$sql=str_replace("<idx>",$this->getParameter("idx_dossier"), |
36 |
$sql_infos_dossier); |
$sql_infos_dossier); |
37 |
$res = $this->db->query($sql); |
$res = $this->db->query($sql); |
38 |
$this->addToLog("demande -> getValFromDossier() : ".$sql); |
$this->f->addToLog("getValFromDossier(): db->query(\"".$sql."\")", VERBOSE_MODE); |
39 |
$this->f->isDatabaseError(); |
if ( database::isError($res)){ |
40 |
|
die(); |
41 |
|
} |
42 |
$row = & $res->fetchRow(DB_FETCHMODE_ASSOC); |
$row = & $res->fetchRow(DB_FETCHMODE_ASSOC); |
43 |
return $row; |
return $row; |
44 |
} |
} |
61 |
} |
} |
62 |
} |
} |
63 |
} |
} |
64 |
|
function getDataSubmit() { |
65 |
|
|
66 |
|
$datasubmit = parent::getDataSubmit(); |
67 |
|
if($this->getParameter("idx_dossier") != "") { |
68 |
|
$datasubmit .= "&idx_dossier=".$this->getParameter("idx_dossier"); |
69 |
|
} |
70 |
|
return $datasubmit; |
71 |
|
} |
72 |
|
|
73 |
/** |
/** |
74 |
* Méthode de verification du contenu |
* Méthode de verification du contenu |
78 |
if(!isset($this->postedIdDemandeur["petitionnaire_principal"]) OR |
if(!isset($this->postedIdDemandeur["petitionnaire_principal"]) OR |
79 |
empty($this->postedIdDemandeur["petitionnaire_principal"])) { |
empty($this->postedIdDemandeur["petitionnaire_principal"])) { |
80 |
$this->correct = false; |
$this->correct = false; |
81 |
$this->addToMessage("La saisie d'un petitionnaire principal est obligatoire."); |
$this->addToMessage(_("La saisie d'un petitionnaire principal est obligatoire.")); |
82 |
|
} |
83 |
|
} |
84 |
|
|
85 |
|
/** |
86 |
|
* Configuration des select |
87 |
|
*/ |
88 |
|
function setSelect(&$form, $maj,&$db,$debug) { |
89 |
|
parent::setSelect($form, $maj,$db,$debug); |
90 |
|
|
91 |
|
if(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc.php")) |
92 |
|
include ("../sql/".$db->phptype."/".$this->table.".form.inc.php"); |
93 |
|
elseif(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc")) |
94 |
|
include ("../sql/".$db->phptype."/".$this->table.".form.inc"); |
95 |
|
|
96 |
|
//Récupération de paramètre pour le rechargement ajax du select |
97 |
|
$idx_dossier = $this->getParameter("idx_dossier"); |
98 |
|
$datd = $this->getParameter("datd"); |
99 |
|
|
100 |
|
$contenu = array(); |
101 |
|
|
102 |
|
// Ajout de filtre sur la requête (initial) |
103 |
|
if(isset($idx_dossier) AND $idx_dossier != "") { |
104 |
|
$sql_demande_type .= " WHERE demande_type.demande_nature = 2 "; |
105 |
|
|
106 |
|
// ajout du numéro de dossier existant pour tester l'état du DA |
107 |
|
$sql_demande_type .= "AND dossier.dossier = '".$idx_dossier."' "; |
108 |
|
} else { |
109 |
|
$sql_demande_type .= " WHERE demande_type.demande_nature = 1 "; |
110 |
|
} |
111 |
|
if(isset($_POST["dossier_autorisation_type_detaille"]) AND $_POST["dossier_autorisation_type_detaille"] != "") { |
112 |
|
$datd = $_POST["dossier_autorisation_type_detaille"]; |
113 |
|
} |
114 |
|
// Ajout de filtre sur la requête (dossier_autorisation_type_detaille) |
115 |
|
if(isset($datd) AND $datd != "") { |
116 |
|
$sql_demande_type .= " AND demande_type.dossier_autorisation_type_detaille = ".$datd; |
117 |
|
} else { |
118 |
|
$datd = $this->getVal("dossier_autorisation_type_detaille"); |
119 |
|
if ($datd != "") { |
120 |
|
$sql_demande_type .= " AND demande_type.dossier_autorisation_type_detaille = ".$datd; |
121 |
|
} |
122 |
} |
} |
123 |
|
|
124 |
|
$res = $db->query($sql_demande_type); |
125 |
|
|
126 |
|
// logger |
127 |
|
$this->f->addToLog("setSelect(): db->query(\"".$sql_demande_type."\");", |
128 |
|
VERBOSE_MODE); |
129 |
|
if ( database::isError($res)){ |
130 |
|
die(); |
131 |
|
} |
132 |
|
|
133 |
|
$contenu[0][0] = ''; |
134 |
|
$contenu[1][0] = _('choisir')." "._("demande_type"); |
135 |
|
|
136 |
|
$k=1; |
137 |
|
while($row =& $res->fetchRow()){ |
138 |
|
|
139 |
|
$contenu[0][$k] = $row[0]; |
140 |
|
$contenu[1][$k] = $row[1]; |
141 |
|
$k++; |
142 |
|
} |
143 |
|
|
144 |
|
$form->setSelect("demande_type", $contenu); |
145 |
|
|
146 |
} |
} |
147 |
/* |
/* |
148 |
* Ajout du fielset |
* Ajout du fielset |
188 |
$form->setOnchange("dossier_autorisation_type_detaille","changeDemandeType();"); |
$form->setOnchange("dossier_autorisation_type_detaille","changeDemandeType();"); |
189 |
$form->setOnchange("demande_type","showFormsDemande();"); |
$form->setOnchange("demande_type","showFormsDemande();"); |
190 |
} |
} |
191 |
|
|
192 |
|
function setLib(&$form,$maj) { |
193 |
|
parent::setLib($form,$maj); |
194 |
|
//libelle des champs |
195 |
|
|
196 |
|
$form->setLib('complement',_('terrain_adresse')); |
197 |
|
} |
198 |
/* |
/* |
199 |
* Cache le champ terrain_references_cadastrales |
* Cache le champ terrain_references_cadastrales |
200 |
* Hide the fiels terrain_references_cadastrales |
* Hide the fiels terrain_references_cadastrales |
238 |
function ajoutDossierAutorisation($id, &$db, $val, $DEBUG){ |
function ajoutDossierAutorisation($id, &$db, $val, $DEBUG){ |
239 |
require_once '../obj/dossier_autorisation.class.php'; |
require_once '../obj/dossier_autorisation.class.php'; |
240 |
$dossier_autorisation = new dossier_autorisation("]",$db,$DEBUG); |
$dossier_autorisation = new dossier_autorisation("]",$db,$DEBUG); |
241 |
// Création du dossier |
$id_etat_initial_da = $this->f->getParameter('etat_initial_dossier_autorisation'); |
242 |
foreach($dossier_autorisation->champs as $value) { |
$error = false; |
243 |
$valAuto[$value] = NULL; |
|
244 |
} |
// Vérification de l'existance d'un état initial des DA dans la table om_parametre |
245 |
$valAuto['dossier_autorisation']=NULL; |
// afin d'éviter d'eventuelle erreur de base de données |
246 |
$valAuto['exercice']=NULL; |
if(isset($id_etat_initial_da)) { |
247 |
$valAuto['insee']=NULL; |
$sql = "SELECT count(*) FROM ".DB_PREFIXE."etat_dossier_autorisation |
248 |
$valAuto['arrondissement']=NULL; |
WHERE etat_dossier_autorisation = ".$id_etat_initial_da; |
249 |
$valAuto['etat']=1; |
$count = $this->db->getOne($sql); |
250 |
$valAuto['erp_numero_batiment']=NULL; |
$this->f->addToLog("ajoutDossierAutorisation() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
251 |
$valAuto['erp_ouvert']=NULL; |
if ( database::isError($count)){ |
252 |
$valAuto['erp_arrete_decision']=NULL; |
die(); |
253 |
$valAuto['dossier_autorisation_type_detaille']=$this->valF['dossier_autorisation_type_detaille']; |
} |
254 |
$valAuto['depot_initial']=$this->valF['date_demande']; |
if($count != 1) { |
255 |
$valAuto['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
$error = true; |
256 |
$valAuto['terrain_adresse_voie_numero']=$this->valF['terrain_adresse_voie_numero']; |
} else { |
257 |
$valAuto['complement']=$this->valF['complement']; |
// La méthode ajouter prend en paramètre un tableau associatif |
258 |
$valAuto['terrain_adresse_lieu_dit']=$this->valF['terrain_adresse_lieu_dit']; |
// contenant toutes les champs de la classe instanciée, |
259 |
$valAuto['terrain_adresse_localite']=$this->valF['terrain_adresse_localite']; |
// d'où l'initialisation du tableau en bouclant sur la liste des champs du DA |
260 |
$valAuto['terrain_adresse_code_postal']=$this->valF['terrain_adresse_code_postal']; |
foreach($dossier_autorisation->champs as $value) { |
261 |
$valAuto['terrain_adresse_bp']=$this->valF['terrain_adresse_bp']; |
$valAuto[$value] = NULL; |
262 |
$valAuto['terrain_adresse_cedex']=$this->valF['terrain_adresse_cedex']; |
} |
263 |
$valAuto['terrain_superficie']=$this->valF['terrain_superficie']; |
// Définition des valeurs à insérer |
264 |
$valAuto['numero_version']=-1; |
$valAuto['dossier_autorisation']=""; |
265 |
// Ajout du dossier dans la base |
$valAuto['exercice']=NULL; |
266 |
$dossier_autorisation->ajouter($valAuto, $db, $DEBUG); |
$valAuto['insee']=NULL; |
267 |
// Liaison du dossier ajouter à la demande |
$valAuto['arrondissement']=NULL; |
268 |
$this->valF['dossier_autorisation'] = $dossier_autorisation->valF['dossier_autorisation']; |
$valAuto['etat_dossier_autorisation']=$this->f->getParameter('etat_initial_dossier_autorisation'); |
269 |
|
$valAuto['erp_numero_batiment']=NULL; |
270 |
|
$valAuto['erp_ouvert']=NULL; |
271 |
|
$valAuto['erp_arrete_decision']=NULL; |
272 |
|
$valAuto['dossier_autorisation_type_detaille']=$this->valF['dossier_autorisation_type_detaille']; |
273 |
|
$valAuto['depot_initial']=$this->dateDBToForm($this->valF['date_demande']); |
274 |
|
$valAuto['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
275 |
|
$valAuto['terrain_adresse_voie_numero']=$this->valF['terrain_adresse_voie_numero']; |
276 |
|
$valAuto['complement']=$this->valF['complement']; |
277 |
|
$valAuto['terrain_adresse_lieu_dit']=$this->valF['terrain_adresse_lieu_dit']; |
278 |
|
$valAuto['terrain_adresse_localite']=$this->valF['terrain_adresse_localite']; |
279 |
|
$valAuto['terrain_adresse_code_postal']=$this->valF['terrain_adresse_code_postal']; |
280 |
|
$valAuto['terrain_adresse_bp']=$this->valF['terrain_adresse_bp']; |
281 |
|
$valAuto['terrain_adresse_cedex']=$this->valF['terrain_adresse_cedex']; |
282 |
|
$valAuto['terrain_superficie']=$this->valF['terrain_superficie']; |
283 |
|
$valAuto['numero_version']=-1; |
284 |
|
// Ajout du dossier dans la base |
285 |
|
$dossier_autorisation->ajouter($valAuto, $db, $DEBUG); |
286 |
|
// Liaison du dossier ajouter à la demande |
287 |
|
$this->valF['dossier_autorisation'] = $dossier_autorisation->valF['dossier_autorisation']; |
288 |
|
} |
289 |
|
} else { |
290 |
|
$error = true; |
291 |
|
} |
292 |
|
// Affichage de l'erreur et stop de l'affichage |
293 |
|
if( $error ) { |
294 |
|
echo "</div>"; |
295 |
|
$class = "error"; |
296 |
|
$message = _("Erreur de parametrage. Contactez votre administrateur."); |
297 |
|
$this->f->displayMessage($class, $message); |
298 |
|
die(); |
299 |
|
} |
300 |
|
|
301 |
} |
} |
302 |
|
|
303 |
function getCodeDemandeType($demande_type){ |
function getCodeDemandeType($demande_type){ |
335 |
// Définition des valeurs à entrée dans la table |
// Définition des valeurs à entrée dans la table |
336 |
$valInstr['dossier_instruction_type']=$dossier_instruction_type; |
$valInstr['dossier_instruction_type']=$dossier_instruction_type; |
337 |
$valInstr['date_depot']=$this->dateDBToForm($this->valF['date_demande']); |
$valInstr['date_depot']=$this->dateDBToForm($this->valF['date_demande']); |
338 |
|
$valInstr['date_dernier_depot']=$this->dateDBToForm($this->valF['date_demande']); |
339 |
$valInstr['date_demande']=$this->dateDBToForm($this->valF['date_demande']); |
$valInstr['date_demande']=$this->dateDBToForm($this->valF['date_demande']); |
340 |
$valInstr['depot_initial']=$this->dateDBToForm($this->valF['date_demande']); |
$valInstr['depot_initial']=$this->dateDBToForm($this->valF['date_demande']); |
341 |
$valInstr['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
$valInstr['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
362 |
strcasecmp($codeDemandeType, "DM") == 0 || |
strcasecmp($codeDemandeType, "DM") == 0 || |
363 |
strcasecmp($codeDemandeType, "DP") == 0 || |
strcasecmp($codeDemandeType, "DP") == 0 || |
364 |
strcasecmp($codeDemandeType, "DTP") == 0 || |
strcasecmp($codeDemandeType, "DTP") == 0 || |
365 |
strcasecmp($codeDemandeType, "DACT") == 0 || |
strcasecmp($codeDemandeType, "DAACT") == 0 || |
366 |
strcasecmp($codeDemandeType, "DOC") == 0 ){ |
strcasecmp($codeDemandeType, "DOC") == 0 ){ |
367 |
|
|
368 |
$valInstr['a_qualifier'] = TRUE; |
$valInstr['a_qualifier'] = TRUE; |
382 |
AND now()>=om_validite_debut |
AND now()>=om_validite_debut |
383 |
AND dossier_instruction_type=".$dossier_instruction_type; |
AND dossier_instruction_type=".$dossier_instruction_type; |
384 |
$valInstr['cerfa'] = $db->getOne($sql); |
$valInstr['cerfa'] = $db->getOne($sql); |
385 |
$this->addToLog("db->getone(\"".$sql."\");", VERBOSE_MODE); |
$this->f->addToLog("ajoutDossierInstruction() : db->getone(\"".$sql."\");", VERBOSE_MODE); |
386 |
|
if ( database::isError($valInstr['cerfa'])){ |
387 |
|
die(); |
388 |
|
} |
389 |
$dossier->ajouter($valInstr, $db, $DEBUG); |
$dossier->ajouter($valInstr, $db, $DEBUG); |
|
$this->f->isDatabaseError(); |
|
390 |
// Liaison du dossier ajouter à la demande |
// Liaison du dossier ajouter à la demande |
391 |
$this->valF['dossier_instruction'] = $dossier->valF['dossier']; |
$this->valF['dossier_instruction'] = $dossier->valF['dossier']; |
392 |
} |
} |
393 |
|
|
394 |
/** |
/** |
395 |
|
* Méthode permettant d'ajouter les données techniques au dossier d'instruction |
396 |
|
*/ |
397 |
|
function ajoutDonneesTechniques($id, &$db, $val, $DEBUG){ |
398 |
|
|
399 |
|
require_once '../obj/donnees_techniques.class.php'; |
400 |
|
$donnees_techniques = new donnees_techniques("]",$db,$DEBUG); |
401 |
|
|
402 |
|
// Champs tous à NULL car seul le champ concernant le dossier d'instruction sera rempli |
403 |
|
foreach($donnees_techniques->champs as $value) { |
404 |
|
$val[$value] = NULL; |
405 |
|
} |
406 |
|
|
407 |
|
// Ajout du numéro de dossier d'instruction |
408 |
|
$val['dossier_instruction']=$this->valF['dossier_instruction']; |
409 |
|
|
410 |
|
// Ajout des données techniques |
411 |
|
$donnees_techniques->ajouter($val, $db, $DEBUG); |
412 |
|
} |
413 |
|
|
414 |
|
/** |
415 |
* Ajout des liens demandeurs / dossier d'autorisation |
* Ajout des liens demandeurs / dossier d'autorisation |
416 |
**/ |
**/ |
417 |
function ajoutLiensDossierAutorisation($id, &$db, $val, $DEBUG) { |
function ajoutLiensDossierAutorisation($id, &$db, $val, $DEBUG) { |
422 |
// Recupération des demandeurs liés à la demande |
// Recupération des demandeurs liés à la demande |
423 |
$sql = str_replace("<demande>",$this->valF['demande'],$sql_lien_demande_demandeur); |
$sql = str_replace("<demande>",$this->valF['demande'],$sql_lien_demande_demandeur); |
424 |
$res = $db->query($sql); |
$res = $db->query($sql); |
425 |
$this->f->addToLog("demande.class.php: db->query(\"".$sql."\");", VERBOSE_MODE); |
$this->f->addToLog("ajoutLiensDossierAutorisation() : db->query(\"".$sql."\");", VERBOSE_MODE); |
426 |
$this->f->isDatabaseError(); |
if ( database::isError($res)){ |
427 |
|
die(); |
428 |
|
} |
429 |
while($row = &$res->fetchRow(DB_FETCHMODE_ASSOC)) { |
while($row = &$res->fetchRow(DB_FETCHMODE_ASSOC)) { |
430 |
$row['lien_dossier_autorisation_demandeur'] = NULL; |
$row['lien_dossier_autorisation_demandeur'] = NULL; |
431 |
$row['dossier_autorisation'] = $this->valF['dossier_autorisation']; |
$row['dossier_autorisation'] = $this->valF['dossier_autorisation']; |
444 |
// Recupération des demandeurs liés à la demande |
// Recupération des demandeurs liés à la demande |
445 |
$sql = str_replace("<demande>",$this->valF['demande'],$sql_lien_demande_demandeur); |
$sql = str_replace("<demande>",$this->valF['demande'],$sql_lien_demande_demandeur); |
446 |
$res = $db->query($sql); |
$res = $db->query($sql); |
447 |
$this->f->addToLog("demande.class.php: db->query(\"".$sql."\");", VERBOSE_MODE); |
$this->f->addToLog("ajoutLiensDossierInstruction() : db->query(\"".$sql."\");", VERBOSE_MODE); |
448 |
$this->f->isDatabaseError(); |
if ( database::isError($res)){ |
449 |
|
die(); |
450 |
|
} |
451 |
while($row = &$res->fetchRow(DB_FETCHMODE_ASSOC)) { |
while($row = &$res->fetchRow(DB_FETCHMODE_ASSOC)) { |
452 |
$row['lien_dossier_demandeur'] = NULL; |
$row['lien_dossier_demandeur'] = NULL; |
453 |
$row['dossier'] = $this->valF['dossier_instruction']; |
$row['dossier'] = $this->valF['dossier_instruction']; |
471 |
$this->addToLog("demande.class.php : ".$sql." execute <br>", EXTRA_VERBOSE_MODE); |
$this->addToLog("demande.class.php : ".$sql." execute <br>", EXTRA_VERBOSE_MODE); |
472 |
|
|
473 |
$res = $this->db->query($sql); |
$res = $this->db->query($sql); |
474 |
$this->f->isDatabaseError($res); |
$this->f->addToLog("getArrondissement() : db->query(\"".$sql."\")", VERBOSE_MODE); |
475 |
|
if ( database::isError($res)){ |
476 |
|
die(); |
477 |
|
} |
478 |
|
|
479 |
if( $res->numrows() > 0 ) { |
if( $res->numrows() > 0 ) { |
480 |
|
|
501 |
demande_type = $demande_type"; |
demande_type = $demande_type"; |
502 |
|
|
503 |
$res = $this->db->query($sql); |
$res = $this->db->query($sql); |
504 |
$this->f->isDatabaseError($res); |
$this->f->addToLog("getEvenement() : db->query(\"".$sql."\")", VERBOSE_MODE); |
505 |
|
if ( database::isError($res)){ |
506 |
|
die(); |
507 |
|
} |
508 |
|
|
509 |
if ( $res->numrows() > 0 ){ |
if ( $res->numrows() > 0 ){ |
510 |
|
|
531 |
evenement = $evenement"; |
evenement = $evenement"; |
532 |
|
|
533 |
$res = $this->db->query($sql); |
$res = $this->db->query($sql); |
534 |
$this->f->isDatabaseError($res); |
$this->f->addToLog("getLettreType() : db->query(\"".$sql."\")", VERBOSE_MODE); |
535 |
|
if ( database::isError($res)){ |
536 |
|
die(); |
537 |
|
} |
538 |
|
|
539 |
if ( $res->numrows() > 0 ){ |
if ( $res->numrows() > 0 ){ |
540 |
|
|
552 |
include '../sql/pgsql/demande.form.inc.php'; |
include '../sql/pgsql/demande.form.inc.php'; |
553 |
if($this->valF["demande_type"] != NULL) { |
if($this->valF["demande_type"] != NULL) { |
554 |
$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)); |
555 |
$this->f->isDatabaseError(); |
$this->f->addToLog("triggerAjouter() : db->query(\"".str_replace('<idx>', $this->valF['demande_type'], $sql_demande_type_details_by_id)."\")", VERBOSE_MODE); |
556 |
|
if ( database::isError($res)){ |
557 |
|
die(); |
558 |
|
} |
559 |
$dossier_type = $res->fetchRow(DB_FETCHMODE_ASSOC); |
$dossier_type = $res->fetchRow(DB_FETCHMODE_ASSOC); |
560 |
// Création du dossier_autorisation |
// Création du dossier_autorisation |
561 |
if($this->valF['dossier_autorisation'] == "") { |
if($this->valF['dossier_autorisation'] == "") { |
566 |
if($dossier_type['dossier_instruction_type'] != NULL) { |
if($dossier_type['dossier_instruction_type'] != NULL) { |
567 |
$this->ajoutDossierInstruction($id, $db, $val, $DEBUG, $dossier_type['dossier_instruction_type']); |
$this->ajoutDossierInstruction($id, $db, $val, $DEBUG, $dossier_type['dossier_instruction_type']); |
568 |
$this -> addToMessage(_("Creation du dossier d'instruction no").$this->valF['dossier_instruction']); |
$this -> addToMessage(_("Creation du dossier d'instruction no").$this->valF['dossier_instruction']); |
569 |
|
|
570 |
|
//Ajout des données techniques au dossier d'instruction |
571 |
|
$this->ajoutDonneesTechniques($id, $db, $val, $DEBUG); |
572 |
} |
} |
573 |
|
|
574 |
/*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*/ |
601 |
$valInstr['delai_notification']="1"; |
$valInstr['delai_notification']="1"; |
602 |
$valInstr['archive_delai']="0"; |
$valInstr['archive_delai']="0"; |
603 |
$valInstr['archive_date_complet']=NULL; |
$valInstr['archive_date_complet']=NULL; |
604 |
|
$valInstr['archive_date_dernier_depot']=NULL; |
605 |
$valInstr['archive_date_rejet']=NULL; |
$valInstr['archive_date_rejet']=NULL; |
606 |
$valInstr['archive_date_limite']=NULL; |
$valInstr['archive_date_limite']=NULL; |
607 |
$valInstr['archive_date_notification_delai']=NULL; |
$valInstr['archive_date_notification_delai']=NULL; |
613 |
$valInstr['archive_date_achevement']=NULL; |
$valInstr['archive_date_achevement']=NULL; |
614 |
$valInstr['archive_date_chantier']=NULL; |
$valInstr['archive_date_chantier']=NULL; |
615 |
$valInstr['archive_date_conformite']=NULL; |
$valInstr['archive_date_conformite']=NULL; |
616 |
|
$valInstr['archive_incompletude']=NULL; |
617 |
|
$valInstr['archive_evenement_suivant_tacite']=""; |
618 |
|
$valInstr['archive_evenement_suivant_tacite_incompletude']=NULL; |
619 |
|
$valInstr['archive_etat_pendant_incompletude']=NULL; |
620 |
|
$valInstr['archive_date_limite_incompletude']=NULL; |
621 |
|
$valInstr['archive_delai_incompletude']=NULL; |
622 |
$valInstr['complement3']=""; |
$valInstr['complement3']=""; |
623 |
$valInstr['complement4']=""; |
$valInstr['complement4']=""; |
624 |
$valInstr['complement5']=""; |
$valInstr['complement5']=""; |
641 |
$valInstr['date_envoi_controle_legalite']=NULL; |
$valInstr['date_envoi_controle_legalite']=NULL; |
642 |
$valInstr['date_retour_controle_legalite']=NULL; |
$valInstr['date_retour_controle_legalite']=NULL; |
643 |
$valInstr['signataire_arrete']=NULL; |
$valInstr['signataire_arrete']=NULL; |
644 |
|
$valInstr['numero_arrete']=NULL; |
645 |
|
|
646 |
/*Fichier requis*/ |
/*Fichier requis*/ |
647 |
require_once '../obj/instruction.class.php'; |
require_once '../obj/instruction.class.php'; |
658 |
$this->valF['instruction_recepisse'] = $instruction->valF['instruction']; |
$this->valF['instruction_recepisse'] = $instruction->valF['instruction']; |
659 |
$this -> addToMessage("<br/><a |
$this -> addToMessage("<br/><a |
660 |
class='lien' |
class='lien' |
661 |
href='../pdf/pdflettretype.php?obj=".$lettretype."&idx=".$this->valF['dossier_instruction']."' |
href='../pdf/pdflettretype.php?obj=".$lettretype."&idx=".$instruction->valF['instruction']."' |
662 |
target='_blank'> |
target='_blank'> |
663 |
<span |
<span |
664 |
class=\"om-icon om-icon-16 om-icon-fix pdf-16\" |
class=\"om-icon om-icon-16 om-icon-fix pdf-16\" |
747 |
$sqlDemandeurs = "SELECT * FROM ".DB_PREFIXE."lien_lot_demandeur |
$sqlDemandeurs = "SELECT * FROM ".DB_PREFIXE."lien_lot_demandeur |
748 |
WHERE lot = ".$rowLot['lot']; |
WHERE lot = ".$rowLot['lot']; |
749 |
$res = $db -> query($sqlDemandeurs); |
$res = $db -> query($sqlDemandeurs); |
750 |
$this->f->addToLog("db->query(\"".$sqlDemandeurs."\");", VERBOSE_MODE); |
$this->f->addToLog("lienLotDossierInstruction() : db->query(\"".$sqlDemandeurs."\");", VERBOSE_MODE); |
751 |
$this->f->isDatabaseError($res); |
if ( database::isError($res)){ |
752 |
|
die(); |
753 |
|
} |
754 |
|
|
755 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
756 |
$valLld["lien_lot_demandeur"] = ""; |
$valLld["lien_lot_demandeur"] = ""; |
839 |
// Execution de la requete de suppression de l'objet |
// Execution de la requete de suppression de l'objet |
840 |
$res = $db->query($sql); |
$res = $db->query($sql); |
841 |
// Logger |
// Logger |
842 |
$this->f->addToLog("supprimer(): db->query(\"".$sql."\");", VERBOSE_MODE); |
$this->f->addToLog("deleteLinkDemandeDemandeur(): db->query(\"".$sql."\");", VERBOSE_MODE); |
843 |
$this->f->isDatabaseError(); |
if ( database::isError($res)){ |
844 |
|
die(); |
845 |
|
} |
846 |
|
|
847 |
} |
} |
848 |
|
|
855 |
WHERE demande = ".$this->valF['demande']. |
WHERE demande = ".$this->valF['demande']. |
856 |
"AND demandeur = ".$idDemandeur; |
"AND demandeur = ".$idDemandeur; |
857 |
$count = $this->f->db->getOne($sql); |
$count = $this->f->db->getOne($sql); |
858 |
$this->f->addToLog("db->getone(\"".$sql."\");", VERBOSE_MODE); |
$this->f->addToLog("isLinkDemandeDemandeurExist() : db->getone(\"".$sql."\");", VERBOSE_MODE); |
859 |
$this->f->isDatabaseError($count); |
if ( database::isError($count)){ |
860 |
|
die(); |
861 |
|
} |
862 |
if ($count === 0) { |
if ($count === 0) { |
863 |
return false; |
return false; |
864 |
} else { |
} else { |
889 |
} |
} |
890 |
} |
} |
891 |
} |
} |
892 |
|
|
893 |
/** |
/** |
894 |
* Méthode permettant de récupérer les id des demandeur liés à la demande ou |
* Méthode permettant de récupérer les id des demandeurs liés à la table |
895 |
* liés au dossier d'autorisation |
* liée passée en paramètre |
896 |
**/ |
* |
897 |
|
* @param string $from Table liée : "demande", "dossier", dossier_autorisation" |
898 |
|
* @param string $id Identifiant (clé primaire de la table liée en question) |
899 |
|
*/ |
900 |
function listeDemandeur($from, $id) { |
function listeDemandeur($from, $id) { |
901 |
// Récupération des demandeurs de la base |
// Récupération des demandeurs de la base |
902 |
$sql = "SELECT demandeur.demandeur, |
$sql = "SELECT demandeur.demandeur, |
907 |
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
908 |
WHERE ".$from." = '".$id."'"; |
WHERE ".$from." = '".$id."'"; |
909 |
$res = $this->f->db->query($sql); |
$res = $this->f->db->query($sql); |
910 |
$this->f->addToLog("listeDemandeur() : ".$sql); |
$this->f->addToLog("listeDemandeur(): db->query(\"".$sql."\")", VERBOSE_MODE); |
911 |
$this->f->isDatabaseError($res); |
if ( database::isError($res)){ |
912 |
// Stoquage du résultat dans un tableau |
die(); |
913 |
|
} |
914 |
|
// Stockage du résultat dans un tableau |
915 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
916 |
if ($row['petitionnaire_principal'] == 't' AND |
if ($row['petitionnaire_principal'] == 't' AND |
917 |
$row['type_demandeur']=="petitionnaire") { |
$row['type_demandeur']=="petitionnaire") { |
969 |
|
|
970 |
|
|
971 |
/** |
/** |
972 |
* Ajout de la liste des demandeurs |
* Cette méthode permet d'afficher des informations spécifiques dans le |
973 |
|
* formulaire de l'objet |
974 |
|
* |
975 |
|
* @param integer $maj Mode de mise à jour |
976 |
*/ |
*/ |
977 |
function formSpecificContent($maj) { |
function formSpecificContent($maj) { |
978 |
if(!$this->correct AND $maj != 0) { |
|
979 |
|
/** |
980 |
|
* Gestion du bloc des demandeurs |
981 |
|
*/ |
982 |
|
// Si le mode est (modification ou suppression ou consultation) ET que |
983 |
|
// le formulaire n'est pas correct (c'est-à-dire que le formulaire est |
984 |
|
// actif) |
985 |
|
if (!$this->correct AND $maj != 0) { |
986 |
|
// Alors on récupère les demandeurs dans la table lien pour |
987 |
|
// affectation des résultats dans this->valIdDemandeur |
988 |
$this->listeDemandeur("demande", $this->val[array_search('demande', $this->champs)]); |
$this->listeDemandeur("demande", $this->val[array_search('demande', $this->champs)]); |
989 |
} |
} |
990 |
// Si le paramètre idx_dossier est défini on récupère les demandeurs liés au dossier d'instruction |
|
991 |
if($this->getParameter("idx_dossier") != "") { |
// Si le mode est (ajout ou modification) ET que le formulaire n'est pas |
992 |
$this->listeDemandeur("dossier", $this->getParameter("idx_dossier")); |
// correct (c'est-à-dire que le formulaire est actif) |
993 |
} |
if ($maj < 2 AND !$this->correct) { |
994 |
if($maj < 2 AND !$this->correct) { |
// Alors on positionne le marqueur linkable a true qui permet |
995 |
|
// d'afficher ou non les actions de gestion des demandeurs |
996 |
$linkable = true; |
$linkable = true; |
997 |
} else { |
} else { |
998 |
|
// Sinon on positionne le marqueur linkable a false qui permet |
999 |
|
// d'afficher ou non les actions de gestion des demandeurs |
1000 |
$linkable = false; |
$linkable = false; |
1001 |
} |
} |
1002 |
|
|
1003 |
|
// Affichage des demandeurs et des actions |
1004 |
// Conteneur de la listes des demandeurs |
// Conteneur de la listes des demandeurs |
1005 |
echo "<div id=\"liste_demandeur\" class=\"demande_hidden_bloc col_12\">"; |
echo "<div id=\"liste_demandeur\" class=\"demande_hidden_bloc col_12\">"; |
1006 |
echo "<fieldset class=\"cadre ui-corner-all ui-widget-content\">"; |
echo "<fieldset class=\"cadre ui-corner-all ui-widget-content\">"; |
1011 |
require_once "../obj/delegataire.class.php"; |
require_once "../obj/delegataire.class.php"; |
1012 |
// Affichage du bloc pétitionnaire principal / délégataire |
// Affichage du bloc pétitionnaire principal / délégataire |
1013 |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
1014 |
echo "<div id=\"petitionnaire_principal_delegataire col_12\">"; |
echo "<div id=\"petitionnaire_principal_delegataire\">"; |
1015 |
// Affichage de la synthèse |
// Affichage de la synthèse |
1016 |
if (isset ($this->valIdDemandeur["petitionnaire_principal"]) AND |
if (isset ($this->valIdDemandeur["petitionnaire_principal"]) AND |
1017 |
!empty($this->valIdDemandeur["petitionnaire_principal"])) { |
!empty($this->valIdDemandeur["petitionnaire_principal"])) { |
1066 |
echo "</div>"; |
echo "</div>"; |
1067 |
// Bloc des pétitionnaires secondaires |
// Bloc des pétitionnaires secondaires |
1068 |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
// L'ID DU DIV SUIVANT EST NECESSAIRE AU BON FONCTIONNEMENT DU JS |
1069 |
echo "<div id=\"listePetitionnaires col_12\">"; |
echo "<div id=\"listePetitionnaires\">"; |
1070 |
|
|
1071 |
// Affichage de la synthèse |
// Affichage de la synthèse |
1072 |
if (isset ($this->valIdDemandeur["petitionnaire"]) AND |
if (isset ($this->valIdDemandeur["petitionnaire"]) AND |
1121 |
demande = $id"; |
demande = $id"; |
1122 |
|
|
1123 |
$res = $this->f->db->query($sql); |
$res = $this->f->db->query($sql); |
1124 |
$this->f->addToLog("triggerSupprimer() : ".$sql); |
$this->f->addToLog("triggerSupprimer() : db->query(\"".$sql."\")"); |
1125 |
$this->f->isDatabaseError($res); |
if ( database::isError($res)){ |
1126 |
|
die(); |
1127 |
|
} |
1128 |
} |
} |
1129 |
|
|
1130 |
// }}} |
// }}} |