96 |
} |
} |
97 |
|
|
98 |
/** |
/** |
99 |
|
* Méthode permettant la création de dossiers |
100 |
|
**/ |
101 |
|
function triggerAjoutDossier($id, &$db, $val, $DEBUG){ |
102 |
|
include '../sql/pgsql/demande.form.inc.php'; |
103 |
|
if($this->valF["demande_type"] != NULL) { |
104 |
|
$res = $db->query(str_replace('<idx>', $this->valF['demande_type'], $sql_demande_type_details_by_id)); |
105 |
|
$this->f->isDatabaseError(); |
106 |
|
$row = $res->fetchRow(DB_FETCHMODE_ASSOC); |
107 |
|
// Création du dossier_autorisation |
108 |
|
if($row ['dossier_autorisation_type_detaille'] != NULL) { |
109 |
|
// Création du dossier |
110 |
|
$valAuto['dossier_autorisation']=NULL; |
111 |
|
$valAuto['nature']=NULL; |
112 |
|
$valAuto['exercice']=NULL; |
113 |
|
$valAuto['insee']=NULL; |
114 |
|
$valAuto['arrondissement']=NULL; |
115 |
|
$valAuto['etat']=NULL; |
116 |
|
$valAuto['erp_numero_batiment']=NULL; |
117 |
|
$valAuto['erp_ouvert']=NULL; |
118 |
|
$valAuto['erp_arrete_decision']=NULL; |
119 |
|
$valAuto['dossier_autorisation_type_detaille']=$this->valF['dossier_autorisation_type_detaille']; |
120 |
|
$valAuto['depot_initial']=$this->valF['date_demande']; |
121 |
|
$valAuto['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
122 |
|
$valAuto['terrain_adresse_voie_numero']=$this->valF['terrain_adresse_voie_numero']; |
123 |
|
$valAuto['complement']=$this->valF['complement']; |
124 |
|
$valAuto['terrain_adresse_lieu_dit']=$this->valF['terrain_adresse_lieu_dit']; |
125 |
|
$valAuto['terrain_adresse_localite']=$this->valF['terrain_adresse_localite']; |
126 |
|
$valAuto['terrain_adresse_code_postal']=$this->valF['terrain_adresse_code_postal']; |
127 |
|
$valAuto['terrain_adresse_bp']=$this->valF['terrain_adresse_bp']; |
128 |
|
$valAuto['terrain_adresse_cedex']=$this->valF['terrain_adresse_cedex']; |
129 |
|
$valAuto['terrain_superficie']=$this->valF['terrain_superficie']; |
130 |
|
require_once '../obj/dossier_autorisation.class.php'; |
131 |
|
$dossier_autorisation = new dossier_autorisation("]",$db,$DEBUG); |
132 |
|
$dossier_autorisation->ajouter($valAuto, $db, $DEBUG); |
133 |
|
$this->valF['dossier_autorisation'] = $dossier_autorisation->valF['dossier_autorisation']; |
134 |
|
// Création des liens entre le dossier et les demandeurs |
135 |
|
require_once '../obj/lien_dossier_autorisation_demandeur.class.php'; |
136 |
|
$ldad = new lien_dossier_autorisation_demandeur("]",$db,$DEBUG); |
137 |
|
$sql = str_replace("<demande>",$this->valF['demande'],$sql_lien_demande_demandeur); |
138 |
|
$res = $db->query($sql); |
139 |
|
$this->f->addToLog("demande.class.php: db->query(\"".$sql."\");", VERBOSE_MODE); |
140 |
|
$this->f->isDatabaseError(); |
141 |
|
print_r($sql); |
142 |
|
while($row = &$res->fetchRow(DB_FETCHMODE_ASSOC)) { |
143 |
|
$row['lien_dossier_autorisation_demandeur'] = NULL; |
144 |
|
$row['dossier_autorisation'] = $this->valF['dossier_autorisation']; |
145 |
|
$ldad->ajouter($row, $db, $DEBUG); |
146 |
|
} |
147 |
|
$this -> addToMessage(_("Creation du dossier d'autorisation no").$this->valF['dossier_autorisation']); |
148 |
|
} |
149 |
|
/* |
150 |
|
if($row ['dossier_instruction_type'] != NULL) { |
151 |
|
$valInstr['dossier_autorisation_type_detaille']=$this->valF['dossier_autorisation_type_detaille']; |
152 |
|
|
153 |
|
$valInstr['depot_initial']=$this->valF['date_demande']; |
154 |
|
$valInstr['terrain_references_cadastrales']=$this->valF['terrain_references_cadastrales']; |
155 |
|
$valInstr['terrain_adresse_voie_numero']=$this->valF['terrain_adresse_voie_numero']; |
156 |
|
$valInstr['complement']=$this->valF['complement']; |
157 |
|
$valInstr['terrain_adresse_lieu_dit']=$this->valF['terrain_adresse_lieu_dit']; |
158 |
|
$valInstr['terrain_adresse_localite']=$this->valF['terrain_adresse_localite']; |
159 |
|
$valInstr['terrain_adresse_code_postal']=$this->valF['terrain_adresse_code_postal']; |
160 |
|
$valInstr['terrain_adresse_bp']=$this->valF['terrain_adresse_bp']; |
161 |
|
$valInstr['terrain_adresse_cedex']=$this->valF['terrain_adresse_cedex']; |
162 |
|
$valInstr['terrain_superficie']=$this->valF['terrain_superficie']; |
163 |
|
|
164 |
|
require_once '../obj/dossier.class.php'; |
165 |
|
$dossier_instruction = new dossier("]",$db,$DEBUG); |
166 |
|
$dossier_instruction->ajouter($valInstr, $db, $DEBUG); |
167 |
|
$this->valF['dossier_instruction'] = $dossier_instruction->valF['dossier']; |
168 |
|
} |
169 |
|
*/ |
170 |
|
} |
171 |
|
} |
172 |
|
|
173 |
|
/** |
174 |
* Ajout des délégataires et pétitionnaires |
* Ajout des délégataires et pétitionnaires |
175 |
**/ |
**/ |
176 |
function triggerAjouterApres($id, &$db, $val, $DEBUG){ |
function triggerAjouterApres($id, &$db, $val, $DEBUG){ |
177 |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
$this->insertLinkDemandeDemandeur($db, $DEBUG); |
178 |
$this->valIdDemandeur=$this->postedIdDemandeur; |
$this->valIdDemandeur=$this->postedIdDemandeur; |
179 |
|
$this->triggerAjoutDossier($id, $db, $val, $DEBUG); |
180 |
} |
} |
181 |
function triggerModifierApres($id, &$db, $val, $DEBUG){ |
function triggerModifierApres($id, &$db, $val, $DEBUG){ |
182 |
$this->listeDemandeur(); |
$this->listeDemandeur(); |