81 |
} |
} |
82 |
|
|
83 |
/** |
/** |
|
* Méthode permettant de vérifier si un autre dossier d'instruction est en cour |
|
|
* pour le même dossier d'autorisation. |
|
|
*/ |
|
|
function autreDossierEnCour() { |
|
|
|
|
|
$idx_dossier = $this->getParameter("idx_dossier"); |
|
|
|
|
|
// Lorsqu'on se trouve sur un dossier existant |
|
|
if(isset($idx_dossier) AND $idx_dossier != "") { |
|
|
|
|
|
// Si on a pas encore défini si un autre dossier est en cours |
|
|
if(!isset($this->autreDossierEnCour)) { |
|
|
|
|
|
if(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php")) |
|
|
include ("../sql/".$this->db->phptype."/".$this->table.".form.inc.php"); |
|
|
elseif(file_exists ("../sql/".$this->db->phptype."/".$this->table.".form.inc")) |
|
|
include ("../sql/".$this->db->phptype."/".$this->table.".form.inc"); |
|
|
$request = str_replace('<idx>', $idx_dossier, |
|
|
$sql_autreDossierEnCour); |
|
|
|
|
|
$nbDossier = $this->db->getOne($request); |
|
|
$this->f->addToLog("db->getone(\"".$request."\");", VERBOSE_MODE); |
|
|
$this->f->isDatabaseError($nbDossier); |
|
|
// Si un dossier est en cour return true |
|
|
if($nbDossier>0) { |
|
|
|
|
|
$this->autreDossierEnCour = true; |
|
|
} else { |
|
|
|
|
|
$this->autreDossierEnCour = false; |
|
|
} |
|
|
|
|
|
} |
|
|
} else { |
|
|
$this->autreDossierEnCour = false; |
|
|
} |
|
|
|
|
|
return $this->autreDossierEnCour; |
|
|
} |
|
|
|
|
|
/** |
|
84 |
* Configuration des select |
* Configuration des select |
85 |
*/ |
*/ |
86 |
function setSelect(&$form, $maj,&$db,$debug) { |
function setSelect(&$form, $maj,&$db,$debug) { |
99 |
|
|
100 |
// Ajout de filtre sur la requête (initial) |
// Ajout de filtre sur la requête (initial) |
101 |
if(isset($idx_dossier) AND $idx_dossier != "") { |
if(isset($idx_dossier) AND $idx_dossier != "") { |
102 |
$sql_demande_type .= " WHERE demande_nature = 2 "; |
$sql_demande_type .= " WHERE demande_type.demande_nature = 2 "; |
103 |
|
|
104 |
|
// ajout du numéro de dossier existant pour tester l'état du DA |
105 |
|
$sql_demande_type .= "AND dossier.dossier = '".$idx_dossier."' "; |
106 |
} else { |
} else { |
107 |
$sql_demande_type .= " WHERE demande_nature = 1 "; |
$sql_demande_type .= " WHERE demande_type.demande_nature = 1 "; |
108 |
} |
} |
109 |
if(isset($_POST["dossier_autorisation_type_detaille"]) AND $_POST["dossier_autorisation_type_detaille"] != "") { |
if(isset($_POST["dossier_autorisation_type_detaille"]) AND $_POST["dossier_autorisation_type_detaille"] != "") { |
110 |
$datd = $_POST["dossier_autorisation_type_detaille"]; |
$datd = $_POST["dossier_autorisation_type_detaille"]; |
111 |
} |
} |
112 |
// Ajout de filtre sur la requête (dossier_autorisation_type_detaille) |
// Ajout de filtre sur la requête (dossier_autorisation_type_detaille) |
113 |
if(isset($datd) AND $datd != "") { |
if(isset($datd) AND $datd != "") { |
114 |
$sql_demande_type .= " AND dossier_autorisation_type_detaille = ".$datd; |
$sql_demande_type .= " AND demande_type.dossier_autorisation_type_detaille = ".$datd; |
115 |
} else { |
} else { |
116 |
$sql_demande_type .= " AND dossier_autorisation_type_detaille = ".$this->getVal("dossier_autorisation_type_detaille"); |
$datd = $this->getVal("dossier_autorisation_type_detaille"); |
117 |
|
if ($datd != "") { |
118 |
|
$sql_demande_type .= " AND demande_type.dossier_autorisation_type_detaille = ".$datd; |
119 |
|
} |
120 |
} |
} |
121 |
|
|
122 |
$res = $db->query($sql_demande_type); |
$res = $db->query($sql_demande_type); |
131 |
|
|
132 |
$k=1; |
$k=1; |
133 |
while($row =& $res->fetchRow()){ |
while($row =& $res->fetchRow()){ |
|
$display = true; |
|
134 |
|
|
135 |
// Vérification des contraintes |
$contenu[0][$k] = $row[0]; |
136 |
if($row[2] != "") { |
$contenu[1][$k] = $row[1]; |
137 |
foreach(explode(";", $row[2]) as $meth) { |
$k++; |
|
if(method_exists($this, $row[2])) { |
|
|
// Si une des contrainte est validée on affiche pas l'option |
|
|
if($this->$row[2]() === true) { |
|
|
$display = false; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// Affichage ou non de l'option |
|
|
if($display) { |
|
|
$contenu[0][$k] = $row[0]; |
|
|
$contenu[1][$k] = $row[1]; |
|
|
$k++; |
|
|
} |
|
138 |
} |
} |
139 |
|
|
140 |
$form->setSelect("demande_type", $contenu); |
$form->setSelect("demande_type", $contenu); |
242 |
$valAuto['exercice']=NULL; |
$valAuto['exercice']=NULL; |
243 |
$valAuto['insee']=NULL; |
$valAuto['insee']=NULL; |
244 |
$valAuto['arrondissement']=NULL; |
$valAuto['arrondissement']=NULL; |
245 |
$valAuto['etat_dossier_autorisation']=1; |
$valAuto['etat_dossier_autorisation']=7; |
246 |
$valAuto['erp_numero_batiment']=NULL; |
$valAuto['erp_numero_batiment']=NULL; |
247 |
$valAuto['erp_ouvert']=NULL; |
$valAuto['erp_ouvert']=NULL; |
248 |
$valAuto['erp_arrete_decision']=NULL; |
$valAuto['erp_arrete_decision']=NULL; |
299 |
// Définition des valeurs à entrée dans la table |
// Définition des valeurs à entrée dans la table |
300 |
$valInstr['dossier_instruction_type']=$dossier_instruction_type; |
$valInstr['dossier_instruction_type']=$dossier_instruction_type; |
301 |
$valInstr['date_depot']=$this->dateDBToForm($this->valF['date_demande']); |
$valInstr['date_depot']=$this->dateDBToForm($this->valF['date_demande']); |
302 |
|
$valInstr['date_dernier_depot']=$this->dateDBToForm($this->valF['date_demande']); |
303 |
$valInstr['date_demande']=$this->dateDBToForm($this->valF['date_demande']); |
$valInstr['date_demande']=$this->dateDBToForm($this->valF['date_demande']); |
304 |
$valInstr['depot_initial']=$this->dateDBToForm($this->valF['date_demande']); |
$valInstr['depot_initial']=$this->dateDBToForm($this->valF['date_demande']); |
305 |
$valInstr['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
$valInstr['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
549 |
$valInstr['delai_notification']="1"; |
$valInstr['delai_notification']="1"; |
550 |
$valInstr['archive_delai']="0"; |
$valInstr['archive_delai']="0"; |
551 |
$valInstr['archive_date_complet']=NULL; |
$valInstr['archive_date_complet']=NULL; |
552 |
|
$valInstr['archive_date_dernier_depot']=NULL; |
553 |
$valInstr['archive_date_rejet']=NULL; |
$valInstr['archive_date_rejet']=NULL; |
554 |
$valInstr['archive_date_limite']=NULL; |
$valInstr['archive_date_limite']=NULL; |
555 |
$valInstr['archive_date_notification_delai']=NULL; |
$valInstr['archive_date_notification_delai']=NULL; |