2013-04-16 Miguel de Dios <miguel.dedios@artica.es>

* godmode/agentes/module_manager_editor_network.php,
	godmode/agentes/module_manager_editor_common.php,
	include/javascript/pandora_modules.js: fixed the hidden fields for
	tcp checks.
	
	Fixes: #3611054
	
	* godmode/setup/setup_visuals.php: improved the source code style.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7994 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-04-16 14:51:04 +00:00
parent 315439bc87
commit ecac868d5c
5 changed files with 38 additions and 21 deletions

View File

@ -1,3 +1,14 @@
2013-04-16 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_common.php,
include/javascript/pandora_modules.js: fixed the hidden fields for
tcp checks.
Fixes: #3611054
* godmode/setup/setup_visuals.php: improved the source code style.
2013-04-16 Mario Pulido <mario.pulido@artica.es>
* godmode/agentes/configurar_agente.php: Fixed helps view in Agent config

View File

@ -139,7 +139,9 @@ if (!empty($id_agent_module) && isset($id_agente)) {
}
$disabled_enable = 0;
$policy_link = db_get_value('policy_linked', 'tagente_modulo', 'id_agente_modulo', $id_agent_module);
$policy_link = db_get_value('policy_linked', 'tagente_modulo',
'id_agente_modulo', $id_agent_module);
if ($policy_link != 0) {
$disabled_enable = 1;
}
@ -237,7 +239,8 @@ if (modules_is_string_type($id_module_type) || $edit) {
}
$table_simple->data[2][1] .= '<br /><em>'.__('Inverse interval').'</em>';
$table_simple->data[2][1] .= html_print_checkbox ("warning_inverse", 1, $warning_inverse, true);
$table_simple->data[2][1] .= html_print_checkbox ("warning_inverse", 1,
$warning_inverse, true);
$table_simple->data[2][2] = __('Critical status').' ' . ui_print_help_icon ('critical_status', true);
$table_simple->data[2][3] = '';

View File

@ -33,8 +33,9 @@ if (strstr($page, "policy_modules") === false) {
if ($config['enterprise_installed']) {
$disabledBecauseInPolicy = policies_is_module_in_policy($id_agent_module) && policies_is_module_linked($id_agent_module);
}
else
else {
$disabledBecauseInPolicy = false;
}
if ($disabledBecauseInPolicy)
$disabledTextBecauseInPolicy = 'disabled = "disabled"';
}
@ -113,13 +114,13 @@ $data[0] = __('TCP send') . ' ' . ui_print_help_icon ("tcp_send", true);
$data[1] = html_print_textarea ('tcp_send', 2, 65, $tcp_send, $disabledTextBecauseInPolicy, true);
$table_advanced->colspan['tcp_send'][1] = 3;
push_table_advanced ($data, 'tcp_send');
push_table_simple ($data, 'tcp_send');
$data[0] = __('TCP receive');
$data[1] = html_print_textarea ('tcp_rcv', 2, 65, $tcp_rcv, $disabledTextBecauseInPolicy, true);
$table_advanced->colspan['tcp_receive'][1] = 3;
push_table_advanced ($data, 'tcp_receive');
push_table_simple ($data, 'tcp_receive');
if ($id_module_type >= 15 && $id_module_type <= 18) {
/* SNMP */
@ -207,25 +208,25 @@ $(document).ready (function () {
});
$("#select_snmp_oid").click (
function () {
$(this).css ("width", "auto");
$(this).css ("min-width", "180px");
});
function () {
$(this).css ("width", "auto");
$(this).css ("min-width", "180px");
});
$("#select_snmp_oid").blur (function () {
$(this).css ("width", "180px");
});
$("#id_module_type").click (
function () {
$(this).css ("width", "auto");
$(this).css ("min-width", "180px");
});
function () {
$(this).css ("width", "auto");
$(this).css ("min-width", "180px");
});
$("#id_module_type").blur (function () {
$(this).css ("width", "180px");
});
// Keep elements in the form and the SNMP browser synced
$('#text-ip_target').keyup(function() {
$('#text-target_ip').val($(this).val());
@ -243,11 +244,11 @@ $(document).ready (function () {
// Show the SNMP browser window
function snmpBrowserWindow () {
// Keep elements in the form and the SNMP browser synced
$('#text-target_ip').val($('#text-ip_target').val());
$('#text-community').val($('#text-snmp_community').val());
$("#snmp_browser_container").show().dialog ({
title: '',
resizable: true,

View File

@ -96,7 +96,7 @@ $units = array(
SECONDS_1DAY => __('days'),
SECONDS_1MONTH => __('months'),
SECONDS_1YEAR => __('years'));
$table->data[$row][1] = __('Add new custom value to intervals') . ': ';
$table->data[$row][1] .= html_print_input_text ('interval_value', '', '', 5, 5, true);
$table->data[$row][1] .= html_print_select ($units, 'interval_unit', 1, "", '', '', true, false, false);
@ -298,7 +298,7 @@ $(document).ready (function () {
function changeIcons() {
icon = $("#gis_default_icon :selected").val();
$("#icon_without_status").attr("src", "images/spinner.png");
$("#icon_default").attr("src", "images/spinner.png");
$("#icon_ok").attr("src", "images/spinner.png");

View File

@ -6,21 +6,23 @@ var id_modules_snmp = Array (15, 16, 17, 18);
function configure_modules_form () {
$("#id_module_type").change (function () {
if (id_modules_icmp.in_array (this.value)) {
$("tr#simple-snmp_1, tr#simple-snmp_2, tr#advanced-tcp_send, tr#advanced-tcp_receive").hide ();
$("tr#simple-snmp_1, tr#simple-snmp_2, tr#simple-tcp_send, tr#simple-tcp_receive").hide ();
$("#text-tcp_port").attr ("disabled", "1");
}
else if (id_modules_snmp.in_array (this.value)) {
$("tr#simple-snmp_1, tr#simple-snmp_2").show ();
$("tr#advanced-tcp_send, tr#advanced-tcp_receive").hide ();
$("tr#simple-tcp_send, tr#simple-tcp_receive").hide ();
$("#text-tcp_port").removeAttr ("disabled");
}
else if (id_modules_tcp.in_array (this.value)) {
$("tr#simple-snmp_1, tr#simple-snmp_2").hide ();
$("tr#advanced-tcp_send, tr#advanced-tcp_receive").show ();
$("tr#simple-tcp_send, tr#simple-tcp_receive").show ();
$("#text-tcp_port").removeAttr ("disabled");
}
});
$("#id_module_type").trigger("change");
$("#local_component_group").change (function () {
var $select = $("#local_component").hide ();