In alert command preview is not array but contain data, create textarea instead of select
This commit is contained in:
parent
8332eb1286
commit
400feb5d0c
|
@ -93,17 +93,23 @@ if (is_ajax ()) {
|
|||
if (empty($fv)) {
|
||||
$fv = array();
|
||||
}
|
||||
|
||||
foreach ($fv as $fv_option) {
|
||||
$fv_option = explode(',', $fv_option);
|
||||
$fields_value_select[$fv_option[0]] = $fv_option[1];
|
||||
if (count($fv) > 1) {
|
||||
foreach ($fv as $fv_option) {
|
||||
$fv_option = explode(',', $fv_option);
|
||||
$fields_value_select[$fv_option[0]] = $fv_option[1];
|
||||
}
|
||||
|
||||
$ffield = html_print_select($fields_value_select,
|
||||
'field' . $i . '_value', '', '', '', 0, true, false, false, 'fields');
|
||||
$rfield = html_print_select($fields_value_select,
|
||||
'field' . $i . '_recovery_value', '', '', '', 0, true, false, false, 'fields_recovery');
|
||||
}
|
||||
else {
|
||||
$ffield = html_print_textarea ('field' . $i . '_value',1, 1, $fv[0],
|
||||
'style="min-height:40px" class="fields"', true);
|
||||
$rfield = html_print_textarea ('field' . $i . '_recovery_value', 1, 1, $fv[0],
|
||||
'style="min-height:40px" class="fields_recovery"', true);
|
||||
}
|
||||
|
||||
|
||||
$ffield = html_print_select($fields_value_select,
|
||||
'field' . $i . '_value', '', '', '', 0, true, false, false, 'fields');
|
||||
$rfield = html_print_select($fields_value_select,
|
||||
'field' . $i . '_recovery_value', '', '', '', 0, true, false, false, 'fields_recovery');
|
||||
}
|
||||
else {
|
||||
$ffield = html_print_textarea ('field' . $i . '_value',
|
||||
|
|
|
@ -263,6 +263,8 @@ $(document).ready (function () {
|
|||
var old_recovery_value = '';
|
||||
var field_row = data["fields_rows"][i];
|
||||
|
||||
old_value = '';
|
||||
old_recovery_value = '';
|
||||
// Only keep the value if is provided from hidden (first time)
|
||||
if (($("[name=field" + i + "_value]").attr('id'))
|
||||
== ("hidden-field" + i + "_value")) {
|
||||
|
@ -282,11 +284,16 @@ $(document).ready (function () {
|
|||
$('#table_macros-field' + i).hide();
|
||||
}
|
||||
else {
|
||||
$('#table_macros-field' + i).replaceWith(field_row);
|
||||
$("[name=field" + i + "_value]").val(old_value);
|
||||
$("[name=field" + i + "_recovery_value]")
|
||||
.val(old_recovery_value);
|
||||
|
||||
$('#table_macros-field' + i).replaceWith(field_row);
|
||||
if (old_value != '' && old_recovery_value != ''){
|
||||
$("[name=field" + i + "_value]").val(old_value);
|
||||
$("[name=field" + i + "_recovery_value]").val(old_recovery_value);
|
||||
}
|
||||
else{
|
||||
$("[name=field" + i + "_value]").val($("[name=field" + i + "_value]").val());
|
||||
$("[name=field" + i + "_recovery_value]").val($("[name=field" + i + "_recovery_value]").val());
|
||||
}
|
||||
|
||||
// Add help hint only in first field
|
||||
if (i == 1) {
|
||||
|
|
Loading…
Reference in New Issue