N.546: Portal: Edit value in case log was kept after UserRequest update.

SVN:trunk[4500]
This commit is contained in:
Guillaume Lajarige
2016-12-08 10:18:59 +00:00
parent 1b1e91f0dc
commit c5a00a1bf1
2 changed files with 16 additions and 1 deletions

View File

@@ -387,9 +387,14 @@ EOF
break;
case 'Combodo\\iTop\\Form\\Field\\TextAreaField':
case 'Combodo\\iTop\\Form\\Field\\CaseLogField':
// Overloading $sFormFieldOptions to include the set_current_value_callback. It would have been nicer to refactor the variable for all field types, but as this is a fix for a maintenance release, we rather be safe.
$sValidators = json_encode($aValidators);
$oOutput->AddJs(
<<<EOF
$("[data-field-id='{$this->oField->GetId()}'][data-form-path='{$this->oField->GetFormPath()}']").portal_form_field_html($sFormFieldOptions);
$("[data-field-id='{$this->oField->GetId()}'][data-form-path='{$this->oField->GetFormPath()}']").portal_form_field_html({
validators: $sValidators,
set_current_value_callback: function(me, oEvent, oData){ $(me.element).find('textarea').val(oData); }
});
EOF
);
// MagnificPopup on images