Fixed unit

This commit is contained in:
Daniel Maya 2020-12-04 12:32:38 +01:00
parent 2d83687c2d
commit 244c4d56d6
4 changed files with 19 additions and 14 deletions

View File

@ -1404,6 +1404,10 @@ if ($update_module || $create_module) {
$each_ff = (int) get_parameter('each_ff', $module['each_ff']); $each_ff = (int) get_parameter('each_ff', $module['each_ff']);
$ff_timeout = (int) get_parameter('ff_timeout'); $ff_timeout = (int) get_parameter('ff_timeout');
$unit = (string) get_parameter('unit'); $unit = (string) get_parameter('unit');
if ($unit === '0') {
$unit = '';
}
$id_tag = (array) get_parameter('id_tag_selected'); $id_tag = (array) get_parameter('id_tag_selected');
$serialize_ops = (string) get_parameter('serialize_ops'); $serialize_ops = (string) get_parameter('serialize_ops');
$critical_instructions = (string) get_parameter('critical_instructions'); $critical_instructions = (string) get_parameter('critical_instructions');

View File

@ -548,17 +548,17 @@ $table_advanced->data[0][4] = html_print_input_text(
$classdisabledBecauseInPolicy $classdisabledBecauseInPolicy
); );
// $table_advanced->colspan[1][4] = 3; // $table_advanced->colspan[1][4] = 3;
// $table_advanced->data[0][4] = html_print_extended_select_for_unit( $table_advanced->data[0][4] = html_print_extended_select_for_unit(
// 'unit', 'unit',
// $unit, $unit,
// '', '',
// '', 'none',
// '0', '0',
// false, false,
// true, true,
// false, false,
// false false
// ); );
$table_advanced->colspan[0][4] = 3; $table_advanced->colspan[0][4] = 3;
$module_id_policy_module = 0; $module_id_policy_module = 0;

View File

@ -1481,7 +1481,6 @@ function html_print_extended_select_for_unit(
// $fields = post_process_get_custom_values(); // $fields = post_process_get_custom_values();
$fields['_timeticks_'] = 'Timeticks'; $fields['_timeticks_'] = 'Timeticks';
$fields['none'] = __('none');
$default_module_custom_units = get_custom_module_units(); $default_module_custom_units = get_custom_module_units();

View File

@ -724,12 +724,14 @@ function post_process_select_init_unit(name, selected) {
); );
$("#text-" + name + "_text").val(""); $("#text-" + name + "_text").val("");
} else { } else {
$("#" + name + "_select option[value=none]").attr("selected", true); $("#" + name + "_select option[value=0]").attr("selected", true);
$("#" + name + "_default").hide(); $("#" + name + "_default").hide();
$("#" + name + "_manual").show(); $("#" + name + "_manual").show();
} }
} else { } else {
$("#" + name + "_select option[value=none]").attr("selected", true); $("#" + name + "_select option[value=0]").attr("selected", true);
$("#" + name + "_default").hide();
$("#" + name + "_manual").show();
} }
$("#" + name + "_select").change(function() { $("#" + name + "_select").change(function() {