176 |
} |
} |
177 |
$list_tasks = array(); |
$list_tasks = array(); |
178 |
foreach ($res['result'] as $task) { |
foreach ($res['result'] as $task) { |
179 |
|
$task['timestamp_log'] = json_decode($task['timestamp_log'], true); |
180 |
$list_tasks[$task['task']] = $task; |
$list_tasks[$task['task']] = $task; |
181 |
} |
} |
182 |
printf(json_encode($list_tasks)); |
printf(json_encode($list_tasks)); |
188 |
"obj" => "dossier", |
"obj" => "dossier", |
189 |
"idx" => $dossier, |
"idx" => $dossier, |
190 |
)); |
)); |
191 |
$val_di = json_decode($inst_di->get_json_data(), true); |
$val_di = $inst_di->get_json_data(); |
192 |
if ($val_di['dossier_instruction_type_code'] === 'T') { |
if ($val_di['dossier_instruction_type_code'] === 'T') { |
193 |
$val_di['date_decision_transfert'] = $val_di['date_decision']; |
$val_di['date_decision_transfert'] = $val_di['date_decision']; |
194 |
} |
} |
203 |
"obj" => "dossier_autorisation", |
"obj" => "dossier_autorisation", |
204 |
"idx" => $da, |
"idx" => $da, |
205 |
)); |
)); |
206 |
$val_da = json_decode($inst_da->get_json_data(), true); |
$val_da = $inst_da->get_json_data(); |
207 |
return $val_da; |
return $val_da; |
208 |
} |
} |
209 |
|
|
225 |
$val_dt['am_exist_date_num'] = $val_dt['am_exist_date']; |
$val_dt['am_exist_date_num'] = $val_dt['am_exist_date']; |
226 |
} |
} |
227 |
} |
} |
228 |
|
// Correspond à la nomenclature de Plat'AU STATUT_INFO |
229 |
|
$val_dt['tax_statut_info'] = 'Déclaré'; |
230 |
|
// |
231 |
|
if ($inst_dt->is_tab_surf_ssdest_enabled() === true) { |
232 |
|
$fields_tab_surf_dest = $inst_dt->get_fields_tab_surf_dest(); |
233 |
|
foreach ($fields_tab_surf_dest as $field) { |
234 |
|
if (isset($val_dt[$field]) === true) { |
235 |
|
unset($val_dt[$field]); |
236 |
|
} |
237 |
|
} |
238 |
|
} else { |
239 |
|
$fields_tab_surf_ssdest = $inst_dt->get_fields_tab_surf_ssdest(); |
240 |
|
foreach ($fields_tab_surf_ssdest as $field) { |
241 |
|
if (isset($val_dt[$field]) === true) { |
242 |
|
unset($val_dt[$field]); |
243 |
|
} |
244 |
|
} |
245 |
|
} |
246 |
|
// Correspond à la nouvelle ligne CERFA v7 dans le DENSI imposition 1.2.3 |
247 |
|
if (isset($val_dt['tax_su_non_habit_surf2']) === true |
248 |
|
&& isset($val_dt['tax_su_non_habit_surf3']) === true) { |
249 |
|
// |
250 |
|
$val_dt['tax_su_non_habit_surf8'] = intval($val_dt['tax_su_non_habit_surf2']) + intval($val_dt['tax_su_non_habit_surf3']); |
251 |
|
} |
252 |
|
if (isset($val_dt['tax_su_non_habit_surf_stat2']) === true |
253 |
|
&& isset($val_dt['tax_su_non_habit_surf_stat3']) === true) { |
254 |
|
// |
255 |
|
$val_dt['tax_su_non_habit_surf_stat8'] = intval($val_dt['tax_su_non_habit_surf_stat2']) + intval($val_dt['tax_su_non_habit_surf_stat3']); |
256 |
|
} |
257 |
|
// Cas particulier d'un projet réduit à l'extension d'une habitation existante |
258 |
|
$particular_case = false; |
259 |
|
$fields_tab_crea_loc_hab = $inst_dt->get_fields_tab_crea_loc_hab(); |
260 |
|
foreach ($fields_tab_crea_loc_hab as $field) { |
261 |
|
if (isset($field) === false |
262 |
|
|| (isset($field) === true |
263 |
|
&& $field !== null |
264 |
|
&& $field !== '')) { |
265 |
|
// |
266 |
|
$particular_case = true; |
267 |
|
} |
268 |
|
} |
269 |
|
if ($particular_case === true) { |
270 |
|
if (isset($val_dt['tax_ext_pret']) === true |
271 |
|
&& $val_dt['tax_ext_pret'] === 'f') { |
272 |
|
// |
273 |
|
$val_dt['tax_su_princ_surf1'] = $val_dt['tax_surf_tot_cstr']; |
274 |
|
$val_dt['tax_su_princ_surf_stat1'] = $val_dt['tax_surf_loc_stat']; |
275 |
|
} |
276 |
|
if (isset($val_dt['tax_ext_pret']) === true |
277 |
|
&& $val_dt['tax_ext_pret'] === 't') { |
278 |
|
// |
279 |
|
if (isset($val_dt['tax_ext_desc']) === true) { |
280 |
|
if (preg_match('/[pP].*[lL].*[aA].*[iI]/', $val_dt['tax_ext_desc']) === 1 |
281 |
|
|| preg_match('/[lL].*[lL].*[tT].*[sS]/', $val_dt['tax_ext_desc']) === 1) { |
282 |
|
// |
283 |
|
$val_dt['tax_su_princ_surf2'] = $val_dt['tax_surf_tot_cstr']; |
284 |
|
$val_dt['tax_su_princ_surf_stat2'] = $val_dt['tax_surf_loc_stat']; |
285 |
|
} |
286 |
|
// if (preg_match('/[pP].*[tT].*[zZ]/', $val_dt['tax_ext_desc']) === 1) { |
287 |
|
// $val_dt['tax_su_princ_surf4'] = $val_dt['tax_surf_tot_cstr']; |
288 |
|
// $val_dt['tax_su_princ_surf_stat4'] = $val_dt['tax_surf_loc_stat']; |
289 |
|
// } |
290 |
|
// if (preg_match('/[pP].*[lL].*[uU].*[sS]/', $val_dt['tax_ext_desc']) === 1 |
291 |
|
// || preg_match('/[lL].*[eE].*[sS]/', $val_dt['tax_ext_desc']) === 1 |
292 |
|
// || preg_match('/[pP].*[sS].*[lL].*[aA]/', $val_dt['tax_ext_desc']) === 1 |
293 |
|
// || preg_match('/[pP].*[lL].*[sS]/', $val_dt['tax_ext_desc']) === 1 |
294 |
|
// || preg_match('/[lL].*[lL].*[sS]/', $val_dt['tax_ext_desc']) === 1) { |
295 |
|
// // |
296 |
|
// $val_dt['tax_su_princ_surf3'] = $val_dt['tax_surf_tot_cstr']; |
297 |
|
// $val_dt['tax_su_princ_surf_stat3'] = $val_dt['tax_surf_loc_stat']; |
298 |
|
// } |
299 |
|
} |
300 |
|
} |
301 |
|
} |
302 |
|
// Cas particulier de la surface taxable démolie |
303 |
|
if (isset($val_dt['tax_surf_tot_demo']) === true |
304 |
|
&& isset($val_dt['tax_surf_tax_demo']) === true |
305 |
|
&& ($val_dt['tax_surf_tot_demo'] === null |
306 |
|
|| $val_dt['tax_surf_tot_demo'] === '')) { |
307 |
|
// |
308 |
|
$val_dt['tax_surf_tot_demo'] = $val_dt['tax_surf_tax_demo']; |
309 |
|
} |
310 |
return $val_dt; |
return $val_dt; |
311 |
} |
} |
312 |
|
|
313 |
protected function get_external_uid($fk_idx, string $fk_idx_2) { |
protected function get_external_uid($fk_idx, string $fk_idx_2) { |
314 |
$inst_external_uid_da = $this->f->get_inst__by_other_idx(array( |
$inst_external_uid = $this->f->get_inst__by_other_idx(array( |
315 |
"obj" => "lien_id_interne_uid_externe", |
"obj" => "lien_id_interne_uid_externe", |
316 |
"fk_field" => 'object_id', |
"fk_field" => 'object_id', |
317 |
"fk_idx" => $fk_idx, |
"fk_idx" => $fk_idx, |
318 |
"fk_field_2" => 'object', |
"fk_field_2" => 'object', |
319 |
"fk_idx_2" => $fk_idx_2, |
"fk_idx_2" => $fk_idx_2, |
320 |
)); |
)); |
321 |
return $inst_external_uid_da->getVal('external_uid'); |
return $inst_external_uid->getVal('external_uid'); |
322 |
} |
} |
323 |
|
|
324 |
protected function get_demandeurs_data(string $dossier) { |
protected function get_demandeurs_data(string $dossier) { |
333 |
"obj" => "demandeur", |
"obj" => "demandeur", |
334 |
"idx" => $demandeur['demandeur'], |
"idx" => $demandeur['demandeur'], |
335 |
)); |
)); |
336 |
$val_demandeur[$demandeur['demandeur']] = json_decode($inst_demandeur->get_json_data(), true); |
$val_demandeur[$demandeur['demandeur']] = $inst_demandeur->get_json_data(); |
337 |
$val_demandeur[$demandeur['demandeur']]['petitionnaire_principal'] = $demandeur['petitionnaire_principal']; |
$val_demandeur[$demandeur['demandeur']]['petitionnaire_principal'] = $demandeur['petitionnaire_principal']; |
338 |
|
// Valeur par défaut pour expériementation sequence 1 |
339 |
|
$val_demandeur[$demandeur['demandeur']]['commerciale'] = 'f'; |
340 |
} |
} |
341 |
return $val_demandeur; |
return $val_demandeur; |
342 |
} |
} |
343 |
|
|
344 |
protected function get_architecte_data($architecte = null) { |
protected function get_architecte_data($architecte = null) { |
345 |
$val_architecte = array(); |
$val_architecte = null; |
346 |
if ($architecte !== null |
if ($architecte !== null |
347 |
&& $architecte !== '') { |
&& $architecte !== '') { |
348 |
// |
// |
350 |
"obj" => "architecte", |
"obj" => "architecte", |
351 |
"idx" => $architecte, |
"idx" => $architecte, |
352 |
)); |
)); |
353 |
$val_architecte = json_decode($inst_architecte->get_json_data(), true); |
$val_architecte = $inst_architecte->get_json_data(); |
354 |
} |
} |
355 |
return $val_architecte; |
return $val_architecte; |
356 |
} |
} |
366 |
"idx" => $inst_di->get_last_instruction_decision(), |
"idx" => $inst_di->get_last_instruction_decision(), |
367 |
)); |
)); |
368 |
if (count($inst_instruction->val) > 0) { |
if (count($inst_instruction->val) > 0) { |
369 |
$val_instruction = json_decode($inst_instruction->get_json_data(), true); |
$val_instruction = $inst_instruction->get_json_data(); |
370 |
} |
} |
371 |
return $val_instruction; |
return $val_instruction; |
372 |
} |
} |
377 |
"obj" => "document_numerise", |
"obj" => "document_numerise", |
378 |
"idx" => $dn, |
"idx" => $dn, |
379 |
)); |
)); |
380 |
$val_dn = json_decode($inst_dn->get_json_data(), true); |
$val_dn = $inst_dn->get_json_data(); |
381 |
$val_dn['path'] = sprintf('%s/%s&snippet=%s&obj=%s&champ=%s&id=%s', $_SERVER['HTTP_HOST'], 'openads/app/index.php?module=form', 'file', 'document_numerise', 'uid', $this->getVal('object_id')); |
$val_dn['path'] = sprintf('%s/%s&snippet=%s&obj=%s&champ=%s&id=%s', $_SERVER['HTTP_HOST'], 'openads/app/index.php?module=form', 'file', 'document_numerise', 'uid', $this->getVal('object_id')); |
382 |
|
// Correspond à la nomenclature Plat'AU NATURE_PIECE |
383 |
|
$val_dn['nature'] = 'Initiale'; |
384 |
return $val_dn; |
return $val_dn; |
385 |
} |
} |
386 |
|
|
462 |
$val = array(); |
$val = array(); |
463 |
// |
// |
464 |
$val_task = array_combine($this->champs, $this->val); |
$val_task = array_combine($this->champs, $this->val); |
465 |
|
foreach ($val_task as $key => $value) { |
466 |
|
$val_task[$key] = strip_tags($value); |
467 |
|
} |
468 |
|
$val_task['timestamp_log'] = json_decode($val_task['timestamp_log'], true); |
469 |
$val['task'] = $val_task; |
$val['task'] = $val_task; |
470 |
// |
// |
471 |
if ($this->getVal('type') === 'creation_DA') { |
if ($this->getVal('type') === 'creation_DA') { |
483 |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
484 |
$val['donnees_techniques'] = $this->get_donnees_techniques_data($this->getVal('object_id'), 'dossier_instruction'); |
$val['donnees_techniques'] = $this->get_donnees_techniques_data($this->getVal('object_id'), 'dossier_instruction'); |
485 |
$val['demandeur'] = $this->get_demandeurs_data($val['dossier']['dossier']); |
$val['demandeur'] = $this->get_demandeurs_data($val['dossier']['dossier']); |
486 |
$val['architecte'] = $this->get_architecte_data($val['donnees_techniques']['architecte']); |
$architecte = isset($val['donnees_techniques']['architecte']) === true ? $val['donnees_techniques']['architecte'] : null; |
487 |
|
$val['architecte'] = $this->get_architecte_data($architecte); |
488 |
$val['dossier_parcelle'] = $this->get_parcelles_data('dossier', $val['dossier']['dossier']); |
$val['dossier_parcelle'] = $this->get_parcelles_data('dossier', $val['dossier']['dossier']); |
489 |
$val_external_uid = array(); |
$val_external_uid = array(); |
490 |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
522 |
if ($type === 'creation_DA') { |
if ($type === 'creation_DA') { |
523 |
$objet = 'dossier_autorisation'; |
$objet = 'dossier_autorisation'; |
524 |
} |
} |
525 |
if ($type === 'creation_DI' || $type = 'modification_DI') { |
if ($type === 'creation_DI' || $type === 'modification_DI') { |
526 |
$objet = 'dossier'; |
$objet = 'dossier'; |
527 |
} |
} |
528 |
if ($type === 'ajout_piece') { |
if ($type === 'ajout_piece') { |