2012-12-07 Sergio Martin <sergio.martin@artica.es>

* include/javascript/pandora_modules.js
	godmode/agentes/module_manager_editor_common.php
	godmode/agentes/configurar_agente.php
	godmode/modules/manage_network_components_form.php
	godmode/modules/manage_network_components_form_common.php
	godmode/modules/manage_network_components.php: Added id_category
	to network components and module editors



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7238 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2012-12-07 14:25:40 +00:00
parent 6e8de73ca5
commit 1bb1011868
7 changed files with 56 additions and 8 deletions

View File

@ -1,3 +1,13 @@
2012-12-07 Sergio Martin <sergio.martin@artica.es>
* include/javascript/pandora_modules.js
godmode/agentes/module_manager_editor_common.php
godmode/agentes/configurar_agente.php
godmode/modules/manage_network_components_form.php
godmode/modules/manage_network_components_form_common.php
godmode/modules/manage_network_components.php: Added id_category
to network components and module editors
2012-12-07 Ramon Novoa <rnovoa@artica.es>
* include/functions_graph.php,

View File

@ -986,7 +986,8 @@ if ($create_module) {
'unknown_instructions' => $unknown_instructions,
'critical_inverse' => $critical_inverse,
'warning_inverse' => $warning_inverse,
'cron_interval' => $cron_interval);
'cron_interval' => $cron_interval,
'id_category' => $id_category);
if ($prediction_module == 3 && $serialize_ops == '') {
$id_agent_module = false;

View File

@ -385,6 +385,10 @@ if (check_acl ($config['id_user'], 0, "PM")) {
$table_advanced->data[13][1] = html_print_select(categories_get_all_categories('forselect'), 'id_category', $id_category, '', __('None'), 0, true);
$table_advanced->colspan[13][1] = 4;
}
else {
// Store in a hidden field if is not visible to avoid delete the value
$table_advanced->data[12][4] .= html_print_input_hidden ('id_category', $id_category, true);
}
?>
<script type="text/javascript">

View File

@ -29,6 +29,7 @@ if (! check_acl ($config['id_user'], 0, "PM")) {
ui_print_page_header (__('Module management').' &raquo; '.__('Network component management'), "", false, "network_component", true);
require_once ('include/functions_network_components.php');
include_once("include/functions_categories.php");
$type = (int) get_parameter ('type');
$name = (string) get_parameter ('name');
@ -81,6 +82,7 @@ $warning_instructions = (string) get_parameter('warning_instructions');
$unknown_instructions = (string) get_parameter('unknown_instructions');
$critical_inverse = (int) get_parameter('critical_inverse');
$warning_inverse = (int) get_parameter('warning_inverse');
$id_category = (int) get_parameter('id_category');
$snmp_version = (string) get_parameter('snmp_version');
$snmp3_auth_user = (string) get_parameter('snmp3_auth_user');
@ -173,7 +175,8 @@ if ($create_component) {
'warning_instructions' => $warning_instructions,
'unknown_instructions' => $unknown_instructions,
'critical_inverse' => $critical_inverse,
'warning_inverse' => $warning_inverse));
'warning_inverse' => $warning_inverse,
'id_category' => $id_category));
}
else {
$id = '';
@ -251,7 +254,8 @@ if ($update_component) {
'warning_instructions' => $warning_instructions,
'unknown_instructions' => $unknown_instructions,
'critical_inverse' => $critical_inverse,
'warning_inverse' => $warning_inverse));
'warning_inverse' => $warning_inverse,
'id_category' => $id_category));
}
else {
$result = '';
@ -367,7 +371,8 @@ $url = ui_get_url_refresh (array ('offset' => false,
'warning_instructions' => false,
'unknown_instructions' => false,
'critical_inverse' => false,
'warning_inverse' => false));
'warning_inverse' => false,
'id_category' => false));
$search_id_group = (int) get_parameter ('search_id_group');

View File

@ -66,6 +66,7 @@ if ($create_network_from_module) {
$unknown_instructions = $data_module["unknown_instructions"];
$critical_inverse = $data_module["critical_inverse"];
$warning_inverse = $data_module["warning_inverse"];
$id_category = $data_module["id_category"];
}
$id_component_type = (int) get_parameter ('id_component_type');
@ -114,6 +115,7 @@ if (isset ($id)) {
$unknown_instructions = $component["unknown_instructions"];
$critical_inverse = $component["critical_inverse"];
$warning_inverse = $component["warning_inverse"];
$id_category = $component["id_category"];
if ($type >= 15 && $type <= 18) {
// New support for snmp v3
@ -160,6 +162,7 @@ if (isset ($id)) {
$unknown_instructions = '';
$critical_inverse = 0;
$warning_inverse = 0;
$id_category = 0;
$snmp_version = 1;
$snmp3_auth_user = '';

View File

@ -134,4 +134,15 @@ $table->data[8][2] = $table->data[8][3] = '';
$table->data[9][0] = __('Unknown instructions'). ui_print_help_tip(__("Instructions when the status is unknown"), true);
$table->data[9][1] = html_print_textarea ('unknown_instructions', 2, 65, $unknown_instructions, '', true);
$table->data[9][2] = $table->data[9][3] = '';
if (check_acl ($config['id_user'], 0, "PM")) {
$table->data[10][0] = __('Category');
$table->data[10][1] = html_print_select(categories_get_all_categories('forselect'), 'id_category', $id_category, '', __('None'), 0, true);
$table->data[10][2] = $table->data[9][3] = '';
}
else {
// Store in a hidden field if is not visible to avoid delete the value
$table->data[9][2] .= html_print_input_hidden ('id_category', $id_category, true);
}
?>

View File

@ -137,7 +137,15 @@ function configure_modules_form () {
$("#text-warning_inverse").attr ("value", (data["warning_inverse"] == 0) ? 0 : data["warning_inverse"]);
$("#component_loading").hide ();
$("#id_module_type").change ();
if($("#id_category").is("select")) {
$("#id_category option[value="+data["id_category"]+"]").select (1);
console.log('select');
}
else {
$("#hidden-id_category").val(data["id_category"]);
console.log('hidden');
}
// Delete macro fields
$('.macro_field').remove();
@ -145,7 +153,7 @@ function configure_modules_form () {
var legend = '';
// If exist macros, load the fields
if(data["macros"] != '') {
if(data["macros"] != '' && data["macros"] != null) {
$('#hidden-macros').val(Base64.encode(data["macros"]));
var obj = jQuery.parseJSON(data["macros"]);
@ -259,14 +267,20 @@ function configure_modules_form () {
$("#text-warning_inverse").attr ("value", (data["warning_inverse"] == 0) ? 0 : data["warning_inverse"]);
$("#component_loading").hide ();
$("#id_module_type").change ();
if($("#id_category").is("select")) {
$("#id_category option[value="+data["id_category"]+"]").select (1);
}
else {
$("#hidden-id_category").val(data["id_category"]);
}
// Delete macro fields
$('.macro_field').remove();
$('#hidden-macros').val('');
// If exist macros, load the fields
if(data["macros"] != '') {
if(data["macros"] != '' && data["macros"] != null) {
$('#hidden-macros').val(Base64.encode(data["macros"]));
var obj = jQuery.parseJSON(data["macros"]);