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 |
// }}} |
// }}} |
205 |
/*Création du numéro de dossier*/ |
/*Création du numéro de dossier*/ |
206 |
$this->valF['dossier'] = $val['dossier_autorisation']."$code$numeroVersion"; |
$this->valF['dossier'] = $val['dossier_autorisation']."$code$numeroVersion"; |
207 |
$this->valF['version'] = $numeroVersion; |
$this->valF['version'] = $numeroVersion; |
208 |
|
|
209 |
|
// Identifiant du dossier d'instruction lisible |
210 |
|
// Ex : DP 013055 13 00002P0 |
211 |
|
$this->valF['dossier_libelle'] = $this->get_dossier_autorisation_libelle($val['dossier_autorisation']).$code.$numeroVersion; |
212 |
} |
} |
213 |
|
|
214 |
/*Récupère la valeur du suffixe d'un dossier_instruction_type*/ |
/*Récupère la valeur du suffixe d'un dossier_instruction_type*/ |
307 |
die($res->getMessage()."erreur ".$sql); |
die($res->getMessage()."erreur ".$sql); |
308 |
|
|
309 |
} |
} |
310 |
|
|
311 |
|
/** |
312 |
|
* Retourne le libellé du dossier d'autorisation |
313 |
|
* @param string $dossier_autorisation Identifiant du dossier d'autorisation |
314 |
|
* @return string Libellé dossier d'autorisation |
315 |
|
*/ |
316 |
|
function get_dossier_autorisation_libelle($dossier_autorisation) { |
317 |
|
|
318 |
|
$dossier_autorisation_libelle = ""; |
319 |
|
|
320 |
|
// Requête SQL |
321 |
|
$sql = "SELECT |
322 |
|
dossier_autorisation_libelle |
323 |
|
FROM |
324 |
|
".DB_PREFIXE."dossier_autorisation |
325 |
|
WHERE |
326 |
|
dossier_autorisation = '$dossier_autorisation'"; |
327 |
|
|
328 |
|
$dossier_autorisation_libelle = $this->db->getOne($sql); |
329 |
|
$this->addToLog("get_dossier_autorisation_libelle(): db->getOne(\"".$sql."\")", VERBOSE_MODE); |
330 |
|
database::isError($dossier_autorisation_libelle); |
331 |
|
|
332 |
|
// Retourne le résultat |
333 |
|
return $dossier_autorisation_libelle; |
334 |
|
} |
335 |
|
|
336 |
function setvalF($val){ |
function setvalF($val){ |
337 |
parent::setvalF($val); |
parent::setvalF($val); |
349 |
unset ($this->valF['etat']); |
unset ($this->valF['etat']); |
350 |
unset ($this->valF['delai']); |
unset ($this->valF['delai']); |
351 |
unset ($this->valF['accord_tacite']); |
unset ($this->valF['accord_tacite']); |
|
unset ($this->valF['types']); |
|
352 |
} |
} |
353 |
unset ($this->valF['avis_decision']); // avis + libelle avis |
unset ($this->valF['avis_decision']); // avis + libelle avis |
354 |
unset ($this->valF['terrain_surface_calcul']); |
unset ($this->valF['terrain_surface_calcul']); |
370 |
if(!isset($this->postedIdDemandeur["petitionnaire_principal"]) OR |
if(!isset($this->postedIdDemandeur["petitionnaire_principal"]) OR |
371 |
empty($this->postedIdDemandeur["petitionnaire_principal"])) { |
empty($this->postedIdDemandeur["petitionnaire_principal"])) { |
372 |
$this->correct = false; |
$this->correct = false; |
373 |
$this->addToMessage("La saisie d'un petitionnaire principal est obligatoire."); |
$this->addToMessage(_("La saisie d'un petitionnaire principal est obligatoire.")); |
374 |
} |
} |
375 |
if($val['parcelle']!="" and $val['sig']!='Oui'){ |
if($val['parcelle']!="" and $val['sig']!='Oui'){ |
376 |
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'])){ |
383 |
|
|
384 |
function setType(&$form,$maj) { |
function setType(&$form,$maj) { |
385 |
parent::setType($form,$maj); |
parent::setType($form,$maj); |
386 |
|
$form->setType('dossier','hidden'); |
387 |
$form->setType('amenagement','hidden'); // PC |
$form->setType('amenagement','hidden'); // PC |
388 |
$form->setType('parcelle_lot','hidden'); // PC |
$form->setType('parcelle_lot','hidden'); // PC |
389 |
$form->setType('parcelle_lot_lotissement','hidden'); // PC |
$form->setType('parcelle_lot_lotissement','hidden'); // PC |
390 |
$form->setType('version','hidden'); // PC |
$form->setType('version','hidden'); // PC |
391 |
|
$form->setType('incompletude','hidden'); |
392 |
|
$form->setType('evenement_suivant_tacite','hidden'); |
393 |
|
$form->setType('evenement_suivant_tacite_incompletude','hidden'); |
394 |
|
$form->setType('etat_pendant_incompletude','hidden'); |
395 |
if ($maj < 2) { //ajouter et modifier |
if ($maj < 2) { //ajouter et modifier |
396 |
// cache |
// cache |
397 |
if($maj==0) $form->setType('dossier', 'hidden'); |
if($maj==0) $form->setType('dossier_libelle', 'hidden'); |
398 |
$form->setType('annee', 'hidden'); |
$form->setType('annee', 'hidden'); |
399 |
$form->setType('parcelle_archive','hidden'); |
$form->setType('parcelle_archive','hidden'); |
400 |
$form->setType('parcelle_lot_archive','hidden'); |
$form->setType('parcelle_lot_archive','hidden'); |
|
$form->setType('objet_dossier','hidden'); // PC |
|
401 |
|
|
402 |
$form->setType('geom1', 'hidden'); |
$form->setType('geom1', 'hidden'); |
403 |
$form->setType('geom', 'geom'); |
$form->setType('geom', 'geom'); |
404 |
$form->setType('servitude', 'hiddenstatic'); |
$form->setType('servitude', 'hiddenstatic'); |
|
|
|
|
//select |
|
|
$form->setType('terrain_numero_complement','select'); |
|
|
|
|
405 |
|
|
406 |
|
|
407 |
// hiddenstatic |
// hiddenstatic |
408 |
if($maj==1) $form->setType('dossier', 'hiddenstatic'); |
if($maj==1) $form->setType('dossier_libelle', 'hiddenstatic'); |
409 |
$form->setType('etat','hiddenstatic'); |
$form->setType('etat','hiddenstatic'); |
410 |
$form->setType('avis_decision','hiddenstatic'); |
$form->setType('avis_decision','hiddenstatic'); |
411 |
|
$form->setType('delai_incompletude','hiddenstatic'); |
412 |
$form->setType('delai','hiddenstatic'); |
$form->setType('delai','hiddenstatic'); |
413 |
$form->setType('terrain_surface_calcul','hiddenstatic'); |
$form->setType('terrain_surface_calcul','hiddenstatic'); |
414 |
$form->setType('shon_calcul','hiddenstatic'); |
$form->setType('shon_calcul','hiddenstatic'); |
415 |
|
|
416 |
$form->setType('accord_tacite','hiddenstatic'); |
$form->setType('accord_tacite','hiddenstatic'); |
|
$form->setType('types', 'hiddenstatic'); // transfert modificatif |
|
417 |
|
|
418 |
|
|
419 |
// hiddenstaticdate |
// hiddenstaticdate |
427 |
$form->setType('date_chantier','hiddenstaticdate'); |
$form->setType('date_chantier','hiddenstaticdate'); |
428 |
$form->setType('date_achevement','hiddenstaticdate'); |
$form->setType('date_achevement','hiddenstaticdate'); |
429 |
$form->setType('date_conformite','hiddenstaticdate'); |
$form->setType('date_conformite','hiddenstaticdate'); |
430 |
|
$form->setType('date_limite_incompletude','hiddenstaticdate'); |
431 |
|
|
432 |
|
$form->setType('date_demande','hiddenstaticdate'); |
433 |
|
$form->setType('date_depot','hiddenstaticdate'); |
434 |
|
$form->setType('date_dernier_depot','hiddenstaticdate'); |
435 |
|
|
436 |
// checkbox |
// checkbox |
437 |
$form->setType('sig','checkbox'); |
$form->setType('sig','checkbox'); |
438 |
|
|
499 |
$form->setType('geom','hidden'); |
$form->setType('geom','hidden'); |
500 |
$form->setType('a_qualifier', 'checkboxstatic'); |
$form->setType('a_qualifier', 'checkboxstatic'); |
501 |
$form->setType('terrain_references_cadastrales','referencescadastralesstatic'); // PC |
$form->setType('terrain_references_cadastrales','referencescadastralesstatic'); // PC |
|
$form->setType('objet_dossier','hidden'); // PC |
|
502 |
$form->setType('parcelle', 'hidden'); |
$form->setType('parcelle', 'hidden'); |
503 |
$form->setType('pos', 'hidden'); |
$form->setType('pos', 'hidden'); |
504 |
$form->setType('sig', 'hidden'); |
$form->setType('sig', 'hidden'); |
515 |
if(!$this->f->getParameter('afficher_division') === 'true') { |
if(!$this->f->getParameter('afficher_division') === 'true') { |
516 |
$form->setType('division', 'hidden'); |
$form->setType('division', 'hidden'); |
517 |
} |
} |
518 |
$form->setType('dossier_autorisation', 'hiddenstatic'); |
$form->setType('dossier_autorisation', 'hidden'); |
519 |
|
$form->setType('dossier_autorisation_libelle', 'hiddenstatic'); |
520 |
$form->setType('dossier_instruction_type', 'selecthiddenstatic'); |
$form->setType('dossier_instruction_type', 'selecthiddenstatic'); |
521 |
// |
// |
522 |
if ($maj == 0) { |
if ($maj == 0) { |
551 |
|
|
552 |
$form->setVal('accord_tacite', 'Non'); |
$form->setVal('accord_tacite', 'Non'); |
553 |
$form->setVal('etat', 'initialiser'); |
$form->setVal('etat', 'initialiser'); |
|
$form->setVal('types', 'Initial'); |
|
554 |
} |
} |
555 |
} |
} |
556 |
} |
} |
579 |
$contenu[0]=array('Non','Oui'); |
$contenu[0]=array('Non','Oui'); |
580 |
$contenu[1]=array('Non','Oui'); |
$contenu[1]=array('Non','Oui'); |
581 |
$form->setSelect("accord_tacite",$contenu); |
$form->setSelect("accord_tacite",$contenu); |
582 |
// terrain_numero_complement |
|
|
$contenu=array(); |
|
|
$contenu[0]=array('','bis','ter','quater'); |
|
|
$contenu[1]=array('','bis','ter','quater'); |
|
|
$form->setSelect("terrain_numero_complement",$contenu); |
|
583 |
// geom *** a voir |
// geom *** a voir |
584 |
if($maj==1){ //modification |
if($maj==1){ //modification |
585 |
$contenu=array(); |
$contenu=array(); |
621 |
function setLib(&$form,$maj) { |
function setLib(&$form,$maj) { |
622 |
parent::setLib($form,$maj); |
parent::setLib($form,$maj); |
623 |
$form->setLib('geom',''); |
$form->setLib('geom',''); |
624 |
|
$form->setLib('date_limite',_("date limite d'instruction")); |
625 |
|
$form->setLib('delai',_("delai d'instruction")); |
626 |
|
$form->setLib('accord_tacite',_("decision tacite")); |
627 |
} |
} |
628 |
|
|
629 |
function setGroupe(&$form,$maj){ |
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'); |
|
630 |
|
|
631 |
// localisation |
// localisation |
632 |
$form->setGroupe('parcelle','D'); |
$form->setGroupe('parcelle','D'); |
661 |
|
|
662 |
function setLayout(&$form, $maj) { |
function setLayout(&$form, $maj) { |
663 |
// |
// |
664 |
$form->setBloc('dossier', 'D', '', ($maj == 3 ? 'col_9':'col_12')); |
$form->setBloc('dossier_libelle', 'D', '', ($maj == 3 ? 'col_9':'col_12')); |
665 |
$form->setBloc('dossier', 'D', '', 'col_9'); |
$form->setBloc('dossier_libelle', 'D', '', 'col_9'); |
666 |
|
|
667 |
$form->setFieldset('dossier', 'D', _("Dossier d'instruction")); |
$form->setFieldset('dossier_libelle', 'D', _("Dossier d'instruction")); |
668 |
$form->setFieldset('autorite_competente', 'F'); |
$form->setFieldset('numero_versement_archive', 'F'); |
669 |
|
|
670 |
$form->setBloc('autorite_competente', 'F'); |
$form->setBloc('numero_versement_archive', 'F'); |
671 |
|
|
672 |
$form->setBloc('date_demande', 'D', '', 'col_3'); |
$form->setBloc('date_demande', 'D', '', 'col_3'); |
673 |
|
|
683 |
$form->setBloc('a_qualifier', 'F'); |
$form->setBloc('a_qualifier', 'F'); |
684 |
$form->setBloc('a_qualifier', 'F'); |
$form->setBloc('a_qualifier', 'F'); |
685 |
// |
// |
686 |
$form->setBloc('objet_dossier', 'D', '', 'col_12'); |
$form->setBloc('date_complet', 'D', '', 'col_12'); |
687 |
|
|
688 |
$form->setFieldset('date_complet', 'D', _('Instruction'), 'col_12'); |
$form->setFieldset('date_complet', 'D', _('Instruction'), 'col_12'); |
689 |
|
|
690 |
|
$form->setBloc('date_complet', 'D', '', 'col_4'); |
691 |
|
$form->setBloc('date_limite_incompletude', 'F'); |
692 |
|
|
693 |
|
$form->setBloc('date_rejet', 'D', '', 'col_4'); |
694 |
|
$form->setBloc('delai_incompletude', 'F'); |
695 |
|
|
696 |
|
$form->setBloc('etat', 'D', '', 'col_4'); |
697 |
|
$form->setBloc('date_conformite', 'F'); |
698 |
|
|
699 |
$form->setFieldset('date_conformite','F',''); |
$form->setFieldset('date_conformite','F',''); |
700 |
|
|
701 |
$form->setBloc('date_conformite', 'F'); |
$form->setBloc('date_conformite', 'F'); |
1075 |
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 |
1076 |
WHERE dossier.dossier = '".$idxDossier."'"; |
WHERE dossier.dossier = '".$idxDossier."'"; |
1077 |
$res = $this -> db -> getOne($sql); |
$res = $this -> db -> getOne($sql); |
1078 |
$this->f->isDatabaseError(); |
$this->f->addToLog("getDATDCode() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1079 |
$this->addToLog($sql); |
if ( database::isError($res)){ |
1080 |
|
die(); |
1081 |
|
} |
1082 |
return $res; |
return $res; |
1083 |
} |
} |
1084 |
|
|
1312 |
$res = $db->query($sql); |
$res = $db->query($sql); |
1313 |
// Logger |
// Logger |
1314 |
$this->f->addToLog("supprimer(): db->query(\"".$sql."\");", VERBOSE_MODE); |
$this->f->addToLog("supprimer(): db->query(\"".$sql."\");", VERBOSE_MODE); |
1315 |
$this->f->isDatabaseError(); |
if ( database::isError($res)){ |
1316 |
|
die(); |
1317 |
|
} |
1318 |
|
|
1319 |
} |
} |
1320 |
|
|
1342 |
} |
} |
1343 |
|
|
1344 |
/** |
/** |
1345 |
* 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 |
1346 |
* liés au dossier d'autorisation |
* liée passée en paramètre |
1347 |
**/ |
* |
1348 |
|
* @param string $from Table liée : "demande", "dossier", dossier_autorisation" |
1349 |
|
* @param string $id Identifiant (clé primaire de la table liée en question) |
1350 |
|
*/ |
1351 |
function listeDemandeur($from, $id) { |
function listeDemandeur($from, $id) { |
1352 |
// Récupération des demandeurs de la base |
// Récupération des demandeurs de la base |
1353 |
$sql = "SELECT demandeur.demandeur, |
$sql = "SELECT demandeur.demandeur, |
1358 |
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
1359 |
WHERE ".$from." = '".$id."'"; |
WHERE ".$from." = '".$id."'"; |
1360 |
$res = $this->f->db->query($sql); |
$res = $this->f->db->query($sql); |
1361 |
$this->f->addToLog("listeDemandeur() : ".$sql); |
$this->f->addToLog("listeDemandeur(): db->query(\"".$sql."\")", VERBOSE_MODE); |
1362 |
$this->f->isDatabaseError($res); |
if ( database::isError($res)){ |
1363 |
// Stoquage du résultat dans un tableau |
die(); |
1364 |
|
} |
1365 |
|
// Stockage du résultat dans un tableau |
1366 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
1367 |
if ($row['petitionnaire_principal'] == 't' AND |
if ($row['petitionnaire_principal'] == 't' AND |
1368 |
$row['type_demandeur']=="petitionnaire") { |
$row['type_demandeur']=="petitionnaire") { |
1487 |
echo "</fieldset>"; |
echo "</fieldset>"; |
1488 |
echo "</div>"; |
echo "</div>"; |
1489 |
} |
} |
1490 |
|
|
1491 |
|
/** |
1492 |
|
* Retourne le statut du dossier |
1493 |
|
* @return string Le statut du dossier d'instruction |
1494 |
|
*/ |
1495 |
|
function getStatut(){ |
1496 |
|
|
1497 |
|
$statut = ''; |
1498 |
|
|
1499 |
|
$etat = $this->getVal("etat"); |
1500 |
|
//Si l'état du dossier d'instruction n'est pas vide |
1501 |
|
if ( $etat != '' ){ |
1502 |
|
|
1503 |
|
$sql = "SELECT statut |
1504 |
|
FROM ".DB_PREFIXE."etat |
1505 |
|
WHERE etat ='".$etat."'"; |
1506 |
|
$statut = $this->db->getOne($sql); |
1507 |
|
$this->f->addToLog("getStatut() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1508 |
|
if ( database::isError($statut)){ |
1509 |
|
die(); |
1510 |
|
} |
1511 |
|
} |
1512 |
|
return $statut; |
1513 |
|
} |
1514 |
|
|
1515 |
|
/** |
1516 |
|
* Retourne l'identifiant du rapport d'instruction lié du dossier |
1517 |
|
* @return string L'identifiant du rapport d'instruction lié du dossier |
1518 |
|
*/ |
1519 |
|
function getRapportInstruction(){ |
1520 |
|
|
1521 |
|
$rapport_instruction = ''; |
1522 |
|
|
1523 |
|
$sql = "SELECT rapport_instruction |
1524 |
|
FROM ".DB_PREFIXE."rapport_instruction |
1525 |
|
WHERE dossier_instruction ='".$this->getVal($this->clePrimaire)."'"; |
1526 |
|
$rapport_instruction = $this->db->getOne($sql); |
1527 |
|
$this->f->addToLog("getStatut() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1528 |
|
if ( database::isError($rapport_instruction)){ |
1529 |
|
die(); |
1530 |
|
} |
1531 |
|
|
1532 |
|
return $rapport_instruction; |
1533 |
|
} |
1534 |
|
|
1535 |
|
/** |
1536 |
|
* Retourne l'identifiant des données techniques liées du dossier |
1537 |
|
* @return string L'identifiant des données techniques liées du dossier |
1538 |
|
*/ |
1539 |
|
function getDonneesTechniques(){ |
1540 |
|
|
1541 |
|
$donnees_techniques = ''; |
1542 |
|
|
1543 |
|
$sql = "SELECT donnees_techniques |
1544 |
|
FROM ".DB_PREFIXE."donnees_techniques |
1545 |
|
WHERE dossier_instruction ='".$this->getVal($this->clePrimaire)."'"; |
1546 |
|
$donnees_techniques = $this->db->getOne($sql); |
1547 |
|
$this->f->addToLog("getStatut() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1548 |
|
if ( database::isError($donnees_techniques)){ |
1549 |
|
die(); |
1550 |
|
} |
1551 |
|
|
1552 |
|
return $donnees_techniques; |
1553 |
|
} |
1554 |
|
|
1555 |
|
/** |
1556 |
|
* Surcharge du bouton retour afin de retourner sur la recherche de dossiers |
1557 |
|
* d'instruction existant |
1558 |
|
*/ |
1559 |
|
function retour($premier = 0, $recherche = "", $tricol = "") { |
1560 |
|
|
1561 |
|
echo "\n<a class=\"retour\" "; |
1562 |
|
echo "href=\""; |
1563 |
|
// |
1564 |
|
if($this->getParameter("idx_dossier") != "") { |
1565 |
|
echo "tab.php?"; |
1566 |
|
echo "obj=recherche_dossier"; |
1567 |
|
|
1568 |
|
} else { |
1569 |
|
if($this->getParameter("retour")=="form" AND !($this->getParameter("validation")>0 AND $this->getParameter("maj")==2 AND $this->correct)) { |
1570 |
|
echo "form.php?"; |
1571 |
|
} else { |
1572 |
|
echo "tab.php?"; |
1573 |
|
} |
1574 |
|
echo "obj=".get_class($this); |
1575 |
|
if($this->getParameter("retour")=="form") { |
1576 |
|
echo "&idx=".$this->getParameter("idx"); |
1577 |
|
echo "&idz=".$this->getParameter("idz"); |
1578 |
|
echo "&action=3"; |
1579 |
|
} |
1580 |
|
} |
1581 |
|
echo "&premier=".$this->getParameter("premier"); |
1582 |
|
echo "&tricol=".$this->getParameter("tricol"); |
1583 |
|
echo "&recherche=".$this->getParameter("recherche"); |
1584 |
|
echo "&selectioncol=".$this->getParameter("selectioncol"); |
1585 |
|
echo "&advs_id=".$this->getParameter("advs_id"); |
1586 |
|
echo "&valide=".$this->getParameter("valide"); |
1587 |
|
// |
1588 |
|
echo "\""; |
1589 |
|
echo ">"; |
1590 |
|
// |
1591 |
|
echo _("Retour"); |
1592 |
|
// |
1593 |
|
echo "</a>\n"; |
1594 |
|
|
1595 |
|
} |
1596 |
|
|
1597 |
|
/** |
1598 |
|
* Permet de modifier le fil d'Ariane |
1599 |
|
* @param string $ent Fil d'Ariane |
1600 |
|
* @param array $val Valeurs de l'objet |
1601 |
|
* @param intger $maj Mode du formulaire |
1602 |
|
*/ |
1603 |
|
function setEnt($ent, $val = array(), $maj) { |
1604 |
|
|
1605 |
|
// Fil d'Ariane |
1606 |
|
$ent = _("instruction")." -> "._("dossiers d'instruction"); |
1607 |
|
|
1608 |
|
// Si différent de l'ajout |
1609 |
|
if($maj != 0) { |
1610 |
|
// Si le champ dossier_libelle existe |
1611 |
|
if (isset($val["dossier_libelle"]) && trim($val["dossier_libelle"]) != '') { |
1612 |
|
$ent .= " -> ".strtoupper($val["dossier_libelle"]); |
1613 |
|
} |
1614 |
|
// Si le champ dossier existe |
1615 |
|
if (isset($val["dossier"]) && trim($val["dossier"]) != '') { |
1616 |
|
$demandeur = $this->get_demandeur($val["dossier"]); |
1617 |
|
// Si le demandeur existe |
1618 |
|
if (isset($demandeur) && trim($demandeur) != '') { |
1619 |
|
$ent .= " ".strtoupper($demandeur); |
1620 |
|
} |
1621 |
|
} |
1622 |
|
} |
1623 |
|
|
1624 |
|
// Change le fil d'Ariane |
1625 |
|
$this->ent .= $ent; |
1626 |
|
} |
1627 |
|
|
1628 |
|
/** |
1629 |
|
* Récupère le demandeur du dossier |
1630 |
|
* @return string Identifiant du dossier |
1631 |
|
*/ |
1632 |
|
private function get_demandeur($dossier) { |
1633 |
|
|
1634 |
|
// init de la variable de retour |
1635 |
|
$demandeur = ''; |
1636 |
|
|
1637 |
|
// Requête SQL |
1638 |
|
$sql = "SELECT |
1639 |
|
CASE WHEN demandeur.qualite='particulier' |
1640 |
|
THEN TRIM(CONCAT(demandeur.particulier_nom, ' ', demandeur.particulier_prenom)) |
1641 |
|
ELSE TRIM(CONCAT(demandeur.personne_morale_raison_sociale, ' ', demandeur.personne_morale_denomination)) |
1642 |
|
END as demandeur |
1643 |
|
FROM ".DB_PREFIXE."dossier |
1644 |
|
LEFT JOIN ".DB_PREFIXE."lien_dossier_demandeur |
1645 |
|
ON lien_dossier_demandeur.dossier=dossier.dossier |
1646 |
|
AND lien_dossier_demandeur.petitionnaire_principal IS TRUE |
1647 |
|
LEFT JOIN ".DB_PREFIXE."demandeur |
1648 |
|
ON lien_dossier_demandeur.demandeur=demandeur.demandeur |
1649 |
|
WHERE dossier.dossier ='".$dossier."'"; |
1650 |
|
$demandeur = $this->db->getOne($sql); |
1651 |
|
$this->f->addToLog("get_demandeur() : db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1652 |
|
database::isError($demandeur); |
1653 |
|
|
1654 |
|
// Résultat retourné |
1655 |
|
return $demandeur; |
1656 |
|
} |
1657 |
|
|
1658 |
}// fin classe |
}// fin classe |
1659 |
?> |
?> |