67 |
"obj" => "task", |
"obj" => "task", |
68 |
"idx" => $task_exists, |
"idx" => $task_exists, |
69 |
)); |
)); |
70 |
|
$update_state = $inst_task->getVal('state'); |
71 |
|
if (isset($params['update_val']['state']) === true) { |
72 |
|
$update_state = $params['update_val']['state']; |
73 |
|
} |
74 |
$update_params = array( |
$update_params = array( |
75 |
'val' => array( |
'val' => array( |
76 |
'state' => $inst_task->getVal('state'), |
'state' => $update_state, |
77 |
), |
), |
78 |
); |
); |
79 |
return $inst_task->update_task($update_params); |
return $inst_task->update_task($update_params); |
231 |
} |
} |
232 |
// Correspond à la nomenclature de Plat'AU STATUT_INFO |
// Correspond à la nomenclature de Plat'AU STATUT_INFO |
233 |
$val_dt['tax_statut_info'] = 'Déclaré'; |
$val_dt['tax_statut_info'] = 'Déclaré'; |
234 |
|
// |
235 |
|
if ($inst_dt->is_tab_surf_ssdest_enabled() === true) { |
236 |
|
$fields_tab_surf_dest = $inst_dt->get_fields_tab_surf_dest(); |
237 |
|
foreach ($fields_tab_surf_dest as $field) { |
238 |
|
if (isset($val_dt[$field]) === true) { |
239 |
|
unset($val_dt[$field]); |
240 |
|
} |
241 |
|
} |
242 |
|
} else { |
243 |
|
$fields_tab_surf_ssdest = $inst_dt->get_fields_tab_surf_ssdest(); |
244 |
|
foreach ($fields_tab_surf_ssdest as $field) { |
245 |
|
if (isset($val_dt[$field]) === true) { |
246 |
|
unset($val_dt[$field]); |
247 |
|
} |
248 |
|
} |
249 |
|
} |
250 |
|
// Correspond à la nouvelle ligne CERFA v7 dans le DENSI imposition 1.2.3 |
251 |
|
if (isset($val_dt['tax_su_non_habit_surf2']) === true |
252 |
|
&& isset($val_dt['tax_su_non_habit_surf3']) === true |
253 |
|
&& (($val_dt['tax_su_non_habit_surf2'] !== null |
254 |
|
&& $val_dt['tax_su_non_habit_surf2'] !== '') |
255 |
|
|| ($val_dt['tax_su_non_habit_surf3'] !== null |
256 |
|
&& $val_dt['tax_su_non_habit_surf3'] !== ''))) { |
257 |
|
// |
258 |
|
$val_dt['tax_su_non_habit_surf8'] = intval($val_dt['tax_su_non_habit_surf2']) + intval($val_dt['tax_su_non_habit_surf3']); |
259 |
|
} |
260 |
|
if (isset($val_dt['tax_su_non_habit_surf_stat2']) === true |
261 |
|
&& isset($val_dt['tax_su_non_habit_surf_stat3']) === true |
262 |
|
&& (($val_dt['tax_su_non_habit_surf_stat2'] !== null |
263 |
|
&& $val_dt['tax_su_non_habit_surf_stat2'] !== '') |
264 |
|
|| ($val_dt['tax_su_non_habit_surf_stat3'] !== null |
265 |
|
&& $val_dt['tax_su_non_habit_surf_stat3'] !== ''))) { |
266 |
|
// |
267 |
|
$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']); |
268 |
|
} |
269 |
|
// Cas particulier d'un projet réduit à l'extension d'une habitation existante |
270 |
|
$particular_case = false; |
271 |
|
$fields_tab_crea_loc_hab = $inst_dt->get_fields_tab_crea_loc_hab(); |
272 |
|
foreach ($fields_tab_crea_loc_hab as $field) { |
273 |
|
if (isset($field) === false |
274 |
|
|| (isset($field) === true |
275 |
|
&& $field !== null |
276 |
|
&& $field !== '')) { |
277 |
|
// |
278 |
|
$particular_case = true; |
279 |
|
} |
280 |
|
} |
281 |
|
if ($particular_case === true) { |
282 |
|
if (isset($val_dt['tax_ext_pret']) === true |
283 |
|
&& $val_dt['tax_ext_pret'] === 'f') { |
284 |
|
// |
285 |
|
$val_dt['tax_su_princ_surf1'] = $val_dt['tax_surf_tot_cstr']; |
286 |
|
$val_dt['tax_su_princ_surf_stat1'] = $val_dt['tax_surf_loc_stat']; |
287 |
|
} |
288 |
|
if (isset($val_dt['tax_ext_pret']) === true |
289 |
|
&& $val_dt['tax_ext_pret'] === 't') { |
290 |
|
// |
291 |
|
if (isset($val_dt['tax_ext_desc']) === true) { |
292 |
|
if (preg_match('/[pP].*[lL].*[aA].*[iI]/', $val_dt['tax_ext_desc']) === 1 |
293 |
|
|| preg_match('/[lL].*[lL].*[tT].*[sS]/', $val_dt['tax_ext_desc']) === 1) { |
294 |
|
// |
295 |
|
$val_dt['tax_su_princ_surf2'] = $val_dt['tax_surf_tot_cstr']; |
296 |
|
$val_dt['tax_su_princ_surf_stat2'] = $val_dt['tax_surf_loc_stat']; |
297 |
|
} |
298 |
|
// if (preg_match('/[pP].*[tT].*[zZ]/', $val_dt['tax_ext_desc']) === 1) { |
299 |
|
// $val_dt['tax_su_princ_surf4'] = $val_dt['tax_surf_tot_cstr']; |
300 |
|
// $val_dt['tax_su_princ_surf_stat4'] = $val_dt['tax_surf_loc_stat']; |
301 |
|
// } |
302 |
|
// if (preg_match('/[pP].*[lL].*[uU].*[sS]/', $val_dt['tax_ext_desc']) === 1 |
303 |
|
// || preg_match('/[lL].*[eE].*[sS]/', $val_dt['tax_ext_desc']) === 1 |
304 |
|
// || preg_match('/[pP].*[sS].*[lL].*[aA]/', $val_dt['tax_ext_desc']) === 1 |
305 |
|
// || preg_match('/[pP].*[lL].*[sS]/', $val_dt['tax_ext_desc']) === 1 |
306 |
|
// || preg_match('/[lL].*[lL].*[sS]/', $val_dt['tax_ext_desc']) === 1) { |
307 |
|
// // |
308 |
|
// $val_dt['tax_su_princ_surf3'] = $val_dt['tax_surf_tot_cstr']; |
309 |
|
// $val_dt['tax_su_princ_surf_stat3'] = $val_dt['tax_surf_loc_stat']; |
310 |
|
// } |
311 |
|
} |
312 |
|
} |
313 |
|
} |
314 |
|
// Cas particulier de la surface taxable démolie |
315 |
|
if (isset($val_dt['tax_surf_tot_demo']) === true |
316 |
|
&& isset($val_dt['tax_surf_tax_demo']) === true |
317 |
|
&& ($val_dt['tax_surf_tot_demo'] === null |
318 |
|
|| $val_dt['tax_surf_tot_demo'] === '')) { |
319 |
|
// |
320 |
|
$val_dt['tax_surf_tot_demo'] = $val_dt['tax_surf_tax_demo']; |
321 |
|
} |
322 |
return $val_dt; |
return $val_dt; |
323 |
} |
} |
324 |
|
|
347 |
)); |
)); |
348 |
$val_demandeur[$demandeur['demandeur']] = $inst_demandeur->get_json_data(); |
$val_demandeur[$demandeur['demandeur']] = $inst_demandeur->get_json_data(); |
349 |
$val_demandeur[$demandeur['demandeur']]['petitionnaire_principal'] = $demandeur['petitionnaire_principal']; |
$val_demandeur[$demandeur['demandeur']]['petitionnaire_principal'] = $demandeur['petitionnaire_principal']; |
350 |
|
// Valeur par défaut pour expériementation sequence 1 |
351 |
|
$val_demandeur[$demandeur['demandeur']]['commerciale'] = 'f'; |
352 |
} |
} |
353 |
return $val_demandeur; |
return $val_demandeur; |
354 |
} |
} |
355 |
|
|
356 |
protected function get_architecte_data($architecte = null) { |
protected function get_architecte_data($architecte = null) { |
357 |
$val_architecte = array(); |
$val_architecte = null; |
358 |
if ($architecte !== null |
if ($architecte !== null |
359 |
&& $architecte !== '') { |
&& $architecte !== '') { |
360 |
// |
// |
368 |
} |
} |
369 |
|
|
370 |
protected function get_instruction_data(string $dossier) { |
protected function get_instruction_data(string $dossier) { |
371 |
$val_instruction = array(); |
$val_instruction = null; |
372 |
$inst_di = $this->f->get_inst__om_dbform(array( |
$inst_di = $this->f->get_inst__om_dbform(array( |
373 |
"obj" => "dossier", |
"obj" => "dossier", |
374 |
"idx" => $dossier, |
"idx" => $dossier, |
378 |
"idx" => $inst_di->get_last_instruction_decision(), |
"idx" => $inst_di->get_last_instruction_decision(), |
379 |
)); |
)); |
380 |
if (count($inst_instruction->val) > 0) { |
if (count($inst_instruction->val) > 0) { |
381 |
$val_instruction = $inst_instruction->get_json_data(); |
$val_instruction[$inst_instruction->getVal($inst_instruction->clePrimaire)] = $inst_instruction->get_json_data(); |
382 |
|
$inst_ev = $this->f->get_inst__om_dbform(array( |
383 |
|
"obj" => "evenement", |
384 |
|
"idx" => $inst_instruction->getVal('evenement'), |
385 |
|
)); |
386 |
|
if ($inst_ev->getVal('retour') === 't') { |
387 |
|
$instructions_related = $inst_instruction->get_related_instructions(); |
388 |
|
foreach ($instructions_related as $instruction) { |
389 |
|
$inst_related_instruction = $this->f->get_inst__om_dbform(array( |
390 |
|
"obj" => "instruction", |
391 |
|
"idx" => $instruction, |
392 |
|
)); |
393 |
|
$val_instruction[$instruction] = $inst_related_instruction->get_json_data(); |
394 |
|
} |
395 |
|
} |
396 |
} |
} |
397 |
return $val_instruction; |
return $val_instruction; |
398 |
} |
} |
488 |
$val = array(); |
$val = array(); |
489 |
// |
// |
490 |
$val_task = array_combine($this->champs, $this->val); |
$val_task = array_combine($this->champs, $this->val); |
491 |
|
foreach ($val_task as $key => $value) { |
492 |
|
$val_task[$key] = strip_tags($value); |
493 |
|
} |
494 |
$val_task['timestamp_log'] = json_decode($val_task['timestamp_log'], true); |
$val_task['timestamp_log'] = json_decode($val_task['timestamp_log'], true); |
495 |
$val['task'] = $val_task; |
$val['task'] = $val_task; |
496 |
// |
// |
520 |
// |
// |
521 |
if ($this->getVal('type') === 'qualification_DI') { |
if ($this->getVal('type') === 'qualification_DI') { |
522 |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
|
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier']); |
|
523 |
$val_external_uid = array(); |
$val_external_uid = array(); |
524 |
$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'); |
525 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
535 |
$val_external_uid['document_numerise'] = $this->get_external_uid($val['document_numerise']['document_numerise'], 'document_numerise'); |
$val_external_uid['document_numerise'] = $this->get_external_uid($val['document_numerise']['document_numerise'], 'document_numerise'); |
536 |
$val['external_uid'] = $val_external_uid; |
$val['external_uid'] = $val_external_uid; |
537 |
} |
} |
538 |
|
// |
539 |
|
if ($this->getVal('type') === 'decision_DI') { |
540 |
|
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
541 |
|
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier']); |
542 |
|
$val_external_uid = array(); |
543 |
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
544 |
|
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
545 |
|
$val['external_uid'] = $val_external_uid; |
546 |
|
} |
547 |
|
|
548 |
// Liste des valeurs affichée en JSON |
// Liste des valeurs affichée en JSON |
549 |
printf(json_encode($val)); |
printf(json_encode($val)); |
556 |
if ($type === 'creation_DA') { |
if ($type === 'creation_DA') { |
557 |
$objet = 'dossier_autorisation'; |
$objet = 'dossier_autorisation'; |
558 |
} |
} |
559 |
if ($type === 'creation_DI' || $type === 'modification_DI') { |
if ($type === 'creation_DI' |
560 |
|
|| $type === 'modification_DI' |
561 |
|
|| $type === 'qualification_DI' |
562 |
|
|| $type === 'decision_DI') { |
563 |
|
// |
564 |
$objet = 'dossier'; |
$objet = 'dossier'; |
565 |
} |
} |
566 |
if ($type === 'ajout_piece') { |
if ($type === 'ajout_piece') { |