40 |
"state", |
"state", |
41 |
"object_id", |
"object_id", |
42 |
"dossier", |
"dossier", |
43 |
|
"json_payload", |
44 |
"timestamp_log", |
"timestamp_log", |
45 |
); |
); |
46 |
} |
} |
52 |
|
|
53 |
if ($maj < 2) { |
if ($maj < 2) { |
54 |
$form->setType("state", "select"); |
$form->setType("state", "select"); |
55 |
|
$form->setType("json_payload", "textarea"); |
56 |
} |
} |
57 |
if ($maj == 3){ |
if ($maj == 3){ |
58 |
$form->setType('dossier', 'link'); |
$form->setType('dossier', 'link'); |
59 |
|
$form->setType('json_payload', 'jsonprettyprint'); |
60 |
} |
} |
61 |
|
|
62 |
} |
} |
107 |
} |
} |
108 |
} |
} |
109 |
|
|
110 |
|
/** |
111 |
|
* SETTER_FORM - setVal (setVal). |
112 |
|
* |
113 |
|
* @return void |
114 |
|
*/ |
115 |
|
function setVal(&$form, $maj, $validation, &$dnu1 = null, $dnu2 = null) { |
116 |
|
// parent::setVal($form, $maj, $validation); |
117 |
|
// |
118 |
|
$form->setVal('json_payload', $this->view_form_json(true)); |
119 |
|
} |
120 |
|
|
121 |
public function verifier($val = array(), &$dnu1 = null, $dnu2 = null) { |
public function verifier($val = array(), &$dnu1 = null, $dnu2 = null) { |
122 |
parent::verifier($val, $dnu1, $dnu2); |
parent::verifier($val, $dnu1, $dnu2); |
123 |
// |
// |
605 |
return $val_dp; |
return $val_dp; |
606 |
} |
} |
607 |
|
|
608 |
protected function view_form_json() { |
protected function view_form_json($in_field = false) { |
609 |
// Mise à jour des valeurs |
// Mise à jour des valeurs |
610 |
if ($this->f->get_submitted_post_value('valid') === 'true' |
if ($this->f->get_submitted_post_value('valid') === 'true' |
611 |
&& $this->f->get_submitted_post_value('state') !== null) { |
&& $this->f->get_submitted_post_value('state') !== null) { |
740 |
$val['external_uid'] = $val_external_uid; |
$val['external_uid'] = $val_external_uid; |
741 |
} |
} |
742 |
|
|
743 |
// Liste des valeurs affichée en JSON |
if ($in_field === true) { |
744 |
printf(json_encode($val, JSON_UNESCAPED_SLASHES)); |
return json_encode($val, JSON_PRETTY_PRINT ,JSON_UNESCAPED_SLASHES); |
745 |
|
} else { |
746 |
|
// Liste des valeurs affichée en JSON |
747 |
|
printf(json_encode($val, JSON_UNESCAPED_SLASHES)); |
748 |
|
} |
749 |
} |
} |
750 |
} |
} |
751 |
|
|
770 |
} |
} |
771 |
return $objet; |
return $objet; |
772 |
} |
} |
773 |
|
|
774 |
|
function setLayout(&$form, $maj) { |
775 |
|
$form->setBloc('json_payload', 'D', '', 'col_6'); |
776 |
|
$form->setFieldset('json_payload', 'DF', _("json_payload"), "collapsible, startClosed"); |
777 |
|
$form->setBloc('json_payload', 'F'); |
778 |
|
$form->setBloc('timestamp_log', 'DF', '', 'col_9'); |
779 |
|
} |
780 |
|
|
781 |
} |
} |