From 1361ecd2e955a7a0bbfed4c5c243d6a352324eb9 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Tue, 16 May 2017 16:37:48 +0200 Subject: [PATCH] Added tags select field --- .../godmode/massive/massive_edit_modules.php | 27 +++++++++++++++++++ .../operation/agentes/ver_agente.php | 2 ++ 2 files changed, 29 insertions(+) diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index bfc3aab6de..923210086d 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -303,6 +303,13 @@ $table->data['form_modules_3'][1] = html_print_select($status_list, 'status_module', 'selected', '', __('All'), AGENT_MODULE_STATUS_ALL, true); $table->data['form_modules_3'][3] = ''; +$tags = tags_get_user_tags(); +$table->rowstyle['form_modules_4'] = 'vertical-align: top;'; +$table->rowclass['form_modules_4'] = 'select_modules_row select_modules_row_2'; +$table->data['form_modules_4'][0] = __('Tags'); +$table->data['form_modules_4'][1] = html_print_select ($tags, 'tags[]', + $tags_name, false, __('Any'), -1, true, true, true); + $table->rowstyle['form_modules_2'] = 'vertical-align: top;'; $table->rowclass['form_modules_2'] = 'select_modules_row select_modules_row_2'; $table->data['form_modules_2'][0] = __('Modules'); @@ -662,8 +669,10 @@ $(document).ready (function () { clean_lists(); + $(".select_modules_row").css('display', ''); $(".select_agents_row").css('display', ''); + $(".select_modules_row_2").css('display', 'none'); // Trigger change to refresh selection when change selection mode $("#agents_selection_mode").change (function() { @@ -720,6 +729,13 @@ $(document).ready (function () { var status_module = $('#status_module').val(); if (status_module != '-1') params['status_module'] = status_module; + + var tags_to_search = $('#tags').val(); + if (tags_to_search != null) { + if (tags_to_search[0] != -1) { + params['tags'] = tags_to_search; + } + } $("#module_loading").show (); $("tr#delete_table-edit1, tr#delete_table-edit0, tr#delete_table-edit2").hide (); @@ -926,6 +942,7 @@ $(document).ready (function () { else if(selector == 'modules') { $(".select_agents_row").hide(); $(".select_modules_row").show(); + $("#module_type").trigger("change"); } }); @@ -1041,6 +1058,16 @@ $(document).ready (function () { } }); + $("#tags").change(function() { + + selector = $("#form_edit input[name=selection_mode]:checked").val(); + if(selector == 'agents') { + $("#id_agents").trigger("change"); + } + else if(selector == 'modules') { + $("#module_type").trigger("change"); + } + }); }); function disabled_status () { diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 9d6fe5a1b3..4a984e46e3 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -549,6 +549,8 @@ if (is_ajax ()) { // Use 0 as not received $id_tipo_modulo = (int) get_parameter ('id_tipo_modulo', 0); $status_modulo = (int) get_parameter ('status_module', -1); + + $tags = (array) get_parameter ('tags', array()); // Filter $filter = array();