59 |
} |
} |
60 |
} |
} |
61 |
} |
} |
62 |
|
function getDataSubmit() { |
63 |
|
|
64 |
|
$datasubmit = parent::getDataSubmit(); |
65 |
|
if($this->getParameter("idx_dossier") != "") { |
66 |
|
$datasubmit .= "&idx_dossier=".$this->getParameter("idx_dossier"); |
67 |
|
} |
68 |
|
return $datasubmit; |
69 |
|
} |
70 |
|
|
71 |
/** |
/** |
72 |
* Méthode de verification du contenu |
* Méthode de verification du contenu |
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 |
// Ajout de filtre sur la requête (dossier_autorisation_type_detaille) |
if(isset($_POST["dossier_autorisation_type_detaille"]) AND $_POST["dossier_autorisation_type_detaille"] != "") { |
110 |
|
$datd = $_POST["dossier_autorisation_type_detaille"]; |
111 |
|
} |
112 |
|
// 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); |
184 |
$form->setOnchange("dossier_autorisation_type_detaille","changeDemandeType();"); |
$form->setOnchange("dossier_autorisation_type_detaille","changeDemandeType();"); |
185 |
$form->setOnchange("demande_type","showFormsDemande();"); |
$form->setOnchange("demande_type","showFormsDemande();"); |
186 |
} |
} |
187 |
|
|
188 |
|
function setLib(&$form,$maj) { |
189 |
|
parent::setLib($form,$maj); |
190 |
|
//libelle des champs |
191 |
|
|
192 |
|
$form->setLib('complement',_('terrain_adresse')); |
193 |
|
} |
194 |
/* |
/* |
195 |
* Cache le champ terrain_references_cadastrales |
* Cache le champ terrain_references_cadastrales |
196 |
* Hide the fiels terrain_references_cadastrales |
* Hide the fiels terrain_references_cadastrales |
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; |
595 |
|
|
596 |
/*Si la création a réussie*/ |
/*Si la création a réussie*/ |
597 |
if ( $instruction->valF['instruction'] != "" ){ |
if ( $instruction->valF['instruction'] != "" ){ |
|
print_r($instruction->valF); |
|
598 |
|
|
599 |
/*Affichage du récépissé de la demande*/ |
/*Affichage du récépissé de la demande*/ |
600 |
$this->valF['instruction_recepisse'] = $instruction->valF['instruction']; |
$this->valF['instruction_recepisse'] = $instruction->valF['instruction']; |
831 |
**/ |
**/ |
832 |
function listeDemandeur($from, $id) { |
function listeDemandeur($from, $id) { |
833 |
// Récupération des demandeurs de la base |
// Récupération des demandeurs de la base |
834 |
$sql = "SELECT demandeur.demandeur, |
if(isset($this->valF['demande_type']) AND $this->getCodeDemandeType($this->valF['demande_type']) != "DT") { |
835 |
demandeur.type_demandeur, |
$sql = "SELECT demandeur.demandeur, |
836 |
lien_".$from."_demandeur.petitionnaire_principal |
demandeur.type_demandeur, |
837 |
FROM ".DB_PREFIXE."lien_".$from."_demandeur |
lien_".$from."_demandeur.petitionnaire_principal |
838 |
INNER JOIN ".DB_PREFIXE."demandeur |
FROM ".DB_PREFIXE."lien_".$from."_demandeur |
839 |
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
INNER JOIN ".DB_PREFIXE."demandeur |
840 |
WHERE ".$from." = '".$id."'"; |
ON demandeur.demandeur=lien_".$from."_demandeur.demandeur |
841 |
$res = $this->f->db->query($sql); |
WHERE ".$from." = '".$id."'"; |
842 |
$this->f->addToLog("listeDemandeur() : ".$sql); |
$res = $this->f->db->query($sql); |
843 |
$this->f->isDatabaseError($res); |
$this->f->addToLog("listeDemandeur() : ".$sql); |
844 |
// Stoquage du résultat dans un tableau |
$this->f->isDatabaseError($res); |
845 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
// Stoquage du résultat dans un tableau |
846 |
if ($row['petitionnaire_principal'] == 't' AND |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
847 |
$row['type_demandeur']=="petitionnaire") { |
if ($row['petitionnaire_principal'] == 't' AND |
848 |
$this->valIdDemandeur['petitionnaire_principal']=$row['demandeur']; |
$row['type_demandeur']=="petitionnaire") { |
849 |
} elseif ($row['petitionnaire_principal'] == 'f' AND |
$this->valIdDemandeur['petitionnaire_principal']=$row['demandeur']; |
850 |
$row['type_demandeur']=="petitionnaire"){ |
} elseif ($row['petitionnaire_principal'] == 'f' AND |
851 |
$this->valIdDemandeur['petitionnaire'][]=$row['demandeur']; |
$row['type_demandeur']=="petitionnaire"){ |
852 |
} elseif ($row['type_demandeur']=="delegataire"){ |
$this->valIdDemandeur['petitionnaire'][]=$row['demandeur']; |
853 |
$this->valIdDemandeur['delegataire']=$row['demandeur']; |
} elseif ($row['type_demandeur']=="delegataire"){ |
854 |
|
$this->valIdDemandeur['delegataire']=$row['demandeur']; |
855 |
|
} |
856 |
} |
} |
857 |
} |
} |
858 |
} |
} |