mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Merge branch '2923-unit-y-post-process-no-se-guardan' into 'develop'
fixed bug: failing load of post process and unit fields in plugin component in module creation See merge request artica/pandorafms!1912 Former-commit-id: 659495290305079e9932ab60b5fef924ef6089ed
This commit is contained in:
commit
4f7733d8e8
@ -434,7 +434,7 @@ $table_advanced->data[2][1] .= html_print_input_hidden ('moduletype', $moduletyp
|
|||||||
$table_advanced->data[2][3] = __('Post process').' ' . ui_print_help_icon ('postprocess', true);
|
$table_advanced->data[2][3] = __('Post process').' ' . ui_print_help_icon ('postprocess', true);
|
||||||
$table_advanced->data[2][4] =
|
$table_advanced->data[2][4] =
|
||||||
html_print_extended_select_for_post_process('post_process',
|
html_print_extended_select_for_post_process('post_process',
|
||||||
$post_process, '', '', '0', false, true, false, true,
|
$post_process, '', '', '0', false, true, false, false,
|
||||||
$disabledBecauseInPolicy);
|
$disabledBecauseInPolicy);
|
||||||
$table_advanced->colspan[2][4] = 3;
|
$table_advanced->colspan[2][4] = 3;
|
||||||
|
|
||||||
|
@ -594,12 +594,51 @@ function post_process_select_init_unit(name,selected) {
|
|||||||
function post_process_select_events_unit(name,selected) {
|
function post_process_select_events_unit(name,selected) {
|
||||||
|
|
||||||
$('.' + name + '_toggler').click(function() {
|
$('.' + name + '_toggler').click(function() {
|
||||||
$('#' + name + '_select option[value=none]').attr("selected",true);
|
var value = $('#text-' + name + '_text').val();
|
||||||
$('#text-' + name + '_text').val("");
|
|
||||||
|
var count = $('#' + name + '_select option')
|
||||||
|
.filter(function(i, item) {
|
||||||
|
|
||||||
|
if ($(item).val() == value)
|
||||||
|
return true;
|
||||||
|
else return false;
|
||||||
|
})
|
||||||
|
.length;
|
||||||
|
|
||||||
|
if (count != 1) {
|
||||||
|
$('#' + name + '_select')
|
||||||
|
.append($("<option>").val(value).text(value));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#' + name + '_select option')
|
||||||
|
.filter(function(i, item) {
|
||||||
|
|
||||||
|
if ($(item).val() == value)
|
||||||
|
return true;
|
||||||
|
else return false;
|
||||||
|
})
|
||||||
|
.prop("selected", true);
|
||||||
|
|
||||||
toggleBoth(name);
|
toggleBoth(name);
|
||||||
|
$('#text-' + name + '_text').focus();
|
||||||
|
});
|
||||||
|
|
||||||
|
// When select a default period, is setted in seconds
|
||||||
|
$('#' + name + '_select').change(function() {
|
||||||
|
var value = $('#' + name + '_select').val();
|
||||||
|
|
||||||
|
$('.' + name).val(value);
|
||||||
|
$('#text-' + name + '_text').val(value);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#text-' + name + '_text').keyup (function () {
|
||||||
|
var value = $('#text-' + name + '_text').val();
|
||||||
|
$('.' + name).val(value);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function post_process_select_events(name) {
|
function post_process_select_events(name) {
|
||||||
$('.' + name + '_toggler').click(function() {
|
$('.' + name + '_toggler').click(function() {
|
||||||
var value = $('#text-' + name + '_text').val();
|
var value = $('#text-' + name + '_text').val();
|
||||||
|
@ -320,8 +320,23 @@ function configure_modules_form () {
|
|||||||
$("#text-ff_event_normal").attr ("value", (data["min_ff_event_normal"] == 0) ? 0 : data["min_ff_event_normal"]);
|
$("#text-ff_event_normal").attr ("value", (data["min_ff_event_normal"] == 0) ? 0 : data["min_ff_event_normal"]);
|
||||||
$("#text-ff_event_warning").attr ("value", (data["min_ff_event_warning"] == 0) ? 0 : data["min_ff_event_warning"]);
|
$("#text-ff_event_warning").attr ("value", (data["min_ff_event_warning"] == 0) ? 0 : data["min_ff_event_warning"]);
|
||||||
$("#text-ff_event_critical").attr ("value", (data["min_ff_event_critical"] == 0) ? 0 : data["min_ff_event_critical"]);
|
$("#text-ff_event_critical").attr ("value", (data["min_ff_event_critical"] == 0) ? 0 : data["min_ff_event_critical"]);
|
||||||
$("#text-post_process").attr("value", (data["post_process"] == 0) ? 0 : data["post_process"]);
|
|
||||||
$("#text-unit").attr("value", (data["unit"] == '') ? '' : data["unit"]);
|
// Shows manual input if post_process field is setted
|
||||||
|
if (data["post_process"] != 0) {
|
||||||
|
$('#post_process_manual').show();
|
||||||
|
$('#post_process_default').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#text-post_process_text").attr("value", (data["post_process"] == 0) ? 0 : data["post_process"]);
|
||||||
|
|
||||||
|
// Shows manual input if unit field is setted
|
||||||
|
if (data["unit"] != '') {
|
||||||
|
$('#unit_manual').show();
|
||||||
|
$('#unit_default').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#text-unit_text").attr("value", (data["unit"] == '') ? '' : data["unit"]);
|
||||||
|
|
||||||
$("#checkbox-critical_inverse").prop ("checked", data["critical_inverse"]);
|
$("#checkbox-critical_inverse").prop ("checked", data["critical_inverse"]);
|
||||||
$("#checkbox-warning_inverse").prop ("checked", data["warning_inverse"]);
|
$("#checkbox-warning_inverse").prop ("checked", data["warning_inverse"]);
|
||||||
$("#component_loading").hide ();
|
$("#component_loading").hide ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user