From 062a783eaad87a457a73edb16541e7f031f117e7 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Thu, 9 Jun 2011 15:35:34 +0000 Subject: [PATCH] 2011-06-09 Juan Manuel Ramon * godmode/agentes/module_manager_editor_common.php godmode/agentes/configurar_agente.php godmode/agentes/module_manager_editor.php: Changed tag assigment interface inside module editor. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4425 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++ .../godmode/agentes/configurar_agente.php | 2 +- .../godmode/agentes/module_manager_editor.php | 3 +- .../agentes/module_manager_editor_common.php | 63 ++++++++++++++++++- 4 files changed, 70 insertions(+), 5 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index b536d03071..971c8ad175 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2011-06-09 Juan Manuel Ramon + + * godmode/agentes/module_manager_editor_common.php + godmode/agentes/configurar_agente.php + godmode/agentes/module_manager_editor.php: Changed tag assigment + interface inside module editor. + 2011-06-08 Juan Manuel Ramon * operation/events/events_list.php: Added tag information in this diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 9969aede15..302a289197 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -617,7 +617,7 @@ if ($update_module || $create_module) { $max_critical = (float) get_parameter ('max_critical'); $ff_event = (int) get_parameter ('ff_event'); $unit = (string) get_parameter('unit'); - $id_tag = (array) get_parameter('id_tag'); + $id_tag = (array) get_parameter('id_tag_selected'); $active_snmp_v3 = get_parameter('active_snmp_v3'); if ($active_snmp_v3) { diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index 61a99baf98..6566e81cad 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -257,7 +257,8 @@ if($is_function_policies !== ENTERPRISE_NOT_HOOK) { } } - +global $__code_from; +$__code_from = 'modules'; switch ($moduletype) { case "dataserver": case 1: diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 1015012447..d319a04a72 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -230,8 +230,65 @@ $table_advanced->data[5][0] = __('Unit'); $table_advanced->data[5][1] = html_print_input_text ('unit', $unit, '', 20, 65, true); /* Tags */ -$table_advanced->data[6][0] = __('Tag'); -$table_advanced->data[6][1] = html_print_select_from_sql ('SELECT id_tag, name FROM ttag ORDER BY name', - 'id_tag[]', $id_tag, '',__('None'),'0', true, true, false, false); +// This var comes from module_manager_editor.php or policy_modules.php +global $__code_from; +$table_advanced->data[6][0] = __('Tags available'); +// Code comes from module_editor +if ($__code_from == 'modules') { + $__table_modules = 'ttag_module'; + $__id_where = 'b.id_agente_modulo'; + $__id = $id_agent_module; +// Code comes from policy module editor +}else { + global $__id_pol_mod; + $__table_modules= 'ttag_policy_module'; + $__id_where = 'b.id_policy_module'; + $__id = $__id_pol_mod; +} +$table_advanced->data[6][1] = html_print_select_from_sql ("SELECT id_tag, name + FROM ttag + WHERE id_tag NOT IN ( + SELECT a.id_tag + FROM ttag a, $__table_modules b + WHERE a.id_tag = b.id_tag AND $__id_where = $__id ) + ORDER BY name", + 'id_tag_available[]', $id_tag, '',__('None'),'0', true, true, false, false); +$table_advanced->data[6][2] = html_print_image('images/darrowright.png', true, array('id' => 'right', 'title' => __('Add tags to module'))); //html_print_input_image ('add', 'images/darrowright.png', 1, '', true, array ('title' => __('Add tags to module'))); +$table_advanced->data[6][2] .= '



' . html_print_image('images/darrowleft.png', true, array('id' => 'left', 'title' => __('Delete tags to module'))); //html_print_input_image ('add', 'images/darrowleft.png', 1, '', true, array ('title' => __('Delete tags to module'))); + +$table_advanced->data[6][3] = '' . __('Tags selected') . ''; +$table_advanced->data[6][4] = html_print_select_from_sql ("SELECT a.id_tag, name + FROM ttag a, $__table_modules b + WHERE a.id_tag = b.id_tag AND $__id_where = $__id + ORDER BY name", + 'id_tag_selected[]', $id_tag, '',__('None'),'0', true, true, false, false); +//$table_advanced->data[6][4] .= html_print_input_hidden('id_tag_serialize', ''); ?> + +