3 |
//gen openMairie le 10/02/2011 20:39 |
//gen openMairie le 10/02/2011 20:39 |
4 |
|
|
5 |
require_once ("../gen/obj/dossier.class.php"); |
require_once ("../gen/obj/dossier.class.php"); |
6 |
|
require_once("../services/outgoing/messageenqueuer.php"); |
7 |
|
|
8 |
class dossier extends dossier_gen { |
class dossier extends dossier_gen { |
9 |
|
|
25 |
var $aff_localisation = "collapsible"; |
var $aff_localisation = "collapsible"; |
26 |
var $aff_description = "startClosed"; |
var $aff_description = "startClosed"; |
27 |
var $aff_amenagement = "startClosed"; |
var $aff_amenagement = "startClosed"; |
28 |
|
var $dossier_instruction_type; |
29 |
|
|
30 |
function dossier($id,&$db,$DEBUG) { |
function dossier($id,&$db,$DEBUG) { |
31 |
$this->constructeur($id,$db,$DEBUG); |
$this->constructeur($id,$db,$DEBUG); |
32 |
} // fin constructeur |
} // fin constructeur |
33 |
|
|
34 |
|
/*Mutateur pour ma variable dossier_instruction_type*/ |
35 |
|
public function getDossierInstructionType(){ |
36 |
|
return $this->dossier_instruction_type; |
37 |
|
} |
38 |
|
public function setDossierInstructionType($dossier_instruction_type){ |
39 |
|
$this->dossier_instruction_type = $dossier_instruction_type; |
40 |
|
} |
41 |
|
|
42 |
|
// {{{ Gestion de la confidentialité des données spécifiques |
43 |
|
|
44 |
|
/** |
45 |
|
* Surcharge pour gérer les actions disponibles dans le portlet |
46 |
|
*/ |
47 |
|
function checkAccessibility() { |
48 |
|
// |
49 |
|
parent::checkAccessibility(); |
50 |
|
// Si l'utilisateur est un intructeur qui en correspond pas à la |
51 |
|
// division du dossier |
52 |
|
if ($this->f->isUserInstructeur() |
53 |
|
&& isset($this->f->om_utilisateur["division"]) |
54 |
|
&& $this->f->om_utilisateur["division"] != $this->getDivisionFromDossier()) { |
55 |
|
// |
56 |
|
$this->actions_sup = array(); |
57 |
|
$this->setParameter("actions", array()); |
58 |
|
} |
59 |
|
|
60 |
|
/* |
61 |
|
* Si une action 'rapport_instruction' est présente et |
62 |
|
* que le le rapport d'instruction existe déjà, lien vers l'objet en modification |
63 |
|
* sinon, lien vers un script qui va créer le nouvel objet et |
64 |
|
* rediriger l'utilisateur vers l'objet en modification. |
65 |
|
*/ |
66 |
|
|
67 |
|
// Vérifie si un rapport d'instruction existe déjà |
68 |
|
if ( isset($this->actions_sup["rapport_instruction"]) ) { |
69 |
|
|
70 |
|
// Requête de vérification |
71 |
|
$sql = "SELECT |
72 |
|
rapport_instruction |
73 |
|
FROM |
74 |
|
".DB_PREFIXE."rapport_instruction |
75 |
|
WHERE |
76 |
|
dossier_instruction = '".$this->getParameter('idx')."'"; |
77 |
|
|
78 |
|
// Ajout au log |
79 |
|
$this->f->addToLog("checkAccessibility(): db->query(\"".$sql."\");", VERBOSE_MODE); |
80 |
|
|
81 |
|
// Exécution de la requête |
82 |
|
$res=$this->f->db->query($sql); |
83 |
|
$this->f->isDatabaseError($res); |
84 |
|
|
85 |
|
/* |
86 |
|
* S'il n'y a pas de rapport d'instruction, redirection vers un script |
87 |
|
* de création, puis vers l'objet. |
88 |
|
* */ |
89 |
|
if ( $res->numrows() == 0 ){ |
90 |
|
|
91 |
|
$this->actions_sup["rapport_instruction"]["lien"] = |
92 |
|
'../app/rapport_instruction.php?idx='; |
93 |
|
} |
94 |
|
// S'il a déjà été créé, lien vers l'objet en modification |
95 |
|
elseif ( $res->numrows() > 0 ){ |
96 |
|
|
97 |
|
$row = & $res->fetchRow(DB_FETCHMODE_ASSOC); |
98 |
|
$this->actions_sup["rapport_instruction"]["lien"] = |
99 |
|
'../scr/form.php?obj=rapport_instruction&action=1&idx='. |
100 |
|
$row['rapport_instruction'].'&idD='; |
101 |
|
} |
102 |
|
|
103 |
|
} |
104 |
|
} |
105 |
|
|
106 |
|
/** |
107 |
|
* Cette methode est à surcharger elle permet de tester dans chaque classe |
108 |
|
* des droits des droits spécifiques en fonction des données |
109 |
|
*/ |
110 |
|
function canAccess() { |
111 |
|
// Si l'utilisateur est un intructeur qui ne correspond pas à la |
112 |
|
// division du dossier |
113 |
|
if ($this->f->isUserInstructeur() |
114 |
|
&& $this->f->om_utilisateur["division"] != $this->getDivisionFromDossier() |
115 |
|
&& $this->getParameter("maj") != 3) { |
116 |
|
// |
117 |
|
return false; |
118 |
|
} |
119 |
|
// |
120 |
|
return true; |
121 |
|
} |
122 |
|
|
123 |
|
/** |
124 |
|
* Cette méthode permet de récupérer la division d'un dossier |
125 |
|
*/ |
126 |
|
function getDivisionFromDossier() { |
127 |
|
// |
128 |
|
if (!isset($this->val[array_search("dossier", $this->champs)])) { |
129 |
|
return NULL; |
130 |
|
} |
131 |
|
// |
132 |
|
$sql = "select division from ".DB_PREFIXE."dossier "; |
133 |
|
$sql .= " where dossier='".$this->val[array_search("dossier", $this->champs)]."'"; |
134 |
|
// |
135 |
|
$division = $this->db->getOne($sql); |
136 |
|
$this->addToLog("getDivisionFromDossier(): db->getone(\"".$sql."\")", VERBOSE_MODE); |
137 |
|
database::isError($division); |
138 |
|
// |
139 |
|
return $division; |
140 |
|
} |
141 |
|
|
142 |
|
// }}} |
143 |
|
/* |
144 |
|
* Ajoute un numéro au dossier |
145 |
|
* |
146 |
|
*/ |
147 |
function setValFAjout($val = array()) { |
function setValFAjout($val = array()) { |
148 |
// Cle primaire |
|
149 |
$lettre=$this->f->collectivite["lettre"]; |
/*Récupération de la lettre associé au type de dossier d'instruction*/ |
150 |
$numero_unique = $this->f->collectivite["numero_unique"]; |
$code = $this->getCode($this->getDossierInstructionType()); |
151 |
if($numero_unique==1){ |
|
152 |
// numero unique (voir dyn/var.inc) |
/* Récupération de la valeur du suffixe ce dossier_instruction_type */ |
153 |
$temp=$this->$db->nextId(DB_PREFIXE.$this->table); |
$suffixe = $this->getSuffixe($this->getDossierInstructionType()); |
154 |
}else{ |
|
155 |
// numero suivant nature |
/*S'il est à TRUE, on récupère le numéro de version du dossier d'autorisation*/ |
156 |
$temp=$this->db->nextId(DB_PREFIXE."dossier_".$val['nature']); |
$numeroVersion = ""; |
157 |
} |
if ( $suffixe == 't' ){ |
158 |
$temp=str_pad($temp,4,"0", STR_PAD_LEFT); |
|
159 |
$this->valF['dossier'] = $this->valF['nature'].$this->valF['annee']. |
$numeroVersion = $this->getNumeroVersion($val['dossier_autorisation']); |
160 |
$lettre.$temp; |
|
161 |
|
/* Incrémentation du numéro de version */ |
162 |
|
if ( is_numeric($numeroVersion) or $numeroVersion == -1 ){ |
163 |
|
|
164 |
|
$this->incrementNumeroVersion($val['dossier_autorisation'], ++$numeroVersion); |
165 |
|
} |
166 |
|
} |
167 |
|
|
168 |
|
/*Création du numéro de dossier*/ |
169 |
|
$this->valF['dossier'] = $val['dossier_autorisation']."$code$numeroVersion"; |
170 |
} |
} |
171 |
|
|
172 |
|
/*Récupère la valeur du suffixe d'un dossier_instruction_type*/ |
173 |
|
function getSuffixe($dossierInstructionType){ |
174 |
|
|
175 |
|
$suffixe = ""; |
176 |
|
|
177 |
|
$sql = "SELECT |
178 |
|
suffixe |
179 |
|
FROM |
180 |
|
".DB_PREFIXE."dossier_instruction_type |
181 |
|
WHERE |
182 |
|
dossier_instruction_type = $dossierInstructionType"; |
183 |
|
|
184 |
|
$this->addToLog("getSuffixe(): db->query(\"".$sql."\")", VERBOSE_MODE); |
185 |
|
$res = $this->db->query($sql); |
186 |
|
if (database :: isError($res)) |
187 |
|
die($res->getMessage()."erreur ".$sql); |
188 |
|
|
189 |
|
if ( $res->numRows() > 0 ){ |
190 |
|
|
191 |
|
$row = $res->fetchRow(DB_FETCHMODE_ASSOC); |
192 |
|
$suffixe = $row['suffixe']; |
193 |
|
} |
194 |
|
|
195 |
|
return $suffixe; |
196 |
|
} |
197 |
|
|
198 |
|
/*Récupère dans la table de paramètrage la lettre correspondant |
199 |
|
* au dossier_instruction_type |
200 |
|
*/ |
201 |
|
function getCode($dossierInstructionType){ |
202 |
|
|
203 |
|
$code = ""; |
204 |
|
|
205 |
|
$sql = "SELECT |
206 |
|
code |
207 |
|
FROM |
208 |
|
".DB_PREFIXE."dossier_instruction_type |
209 |
|
WHERE |
210 |
|
dossier_instruction_type = $dossierInstructionType"; |
211 |
|
|
212 |
|
$this->addToLog("getCode(): db->query(\"".$sql."\")", VERBOSE_MODE); |
213 |
|
$res = $this->db->query($sql); |
214 |
|
if (database :: isError($res)) |
215 |
|
die($res->getMessage()."erreur ".$sql); |
216 |
|
|
217 |
|
if ( $res->numRows() > 0 ){ |
218 |
|
|
219 |
|
$row = $res->fetchRow(DB_FETCHMODE_ASSOC); |
220 |
|
$code = $row['code']; |
221 |
|
} |
222 |
|
|
223 |
|
return $code; |
224 |
|
} |
225 |
|
|
226 |
|
/*Récupère le numéro de version d'un dossier_autorisation*/ |
227 |
|
function getNumeroVersion($dossierAutorisation){ |
228 |
|
|
229 |
|
$numeroVersion = ""; |
230 |
|
|
231 |
|
$sql = "SELECT |
232 |
|
numero_version |
233 |
|
FROM |
234 |
|
".DB_PREFIXE."dossier_autorisation |
235 |
|
WHERE |
236 |
|
dossier_autorisation = '$dossierAutorisation'"; |
237 |
|
|
238 |
|
$this->addToLog("getNumeroVersion(): db->query(\"".$sql."\")", VERBOSE_MODE); |
239 |
|
$res = $this->db->query($sql); |
240 |
|
if (database :: isError($res)) |
241 |
|
die($res->getMessage()."erreur ".$sql); |
242 |
|
|
243 |
|
if ( $res->numRows() > 0 ){ |
244 |
|
|
245 |
|
$row = $res->fetchRow(DB_FETCHMODE_ASSOC); |
246 |
|
$numeroVersion = $row['numero_version']; |
247 |
|
} |
248 |
|
|
249 |
|
return $numeroVersion; |
250 |
|
} |
251 |
|
|
252 |
|
/*Incrémente le numéro de version du dossier*/ |
253 |
|
function incrementNumeroVersion($dossierAutorisation, $nouveauNumeroVersion) { |
254 |
|
|
255 |
|
$valF = array ( |
256 |
|
"numero_version" => $nouveauNumeroVersion |
257 |
|
); |
258 |
|
|
259 |
|
$res = $this->db->autoExecute(DB_PREFIXE."dossier_autorisation", |
260 |
|
$valF, |
261 |
|
DB_AUTOQUERY_UPDATE, |
262 |
|
"dossier_autorisation = '$dossierAutorisation'"); |
263 |
|
|
264 |
|
if (database :: isError($res)) |
265 |
|
die($res->getMessage()."erreur ".$sql); |
266 |
|
|
267 |
|
} |
268 |
|
|
269 |
function setvalF($val){ |
function setvalF($val){ |
270 |
parent::setvalF($val); |
parent::setvalF($val); |
271 |
// enlever les valeurs a ne pas saisir -> recherche en trigger ajouter et modifier |
// enlever les valeurs a ne pas saisir -> recherche en trigger ajouter et modifier |
294 |
unset ($this->valF['date_conformite']); |
unset ($this->valF['date_conformite']); |
295 |
} |
} |
296 |
|
|
297 |
|
/*Vérification des données saisies*/ |
298 |
function verifier($val,&$db,$DEBUG){ |
function verifier($val,&$db,$DEBUG){ |
299 |
parent::verifier($val,$db,$DEBUG); |
parent::verifier($val,$db,$DEBUG); |
300 |
if($val['parcelle']!="" and $val['sig']!='Oui'){ |
if($val['parcelle']!="" and $val['sig']!='Oui'){ |
427 |
// cache |
// cache |
428 |
if($maj==0) $form->setType('dossier', 'hidden'); |
if($maj==0) $form->setType('dossier', 'hidden'); |
429 |
$form->setType('annee', 'hidden'); |
$form->setType('annee', 'hidden'); |
|
$form->setType('nature', 'select'); |
|
430 |
$form->setType('parcelle_archive','hidden'); |
$form->setType('parcelle_archive','hidden'); |
431 |
$form->setType('parcelle_lot_archive','hidden'); |
$form->setType('parcelle_lot_archive','hidden'); |
432 |
$form->setType('objet_dossier','hidden'); // PC |
$form->setType('objet_dossier','hidden'); // PC |
497 |
$form->setType('temp3',$temp3_type); |
$form->setType('temp3',$temp3_type); |
498 |
$form->setType('temp4',$temp4_type); |
$form->setType('temp4',$temp4_type); |
499 |
$form->setType('temp5',$temp5_type); |
$form->setType('temp5',$temp5_type); |
500 |
|
$form->setType('a_qualifier', 'checkbox'); |
501 |
|
} |
502 |
|
if ($maj == 1) { |
503 |
|
// |
504 |
|
if ($this->f->isAccredited("dossier_modifier_instructeur")) { |
505 |
|
$form->setType('instructeur', 'select'); |
506 |
|
} else { |
507 |
|
$form->setType('instructeur', 'selecthiddenstatic'); |
508 |
|
} |
509 |
|
// |
510 |
|
if($this->f->getParameter('afficher_division') === 'true') { |
511 |
|
// |
512 |
|
if ($this->f->isAccredited("dossier_modifier_division")) { |
513 |
|
$form->setType('division', 'select'); |
514 |
|
} else { |
515 |
|
$form->setType('division', 'selecthiddenstatic'); |
516 |
|
} |
517 |
|
} else { |
518 |
|
$form->setType('division', 'hidden'); |
519 |
|
} |
520 |
} |
} |
521 |
if($maj == 3) { |
if($maj == 3) { |
522 |
$form->setType('annee', 'hidden'); |
$form->setType('annee', 'hidden'); |
|
$form->setType('nature', 'selectstatic'); |
|
523 |
$form->setType('temp1','hidden'); |
$form->setType('temp1','hidden'); |
524 |
$form->setType('temp2','hidden'); |
$form->setType('temp2','hidden'); |
525 |
$form->setType('temp3','hidden'); |
$form->setType('temp3','hidden'); |
529 |
$form->setType('parcelle_lot_archive','hidden'); |
$form->setType('parcelle_lot_archive','hidden'); |
530 |
$form->setType('geom1','hidden'); |
$form->setType('geom1','hidden'); |
531 |
$form->setType('geom','hidden'); |
$form->setType('geom','hidden'); |
532 |
|
$form->setType('a_qualifier', 'checkboxstatic'); |
533 |
} |
} |
534 |
if($this->f->getParameter('afficher_division')==='true') { |
// |
535 |
$form->setType('division','hiddenstatic'); |
if(!$this->f->getParameter('afficher_division') === 'true') { |
536 |
} else { |
$form->setType('division', 'hidden'); |
537 |
$form->setType('division','hidden'); |
} |
538 |
|
$form->setType('dossier_autorisation', 'hiddenstatic'); |
539 |
|
$form->setType('dossier_instruction_type', 'selectstatic'); |
540 |
|
// |
541 |
|
if ($maj == 0) { |
542 |
|
$form->setType('dossier_autorisation', 'select'); |
543 |
|
} |
544 |
|
// On cache enjeu_ERP si l'option n'est pas activée |
545 |
|
if($this->f->getParameter('option_ERP') != 'true') { |
546 |
|
$form->setType('erp', 'hidden'); |
547 |
|
$form->setType('enjeu_erp', 'hidden'); |
548 |
} |
} |
|
|
|
|
/* Gestion des droits pour l'ajout forcé d'un instructeur, si le profil est 5, c'est un administrateur */ |
|
|
if ( !$this->f->isAccredited("dossier_modifier_instructeur") ) |
|
|
$form->setType('instructeur', 'hidden'); |
|
549 |
} |
} |
550 |
|
|
551 |
function setVal(&$form,$maj,$validation){ |
function setVal(&$form,$maj,$validation){ |
554 |
if ($maj == 0){ |
if ($maj == 0){ |
555 |
//$dossier_cp = $this->f->collectivite["cp"]; |
//$dossier_cp = $this->f->collectivite["cp"]; |
556 |
//$dossier_ville = $this->f->collectivite["ville"]; |
//$dossier_ville = $this->f->collectivite["ville"]; |
|
//$form->setVal('nature', $this->nature); |
|
557 |
|
|
558 |
$form->setVal('annee', date('y')); |
$form->setVal('annee', date('y')); |
559 |
$form->setVal('date_demande', date('Y-m-d')); |
$form->setVal('date_demande', date('Y-m-d')); |
659 |
$contenu[0]=array("dossier",$this->getParameter("idx")); |
$contenu[0]=array("dossier",$this->getParameter("idx")); |
660 |
$form->setSelect('geom',$contenu); |
$form->setSelect('geom',$contenu); |
661 |
} |
} |
662 |
|
// arrondissement recherche anvancée |
663 |
|
$this->init_select($form, $db, $maj, $debug, "arrondissement", |
664 |
|
$sql_arrondissement, $sql_arrondissement_by_id, false); |
665 |
|
// dossier_autorisation_type_detaille recherche anvancée |
666 |
|
$this->init_select($form, $db, $maj, $debug, "dossier_autorisation_type_detaille", |
667 |
|
$sql_dossier_autorisation_type_detaille, $sql_dossier_autorisation_type_detaille_by_id, false); |
668 |
/* |
/* |
669 |
* Affichage de données dans le select de la parcelle |
* Affichage de données dans le select de la parcelle |
670 |
* */ |
* */ |
697 |
} |
} |
698 |
|
|
699 |
function setGroupe(&$form,$maj){ |
function setGroupe(&$form,$maj){ |
700 |
If ($maj==0){ |
//If ($maj==0){ |
701 |
$form->setGroupe('date_demande','D'); |
// $form->setGroupe('date_demande','D'); |
702 |
$form->setGroupe('date_depot','G'); |
// $form->setGroupe('date_depot','G'); |
703 |
$form->setGroupe('division','F'); |
// $form->setGroupe('division','F'); |
704 |
}else{ |
//}else{ |
705 |
$form->setGroupe('dossier','D'); |
// $form->setGroupe('dossier','D'); |
706 |
$form->setGroupe('nature','G'); |
// $form->setGroupe('annee','G'); |
707 |
$form->setGroupe('annee','G'); |
// $form->setGroupe('date_demande','G'); |
708 |
$form->setGroupe('date_demande','G'); |
// $form->setGroupe('date_depot','G'); |
709 |
$form->setGroupe('date_depot','G'); |
// $form->setGroupe('division','F'); |
710 |
$form->setGroupe('division','F'); |
//} |
|
} |
|
711 |
$form->setGroupe('demandeur_categorie','D'); |
$form->setGroupe('demandeur_categorie','D'); |
712 |
$form->setGroupe('demandeur_civilite','G'); |
$form->setGroupe('demandeur_civilite','G'); |
713 |
$form->setGroupe('demandeur_nom','F'); |
$form->setGroupe('demandeur_nom','F'); |
823 |
$form->setOnchange('terrain_surface','VerifNumdec(this)'); |
$form->setOnchange('terrain_surface','VerifNumdec(this)'); |
824 |
} |
} |
825 |
|
|
826 |
function setRegroupe(&$form,$maj){ |
function setLayout(&$form, $maj) { |
827 |
// depot |
// |
828 |
If ($maj==0){ |
$form->setBloc('dossier', 'D', '', ($maj == 3 ? 'col_9':'col_12')); |
829 |
$form->setRegroupe('date_demande','D',_("Depot"),$this->aff_depot ); |
$form->setBloc('dossier', 'D', '', 'col_9'); |
830 |
} |
$form->setFieldset('dossier', 'D', _("Dossier d'instruction")); |
831 |
If ($maj==1){ |
$form->setFieldset('autorite_competente', 'F'); |
832 |
$form->setRegroupe('dossier','D',_("Depot"), $this->aff_depot); |
$form->setBloc('autorite_competente', 'F'); |
833 |
$form->setRegroupe('date_demande','G',''); |
$form->setBloc('date_demande', 'D', '', 'col_3'); |
834 |
} |
$form->setFieldset('date_demande', 'D', _("Depot")); |
835 |
$form->setRegroupe('date_depot','G',''); |
$form->setFieldset('date_depot', 'F'); |
836 |
$form->setRegroupe('division','F',''); |
$form->setFieldset('enjeu_urba', 'D', _("Enjeu")); |
837 |
|
$form->setFieldset('enjeu_erp', 'F'); |
838 |
|
$form->setBloc('enjeu_erp', 'F'); |
839 |
|
$form->setBloc('enjeu_erp', 'F'); |
840 |
|
// |
841 |
|
$form->setBloc('objet_dossier', 'D', '', 'col_12'); |
842 |
|
// |
843 |
|
$form->setFieldset('date_complet', 'D', _('Instruction'), 'col_12'); |
844 |
|
$form->setRegroupe('date_conformite','F',''); |
845 |
|
// |
846 |
|
$form->setBloc('terrain_superficie', 'F'); |
847 |
|
|
848 |
|
} |
849 |
|
|
850 |
|
function setRegroupe(&$form,$maj) { |
851 |
|
//// depot |
852 |
|
//If ($maj==0){ |
853 |
|
// $form->setRegroupe('date_demande','D',_("Depot"),$this->aff_depot ); |
854 |
|
//} |
855 |
|
//If ($maj==1){ |
856 |
|
// $form->setRegroupe('dossier','D',_("Depot"), $this->aff_depot); |
857 |
|
// $form->setRegroupe('date_demande','G',''); |
858 |
|
//} |
859 |
|
//$form->setRegroupe('date_depot','G',''); |
860 |
|
//$form->setRegroupe('division','F',''); |
861 |
|
|
862 |
// travaux |
// travaux |
863 |
$form->setRegroupe('architecte','D',_('Architecte')." / "._("Travaux"), $this->aff_travaux); |
$form->setRegroupe('architecte','D',_('Architecte')." / "._("Travaux"), $this->aff_travaux); |
864 |
$form->setRegroupe('architecte_nom','G',''); |
$form->setRegroupe('architecte_nom','G',''); |
865 |
$form->setRegroupe('travaux','G',''); |
$form->setRegroupe('travaux','G',''); |
866 |
$form->setRegroupe('travaux_complement','F',''); |
$form->setRegroupe('travaux_complement','F',''); |
867 |
|
|
868 |
// instruction |
//// instruction |
869 |
$form->setRegroupe('date_complet','D',_('Instruction'), $this->aff_instruction); |
//$form->setRegroupe('date_complet','D',_('Instruction'), $this->aff_instruction); |
870 |
$form->setRegroupe('date_rejet','G',''); |
//$form->setRegroupe('date_rejet','G',''); |
871 |
$form->setRegroupe('date_notification_delai','G',''); |
//$form->setRegroupe('date_notification_delai','G',''); |
872 |
$form->setRegroupe('delai','G',''); |
//$form->setRegroupe('delai','G',''); |
873 |
$form->setRegroupe('date_limite','G','Decision '); |
//$form->setRegroupe('date_limite','G','Decision '); |
874 |
$form->setRegroupe('accord_tacite','G',''); |
//$form->setRegroupe('accord_tacite','G',''); |
875 |
$form->setRegroupe('etat','G',''); |
//$form->setRegroupe('etat','G',''); |
876 |
$form->setRegroupe('date_decision','G',''); |
//$form->setRegroupe('date_decision','G',''); |
877 |
$form->setRegroupe('avis_decision','G',''); |
//$form->setRegroupe('avis_decision','G',''); |
878 |
$form->setRegroupe('date_validite','G',''); |
//$form->setRegroupe('date_validite','G',''); |
879 |
$form->setRegroupe('types','G',''); |
//$form->setRegroupe('types','G',''); |
880 |
$form->setRegroupe('date_chantier','G',''); |
//$form->setRegroupe('date_chantier','G',''); |
881 |
$form->setRegroupe('date_achevement','G',''); |
//$form->setRegroupe('date_achevement','G',''); |
882 |
$form->setRegroupe('date_conformite','F',''); |
//$form->setRegroupe('date_conformite','F',''); |
883 |
|
|
884 |
// demandeur |
// demandeur |
885 |
$form->setRegroupe('demandeur_categorie','D',_('Demandeur'), $this->aff_demandeur); |
$form->setRegroupe('demandeur_categorie','D',_('Demandeur'), $this->aff_demandeur); |
943 |
$form->setRegroupe('amenagement','D',_('Amenagement'), $this->aff_amenagement); |
$form->setRegroupe('amenagement','D',_('Amenagement'), $this->aff_amenagement); |
944 |
$form->setRegroupe('parcelle_lot','G',''); |
$form->setRegroupe('parcelle_lot','G',''); |
945 |
$form->setRegroupe('parcelle_lot_lotissement','F',''); |
$form->setRegroupe('parcelle_lot_lotissement','F',''); |
946 |
|
|
947 |
} |
} |
948 |
|
|
|
|
|
|
|
|
949 |
/* ============================================================= |
/* ============================================================= |
950 |
* fonction trigger relative a la connexion SIG |
* fonction trigger relative a la connexion SIG |
951 |
* $sig = 1 dans dyn/var.inc |
* $sig = 1 dans dyn/var.inc |
952 |
|
* utilisé aussi pour envoyer une message au service REST d'ERP |
953 |
* =============================================================== |
* =============================================================== |
954 |
*/ |
*/ |
955 |
|
|
965 |
$this->addToMessage("<br>"._("Parcelle non renseignee dans dossier")." ".$id." <br>"); |
$this->addToMessage("<br>"._("Parcelle non renseignee dans dossier")." ".$id." <br>"); |
966 |
|
|
967 |
} |
} |
968 |
|
|
969 |
|
|
970 |
|
if ($this->f->getParameter('option_erp') != "") { |
971 |
|
// envoi du message a ERP en cas d'un depot du dossier dat |
972 |
|
if ($this->getDATDCode($this->valF['dossier']) == |
973 |
|
$this->f->getParameter('erp_depot_dossier_dat')) { |
974 |
|
$msgenque = new MessageEnqueuer(); |
975 |
|
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
976 |
|
$msgenque->enqueueMessage($msgenque::$ERP_DEPOT_DOSSIER_DAT); |
977 |
|
} |
978 |
|
|
979 |
|
// envoi du message a ERP en cas d'une demande d'ouverture DAT |
980 |
|
if ($this->getDATDCode($this->valF['dossier']) == |
981 |
|
$this->f->getParameter('erp_demande_ouverture_dat')) { |
982 |
|
$msgenque = new MessageEnqueuer(); |
983 |
|
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
984 |
|
$msgenque->enqueueMessage($msgenque::$ERP_DEMANDE_OUVERTURE_DAT); |
985 |
|
} |
986 |
|
|
987 |
|
if ($this->valF['erp'] === true) { |
988 |
|
// envoi du message a ERP en cas d'annulation d'une demande |
989 |
|
if ($this->getDATDCode($this->valF['dossier']) == |
990 |
|
$this->f->getParameter('erp_annulation_demande')) { |
991 |
|
$msgenque = new MessageEnqueuer(); |
992 |
|
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
993 |
|
$msgenque->enqueueMessage($msgenque::$ERP_ANNULATION_DEMANDE); |
994 |
|
} |
995 |
|
|
996 |
|
// envoi du message a ERP en cas d'ouverture d'un dossier PC "rattache" |
997 |
|
// au dossier DAACT |
998 |
|
if ($this->getDATDCode($this->valF['dossier']) == |
999 |
|
$this->f->getParameter('erp_demande_ouverture_pc_daact')) { |
1000 |
|
$msgenque = new MessageEnqueuer(); |
1001 |
|
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
1002 |
|
$msgenque->enqueueMessage($msgenque::$ERP_DEMANDE_OUVERTURE_PC); |
1003 |
|
} |
1004 |
|
} |
1005 |
|
} // fin de if ($this->f->getParameter('option_erp') != "") |
1006 |
} |
} |
1007 |
|
|
1008 |
/* |
/* |
1009 |
* Calcul l'identifiant du quartier et d'un arrondissement d'une parcelle |
* Calcul l'identifiant du quartier et d'un arrondissement d'une parcelle |
1010 |
* */ |
* */ |
1011 |
function getQuartierArrondissement($parcelle, &$quartier, &$arrondissement, &$db) { |
function getQuartierArrondissement($parcelle) { |
1012 |
|
|
1013 |
$parcelle = trim($parcelle); |
$parcelle = trim($parcelle); |
1014 |
$quartier = ''; |
$quartier = ''; |
1015 |
|
|
1016 |
/*Code impots*/ |
/*Récupère le code impot du quartier dans la parcelle*/ |
1017 |
for ( $i = 0 ; $i < strlen($parcelle) ; $i++ ) |
for ( $i = 0 ; $i < strlen($parcelle) ; $i++ ){ |
1018 |
if (is_numeric($parcelle[$i]) ) |
|
1019 |
|
if (is_numeric($parcelle[$i]) ){ |
1020 |
|
|
1021 |
$quartier .= $parcelle[$i]; |
$quartier .= $parcelle[$i]; |
1022 |
else |
} |
1023 |
|
else{ |
1024 |
|
|
1025 |
break; |
break; |
1026 |
|
} |
1027 |
|
} |
1028 |
|
|
1029 |
if ( $quartier !== '' ){ |
if ( $quartier !== '' ){ |
1030 |
|
|
1032 |
$sql = "SELECT |
$sql = "SELECT |
1033 |
quartier, arrondissement |
quartier, arrondissement |
1034 |
FROM |
FROM |
1035 |
quartier |
".DB_PREFIXE."quartier |
1036 |
WHERE |
WHERE |
1037 |
code_impots='$quartier'"; |
code_impots='$quartier'"; |
1038 |
|
|
1039 |
$res = $db->query($sql); |
$this->addToLog("getQuartierArrondissement(parcelle) : db->query(\"$sql\")", VERBOSE_MODE); |
1040 |
|
$res = $this->db->query($sql); |
1041 |
if (database :: isError($res)) |
if (database :: isError($res)) |
1042 |
die($res->getMessage()."erreur ".$sql); |
die($res->getMessage()."erreur ".$sql); |
1043 |
|
|
1044 |
if ( $res->numRows() > 0 ){ |
if ( $res->numRows() > 0 ){ |
1045 |
|
|
1046 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
return $res->fetchRow(DB_FETCHMODE_ASSOC); |
|
|
|
|
$quartier = $row['quartier']; |
|
|
$arrondissement = $row['arrondissement']; |
|
|
} |
|
1047 |
} |
} |
1048 |
} |
} |
1049 |
|
|
1050 |
|
return NULL; |
1051 |
} |
} |
1052 |
|
|
1053 |
/* |
/* |
1068 |
/* |
/* |
1069 |
* Retourne l'intructeur correspondant le mieux à la parcelle |
* Retourne l'intructeur correspondant le mieux à la parcelle |
1070 |
* */ |
* */ |
1071 |
function getInstructeur( $quartier, $arrondissement, $section, $nature, &$db) { |
function getInstructeurDivision( $quartier, $arrondissement, $section, $dossier_autorisation) { |
1072 |
|
|
1073 |
|
$quartier = ( $quartier == NULL ) ? -1 : $quartier; |
1074 |
|
$arrondissement = ( $arrondissement == NULL ) ? -1 : $arrondissement; |
1075 |
|
|
1076 |
|
/*Récupération du dossier_autorisation_type_detaille concerné par le $dossier_autorisation*/ |
1077 |
$sql = " |
$sql = " |
1078 |
SELECT |
SELECT |
1079 |
instructeur, section, quartier, arrondissement, nature |
dossier_autorisation_type_detaille |
1080 |
FROM |
FROM |
1081 |
lien_localisation_nature l |
".DB_PREFIXE."dossier_autorisation |
1082 |
WHERE |
WHERE |
1083 |
( nature IS NULL AND arrondissement IS NULL AND quartier IS NULL AND section IS NULL ) OR |
dossier_autorisation = '$dossier_autorisation'"; |
|
( nature IS NULL AND arrondissement IS NULL AND quartier IS NULL AND section = '$section' ) OR |
|
|
( nature IS NULL AND arrondissement IS NULL AND quartier = $quartier AND section IS NULL ) OR |
|
|
( nature IS NULL AND arrondissement IS NULL AND quartier = $quartier AND section = '$section' ) OR |
|
|
( nature IS NULL AND arrondissement = $arrondissement AND quartier IS NULL AND section IS NULL ) OR |
|
|
( nature IS NULL AND arrondissement = $arrondissement AND quartier IS NULL AND section = '$section' ) OR |
|
|
( nature IS NULL AND arrondissement = $arrondissement AND quartier = $quartier AND section IS NULL ) OR |
|
|
( nature IS NULL AND arrondissement = $arrondissement AND quartier = $quartier AND section = '$section' ) OR |
|
|
( nature = '$nature' AND arrondissement IS NULL AND quartier IS NULL AND section IS NULL ) OR |
|
|
( nature = '$nature' AND arrondissement IS NULL AND quartier IS NULL AND section = '$section' ) OR |
|
|
( nature = '$nature' AND arrondissement IS NULL AND quartier = $quartier AND section IS NULL ) OR |
|
|
( nature = '$nature' AND arrondissement IS NULL AND quartier = $quartier AND section = '$section' ) OR |
|
|
( nature = '$nature' AND arrondissement = $arrondissement AND quartier IS NULL AND section IS NULL ) OR |
|
|
( nature = '$nature' AND arrondissement = $arrondissement AND quartier IS NULL AND section = '$section' ) OR |
|
|
( nature = '$nature' AND arrondissement = $arrondissement AND quartier = $quartier AND section IS NULL ) OR |
|
|
( nature = '$nature' AND arrondissement = $arrondissement AND quartier = $quartier AND section = '$section' ) |
|
|
ORDER BY section, quartier, arrondissement, nature |
|
|
LIMIT 1 |
|
|
"; |
|
|
|
|
|
$res = $db->query($sql); |
|
|
if (database :: isError($res)) |
|
|
die($res->getMessage()."erreur ".$sql); |
|
1084 |
|
|
1085 |
if ( $res->numRows() > 0 ){ |
$this->addToLog("getInstructeurDivision : db->query(\"$sql\")", VERBOSE_MODE); |
1086 |
$row=& $res->fetchRow(DB_FETCHMODE_ASSOC); |
$resDATD = $this->db->query($sql); |
1087 |
return $row['instructeur']; |
if (database :: isError($resDATD)) |
1088 |
} |
die($resDATD->getMessage()."erreur ".$sql); |
1089 |
|
|
1090 |
|
if ( $resDATD->numRows() > 0 ){ |
1091 |
|
$rowDATD = $resDATD->fetchRow(DB_FETCHMODE_ASSOC); |
1092 |
|
|
1093 |
|
$sql = " |
1094 |
|
SELECT |
1095 |
|
instructeur, section, quartier, arrondissement, dossier_autorisation_type_detaille |
1096 |
|
FROM |
1097 |
|
".DB_PREFIXE."affectation_automatique l |
1098 |
|
WHERE |
1099 |
|
( dossier_autorisation_type_detaille IS NULL AND arrondissement IS NULL AND quartier IS NULL AND section IS NULL ) OR |
1100 |
|
( dossier_autorisation_type_detaille IS NULL AND arrondissement IS NULL AND quartier IS NULL AND section = '$section' ) OR |
1101 |
|
( dossier_autorisation_type_detaille IS NULL AND arrondissement IS NULL AND quartier = $quartier AND section IS NULL ) OR |
1102 |
|
( dossier_autorisation_type_detaille IS NULL AND arrondissement IS NULL AND quartier = $quartier AND section = '$section' ) OR |
1103 |
|
( dossier_autorisation_type_detaille IS NULL AND arrondissement = $arrondissement AND quartier IS NULL AND section IS NULL ) OR |
1104 |
|
( dossier_autorisation_type_detaille IS NULL AND arrondissement = $arrondissement AND quartier IS NULL AND section = '$section' ) OR |
1105 |
|
( dossier_autorisation_type_detaille IS NULL AND arrondissement = $arrondissement AND quartier = $quartier AND section IS NULL ) OR |
1106 |
|
( dossier_autorisation_type_detaille IS NULL AND arrondissement = $arrondissement AND quartier = $quartier AND section = '$section' ) OR |
1107 |
|
( dossier_autorisation_type_detaille = ".$rowDATD['dossier_autorisation_type_detaille']." AND arrondissement IS NULL AND quartier IS NULL AND section IS NULL ) OR |
1108 |
|
( dossier_autorisation_type_detaille = ".$rowDATD['dossier_autorisation_type_detaille']." AND arrondissement IS NULL AND quartier IS NULL AND section = '$section' ) OR |
1109 |
|
( dossier_autorisation_type_detaille = ".$rowDATD['dossier_autorisation_type_detaille']." AND arrondissement IS NULL AND quartier = $quartier AND section IS NULL ) OR |
1110 |
|
( dossier_autorisation_type_detaille = ".$rowDATD['dossier_autorisation_type_detaille']." AND arrondissement IS NULL AND quartier = $quartier AND section = '$section' ) OR |
1111 |
|
( dossier_autorisation_type_detaille = ".$rowDATD['dossier_autorisation_type_detaille']." AND arrondissement = $arrondissement AND quartier IS NULL AND section IS NULL ) OR |
1112 |
|
( dossier_autorisation_type_detaille = ".$rowDATD['dossier_autorisation_type_detaille']." AND arrondissement = $arrondissement AND quartier IS NULL AND section = '$section' ) OR |
1113 |
|
( dossier_autorisation_type_detaille = ".$rowDATD['dossier_autorisation_type_detaille']." AND arrondissement = $arrondissement AND quartier = $quartier AND section IS NULL ) OR |
1114 |
|
( dossier_autorisation_type_detaille = ".$rowDATD['dossier_autorisation_type_detaille']." AND arrondissement = $arrondissement AND quartier = $quartier AND section = '$section' ) |
1115 |
|
ORDER BY section, quartier, arrondissement, dossier_autorisation_type_detaille |
1116 |
|
LIMIT 1 |
1117 |
|
"; |
1118 |
|
|
1119 |
|
$this->addToLog("getInstructeurDivision : db->query(\"$sql\")", VERBOSE_MODE); |
1120 |
|
$res = $this->db->query($sql); |
1121 |
|
if (database :: isError($res)) |
1122 |
|
die($res->getMessage()."erreur ".$sql); |
1123 |
|
|
1124 |
|
if ( $res->numRows() > 0 ){ |
1125 |
|
|
1126 |
|
$row = $res->fetchRow(DB_FETCHMODE_ASSOC); |
1127 |
|
|
1128 |
|
$sql = "SELECT division FROM ".DB_PREFIXE."instructeur WHERE instructeur = ".$row['instructeur']; |
1129 |
|
$res = $this->db->query($sql); |
1130 |
|
if (database :: isError($res)) |
1131 |
|
die($res->getMessage()."erreur ".$sql); |
1132 |
|
|
1133 |
|
if ( $res->numRows() > 0 ){ |
1134 |
|
|
1135 |
|
$rowT=& $res->fetchRow(DB_FETCHMODE_ASSOC); |
1136 |
|
$row['division'] = $rowT['division']; |
1137 |
|
} |
1138 |
|
|
1139 |
|
return $row; |
1140 |
|
} |
1141 |
|
} |
1142 |
|
|
1143 |
return NULL; |
return NULL; |
1144 |
} |
} |
1145 |
|
|
1150 |
*/ |
*/ |
1151 |
|
|
1152 |
function triggerajouter($id,&$db,$val,$DEBUG) { |
function triggerajouter($id,&$db,$val,$DEBUG) { |
1153 |
|
// |
1154 |
|
$this->addToLog("triggerajouter() : start", EXTRA_VERBOSE_MODE); |
1155 |
|
|
1156 |
|
// Initialisation des variables nécessaires à l'affectation automatique |
1157 |
|
$quartier = NULL; |
1158 |
|
$arrondissement = NULL; |
1159 |
|
$section = NULL; |
1160 |
|
$instructeur = NULL; |
1161 |
|
|
1162 |
|
// Si la parcelle n'est pas vide alors on récupère la section, le |
1163 |
|
// quartier et l'arrondissement |
1164 |
|
if ($val['parcelle'] != '') { |
1165 |
|
// Cette méthode récupère l'arrondissement et le quartier associé à une parcelle |
1166 |
|
$quartierArrondissement = $this->getQuartierArrondissement($val['parcelle']); |
1167 |
|
if ( $quartierArrondissement!= NULL ){ |
1168 |
|
|
1169 |
/*Localisation*/ |
$quartier = $quartierArrondissement['quartier']; |
1170 |
$quartier = 'NULL'; |
$arrondissement = $quartierArrondissement['arrondissement']; |
1171 |
$arrondissement = 'NULL'; |
} |
1172 |
$section = 'NULL' ; |
// Si il n'y a pas d'arrondissement alors on vide le quartier |
1173 |
|
if ( strcmp($arrondissement,'') == 0 ) { |
1174 |
if($val['parcelle']!=''){ |
|
1175 |
|
$arrondissement = NULL; |
1176 |
$this->getQuartierArrondissement($val['parcelle'], $quartier, $arrondissement, $db); |
$quartier = NULL; |
1177 |
|
} |
1178 |
if ( strcmp($arrondissement,'NULL') == 0 ) |
// On récupère la section |
|
$quartier = 'NULL'; |
|
|
|
|
1179 |
$section = $this->getSection($val['parcelle']); |
$section = $this->getSection($val['parcelle']); |
|
|
|
|
|
|
1180 |
} |
} |
1181 |
|
|
1182 |
/*Instructeur*/ |
// Si aucun instructeur n'est saisi et que la dossier_autorisation_type_detaille n'est pas vide |
1183 |
if ( ( empty($this->valF['instructeur']) || $this->valF['instructeur'] == '' ) && $val['nature'] != '' ){ |
// alors on récupère l'instructeur et la division depuis l'affectation |
1184 |
|
if ( ( empty($this->valF['instructeur']) || $this->valF['instructeur'] == '' ) && $val['dossier_autorisation'] != '' ) { |
|
$instructeur = $this->getInstructeur($quartier, $arrondissement, $section, $val['nature'], $db); |
|
1185 |
|
|
1186 |
if ( $instructeur != NULL ) |
// |
1187 |
|
$instructeurDivision = $this->getInstructeurDivision($quartier, $arrondissement, $section, $val['dossier_autorisation']); |
1188 |
|
if ( $instructeurDivision != NULL ){ |
1189 |
|
|
1190 |
|
$instructeur = $instructeurDivision['instructeur']; |
1191 |
|
$division = $instructeurDivision['division']; |
1192 |
|
} |
1193 |
|
|
1194 |
|
if ( $instructeur != NULL ){ |
1195 |
|
|
1196 |
$this->valF['instructeur'] = $instructeur; |
$this->valF['instructeur'] = $instructeur; |
1197 |
else { |
$this->valF['division'] = $division; |
1198 |
if ( is_numeric($_SESSION['profil']) && $_SESSION['profil'] == 5 ) |
} else { |
1199 |
|
if ($this->f->isAccredited("dossier_modifier_instructeur")) { |
1200 |
$this->addToMessage("<br/> "._("Pensez a assigner un instructeur a ce dossier.")." <br/>"); |
$this->addToMessage("<br/> "._("Pensez a assigner un instructeur a ce dossier.")." <br/>"); |
1201 |
else |
} else { |
1202 |
$this->addToMessage("<br/> "._("Aucun instructeur compatible avec ce dossier trouve, contactez votre administrateur afin d'en assigner un a ce dossier.")." <br/>"); |
$this->addToMessage("<br/> "._("Aucun instructeur compatible avec ce dossier trouve, contactez votre administrateur afin d'en assigner un a ce dossier.")." <br/>"); |
1203 |
|
} |
1204 |
} |
} |
1205 |
|
} else { |
1206 |
|
$this->addToMessage("<br/> "._("Aucun instructeur compatible avec ce dossier trouve, contactez votre administrateur afin d'en assigner un a ce dossier.")." <br/>"); |
1207 |
} |
} |
1208 |
|
// |
1209 |
else |
$this->addToLog("triggerajouter() : end", EXTRA_VERBOSE_MODE); |
|
$this->addToMessage("<br/> "._("Aucun instructeur compatible avec ce dossier trouve, contactez votre administrateur afin d'en assigner un a ce dossier.")." <br/>"); |
|
1210 |
} |
} |
1211 |
|
|
1212 |
function triggermodifierapres($id,&$db,$val,$DEBUG) { |
function triggermodifierapres($id,&$db,$val,$DEBUG) { |
1226 |
} |
} |
1227 |
$this->addToMessage("<br>"._("Parcelle ou parcelle_lot non renseignee dans dossier")." ".$id." <br>"); |
$this->addToMessage("<br>"._("Parcelle ou parcelle_lot non renseignee dans dossier")." ".$id." <br>"); |
1228 |
} |
} |
1229 |
} |
} |
1230 |
|
|
1231 |
|
// verification si envoi vers ERP est active |
1232 |
|
if ($this->f->getParameter('option_erp') != "") { |
1233 |
|
if ($this->val[array_search('a_qualifier', $this->champs)] == 't' |
1234 |
|
&& $this->valF['a_qualifier'] === false) { |
1235 |
|
|
1236 |
|
// envoi du message "ERP Qualifie" pour un dossier DAT qui a besoin |
1237 |
|
// de la qualification URBA |
1238 |
|
if ($this->getDATDCode($this->valF['dossier']) == |
1239 |
|
$this->f->getParameter('erp_nature_dat')) { |
1240 |
|
$msgenque = new MessageEnqueuer(); |
1241 |
|
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
1242 |
|
$msgenque->setCompetence($this->valF['autorite_competente']); |
1243 |
|
$msgenque->setContraintePlu($this->valF['servitude']); |
1244 |
|
$msgenque->setReferenceCadastrale( |
1245 |
|
$this->getReferenceCadastrale($this->valF['dossier'])); |
1246 |
|
$msgenque->enqueueMessage($msgenque::$ERP_QUALIFIE); |
1247 |
|
} |
1248 |
|
|
1249 |
|
// envoi des messages a ERP en cas du dossier PC traite par URBA, et |
1250 |
|
// qui etait classifie come ERP |
1251 |
|
if ($this->getDATDCode($this->valF['dossier']) == |
1252 |
|
$this->f->getParameter('erp_dossier_nature_pc') |
1253 |
|
&& $this->valF['erp'] == true) { |
1254 |
|
$msgenque = new MessageEnqueuer(); |
1255 |
|
$msgenque->setDossierInstructionIdentifier($this->valF['dossier']); |
1256 |
|
$msgenque->enqueueMessage($msgenque::$ERP_DEMANDE_COMPLETUDE_PC); |
1257 |
|
$msgenque->enqueueMessage($msgenque::$ERP_DEMANDE_QUALIFICATION_PC); |
1258 |
|
} |
1259 |
|
} |
1260 |
|
} // fin de if($this->f->getParameter('option_erp')) |
1261 |
|
} |
1262 |
|
|
1263 |
|
/** |
1264 |
|
* Retourne le type de dossier d'autorisation du dossier courant : |
1265 |
|
* - dossier_autorisation_type_detaille.code |
1266 |
|
**/ |
1267 |
|
function getDATDCode($idxDossier) { |
1268 |
|
$sql = "SELECT dossier_autorisation_type_detaille.code |
1269 |
|
FROM ".DB_PREFIXE."dossier_autorisation_type_detaille |
1270 |
|
INNER JOIN ".DB_PREFIXE."dossier_autorisation |
1271 |
|
ON dossier_autorisation_type_detaille.dossier_autorisation_type_detaille = |
1272 |
|
dossier_autorisation.dossier_autorisation_type_detaille |
1273 |
|
INNER JOIN ".DB_PREFIXE."dossier ON dossier.dossier_autorisation = dossier_autorisaiton.dossier_autorisation |
1274 |
|
WHERE dossier.dossier = ".$idxDossier; |
1275 |
|
$res = $db -> getOne($sql); |
1276 |
|
$this->f->isDatabaseError(); |
1277 |
|
return $res; |
1278 |
|
} |
1279 |
|
|
1280 |
|
|
1281 |
|
/** |
1282 |
|
* Retourne la reference cadastrale de la demande attache a un dossier ERP |
1283 |
|
* specifique |
1284 |
|
* @param string $dossier L'identifiant du dossier |
1285 |
|
* @return string|null La reference cadastrale si elle est trouve, |
1286 |
|
* sinon NULL. En cas d'erreur de la BD, l'execution s'arrete. |
1287 |
|
*/ |
1288 |
|
function getReferenceCadastrale($dossier) { |
1289 |
|
$sql = "SELECT terrain_references_cadastrales FROM ".DB_PREFIXE."demande WHERE dossier_instruction = '" . $dossier . "'"; |
1290 |
|
$res = $this->db->limitquery($sql, 0, 1); |
1291 |
|
$this->addToLog("getReferenceCadastrale(): db->limitquery(\"". |
1292 |
|
str_replace(",",", ",$sql)."\", 0, 1);", VERBOSE_MODE); |
1293 |
|
// Si une erreur survient on die |
1294 |
|
if (database::isError($res, true)) { |
1295 |
|
// Appel de la methode de recuperation des erreurs |
1296 |
|
$this->erreur_db($res->getDebugInfo(), $res->getMessage(), 'demande'); |
1297 |
|
} |
1298 |
|
// retourne la nature du dossier |
1299 |
|
while ($row =& $res->fetchRow()) { |
1300 |
|
return $row[0]; |
1301 |
|
} |
1302 |
|
// la nature n'etait pas trouve, ce qui ne devrait pas se passer |
1303 |
|
return NULL; |
1304 |
} |
} |
1305 |
|
|
1306 |
|
|
1307 |
function sig_parametre(&$db){ |
function sig_parametre(&$db){ |
1308 |
if (file_exists ("../dyn/var.inc")) |
if (file_exists ("../dyn/var.inc")) |