318 |
|
|
319 |
protected function view_form_json() { |
protected function view_form_json() { |
320 |
// Mise à jour des valeurs |
// Mise à jour des valeurs |
321 |
if ($this->f->get_submitted_get_value('valid') === 'true' |
if ($this->f->get_submitted_post_value('valid') === 'true' |
322 |
&& $this->f->get_submitted_get_value('state') !== null) { |
&& $this->f->get_submitted_post_value('state') !== null) { |
323 |
// |
// |
324 |
$params = array( |
$params = array( |
325 |
'val' => array( |
'val' => array( |
326 |
'state' => $this->f->get_submitted_get_value('state') |
'state' => $this->f->get_submitted_post_value('state') |
327 |
), |
), |
328 |
); |
); |
329 |
$update = $this->update_task($params); |
$update = $this->update_task($params); |
341 |
$this->f->displayMessage($message_class, $message); |
$this->f->displayMessage($message_class, $message); |
342 |
} |
} |
343 |
// |
// |
344 |
if ($this->f->get_submitted_get_value('valid') === 'true' |
if ($this->f->get_submitted_post_value('valid') === 'true' |
345 |
&& $this->f->get_submitted_get_value('external_uid') !== null) { |
&& $this->f->get_submitted_post_value('external_uid') !== null) { |
346 |
// |
// |
347 |
$inst_lien = $this->f->get_inst__om_dbform(array( |
$inst_lien = $this->f->get_inst__om_dbform(array( |
348 |
"obj" => "lien_id_interne_uid_externe", |
"obj" => "lien_id_interne_uid_externe", |
352 |
'lien_id_interne_uid_externe' => '', |
'lien_id_interne_uid_externe' => '', |
353 |
'object' => $this->get_lien_objet_by_type($this->getVal('type')), |
'object' => $this->get_lien_objet_by_type($this->getVal('type')), |
354 |
'object_id' => $this->getVal('object_id'), |
'object_id' => $this->getVal('object_id'), |
355 |
'external_uid' => $this->f->get_submitted_get_value('external_uid'), |
'external_uid' => $this->f->get_submitted_post_value('external_uid'), |
356 |
); |
); |
357 |
$add = $inst_lien->ajouter($valF); |
$add = $inst_lien->ajouter($valF); |
358 |
$message_class = "valid"; |
$message_class = "valid"; |
369 |
$this->f->displayMessage($message_class, $message); |
$this->f->displayMessage($message_class, $message); |
370 |
} |
} |
371 |
|
|
|
// Liste des valeurs à afficher |
|
|
$val = array(); |
|
372 |
// |
// |
373 |
$val_task = array_combine($this->champs, $this->val); |
if ($this->f->get_submitted_post_value('valid') === null) { |
374 |
$val['task'] = $val_task; |
// Liste des valeurs à afficher |
375 |
// |
$val = array(); |
|
if ($this->getVal('type') === 'creation_DA') { |
|
|
$val['dossier_autorisation'] = $this->get_dossier_autorisation_data($this->getVal('object_id')); |
|
|
$val['donnees_techniques'] = $this->get_donnees_techniques_data($this->getVal('object_id'), 'dossier_autorisation'); |
|
|
$val['dossier_autorisation_parcelle'] = $this->get_parcelles_data('dossier_autorisation', $val['dossier_autorisation']['dossier_autorisation']); |
|
|
$val_external_uid = array(); |
|
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier_autorisation']['dossier_autorisation'], 'dossier_autorisation'); |
|
|
$val['external_uid'] = $val_external_uid; |
|
|
} |
|
|
// |
|
|
if ($this->getVal('type') === 'creation_DI' |
|
|
|| $this->getVal('type') === 'modification_DI') { |
|
376 |
// |
// |
377 |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
$val_task = array_combine($this->champs, $this->val); |
378 |
$val['donnees_techniques'] = $this->get_donnees_techniques_data($this->getVal('object_id'), 'dossier_instruction'); |
$val['task'] = $val_task; |
379 |
$val['demandeur'] = $this->get_demandeurs_data($val['dossier']['dossier']); |
// |
380 |
$val['architecte'] = $this->get_architecte_data($val['donnees_techniques']['architecte']); |
if ($this->getVal('type') === 'creation_DA') { |
381 |
$val['dossier_parcelle'] = $this->get_parcelles_data('dossier', $val['dossier']['dossier']); |
$val['dossier_autorisation'] = $this->get_dossier_autorisation_data($this->getVal('object_id')); |
382 |
$val_external_uid = array(); |
$val['donnees_techniques'] = $this->get_donnees_techniques_data($this->getVal('object_id'), 'dossier_autorisation'); |
383 |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
$val['dossier_autorisation_parcelle'] = $this->get_parcelles_data('dossier_autorisation', $val['dossier_autorisation']['dossier_autorisation']); |
384 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
$val_external_uid = array(); |
385 |
$val['external_uid'] = $val_external_uid; |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier_autorisation']['dossier_autorisation'], 'dossier_autorisation'); |
386 |
} |
$val['external_uid'] = $val_external_uid; |
387 |
// |
} |
388 |
if ($this->getVal('type') === 'qualification_DI') { |
// |
389 |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
if ($this->getVal('type') === 'creation_DI' |
390 |
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier']); |
|| $this->getVal('type') === 'modification_DI') { |
391 |
$val_external_uid = array(); |
// |
392 |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
393 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
$val['donnees_techniques'] = $this->get_donnees_techniques_data($this->getVal('object_id'), 'dossier_instruction'); |
394 |
$val['external_uid'] = $val_external_uid; |
$val['demandeur'] = $this->get_demandeurs_data($val['dossier']['dossier']); |
395 |
} |
$val['architecte'] = $this->get_architecte_data($val['donnees_techniques']['architecte']); |
396 |
// |
$val['dossier_parcelle'] = $this->get_parcelles_data('dossier', $val['dossier']['dossier']); |
397 |
if ($this->getVal('type') === 'ajout_piece') { |
$val_external_uid = array(); |
398 |
$val['document_numerise'] = $this->get_document_numerise_data($this->getVal('object_id')); |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
399 |
$val['dossier'] = $this->get_dossier_data($val['document_numerise']['dossier']); |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
400 |
$val_external_uid = array(); |
$val['external_uid'] = $val_external_uid; |
401 |
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
} |
402 |
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
// |
403 |
$val_external_uid['document_numerise'] = $this->get_external_uid($val['document_numerise']['document_numerise'], 'document_numerise'); |
if ($this->getVal('type') === 'qualification_DI') { |
404 |
$val['external_uid'] = $val_external_uid; |
$val['dossier'] = $this->get_dossier_data($this->getVal('object_id')); |
405 |
} |
$val['instruction'] = $this->get_instruction_data($val['dossier']['dossier']); |
406 |
|
$val_external_uid = array(); |
407 |
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
408 |
|
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
409 |
|
$val['external_uid'] = $val_external_uid; |
410 |
|
} |
411 |
|
// |
412 |
|
if ($this->getVal('type') === 'ajout_piece') { |
413 |
|
$val['document_numerise'] = $this->get_document_numerise_data($this->getVal('object_id')); |
414 |
|
$val['dossier'] = $this->get_dossier_data($val['document_numerise']['dossier']); |
415 |
|
$val_external_uid = array(); |
416 |
|
$val_external_uid['dossier_autorisation'] = $this->get_external_uid($val['dossier']['dossier_autorisation'], 'dossier_autorisation'); |
417 |
|
$val_external_uid['dossier'] = $this->get_external_uid($val['dossier']['dossier'], 'dossier'); |
418 |
|
$val_external_uid['document_numerise'] = $this->get_external_uid($val['document_numerise']['document_numerise'], 'document_numerise'); |
419 |
|
$val['external_uid'] = $val_external_uid; |
420 |
|
} |
421 |
|
|
422 |
// Liste des valeurs affichée en JSON |
// Liste des valeurs affichée en JSON |
423 |
printf(json_encode($val)); |
printf(json_encode($val)); |
424 |
|
} |
425 |
} |
} |
426 |
|
|
427 |
protected function get_lien_objet_by_type($type) { |
protected function get_lien_objet_by_type($type) { |