2013-02-27 Miguel de Dios <miguel.dedios@artica.es>

* include/javascript/pandora_modules.js, include/functions_api.php:
	improved the source code style.
	
	* operation/agentes/estado_generalagente.php: fixed the set name
	style for the agent.
	
	Fixes: #3606134




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7729 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-02-27 10:22:51 +00:00
parent 606e825895
commit 954f56dd60
4 changed files with 35 additions and 21 deletions

View File

@ -1,3 +1,13 @@
2013-02-27 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/pandora_modules.js, include/functions_api.php:
improved the source code style.
* operation/agentes/estado_generalagente.php: fixed the set name
style for the agent.
Fixes: #3606134
2013-02-27 Miguel de Dios <miguel.dedios@artica.es> 2013-02-27 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/module_manager_editor_common.php, * godmode/agentes/module_manager_editor_common.php,

View File

@ -3048,7 +3048,7 @@ function api_set_update_network_module_policy($id, $thrash1, $other, $thrash3) {
return; return;
} }
if ($other['data'][0] == ""){ if ($other['data'][0] == "") {
returnError('error_update_network_module_policy', __('Error updating network module in policy. Id_policy_module cannot be left blank.')); returnError('error_update_network_module_policy', __('Error updating network module in policy. Id_policy_module cannot be left blank.'));
return; return;
} }
@ -3061,25 +3061,27 @@ function api_set_update_network_module_policy($id, $thrash1, $other, $thrash3) {
return; return;
} }
if ($module_policy[0]['id_module'] != 2){ if ($module_policy[0]['id_module'] != 2) {
returnError('error_update_network_module_policy', __('Error updating network module in policy. Module type is not network type.')); returnError('error_update_network_module_policy', __('Error updating network module in policy. Module type is not network type.'));
return; return;
} }
$fields_network_module = array('id','description', 'id_module_group', 'min', 'max', 'post_process', 'module_interval', $fields_network_module = array('id','description',
'min_warning', 'max_warning', 'str_warning', 'min_critical', 'max_critical', 'str_critical', 'id_module_group', 'min', 'max', 'post_process',
'history_data', 'min_ff_event', 'disabled', 'tcp_port', 'snmp_community', 'snmp_oid', 'custom_id'); 'module_interval', 'min_warning', 'max_warning', 'str_warning',
'min_critical', 'max_critical', 'str_critical', 'history_data',
'min_ff_event', 'disabled', 'tcp_port', 'snmp_community',
'snmp_oid', 'custom_id');
$cont = 0; $cont = 0;
foreach ($fields_network_module as $field){ foreach ($fields_network_module as $field) {
if ($other['data'][$cont] != "" and $field != 'id'){ if ($other['data'][$cont] != "" and $field != 'id') {
$values[$field] = $other['data'][$cont]; $values[$field] = $other['data'][$cont];
} }
$cont++; $cont++;
} }
$result_update = enterprise_hook('policies_update_module', array($other['data'][0], $values, false)); $result_update = enterprise_hook('policies_update_module', array($other['data'][0], $values, false));

View File

@ -8,11 +8,13 @@ function configure_modules_form () {
if (id_modules_icmp.in_array (this.value)) { 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#advanced-tcp_send, tr#advanced-tcp_receive").hide ();
$("#text-tcp_port").attr ("disabled", "1"); $("#text-tcp_port").attr ("disabled", "1");
} else if (id_modules_snmp.in_array (this.value)) { }
else if (id_modules_snmp.in_array (this.value)) {
$("tr#simple-snmp_1, tr#simple-snmp_2").show (); $("tr#simple-snmp_1, tr#simple-snmp_2").show ();
$("tr#advanced-tcp_send, tr#advanced-tcp_receive").hide (); $("tr#advanced-tcp_send, tr#advanced-tcp_receive").hide ();
$("#text-tcp_port").removeAttr ("disabled"); $("#text-tcp_port").removeAttr ("disabled");
} else if (id_modules_tcp.in_array (this.value)) { }
else if (id_modules_tcp.in_array (this.value)) {
$("tr#simple-snmp_1, tr#simple-snmp_2").hide (); $("tr#simple-snmp_1, tr#simple-snmp_2").hide ();
$("tr#advanced-tcp_send, tr#advanced-tcp_receive").show (); $("tr#advanced-tcp_send, tr#advanced-tcp_receive").show ();
$("#text-tcp_port").removeAttr ("disabled"); $("#text-tcp_port").removeAttr ("disabled");

View File

@ -60,7 +60,7 @@ $table_agent->style[1] = 'width: 100px;';
$table_agent->style[2] = 'width: 16px;'; $table_agent->style[2] = 'width: 16px;';
$data = array(); $data = array();
$agent_name = ui_print_agent_name ($agent["id_agente"], true, 500, "text-transform: uppercase; font-size: medium;", true); $agent_name = ui_print_agent_name ($agent["id_agente"], true, 500, "font-size: medium;", true);
if ($agent['disabled']) { if ($agent['disabled']) {
$agent_name = "<em>" . $agent_name . "</em>" . ui_print_help_tip(__('Disabled'), true); $agent_name = "<em>" . $agent_name . "</em>" . ui_print_help_tip(__('Disabled'), true);
@ -76,7 +76,7 @@ $data[0] = ui_print_group_icon ($agent["id_grupo"], true) . '&nbsp;&nbsp;';
$data[0] .= $agent_name; $data[0] .= $agent_name;
$status_img = agents_tree_view_status_img ($agent["critical_count"], $status_img = agents_tree_view_status_img ($agent["critical_count"],
$agent["warning_count"], $agent["unknown_count"]); $agent["warning_count"], $agent["unknown_count"]);
$data[1] = events_tiny_stats ($agent['total_count'], $agent['normal_count'], $agent['critical_count'], $agent['warning_count'], $agent['unknown_count'], true); $data[1] = events_tiny_stats ($agent['total_count'], $agent['normal_count'], $agent['critical_count'], $agent['warning_count'], $agent['unknown_count'], true);
$data[2] = str_replace('.png' ,'_ball.png', $status_img); $data[2] = str_replace('.png' ,'_ball.png', $status_img);
@ -86,7 +86,7 @@ $table_agent->rowclass[] = '';
$data = array(); $data = array();
$addresses = agents_get_addresses($id_agente); $addresses = agents_get_addresses($id_agente);
$address = agents_get_address($id_agente); $address = agents_get_address($id_agente);
foreach($addresses as $k => $add) { foreach ($addresses as $k => $add) {
if($add == $address) { if($add == $address) {
unset($addresses[$k]); unset($addresses[$k]);
} }