59 |
&& isset($this->f->om_utilisateur["division"]) |
&& isset($this->f->om_utilisateur["division"]) |
60 |
&& $this->f->om_utilisateur["division"] != $this->getDivisionFromDossier()) { |
&& $this->f->om_utilisateur["division"] != $this->getDivisionFromDossier()) { |
61 |
// |
// |
62 |
$this->actions_sup = array(); |
$this->parameters["actions"]["modifier"] = NULL; |
63 |
$this->setParameter("actions", array()); |
|
64 |
|
//Cache le lien du rapport d'instruction, si aucun n'est lié |
65 |
|
if ( $this->getRapportInstruction() == '' ){ |
66 |
|
|
67 |
|
$this->actions_sup['rapport_instruction'] = NULL; |
68 |
|
} |
69 |
|
|
70 |
|
//Cache le lien des données techniques, si aucun n'est lié |
71 |
|
if ( $this->getDonneesTechniques() == '' ){ |
72 |
|
|
73 |
|
$this->actions_sup['donnees_techniques'] = NULL; |
74 |
|
} |
75 |
|
} |
76 |
|
|
77 |
|
//Si l'utilisateur est un instructeur et le dossier d'instruction est clôturé, |
78 |
|
//il n'est plus possible de le modifier, on affiche pas le lien de modification du |
79 |
|
//portlet |
80 |
|
if ( $this->f->isUserInstructeur() && $this->getStatut() == "cloture" ){ |
81 |
|
|
82 |
|
$this->parameters["actions"]["modifier"] = NULL; |
83 |
|
|
84 |
|
//Cache le lien du rapport d'instruction, si aucun n'est lié |
85 |
|
if ( $this->getRapportInstruction() == '' ){ |
86 |
|
|
87 |
|
$this->actions_sup['rapport_instruction'] = NULL; |
88 |
|
} |
89 |
|
|
90 |
|
//Cache le lien des données techniques, si aucun n'est lié |
91 |
|
if ( $this->getDonneesTechniques() == '' ){ |
92 |
|
|
93 |
|
$this->actions_sup['donnees_techniques'] = NULL; |
94 |
|
} |
95 |
} |
} |
96 |
} |
} |
97 |
|
|
108 |
// |
// |
109 |
return false; |
return false; |
110 |
} |
} |
111 |
|
// Si l'utilisateur est un instructeur et que le dossier est cloturé |
112 |
|
if ( $this->f->isUserInstructeur() && $this->getStatut() == "cloture" |
113 |
|
&& $this->getParameter("maj") != 3) { |
114 |
|
|
115 |
|
return false; |
116 |
|
} |
117 |
// |
// |
118 |
return true; |
return true; |
119 |
} |
} |
120 |
|
|
121 |
/** |
/** |
122 |
* Cette méthode permet de récupérer la division d'un dossier |
* Cette variable permet de stocker le résultat de la méthode |
123 |
|
* getDivisionFromDossier() afin de ne pas effectuer le recalcul à chacun de |
124 |
|
* ces appels. |
125 |
|
* @var string Code de la division du dossier en cours |
126 |
|
*/ |
127 |
|
var $_division_from_dossier = NULL; |
128 |
|
|
129 |
|
/** |
130 |
|
* Cette méthode permet de récupérer le code de division correspondant |
131 |
|
* au dossier sur lequel on se trouve. |
132 |
|
* |
133 |
|
* @return string Code de la division du dossier en cours |
134 |
*/ |
*/ |
135 |
function getDivisionFromDossier() { |
function getDivisionFromDossier() { |
136 |
// |
|
137 |
if (!isset($this->val[array_search("dossier", $this->champs)])) { |
// Cette méthode peut être appelée plusieurs fois lors d'une requête. |
138 |
return NULL; |
// Pour éviter de refaire le traitement de recherche de la division |
139 |
|
// alors on vérifie si nous ne l'avons pas déjà calculé. |
140 |
|
if ($this->_division_from_dossier != NULL) { |
141 |
|
// Logger |
142 |
|
$this->addToLog("getDivisionFromDossier(): retour de la valeur déjà calculée - '".$this->_division_from_dossier."'", EXTRA_VERBOSE_MODE); |
143 |
|
// On retourne la valeur déjà calculée |
144 |
|
return $this->_division_from_dossier; |
145 |
|
} |
146 |
|
|
147 |
|
// Par défaut, on définit la valeur du dossier à NULL |
148 |
|
$dossier = NULL; |
149 |
|
// Test sur le mode et le contexte du formulaire |
150 |
|
if ($this->getParameter("maj") == 0 |
151 |
|
&& ($this->getParameter("retourformulaire") == "dossier" |
152 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction" |
153 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction_mes_encours" |
154 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction_tous_encours" |
155 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction_mes_clotures" |
156 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction_tous_clotures")) { |
157 |
|
// Si on se trouve en mode AJOUT (seul mode où l'enregistrement |
158 |
|
// n'existe pas en base de données) ET que nous nous trouvons |
159 |
|
// dans le contexte d'un dossier d'instruction alors on récupère |
160 |
|
// le numéro de dossier depuis le paramètre 'idxformulaire' |
161 |
|
$dossier = $this->getParameter("idxformulaire"); |
162 |
|
} else { |
163 |
|
// Sinon on récupère le numéro de dossier dans le champs dossier de |
164 |
|
// l'enregistrement (en base de données) |
165 |
|
$dossier = $this->getVal("dossier"); |
166 |
} |
} |
167 |
// |
|
168 |
$sql = "select division from ".DB_PREFIXE."dossier "; |
// On appelle la méthode de la classe utils qui renvoi le code de la |
169 |
$sql .= " where dossier='".$this->val[array_search("dossier", $this->champs)]."'"; |
// division d'un dossier, on la stocke pour ne pas refaire le calcul au |
170 |
// |
// prochain appel de cette méthode |
171 |
$division = $this->db->getOne($sql); |
$this->_division_from_dossier = $this->f->getDivisionFromDossier($dossier); |
172 |
$this->addToLog("getDivisionFromDossier(): db->getone(\"".$sql."\")", VERBOSE_MODE); |
// Logger |
173 |
database::isError($division); |
$this->addToLog("getDivisionFromDossier(): retour de la valeur nouvellement calculée - '".$this->_division_from_dossier."'", EXTRA_VERBOSE_MODE); |
174 |
// |
// On retourne la valeur retournée |
175 |
return $division; |
return $this->_division_from_dossier; |
176 |
|
|
177 |
} |
} |
178 |
|
|
179 |
// }}} |
// }}} |
183 |
*/ |
*/ |
184 |
function setValFAjout($val = array()) { |
function setValFAjout($val = array()) { |
185 |
|
|
186 |
/*Récupération de la lettre associé au type de dossier d'instruction*/ |
//Récupération de la lettre associé au type de dossier d'instruction |
187 |
$code = $this->getCode($this->getDossierInstructionType()); |
$code = $this->getCode($this->getDossierInstructionType()); |
188 |
|
|
189 |
/* Récupération de la valeur du suffixe ce dossier_instruction_type */ |
//Récupération de la valeur du suffixe ce dossier_instruction_type |
190 |
$suffixe = $this->getSuffixe($this->getDossierInstructionType()); |
$suffixe = $this->getSuffixe($this->getDossierInstructionType()); |
191 |
|
|
192 |
/*S'il est à TRUE, on récupère le numéro de version du dossier d'autorisation*/ |
//S'il est à TRUE, on récupère le numéro de version du dossier d'autorisation |
193 |
$numeroVersion = ""; |
$numeroVersion = ""; |
194 |
|
$numeroVersionDIT = ""; |
195 |
if ( $suffixe == 't' ){ |
if ( $suffixe == 't' ){ |
196 |
|
|
197 |
|
//Récupération du numéro de version |
198 |
$numeroVersion = $this->getNumeroVersion($val['dossier_autorisation']); |
$numeroVersion = $this->getNumeroVersion($val['dossier_autorisation']); |
199 |
|
|
200 |
/* Incrémentation du numéro de version */ |
//Incrémentation du numéro de version |
201 |
if ( is_numeric($numeroVersion) or $numeroVersion == -1 ){ |
if ( is_numeric($numeroVersion) or $numeroVersion == -1 ){ |
202 |
|
|
203 |
$this->incrementNumeroVersion($val['dossier_autorisation'], ++$numeroVersion); |
$this->incrementNumeroVersion($val['dossier_autorisation'], ++$numeroVersion); |
204 |
} |
} |
205 |
|
//Récupération du numéro de version en fonction du type de dossier d'instruction |
206 |
|
//Si c'est un modificatif ou un transfert, on utilise un numéro du type |
207 |
|
// 01 ou 02, etc. sinon on utilise le numéro de version comme auparavant |
208 |
|
$numeroVersionDossierInstructionType = $this->getNumeroVersionDossierInstructionType($val['dossier_autorisation'], $val['dossier_instruction_type'], $numeroVersion); |
209 |
} |
} |
210 |
|
|
211 |
/*Création du numéro de dossier*/ |
//Création du numéro de dossier |
212 |
$this->valF['dossier'] = $val['dossier_autorisation']."$code$numeroVersion"; |
$this->valF['dossier'] = $val['dossier_autorisation'].$code.$numeroVersionDossierInstructionType; |
213 |
|
$this->valF['version'] = $numeroVersion; |
214 |
|
|
215 |
|
// Identifiant du dossier d'instruction lisible |
216 |
|
// Ex : DP 013055 13 00002P0 |
217 |
|
$this->valF['dossier_libelle'] = $this->get_dossier_autorisation_libelle($val['dossier_autorisation']).$code.$numeroVersionDossierInstructionType; |
218 |
} |
} |
219 |
|
|
220 |
/*Récupère la valeur du suffixe d'un dossier_instruction_type*/ |
/*Récupère la valeur du suffixe d'un dossier_instruction_type*/ |
313 |
die($res->getMessage()."erreur ".$sql); |
die($res->getMessage()."erreur ".$sql); |
314 |
|
|
315 |
} |
} |
316 |
|
|
317 |
|
/** |
318 |
|
* Retourne un numéro de version en fonction du type de dossier d'instruction |
319 |
|
* @param string $dossier_autorisation |
320 |
|
* @param integer $dossier_instruction_type |
321 |
|
* @return int |
322 |
|
*/ |
323 |
|
public function getNumeroVersionDossierInstructionType($dossier_autorisation, $dossier_instruction_type, $numero_version, $increment = true){ |
324 |
|
|
325 |
|
$numeroVersionDossierInstructionType = $numero_version; |
326 |
|
|
327 |
|
//On récupère le code correspondant au type de dossier d'instruction passé |
328 |
|
//en paramètre |
329 |
|
$sql = "SELECT |
330 |
|
code |
331 |
|
FROM |
332 |
|
".DB_PREFIXE."dossier_instruction_type |
333 |
|
WHERE |
334 |
|
dossier_instruction_type = ".$dossier_instruction_type; |
335 |
|
$codeDossierInstructionType = $this->db->getOne($sql); |
336 |
|
$this->f->addToLog("getNumeroVersionDossierInstructionType(): db->getOne(\"".$sql."\")", VERBOSE_MODE); |
337 |
|
if ( database::isError($codeDossierInstructionType)){ |
338 |
|
$this->f->addToError("", $codeDossierInstructionType, $codeDossierInstructionType); |
339 |
|
return false; |
340 |
|
} |
341 |
|
|
342 |
|
|
343 |
|
// Si c'est un dossier d'instruction de type "Initial", code "P", on retourne 0 |
344 |
|
if ( strcmp($codeDossierInstructionType, "P") == 0 ){ |
345 |
|
return 0; |
346 |
|
} |
347 |
|
//Si c'est un modificatif ou transfert on retourne un nombre correspondant au |
348 |
|
//nombre de dossier d'instruction de ce type, rattaché au dossier |
349 |
|
//d'autorisation complété par des 0 à gauche si besoin. Format du retour |
350 |
|
//attendu : 01 ou 02, etc. |
351 |
|
elseif ( strcmp($codeDossierInstructionType, "M") == 0 || |
352 |
|
strcmp($codeDossierInstructionType, "T") == 0 ){ |
353 |
|
|
354 |
|
//On récupère le nombre de dossier d'instruction de ce type rattaché au |
355 |
|
//dossier d'autorisation |
356 |
|
$sql = "SELECT |
357 |
|
count(*) |
358 |
|
FROM |
359 |
|
".DB_PREFIXE."dossier |
360 |
|
LEFT JOIN |
361 |
|
".DB_PREFIXE."dossier_autorisation |
362 |
|
ON |
363 |
|
dossier_autorisation.dossier_autorisation = dossier.dossier_autorisation |
364 |
|
WHERE |
365 |
|
dossier_autorisation.dossier_autorisation = '".$dossier_autorisation."' |
366 |
|
AND |
367 |
|
dossier.dossier_instruction_type = ".$dossier_instruction_type; |
368 |
|
$numeroVersionDossierInstructionType = $this->db->getOne($sql); |
369 |
|
$this->f->addToLog("getNumeroVersionDossierInstructionType(): db->getOne(\"".$sql."\")", VERBOSE_MODE); |
370 |
|
if ( database::isError($numeroVersionDossierInstructionType)){ |
371 |
|
$this->f->addToError("", $numeroVersionDossierInstructionType, $numeroVersionDossierInstructionType); |
372 |
|
return false; |
373 |
|
} |
374 |
|
|
375 |
|
// |
376 |
|
if ($increment === true) { |
377 |
|
$numeroVersionDossierInstructionType = ++$numeroVersionDossierInstructionType; |
378 |
|
} |
379 |
|
//On compléte par des 0 à gauche |
380 |
|
$numeroVersionDossierInstructionType = str_pad($numeroVersionDossierInstructionType, 2, "0", STR_PAD_LEFT); |
381 |
|
|
382 |
|
return $numeroVersionDossierInstructionType; |
383 |
|
} |
384 |
|
//Sinon on retourne le numéro de version |
385 |
|
else{ |
386 |
|
return $numeroVersionDossierInstructionType; |
387 |
|
} |
388 |
|
} |
389 |
|
/** |
390 |
|
* Retourne le libellé du dossier d'autorisation |
391 |
|
* @param string $dossier_autorisation Identifiant du dossier d'autorisation |
392 |
|
* @return string Libellé dossier d'autorisation |
393 |
|
*/ |
394 |
|
function get_dossier_autorisation_libelle($dossier_autorisation) { |
395 |
|
|
396 |
|
$dossier_autorisation_libelle = ""; |
397 |
|
|
398 |
|
// Requête SQL |
399 |
|
$sql = "SELECT |
400 |
|
dossier_autorisation_libelle |
401 |
|
FROM |
402 |
|
".DB_PREFIXE."dossier_autorisation |
403 |
|
WHERE |
404 |
|
dossier_autorisation = '$dossier_autorisation'"; |
405 |
|
|
406 |
|
$dossier_autorisation_libelle = $this->db->getOne($sql); |
407 |
|
$this->addToLog("get_dossier_autorisation_libelle(): db->getOne(\"".$sql."\")", VERBOSE_MODE); |
408 |
|
database::isError($dossier_autorisation_libelle); |
409 |
|
|
410 |
|
// Retourne le résultat |
411 |
|
return $dossier_autorisation_libelle; |
412 |
|
} |
413 |
|
|
414 |
function setvalF($val){ |
function setvalF($val){ |
415 |
parent::setvalF($val); |
parent::setvalF($val); |
427 |
unset ($this->valF['etat']); |
unset ($this->valF['etat']); |
428 |
unset ($this->valF['delai']); |
unset ($this->valF['delai']); |
429 |
unset ($this->valF['accord_tacite']); |
unset ($this->valF['accord_tacite']); |
|
unset ($this->valF['types']); |
|
430 |
} |
} |
431 |
unset ($this->valF['avis_decision']); // avis + libelle avis |
unset ($this->valF['avis_decision']); // avis + libelle avis |
432 |
unset ($this->valF['terrain_surface_calcul']); |
unset ($this->valF['terrain_surface_calcul']); |
440 |
unset ($this->valF['date_chantier']); |
unset ($this->valF['date_chantier']); |
441 |
unset ($this->valF['date_achevement']); |
unset ($this->valF['date_achevement']); |
442 |
unset ($this->valF['date_conformite']); |
unset ($this->valF['date_conformite']); |
443 |
|
|
444 |
|
// Durée de validaité lors de la création du dossier d'instruction |
445 |
|
$this->valF['duree_validite'] = $this->get_duree_validite($this->valF['dossier_autorisation']); |
446 |
} |
} |
447 |
|
|
448 |
/*Vérification des données saisies*/ |
/*Vérification des données saisies*/ |
451 |
if(!isset($this->postedIdDemandeur["petitionnaire_principal"]) OR |
if(!isset($this->postedIdDemandeur["petitionnaire_principal"]) OR |
452 |
empty($this->postedIdDemandeur["petitionnaire_principal"])) { |
empty($this->postedIdDemandeur["petitionnaire_principal"])) { |
453 |
$this->correct = false; |
$this->correct = false; |
454 |
$this->addToMessage("La saisie d'un petitionnaire principal est obligatoire."); |
$this->addToMessage(_("La saisie d'un petitionnaire principal est obligatoire.")); |
455 |
} |
} |
456 |
if($val['parcelle']!="" and $val['sig']!='Oui'){ |
if($val['parcelle']!="" and $val['sig']!='Oui'){ |
457 |
if (!preg_match('/^[0-9]{3} [A-Z]{1,3} [0-9]{1,5}$/', $val['parcelle']) && !preg_match('/^[0-9]{3}[A-Z]{1,3}[0-9]{1,5}$/', $val['parcelle'])){ |
if (!preg_match('/^[0-9]{3} [A-Z]{1,3} [0-9]{1,5}$/', $val['parcelle']) && !preg_match('/^[0-9]{3}[A-Z]{1,3}[0-9]{1,5}$/', $val['parcelle'])){ |
464 |
|
|
465 |
function setType(&$form,$maj) { |
function setType(&$form,$maj) { |
466 |
parent::setType($form,$maj); |
parent::setType($form,$maj); |
467 |
|
$form->setType('dossier','hidden'); |
468 |
|
$form->setType('amenagement','hidden'); // PC |
469 |
|
$form->setType('parcelle_lot','hidden'); // PC |
470 |
|
$form->setType('parcelle_lot_lotissement','hidden'); // PC |
471 |
|
$form->setType('version','hidden'); // PC |
472 |
|
$form->setType('incompletude','hidden'); |
473 |
|
$form->setType('evenement_suivant_tacite','hidden'); |
474 |
|
$form->setType('evenement_suivant_tacite_incompletude','hidden'); |
475 |
|
$form->setType('etat_pendant_incompletude','hidden'); |
476 |
|
$form->setType('duree_validite','hidden'); |
477 |
if ($maj < 2) { //ajouter et modifier |
if ($maj < 2) { //ajouter et modifier |
478 |
// cache |
// cache |
479 |
if($maj==0) $form->setType('dossier', 'hidden'); |
if($maj==0) $form->setType('dossier_libelle', 'hidden'); |
480 |
$form->setType('annee', 'hidden'); |
$form->setType('annee', 'hidden'); |
481 |
$form->setType('parcelle_archive','hidden'); |
$form->setType('parcelle_archive','hidden'); |
482 |
$form->setType('parcelle_lot_archive','hidden'); |
$form->setType('parcelle_lot_archive','hidden'); |
|
$form->setType('objet_dossier','hidden'); // PC |
|
|
$form->setType('amenagement','hidden'); // PC |
|
|
$form->setType('parcelle_lot','hidden'); // PC |
|
|
$form->setType('parcelle_lot_lotissement','hidden'); // PC |
|
483 |
|
|
484 |
$form->setType('geom1', 'hidden'); |
$form->setType('geom1', 'hidden'); |
485 |
$form->setType('geom', 'geom'); |
$form->setType('geom', 'hiddenstatic'); |
486 |
$form->setType('servitude', 'hiddenstatic'); |
$form->setType('servitude', 'hiddenstatic'); |
|
|
|
|
//select |
|
|
$form->setType('terrain_numero_complement','select'); |
|
|
|
|
487 |
|
|
488 |
|
|
489 |
// hiddenstatic |
// hiddenstatic |
490 |
if($maj==1) $form->setType('dossier', 'hiddenstatic'); |
if($maj==1) $form->setType('dossier_libelle', 'hiddenstatic'); |
491 |
$form->setType('etat','hiddenstatic'); |
$form->setType('etat','hiddenstatic'); |
492 |
$form->setType('avis_decision','hiddenstatic'); |
$form->setType('avis_decision','hiddenstatic'); |
493 |
|
$form->setType('delai_incompletude','hiddenstatic'); |
494 |
$form->setType('delai','hiddenstatic'); |
$form->setType('delai','hiddenstatic'); |
495 |
$form->setType('terrain_surface_calcul','hiddenstatic'); |
$form->setType('terrain_surface_calcul','hiddenstatic'); |
496 |
$form->setType('shon_calcul','hiddenstatic'); |
$form->setType('shon_calcul','hiddenstatic'); |
497 |
|
|
498 |
$form->setType('accord_tacite','hiddenstatic'); |
$form->setType('accord_tacite','hiddenstatic'); |
|
$form->setType('types', 'hiddenstatic'); // transfert modificatif |
|
499 |
|
|
500 |
|
|
501 |
// hiddenstaticdate |
// hiddenstaticdate |
509 |
$form->setType('date_chantier','hiddenstaticdate'); |
$form->setType('date_chantier','hiddenstaticdate'); |
510 |
$form->setType('date_achevement','hiddenstaticdate'); |
$form->setType('date_achevement','hiddenstaticdate'); |
511 |
$form->setType('date_conformite','hiddenstaticdate'); |
$form->setType('date_conformite','hiddenstaticdate'); |
512 |
|
$form->setType('date_limite_incompletude','hiddenstaticdate'); |
513 |
|
|
514 |
|
$form->setType('date_demande','hiddenstaticdate'); |
515 |
|
$form->setType('date_depot','hiddenstaticdate'); |
516 |
|
$form->setType('date_dernier_depot','hiddenstaticdate'); |
517 |
|
|
518 |
// checkbox |
// checkbox |
519 |
$form->setType('sig','checkbox'); |
$form->setType('sig','checkbox'); |
520 |
|
|
536 |
$form->setType('temp4',$temp4_type); |
$form->setType('temp4',$temp4_type); |
537 |
$form->setType('temp5',$temp5_type); |
$form->setType('temp5',$temp5_type); |
538 |
$form->setType('a_qualifier', 'checkbox'); |
$form->setType('a_qualifier', 'checkbox'); |
539 |
|
|
540 |
|
$form->setType('parcelle', 'hidden'); |
541 |
|
$form->setType('pos', 'hidden'); |
542 |
|
$form->setType('sig', 'hidden'); |
543 |
|
$form->setType('batiment_nombre', 'hidden'); |
544 |
|
$form->setType('logement_nombre', 'hidden'); |
545 |
|
$form->setType('hauteur', 'hidden'); |
546 |
|
$form->setType('piece_nombre', 'hidden'); |
547 |
|
$form->setType('shon', 'hidden'); |
548 |
|
$form->setType('shon_calcul', 'hidden'); |
549 |
|
$form->setType('shob', 'hidden'); |
550 |
|
$form->setType('lot', 'hidden'); |
551 |
} |
} |
552 |
if ($maj == 1) { |
if ($maj == 1) { |
553 |
// |
// |
578 |
$form->setType('parcelle_archive','hidden'); |
$form->setType('parcelle_archive','hidden'); |
579 |
$form->setType('parcelle_lot_archive','hidden'); |
$form->setType('parcelle_lot_archive','hidden'); |
580 |
$form->setType('geom1','hidden'); |
$form->setType('geom1','hidden'); |
581 |
$form->setType('geom','hidden'); |
$form->setType('geom','hiddenstatic'); |
582 |
$form->setType('a_qualifier', 'checkboxstatic'); |
$form->setType('a_qualifier', 'checkboxstatic'); |
583 |
|
$form->setType('terrain_references_cadastrales','referencescadastralesstatic'); // PC |
584 |
|
$form->setType('parcelle', 'hidden'); |
585 |
|
$form->setType('pos', 'hidden'); |
586 |
|
$form->setType('sig', 'hidden'); |
587 |
|
$form->setType('batiment_nombre', 'hidden'); |
588 |
|
$form->setType('logement_nombre', 'hidden'); |
589 |
|
$form->setType('hauteur', 'hidden'); |
590 |
|
$form->setType('piece_nombre', 'hidden'); |
591 |
|
$form->setType('shon', 'hidden'); |
592 |
|
$form->setType('shon_calcul', 'hidden'); |
593 |
|
$form->setType('shob', 'hidden'); |
594 |
|
$form->setType('lot', 'hidden'); |
595 |
|
} |
596 |
|
|
597 |
|
// Le profil Qualificateur ne peut modifier seulement les champs |
598 |
|
// autorite_competente, a_qualifier et erp |
599 |
|
if ($this->f->isUserQualificateur()) { |
600 |
|
|
601 |
|
// En modification |
602 |
|
if ($maj == 1) { |
603 |
|
|
604 |
|
$form->setType('numero_versement_archive', 'static'); |
605 |
|
$form->setType('enjeu_urba', 'checkboxstatic'); |
606 |
|
$form->setType('enjeu_erp', 'checkboxstatic'); |
607 |
|
$form->setType('description','textareastatic'); |
608 |
|
$form->setType('terrain_references_cadastrales','referencescadastralesstatic'); |
609 |
|
$form->setType('terrain_adresse_voie_numero','static'); |
610 |
|
$form->setType('terrain_adresse_voie','static'); |
611 |
|
$form->setType('terrain_adresse_lieu_dit','static'); |
612 |
|
$form->setType('terrain_adresse_localite','static'); |
613 |
|
$form->setType('terrain_adresse_code_postal','static'); |
614 |
|
$form->setType('terrain_adresse_bp','static'); |
615 |
|
$form->setType('terrain_adresse_cedex','static'); |
616 |
|
$form->setType('terrain_superficie','static'); |
617 |
|
} |
618 |
} |
} |
619 |
|
|
620 |
// |
// |
621 |
if(!$this->f->getParameter('afficher_division') === 'true') { |
if(!$this->f->getParameter('afficher_division') === 'true') { |
622 |
$form->setType('division', 'hidden'); |
$form->setType('division', 'hidden'); |
623 |
} |
} |
624 |
$form->setType('dossier_autorisation', 'hiddenstatic'); |
$form->setType('dossier_autorisation', 'hidden'); |
625 |
|
$form->setType('dossier_autorisation_libelle', 'hiddenstatic'); |
626 |
$form->setType('dossier_instruction_type', 'selecthiddenstatic'); |
$form->setType('dossier_instruction_type', 'selecthiddenstatic'); |
627 |
// |
// |
628 |
if ($maj == 0) { |
if ($maj == 0) { |
637 |
|
|
638 |
function setVal(&$form,$maj,$validation){ |
function setVal(&$form,$maj,$validation){ |
639 |
$this->maj=$maj; |
$this->maj=$maj; |
640 |
|
|
641 |
|
if($this->getVal('geom') != "") { |
642 |
|
$form->setVal('geom', |
643 |
|
"<a id='action-form-localiser'". |
644 |
|
" target='_blank' href='../app/redirect_plan_sig.php?idx=".$this->getVal("dossier")."'>". |
645 |
|
"<span class='om-icon om-icon-16 om-icon-fix sig-16' title='Localiser'>Localiser</span> ". |
646 |
|
$this->getVal('geom'). |
647 |
|
" </a>"); |
648 |
|
} else { |
649 |
|
$form->setVal('geom', ''); |
650 |
|
} |
651 |
if ($validation==0) { |
if ($validation==0) { |
652 |
if ($maj == 0){ |
if ($maj == 0){ |
653 |
//$dossier_cp = $this->f->collectivite["cp"]; |
//$dossier_cp = $this->f->collectivite["cp"]; |
668 |
|
|
669 |
$form->setVal('accord_tacite', 'Non'); |
$form->setVal('accord_tacite', 'Non'); |
670 |
$form->setVal('etat', 'initialiser'); |
$form->setVal('etat', 'initialiser'); |
|
$form->setVal('types', 'Initial'); |
|
671 |
} |
} |
672 |
} |
} |
673 |
} |
} |
696 |
$contenu[0]=array('Non','Oui'); |
$contenu[0]=array('Non','Oui'); |
697 |
$contenu[1]=array('Non','Oui'); |
$contenu[1]=array('Non','Oui'); |
698 |
$form->setSelect("accord_tacite",$contenu); |
$form->setSelect("accord_tacite",$contenu); |
699 |
// terrain_numero_complement |
|
|
$contenu=array(); |
|
|
$contenu[0]=array('','bis','ter','quater'); |
|
|
$contenu[1]=array('','bis','ter','quater'); |
|
|
$form->setSelect("terrain_numero_complement",$contenu); |
|
700 |
// geom *** a voir |
// geom *** a voir |
701 |
if($maj==1){ //modification |
if($maj==1){ //modification |
702 |
$contenu=array(); |
$contenu=array(); |
736 |
} |
} |
737 |
|
|
738 |
function setLib(&$form,$maj) { |
function setLib(&$form,$maj) { |
739 |
parent::setLib($form,$maj); |
parent::setLib($form,$maj); |
740 |
$form->setLib('geom',''); |
$form->setLib('geom',_('centroide')); |
741 |
|
$form->setLib('date_limite',_("date limite d'instruction")); |
742 |
|
$form->setLib('delai',_("delai d'instruction")); |
743 |
|
$form->setLib('accord_tacite',_("decision tacite")); |
744 |
} |
} |
745 |
|
|
|
function setGroupe(&$form,$maj){ |
|
|
// instruction |
|
|
$form->setGroupe('date_complet','D'); |
|
|
$form->setGroupe('date_rejet','G'); |
|
|
$form->setGroupe('rejet','G'); |
|
|
$form->setGroupe('delai','F'); |
|
|
|
|
|
$form->setGroupe('date_limite','D'); |
|
|
$form->setGroupe('date_notification_delai','G'); |
|
|
$form->setGroupe('accord_tacite','G'); |
|
|
$form->setGroupe('etat','F'); |
|
|
|
|
|
$form->setGroupe('date_decision','D'); |
|
|
$form->setGroupe('avis_decision','G'); |
|
|
$form->setGroupe('date_validite','G'); |
|
|
$form->setGroupe('types','F'); |
|
|
|
|
|
$form->setGroupe('date_chantier','D'); |
|
|
$form->setGroupe('date_achevement','G'); |
|
|
$form->setGroupe('date_conformite','F'); |
|
|
|
|
|
// localisation |
|
|
$form->setGroupe('parcelle','D'); |
|
|
$form->setGroupe('pos','G'); |
|
|
if($maj==1){ |
|
|
$form->setGroupe('sig','G'); |
|
|
$form->setGroupe('geom','F'); |
|
|
}else { |
|
|
$form->setGroupe('sig','F'); |
|
|
} |
|
|
if($maj==1){ |
|
|
$form->setGroupe('sig','G'); |
|
|
$form->setGroupe('geom','F'); |
|
|
} |
|
|
|
|
|
// description |
|
|
$form->setGroupe('batiment_nombre','D'); |
|
|
$form->setGroupe('logement_nombre','G'); |
|
|
$form->setGroupe('hauteur','G'); |
|
|
$form->setGroupe('piece_nombre','F'); |
|
|
|
|
|
$form->setGroupe('shon','D'); |
|
|
$form->setGroupe('shon_calcul','G'); |
|
|
$form->setGroupe('shob','G'); |
|
|
$form->setGroupe('lot','F'); |
|
|
|
|
|
$form->setGroupe('amenagement','D'); |
|
|
$form->setGroupe('parcelle_lot','G'); |
|
|
$form->setGroupe('parcelle_lot_lotissement','F'); |
|
|
} |
|
|
|
|
746 |
function setOnchange(&$form,$maj){ |
function setOnchange(&$form,$maj){ |
747 |
parent::setOnchange($form,$maj); |
parent::setOnchange($form,$maj); |
748 |
// mise en majuscule |
// mise en majuscule |
760 |
|
|
761 |
function setLayout(&$form, $maj) { |
function setLayout(&$form, $maj) { |
762 |
// |
// |
763 |
$form->setBloc('dossier', 'D', '', ($maj == 3 ? 'col_9':'col_12')); |
$form->setBloc('dossier_libelle', 'D', '', ($maj == 3 ? 'col_9':'col_12')); |
764 |
$form->setBloc('dossier', 'D', '', 'col_9'); |
$form->setBloc('dossier_libelle', 'D', '', 'col_9'); |
765 |
$form->setFieldset('dossier', 'D', _("Dossier d'instruction")); |
|
766 |
$form->setFieldset('autorite_competente', 'F'); |
$form->setFieldset('dossier_libelle', 'D', _("Dossier d'instruction")); |
767 |
$form->setBloc('autorite_competente', 'F'); |
$form->setFieldset('numero_versement_archive', 'F'); |
768 |
$form->setBloc('date_demande', 'D', '', 'col_3'); |
|
769 |
$form->setFieldset('date_demande', 'D', _("Depot")); |
$form->setBloc('numero_versement_archive', 'F'); |
770 |
$form->setFieldset('date_depot', 'F'); |
|
771 |
$form->setFieldset('enjeu_urba', 'D', _("Enjeu")); |
$form->setBloc('date_demande', 'D', '', 'col_3'); |
772 |
$form->setFieldset('enjeu_erp', 'F'); |
|
773 |
$form->setBloc('enjeu_erp', 'F'); |
$form->setFieldset('date_demande', 'D', _("Depot")); |
774 |
$form->setBloc('enjeu_erp', 'F'); |
$form->setFieldset('date_dernier_depot', 'F'); |
775 |
// |
|
776 |
$form->setBloc('objet_dossier', 'D', '', 'col_12'); |
$form->setFieldset('enjeu_urba', 'D', _("Enjeu")); |
777 |
// |
$form->setFieldset('enjeu_erp', 'F'); |
778 |
$form->setFieldset('date_complet', 'D', _('Instruction'), 'col_12'); |
|
779 |
$form->setRegroupe('date_conformite','F',''); |
$form->setFieldset('erp', 'D', _("Qualification")); |
780 |
|
$form->setFieldset('a_qualifier', 'F'); |
781 |
|
|
782 |
|
$form->setBloc('a_qualifier', 'F'); |
783 |
|
$form->setBloc('a_qualifier', 'F'); |
784 |
// |
// |
785 |
|
$form->setBloc('date_complet', 'D', '', 'col_12'); |
786 |
|
|
787 |
|
$form->setFieldset('date_complet', 'D', _('Instruction'), 'col_12'); |
788 |
|
|
789 |
|
$form->setBloc('date_complet', 'D', '', 'col_4'); |
790 |
|
$form->setBloc('date_limite_incompletude', 'F'); |
791 |
|
|
792 |
|
$form->setBloc('date_rejet', 'D', '', 'col_4'); |
793 |
|
$form->setBloc('delai_incompletude', 'F'); |
794 |
|
|
795 |
|
$form->setBloc('etat', 'D', '', 'col_4'); |
796 |
|
$form->setBloc('date_conformite', 'F'); |
797 |
|
|
798 |
|
$form->setFieldset('date_conformite','F',''); |
799 |
|
|
800 |
$form->setBloc('date_conformite', 'F'); |
$form->setBloc('date_conformite', 'F'); |
801 |
|
|
802 |
$form->setBloc('parcelle','D',"", "col_12"); |
$form->setBloc('parcelle','D',"", "col_12"); |
803 |
$form->setBloc('a_qualifier','F'); |
$form->setBloc('geom1','F'); |
804 |
|
|
805 |
//Fieldset "Localisation du terrain" |
//Fieldset "Localisation du terrain" |
806 |
$form->setBloc('terrain_references_cadastrales','D',"","col_12"); |
$form->setBloc('terrain_references_cadastrales','D',"","col_12"); |
826 |
$form->setRegroupe('description','D',_('description').' '._('servitude'), $this->aff_amenagement); |
$form->setRegroupe('description','D',_('description').' '._('servitude'), $this->aff_amenagement); |
827 |
$form->setRegroupe('servitude','F',''); |
$form->setRegroupe('servitude','F',''); |
828 |
|
|
|
// amenagement |
|
|
$form->setRegroupe('amenagement','D',_('Amenagement'), $this->aff_amenagement); |
|
|
$form->setRegroupe('parcelle_lot','G',''); |
|
|
$form->setRegroupe('parcelle_lot_lotissement','F',''); |
|
829 |
|
|
830 |
} |
} |
831 |
|
|
885 |
$msgenque->enqueueMessage($msgenque::$ERP_DEMANDE_OUVERTURE_PC); |
$msgenque->enqueueMessage($msgenque::$ERP_DEMANDE_OUVERTURE_PC); |
886 |
} |
} |
887 |
} |
} |
888 |
} // fin de if ($this->f->getParameter('option_erp') != "") |
} // fin de if ($this->f->getParameter('option_erp') != "") |
889 |
|
|
890 |
|
// Mise à jour des données du dossier d'autorisation |
891 |
|
require_once "../obj/dossier_autorisation.class.php"; |
892 |
|
$da = new dossier_autorisation($this->valF["dossier_autorisation"], $this->db, DEBUG); |
893 |
|
$da->majDossierAutorisation(); |
894 |
} |
} |
895 |
|
|
896 |
/* |
/* |
1151 |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
1152 |
} |
} |
1153 |
|
|
1154 |
|
/** |
1155 |
|
* Ne servira surement pas mais dans le doute autant recalculer les données du DA |
1156 |
|
*/ |
1157 |
|
function triggersupprimerapres($id,&$db,$val,$DEBUG) { |
1158 |
|
// Mise à jour des données du dossier d'autorisation |
1159 |
|
require_once "../obj/dossier_autorisation.class.php"; |
1160 |
|
$da = new dossier_autorisation($this->valF["dossier_autorisation"], $this->db, DEBUG); |
1161 |
|
$da->majDossierAutorisation(); |
1162 |
|
} |
1163 |
|
|
1164 |
/** |
/** |
1165 |
* Retourne le type de dossier d'autorisation du dossier courant : |
* Retourne le type de dossier d'autorisation du dossier courant : |
1174 |
INNER JOIN ".DB_PREFIXE."dossier ON dossier.dossier_autorisation = dossier_autorisation.dossier_autorisation |
INNER JOIN ".DB_PREFIXE."dossier ON dossier.dossier_autorisation = dossier_autorisation.dossier_autorisation |
1175 |
WHERE dossier.dossier = '".$idxDossier."'"; |
WHERE dossier.dossier = '".$idxDossier."'"; |
1176 |
$res = $this -> db -> getOne($sql); |
$res = $this -> db -> getOne($sql); |
1177 |
$this->f->isDatabaseError(); |
$this->f->addToLog("getDATDCode() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1178 |
$this->addToLog($sql); |
if ( database::isError($res)){ |
1179 |
|
die(); |
1180 |
|
} |
1181 |
return $res; |
return $res; |
1182 |
} |
} |
1183 |
|
|
1369 |
|
|
1370 |
// Ajout du délégataire |
// Ajout du délégataire |
1371 |
if(!empty($this->postedIdDemandeur['delegataire'])) { |
if(!empty($this->postedIdDemandeur['delegataire'])) { |
1372 |
$this->addLinkDossierDemandeur($this->postedIdDemandeur['delegataire'], true, $db, $DEBUG); |
$this->addLinkDossierDemandeur($this->postedIdDemandeur['delegataire'], false, $db, $DEBUG); |
1373 |
} |
} |
1374 |
|
|
1375 |
// Ajout des pétitionnaires |
// Ajout des pétitionnaires |
1411 |
$res = $db->query($sql); |
$res = $db->query($sql); |
1412 |
// Logger |
// Logger |
1413 |
$this->f->addToLog("supprimer(): db->query(\"".$sql."\");", VERBOSE_MODE); |
$this->f->addToLog("supprimer(): db->query(\"".$sql."\");", VERBOSE_MODE); |
1414 |
$this->f->isDatabaseError(); |
if ( database::isError($res)){ |
1415 |
|
die(); |
1416 |
|
} |
1417 |
|
|
1418 |
} |
} |
1419 |
|
|
1441 |
} |
} |
1442 |
|
|
1443 |
/** |
/** |
1444 |
* 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 |
1445 |
* liés au dossier d'autorisation |
* liée passée en paramètre |
1446 |
**/ |
* |
1447 |
|
* @param string $from Table liée : "demande", "dossier", dossier_autorisation" |
1448 |
|
* @param string $id Identifiant (clé primaire de la table liée en question) |
1449 |
|
*/ |
1450 |
function listeDemandeur($from, $id) { |
function listeDemandeur($from, $id) { |
1451 |
// Récupération des demandeurs de la base |
// Récupération des demandeurs de la base |
1452 |
$sql = "SELECT demandeur.demandeur, |
$sql = "SELECT demandeur.demandeur, |
1457 |
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
1458 |
WHERE ".$from." = '".$id."'"; |
WHERE ".$from." = '".$id."'"; |
1459 |
$res = $this->f->db->query($sql); |
$res = $this->f->db->query($sql); |
1460 |
$this->f->addToLog("listeDemandeur() : ".$sql); |
$this->f->addToLog("listeDemandeur(): db->query(\"".$sql."\")", VERBOSE_MODE); |
1461 |
$this->f->isDatabaseError($res); |
if ( database::isError($res)){ |
1462 |
// Stoquage du résultat dans un tableau |
die(); |
1463 |
|
} |
1464 |
|
// Stockage du résultat dans un tableau |
1465 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
1466 |
if ($row['petitionnaire_principal'] == 't' AND |
if ($row['petitionnaire_principal'] == 't' AND |
1467 |
$row['type_demandeur']=="petitionnaire") { |
$row['type_demandeur']=="petitionnaire") { |
1482 |
|
|
1483 |
$this->listeDemandeur("dossier", $this->getVal('dossier')); |
$this->listeDemandeur("dossier", $this->getVal('dossier')); |
1484 |
|
|
1485 |
if($maj < 2 AND !$this->correct) { |
if($maj < 2 AND !$this->correct AND !$this->f->isUserQualificateur()) { |
1486 |
$linkable = true; |
$linkable = true; |
1487 |
} else { |
} else { |
1488 |
$linkable = false; |
$linkable = false; |
1586 |
echo "</fieldset>"; |
echo "</fieldset>"; |
1587 |
echo "</div>"; |
echo "</div>"; |
1588 |
} |
} |
1589 |
|
|
1590 |
|
/** |
1591 |
|
* Retourne le statut du dossier |
1592 |
|
* @return string Le statut du dossier d'instruction |
1593 |
|
*/ |
1594 |
|
function getStatut(){ |
1595 |
|
|
1596 |
|
$statut = ''; |
1597 |
|
|
1598 |
|
$etat = $this->getVal("etat"); |
1599 |
|
//Si l'état du dossier d'instruction n'est pas vide |
1600 |
|
if ( $etat != '' ){ |
1601 |
|
|
1602 |
|
$sql = "SELECT statut |
1603 |
|
FROM ".DB_PREFIXE."etat |
1604 |
|
WHERE etat ='".$etat."'"; |
1605 |
|
$statut = $this->db->getOne($sql); |
1606 |
|
$this->f->addToLog("getStatut() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1607 |
|
if ( database::isError($statut)){ |
1608 |
|
die(); |
1609 |
|
} |
1610 |
|
} |
1611 |
|
return $statut; |
1612 |
|
} |
1613 |
|
|
1614 |
|
/** |
1615 |
|
* Retourne l'identifiant du rapport d'instruction lié du dossier |
1616 |
|
* @return string L'identifiant du rapport d'instruction lié du dossier |
1617 |
|
*/ |
1618 |
|
function getRapportInstruction(){ |
1619 |
|
|
1620 |
|
$rapport_instruction = ''; |
1621 |
|
|
1622 |
|
$sql = "SELECT rapport_instruction |
1623 |
|
FROM ".DB_PREFIXE."rapport_instruction |
1624 |
|
WHERE dossier_instruction ='".$this->getVal($this->clePrimaire)."'"; |
1625 |
|
$rapport_instruction = $this->db->getOne($sql); |
1626 |
|
$this->f->addToLog("getStatut() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1627 |
|
if ( database::isError($rapport_instruction)){ |
1628 |
|
die(); |
1629 |
|
} |
1630 |
|
|
1631 |
|
return $rapport_instruction; |
1632 |
|
} |
1633 |
|
|
1634 |
|
/** |
1635 |
|
* Retourne l'identifiant des données techniques liées du dossier |
1636 |
|
* @return string L'identifiant des données techniques liées du dossier |
1637 |
|
*/ |
1638 |
|
function getDonneesTechniques(){ |
1639 |
|
|
1640 |
|
$donnees_techniques = ''; |
1641 |
|
|
1642 |
|
$sql = "SELECT donnees_techniques |
1643 |
|
FROM ".DB_PREFIXE."donnees_techniques |
1644 |
|
WHERE dossier_instruction ='".$this->getVal($this->clePrimaire)."'"; |
1645 |
|
$donnees_techniques = $this->db->getOne($sql); |
1646 |
|
$this->f->addToLog("getStatut() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1647 |
|
if ( database::isError($donnees_techniques)){ |
1648 |
|
die(); |
1649 |
|
} |
1650 |
|
|
1651 |
|
return $donnees_techniques; |
1652 |
|
} |
1653 |
|
|
1654 |
|
/** |
1655 |
|
* Surcharge du bouton retour afin de retourner sur la recherche de dossiers |
1656 |
|
* d'instruction existant |
1657 |
|
*/ |
1658 |
|
function retour($premier = 0, $recherche = "", $tricol = "") { |
1659 |
|
|
1660 |
|
echo "\n<a class=\"retour\" "; |
1661 |
|
echo "href=\""; |
1662 |
|
// |
1663 |
|
if($this->getParameter("idx_dossier") != "") { |
1664 |
|
echo "tab.php?"; |
1665 |
|
echo "obj=recherche_dossier"; |
1666 |
|
|
1667 |
|
} else { |
1668 |
|
if($this->getParameter("retour")=="form" AND !($this->getParameter("validation")>0 AND $this->getParameter("maj")==2 AND $this->correct)) { |
1669 |
|
echo "form.php?"; |
1670 |
|
} else { |
1671 |
|
echo "tab.php?"; |
1672 |
|
} |
1673 |
|
// Permet de retourner sur la bonne page |
1674 |
|
if (isset($_GET['retourformulaire']) && $_GET['retourformulaire'] != '') { |
1675 |
|
echo "obj=".$_GET['retourformulaire']; |
1676 |
|
} else { |
1677 |
|
echo "obj=".get_class($this); |
1678 |
|
} |
1679 |
|
if($this->getParameter("retour")=="form") { |
1680 |
|
echo "&idx=".$this->getParameter("idx"); |
1681 |
|
echo "&idz=".$this->getParameter("idz"); |
1682 |
|
echo "&action=3"; |
1683 |
|
} |
1684 |
|
} |
1685 |
|
echo "&premier=".$this->getParameter("premier"); |
1686 |
|
echo "&tricol=".$this->getParameter("tricol"); |
1687 |
|
echo "&recherche=".$this->getParameter("recherche"); |
1688 |
|
echo "&selectioncol=".$this->getParameter("selectioncol"); |
1689 |
|
echo "&advs_id=".$this->getParameter("advs_id"); |
1690 |
|
echo "&valide=".$this->getParameter("valide"); |
1691 |
|
// |
1692 |
|
echo "\""; |
1693 |
|
echo ">"; |
1694 |
|
// |
1695 |
|
echo _("Retour"); |
1696 |
|
// |
1697 |
|
echo "</a>\n"; |
1698 |
|
|
1699 |
|
} |
1700 |
|
|
1701 |
|
/** |
1702 |
|
* Permet de modifier le fil d'Ariane |
1703 |
|
* @param string $ent Fil d'Ariane |
1704 |
|
* @param array $val Valeurs de l'objet |
1705 |
|
* @param intger $maj Mode du formulaire |
1706 |
|
*/ |
1707 |
|
function getFormTitle($ent) { |
1708 |
|
|
1709 |
|
// Fil d'Ariane |
1710 |
|
$ent = _("instruction")." -> "._("dossiers d'instruction"); |
1711 |
|
|
1712 |
|
// Si différent de l'ajout |
1713 |
|
if($this->getParameter("maj") != 0) { |
1714 |
|
// Si le champ dossier_libelle existe |
1715 |
|
if (trim($this->getVal("dossier_libelle")) != '') { |
1716 |
|
$ent .= " -> ".strtoupper($this->getVal("dossier_libelle")); |
1717 |
|
} |
1718 |
|
// Si le champ dossier existe |
1719 |
|
if (trim($this->getVal("dossier")) != '') { |
1720 |
|
$demandeur = $this->get_demandeur($this->getVal("dossier")); |
1721 |
|
// Si le demandeur existe |
1722 |
|
if (isset($demandeur) && trim($demandeur) != '') { |
1723 |
|
$ent .= " ".strtoupper($demandeur); |
1724 |
|
} |
1725 |
|
} |
1726 |
|
} |
1727 |
|
|
1728 |
|
// Change le fil d'Ariane |
1729 |
|
return $ent; |
1730 |
|
} |
1731 |
|
|
1732 |
|
/** |
1733 |
|
* Récupère le demandeur du dossier |
1734 |
|
* @return string Identifiant du dossier |
1735 |
|
*/ |
1736 |
|
private function get_demandeur($dossier) { |
1737 |
|
|
1738 |
|
// init de la variable de retour |
1739 |
|
$demandeur = ''; |
1740 |
|
|
1741 |
|
// Requête SQL |
1742 |
|
$sql = "SELECT |
1743 |
|
CASE WHEN demandeur.qualite='particulier' |
1744 |
|
THEN TRIM(CONCAT(demandeur.particulier_nom, ' ', demandeur.particulier_prenom)) |
1745 |
|
ELSE TRIM(CONCAT(demandeur.personne_morale_raison_sociale, ' ', demandeur.personne_morale_denomination)) |
1746 |
|
END as demandeur |
1747 |
|
FROM ".DB_PREFIXE."dossier |
1748 |
|
LEFT JOIN ".DB_PREFIXE."lien_dossier_demandeur |
1749 |
|
ON lien_dossier_demandeur.dossier=dossier.dossier |
1750 |
|
AND lien_dossier_demandeur.petitionnaire_principal IS TRUE |
1751 |
|
LEFT JOIN ".DB_PREFIXE."demandeur |
1752 |
|
ON lien_dossier_demandeur.demandeur=demandeur.demandeur |
1753 |
|
WHERE dossier.dossier ='".$dossier."'"; |
1754 |
|
$demandeur = $this->db->getOne($sql); |
1755 |
|
$this->f->addToLog("get_demandeur() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1756 |
|
database::isError($demandeur); |
1757 |
|
|
1758 |
|
// Résultat retourné |
1759 |
|
return $demandeur; |
1760 |
|
} |
1761 |
|
|
1762 |
|
/** |
1763 |
|
* Récupère la durée de validité du type détaillé du dossier d'autorisation |
1764 |
|
* @param string $dossier_autorisation Identifiant dossier d'autorisation |
1765 |
|
* @return intger Durée de validité |
1766 |
|
*/ |
1767 |
|
function get_duree_validite($dossier_autorisation) { |
1768 |
|
|
1769 |
|
// init de la variable de retour |
1770 |
|
$duree_validite = ""; |
1771 |
|
|
1772 |
|
// Récupération de la duree de validite du dossier d'autorisation |
1773 |
|
$sql = "SELECT duree_validite_parametrage |
1774 |
|
FROM ".DB_PREFIXE."dossier_autorisation_type_detaille |
1775 |
|
LEFT JOIN ".DB_PREFIXE."dossier_autorisation |
1776 |
|
ON dossier_autorisation.dossier_autorisation_type_detaille = dossier_autorisation_type_detaille.dossier_autorisation_type_detaille |
1777 |
|
WHERE dossier_autorisation.dossier_autorisation='".$dossier_autorisation."'"; |
1778 |
|
$duree_validite = $this->db->getOne($sql); |
1779 |
|
$this->f->addToLog("get_duree_validite(): db->getOne(\"".$sql."\");", VERBOSE_MODE); |
1780 |
|
database::isError($duree_validite); |
1781 |
|
|
1782 |
|
// retourne le résultat |
1783 |
|
return $duree_validite; |
1784 |
|
|
1785 |
|
} |
1786 |
|
|
1787 |
}// fin classe |
}// fin classe |
1788 |
?> |
?> |