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é, |
//Si l'utilisateur est un instructeur et le dossier d'instruction est clôturé, |
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; |
$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); |
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*/ |
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 |
$form->setType('amenagement','hidden'); // PC |
469 |
$form->setType('parcelle_lot','hidden'); // PC |
$form->setType('parcelle_lot','hidden'); // PC |
470 |
$form->setType('parcelle_lot_lotissement','hidden'); // PC |
$form->setType('parcelle_lot_lotissement','hidden'); // PC |
473 |
$form->setType('evenement_suivant_tacite','hidden'); |
$form->setType('evenement_suivant_tacite','hidden'); |
474 |
$form->setType('evenement_suivant_tacite_incompletude','hidden'); |
$form->setType('evenement_suivant_tacite_incompletude','hidden'); |
475 |
$form->setType('etat_pendant_incompletude','hidden'); |
$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'); |
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'); |
$form->setType('delai_incompletude','hiddenstatic'); |
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 |
$form->setType('terrain_references_cadastrales','referencescadastralesstatic'); // PC |
584 |
$form->setType('parcelle', 'hidden'); |
$form->setType('parcelle', 'hidden'); |
593 |
$form->setType('shob', 'hidden'); |
$form->setType('shob', 'hidden'); |
594 |
$form->setType('lot', 'hidden'); |
$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 |
|
} |
649 |
if ($validation==0) { |
if ($validation==0) { |
650 |
if ($maj == 0){ |
if ($maj == 0){ |
651 |
//$dossier_cp = $this->f->collectivite["cp"]; |
//$dossier_cp = $this->f->collectivite["cp"]; |
694 |
$contenu[0]=array('Non','Oui'); |
$contenu[0]=array('Non','Oui'); |
695 |
$contenu[1]=array('Non','Oui'); |
$contenu[1]=array('Non','Oui'); |
696 |
$form->setSelect("accord_tacite",$contenu); |
$form->setSelect("accord_tacite",$contenu); |
697 |
// terrain_numero_complement |
|
|
$contenu=array(); |
|
|
$contenu[0]=array('','bis','ter','quater'); |
|
|
$contenu[1]=array('','bis','ter','quater'); |
|
|
$form->setSelect("terrain_numero_complement",$contenu); |
|
698 |
// geom *** a voir |
// geom *** a voir |
699 |
if($maj==1){ //modification |
if($maj==1){ //modification |
700 |
$contenu=array(); |
$contenu=array(); |
734 |
} |
} |
735 |
|
|
736 |
function setLib(&$form,$maj) { |
function setLib(&$form,$maj) { |
737 |
parent::setLib($form,$maj); |
parent::setLib($form,$maj); |
738 |
$form->setLib('geom',''); |
$form->setLib('geom',_('centroide')); |
739 |
$form->setLib('date_limite',_("date limite d'instruction")); |
$form->setLib('date_limite',_("date limite d'instruction")); |
740 |
$form->setLib('delai',_("delai d'instruction")); |
$form->setLib('delai',_("delai d'instruction")); |
741 |
|
$form->setLib('accord_tacite',_("decision tacite")); |
742 |
} |
} |
743 |
|
|
|
function setGroupe(&$form,$maj){ |
|
|
|
|
|
// 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'); |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
744 |
function setOnchange(&$form,$maj){ |
function setOnchange(&$form,$maj){ |
745 |
parent::setOnchange($form,$maj); |
parent::setOnchange($form,$maj); |
746 |
// mise en majuscule |
// mise en majuscule |
758 |
|
|
759 |
function setLayout(&$form, $maj) { |
function setLayout(&$form, $maj) { |
760 |
// |
// |
761 |
$form->setBloc('dossier', 'D', '', ($maj == 3 ? 'col_9':'col_12')); |
$form->setBloc('dossier_libelle', 'D', '', ($maj == 3 ? 'col_9':'col_12')); |
762 |
$form->setBloc('dossier', 'D', '', 'col_9'); |
$form->setBloc('dossier_libelle', 'D', '', 'col_9'); |
763 |
|
|
764 |
$form->setFieldset('dossier', 'D', _("Dossier d'instruction")); |
$form->setFieldset('dossier_libelle', 'D', _("Dossier d'instruction")); |
765 |
$form->setFieldset('autorite_competente', 'F'); |
$form->setFieldset('numero_versement_archive', 'F'); |
766 |
|
|
767 |
$form->setBloc('autorite_competente', 'F'); |
$form->setBloc('numero_versement_archive', 'F'); |
768 |
|
|
769 |
$form->setBloc('date_demande', 'D', '', 'col_3'); |
$form->setBloc('date_demande', 'D', '', 'col_3'); |
770 |
|
|
1480 |
|
|
1481 |
$this->listeDemandeur("dossier", $this->getVal('dossier')); |
$this->listeDemandeur("dossier", $this->getVal('dossier')); |
1482 |
|
|
1483 |
if($maj < 2 AND !$this->correct) { |
if($maj < 2 AND !$this->correct AND !$this->f->isUserQualificateur()) { |
1484 |
$linkable = true; |
$linkable = true; |
1485 |
} else { |
} else { |
1486 |
$linkable = false; |
$linkable = false; |
1648 |
|
|
1649 |
return $donnees_techniques; |
return $donnees_techniques; |
1650 |
} |
} |
1651 |
|
|
1652 |
|
/** |
1653 |
|
* Surcharge du bouton retour afin de retourner sur la recherche de dossiers |
1654 |
|
* d'instruction existant |
1655 |
|
*/ |
1656 |
|
function retour($premier = 0, $recherche = "", $tricol = "") { |
1657 |
|
|
1658 |
|
echo "\n<a class=\"retour\" "; |
1659 |
|
echo "href=\""; |
1660 |
|
// |
1661 |
|
if($this->getParameter("idx_dossier") != "") { |
1662 |
|
echo "tab.php?"; |
1663 |
|
echo "obj=recherche_dossier"; |
1664 |
|
|
1665 |
|
} else { |
1666 |
|
if($this->getParameter("retour")=="form" AND !($this->getParameter("validation")>0 AND $this->getParameter("maj")==2 AND $this->correct)) { |
1667 |
|
echo "form.php?"; |
1668 |
|
} else { |
1669 |
|
echo "tab.php?"; |
1670 |
|
} |
1671 |
|
// Permet de retourner sur la bonne page |
1672 |
|
if (isset($_GET['retourformulaire']) && $_GET['retourformulaire'] != '') { |
1673 |
|
echo "obj=".$_GET['retourformulaire']; |
1674 |
|
} else { |
1675 |
|
echo "obj=".get_class($this); |
1676 |
|
} |
1677 |
|
if($this->getParameter("retour")=="form") { |
1678 |
|
echo "&idx=".$this->getParameter("idx"); |
1679 |
|
echo "&idz=".$this->getParameter("idz"); |
1680 |
|
echo "&action=3"; |
1681 |
|
} |
1682 |
|
} |
1683 |
|
echo "&premier=".$this->getParameter("premier"); |
1684 |
|
echo "&tricol=".$this->getParameter("tricol"); |
1685 |
|
echo "&recherche=".$this->getParameter("recherche"); |
1686 |
|
echo "&selectioncol=".$this->getParameter("selectioncol"); |
1687 |
|
echo "&advs_id=".$this->getParameter("advs_id"); |
1688 |
|
echo "&valide=".$this->getParameter("valide"); |
1689 |
|
// |
1690 |
|
echo "\""; |
1691 |
|
echo ">"; |
1692 |
|
// |
1693 |
|
echo _("Retour"); |
1694 |
|
// |
1695 |
|
echo "</a>\n"; |
1696 |
|
|
1697 |
|
} |
1698 |
|
|
1699 |
|
/** |
1700 |
|
* Permet de modifier le fil d'Ariane |
1701 |
|
* @param string $ent Fil d'Ariane |
1702 |
|
* @param array $val Valeurs de l'objet |
1703 |
|
* @param intger $maj Mode du formulaire |
1704 |
|
*/ |
1705 |
|
function getFormTitle($ent) { |
1706 |
|
|
1707 |
|
// Fil d'Ariane |
1708 |
|
$ent = _("instruction")." -> "._("dossiers d'instruction"); |
1709 |
|
|
1710 |
|
// Si différent de l'ajout |
1711 |
|
if($this->getParameter("maj") != 0) { |
1712 |
|
// Si le champ dossier_libelle existe |
1713 |
|
if (trim($this->getVal("dossier_libelle")) != '') { |
1714 |
|
$ent .= " -> ".strtoupper($this->getVal("dossier_libelle")); |
1715 |
|
} |
1716 |
|
// Si le champ dossier existe |
1717 |
|
if (trim($this->getVal("dossier")) != '') { |
1718 |
|
$demandeur = $this->get_demandeur($this->getVal("dossier")); |
1719 |
|
// Si le demandeur existe |
1720 |
|
if (isset($demandeur) && trim($demandeur) != '') { |
1721 |
|
$ent .= " ".strtoupper($demandeur); |
1722 |
|
} |
1723 |
|
} |
1724 |
|
} |
1725 |
|
|
1726 |
|
// Change le fil d'Ariane |
1727 |
|
return $ent; |
1728 |
|
} |
1729 |
|
|
1730 |
|
/** |
1731 |
|
* Récupère le demandeur du dossier |
1732 |
|
* @return string Identifiant du dossier |
1733 |
|
*/ |
1734 |
|
private function get_demandeur($dossier) { |
1735 |
|
|
1736 |
|
// init de la variable de retour |
1737 |
|
$demandeur = ''; |
1738 |
|
|
1739 |
|
// Requête SQL |
1740 |
|
$sql = "SELECT |
1741 |
|
CASE WHEN demandeur.qualite='particulier' |
1742 |
|
THEN TRIM(CONCAT(demandeur.particulier_nom, ' ', demandeur.particulier_prenom)) |
1743 |
|
ELSE TRIM(CONCAT(demandeur.personne_morale_raison_sociale, ' ', demandeur.personne_morale_denomination)) |
1744 |
|
END as demandeur |
1745 |
|
FROM ".DB_PREFIXE."dossier |
1746 |
|
LEFT JOIN ".DB_PREFIXE."lien_dossier_demandeur |
1747 |
|
ON lien_dossier_demandeur.dossier=dossier.dossier |
1748 |
|
AND lien_dossier_demandeur.petitionnaire_principal IS TRUE |
1749 |
|
LEFT JOIN ".DB_PREFIXE."demandeur |
1750 |
|
ON lien_dossier_demandeur.demandeur=demandeur.demandeur |
1751 |
|
WHERE dossier.dossier ='".$dossier."'"; |
1752 |
|
$demandeur = $this->db->getOne($sql); |
1753 |
|
$this->f->addToLog("get_demandeur() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1754 |
|
database::isError($demandeur); |
1755 |
|
|
1756 |
|
// Résultat retourné |
1757 |
|
return $demandeur; |
1758 |
|
} |
1759 |
|
|
1760 |
|
/** |
1761 |
|
* Récupère la durée de validité du type détaillé du dossier d'autorisation |
1762 |
|
* @param string $dossier_autorisation Identifiant dossier d'autorisation |
1763 |
|
* @return intger Durée de validité |
1764 |
|
*/ |
1765 |
|
function get_duree_validite($dossier_autorisation) { |
1766 |
|
|
1767 |
|
// init de la variable de retour |
1768 |
|
$duree_validite = ""; |
1769 |
|
|
1770 |
|
// Récupération de la duree de validite du dossier d'autorisation |
1771 |
|
$sql = "SELECT duree_validite_parametrage |
1772 |
|
FROM ".DB_PREFIXE."dossier_autorisation_type_detaille |
1773 |
|
LEFT JOIN ".DB_PREFIXE."dossier_autorisation |
1774 |
|
ON dossier_autorisation.dossier_autorisation_type_detaille = dossier_autorisation_type_detaille.dossier_autorisation_type_detaille |
1775 |
|
WHERE dossier_autorisation.dossier_autorisation='".$dossier_autorisation."'"; |
1776 |
|
$duree_validite = $this->db->getOne($sql); |
1777 |
|
$this->f->addToLog("get_duree_validite(): db->getOne(\"".$sql."\");", VERBOSE_MODE); |
1778 |
|
database::isError($duree_validite); |
1779 |
|
|
1780 |
|
// retourne le résultat |
1781 |
|
return $duree_validite; |
1782 |
|
|
1783 |
|
} |
1784 |
|
|
1785 |
}// fin classe |
}// fin classe |
1786 |
?> |
?> |