diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 00857478e1..704dde0130 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,22 @@ +2012-09-18 Miguel de Dios + + * godmode/reporting/visual_console_builder.editor.js, + godmode/alerts/alert_list.builder.php, + godmode/alerts/alert_list.list.php, + godmode/gis_maps/configure_gis_map.php, + include/functions_visual_map_editor.php, include/functions_ui.php, + operation/tree.php, operation/agentes/exportdata.excel.php, + operation/agentes/exportdata.php, operation/agentes/ver_agente.php, + operation/snmpconsole/snmp_view.php, operation/users/user_edit.php, + operation/gis_maps/ajax.php, operation/events/events_validate.php, + operation/messages/message_edit.php, + operation/messages/message_list.php, + operation/reporting/reporting_viewer.php, + operation/netflow/nf_live_view.php, + operation/incidents/incident.php, operation/search_modules.php: + started to use the new function "ui_print_agent_autocomplete_input" + to make more easy (and standar) the autocomplete agent input. + 2012-09-18 Ramon Novoa * pandoradb.postgreSQL.sql, diff --git a/pandora_console/godmode/alerts/alert_list.builder.php b/pandora_console/godmode/alerts/alert_list.builder.php index 8dbec73fd2..1f9ce46b96 100644 --- a/pandora_console/godmode/alerts/alert_list.builder.php +++ b/pandora_console/godmode/alerts/alert_list.builder.php @@ -44,12 +44,15 @@ $table->align[1] = 'left'; /* Add an agent selector */ if (! $id_agente) { - $table->data['agent'][0] = __('Agent'); - $src_code = html_print_image('images/lightning.png', true, false, true); - $table->data['agent'][1] = html_print_input_text_extended ('id_agent', '', 'text_id_agent', '', 30, 100, false, '', - array('style' => 'background: url(' . $src_code . ') no-repeat right;'), true) - . ui_print_help_tip(__('Type at least two characters to search'), true); + + $params = array(); + $params['return'] = true; + $params['show_helptip'] = true; + $params['input_name'] = 'id_agent'; + $params['selectbox_id'] = 'id_agent_module'; + $params['javascript_is_function_select'] = true; + $table->data['agent'][1] = ui_print_agent_autocomplete_input($params); } $table->data[0][0] = __('Module'); @@ -141,94 +144,6 @@ ui_require_jquery_file ('bgiframe'); + \ No newline at end of file diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index b6401d28cd..4961dd2d70 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -42,7 +42,6 @@ function visual_map_main() { eventsBackground(); eventsItems(); - eventsTextAgent(); //Fixed to wait the load of images. $(window).load(function() { @@ -51,95 +50,6 @@ function visual_map_main() { ); } -function eventsTextAgent() { - var idText = $("#ip_text").html(); - - $("#text-agent").autocomplete({ - minLength: 2, - source: function( request, response ) { - var term = request.term; //Word to search - - var params = []; - params.push("all=enabled"); - params.push("search_agents_2=1"); - params.push("page=include/ajax/agent"); - params.push("id_group="+ $("#group").val()); - params.push("q="+ term); - jQuery.ajax ({ - data: params.join ("&"), - async: false, - type: 'POST', - url: action="ajax.php", - timeout: 10000, - dataType: 'json', - success: function (data) { - response(data); - return; - } - }); - return; - }, - select: function( event, ui ) { - var agent_name = ui.item.name; - - //Put the name - $(this).val(agent_name); - - //Fill the modules select box - $('#module').fadeOut ('normal', function () { - $('#module').empty (); - var inputs = []; - inputs.push ("filter=disabled = 0"); - inputs.push ("agent_name=" + agent_name); - inputs.push ("get_agent_modules_json=1"); - inputs.push ("page=operation/agentes/ver_agente"); - jQuery.ajax ({ - data: inputs.join ("&"), - type: 'GET', - url: action="ajax.php", - timeout: 10000, - dataType: 'json', - success: function (data) { - $('#module').append ($('').attr ('value', 0).text ("--")); - jQuery.each (data, function (i, val) { - s = js_html_entity_decode (val['nombre']); - $('#module').append ($('').attr ('value', val['id_agente_modulo']).text (s)); - }); - $('#module').fadeIn ('normal'); - } - }); - }); - - return false; - } - }) - .data( "autocomplete")._renderItem = function( ul, item ) { - if (item.ip == '') { - text = "" + item.name + ""; - } - else { - text = "" + item.name - + "
IP:" + item.ip + "
"; - } - - return $("
  • ") - .data("item.autocomplete", item) - .append(text) - .appendTo(ul); - }; - - //Force the size of autocomplete - $(".ui-autocomplete").css("max-height", "100px"); - $(".ui-autocomplete").css("overflow-y", "auto"); - /* prevent horizontal scrollbar */ - $(".ui-autocomplete").css("overflow-x", "hidden"); - /* add padding to account for vertical scrollbar */ - $(".ui-autocomplete").css("padding-right", "20px"); - - //Force to style of items - $(".ui-autocomplete").css("text-align", "left"); -} - function cancel_button_palette_callback() { if (is_opened_palette) { toggle_item_palette(); diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 90905cd425..d71a1c6312 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -2140,6 +2140,38 @@ function ui_print_agent_autocomplete_input($parameters) { // Javascript configurations //----------------------------------------- + $javascript_function_action_after_select = ''; //Default value + $javascript_function_action_after_select_js_call = ''; //Default value + if (isset($parameters['javascript_function_action_after_select'])) { + $javascript_function_action_after_select = $parameters['javascript_function_action_after_select']; + $javascript_function_action_after_select_js_call = + $javascript_function_action_after_select . '();'; + } + + if (isset($parameters['javascript_function_action_after_select_js_call'])) { + if ($javascript_function_action_after_select_js_call != + $parameters['javascript_function_action_after_select_js_call']) { + $javascript_function_action_after_select_js_call = + $parameters['javascript_function_action_after_select_js_call']; + } + } + + $javascript_function_action_into_source = ''; //Default value + $javascript_function_action_into_source_js_call = ''; //Default value + if (isset($parameters['javascript_function_action_into_source'])) { + $javascript_function_action_into_source = $parameters['javascript_function_action_into_source']; + $javascript_function_action_into_source_js_call = + $javascript_function_action_into_source . '();'; + } + + if (isset($parameters['javascript_function_action_into_source_js_call'])) { + if ($javascript_function_action_into_source_js_call != + $parameters['javascript_function_action_into_source_js_call']) { + $javascript_function_action_into_source_js_call = + $parameters['javascript_function_action_into_source_js_call']; + } + } + $javascript = true; //Default value if (isset($parameters['javascript'])) { $javascript = $parameters['javascript']; @@ -2205,6 +2237,53 @@ function ui_print_agent_autocomplete_input($parameters) { $javascript_page = $parameters['javascript_page']; } + $javascript_change_ajax_params_original = array('page' => '"' . $javascript_page . '"', + 'search_agents_2' => 1, + 'id_group' => 'function() { + var group_id = 0; + + if (' . ((int)!empty($selectbox_group)) . ') { + group_id = $("#' . $selectbox_group . '").val(); + } + + return group_id; + }', + 'q' => 'term'); + if (isset($parameters['javascript_change_ajax_params'])) { + $javascript_change_ajax_params = array(); + + $found_page = false; + foreach ($parameters['javascript_change_ajax_params'] as $key => $param_ajax) { + if ($key == 'page') { + $found_page = true; + if ($javascript_page != $param_ajax) { + $javascript_change_ajax_params['page'] = $param_ajax; + } + else { + $javascript_change_ajax_params['page'] = $javascript_page; + } + } + else { + $javascript_change_ajax_params[$key] = $param_ajax; + } + } + + if (!$found_page) { + $javascript_change_ajax_params['page'] = $javascript_page; + } + } + else { + $javascript_change_ajax_params = $javascript_change_ajax_params_original; + } + $first = true; + $javascript_change_ajax_params_text = 'var data_params = {'; + foreach ($javascript_change_ajax_params as $key => $param_ajax) { + if (!$first) $javascript_change_ajax_params_text .= ",\n"; + else $first = false; + $javascript_change_ajax_params_text .= '"' . $key . '":' . $param_ajax; + } + $javascript_change_ajax_params_text .= '};'; + $javascript_function_change =''; $javascript_function_change .=' function set_functions_change_autocomplete_' . $input_name . '() { @@ -2213,19 +2292,13 @@ function ui_print_agent_autocomplete_input($parameters) { source: function( request, response ) { var term = request.term; //Word to search - var data_params = { - "page": "' . $javascript_page . '", - "search_agents_2": 1, - id_group: function() { - var group_id = 0; - - if (' . ((int)!empty($selectbox_group)) . ') { - group_id = $("#' . $selectbox_group . '").val(); - } - - return group_id; - }, - "q": term}; + ' . $javascript_change_ajax_params_text . ' + + //Function to call when the source + if (' . ((int)!empty($javascript_function_action_into_source_js_call)) . ') { + ' . $javascript_function_action_into_source_js_call . ' + } + jQuery.ajax ({ data: data_params, @@ -2260,10 +2333,16 @@ function ui_print_agent_autocomplete_input($parameters) { $("#' . $hidden_input_idagent_id . '").val(agent_id); } + //Put the server id into the hidden input if (' . ((int)$use_input_server) . ') { $("#' . $input_server_id . '").val(server_name); } + //Function to call after the select + if (' . ((int)!empty($javascript_function_action_after_select_js_call)) . ') { + ' . $javascript_function_action_after_select_js_call . ' + } + return false; } }) diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 13833a5be6..1f516cd130 100644 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -101,10 +101,20 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items['agent_row']['items'] = array('static_graph', 'percentile_bar', 'percentile_item', 'module_graph', 'simple_value', 'datos'); - $form_items['agent_row']['html'] = '' . __('Agent') . - ' ' . __("Type at least two characters to search.") . '' . ' - ' . html_print_input_text_extended ('agent', '', 'text-agent', '', 25, 100, false, '', - array('style' => 'background: #ffffff url(images/lightning.png) no-repeat right;'), true) . ''; + $form_items['agent_row']['html'] = '' . __('Agent') . ''; + + + + $params = array(); + $params['return'] = true; + $params['show_helptip'] = true; + $params['input_name'] = 'agent'; + $params['size'] = 20; + $params['selectbox_id'] = 'module'; + $params['javascript_is_function_select'] = true; + $form_items['agent_row']['html'] .= '' . ui_print_agent_autocomplete_input($params); + + $form_items['module_row'] = array(); $form_items['module_row']['items'] = array('static_graph', diff --git a/pandora_console/operation/agentes/exportdata.excel.php b/pandora_console/operation/agentes/exportdata.excel.php index b7961e07a1..5c346b0a62 100644 --- a/pandora_console/operation/agentes/exportdata.excel.php +++ b/pandora_console/operation/agentes/exportdata.excel.php @@ -50,28 +50,28 @@ $export_type = get_parameter_post ('export_type', 'data'); $export_btn = get_parameter_post ('export_btn', 0); if (!empty ($module)) { - + // Disable SQL cache global $sql_cache; $sql_cache = array ('saved' => 0); - - + + //Convert start time and end time to unix timestamps $start = strtotime ($start_date." ".$start_time); $end = strtotime ($end_date." ".$end_time); $period = $end - $start; - $data = array (); + $data = array (); //If time is negative or zero, don't process - it's invalid if ($start < 1 || $end < 1) { ui_print_error_message (__('Invalid time specified')); return; } - - // *************************************************** + + //****************************************************************** // Starts, ends and dividers - // *************************************************** - + //****************************************************************** + //Excel is tab-delimited, needs quotes and needs Windows-style newlines $datastart = __('Agent')."\t".__('Module')."\t".__('Data')."\t".__('Timestamp')."\r\n"; $rowstart = '"'; @@ -80,10 +80,10 @@ if (!empty ($module)) { $dataend = "\r\n"; $extension = "xls"; - // *************************************************** + //****************************************************************** // Header output - // *************************************************** - + //****************************************************************** + $config['ignore_callback'] = true; while (@ob_end_clean ()); @@ -91,29 +91,29 @@ if (!empty ($module)) { header("Content-Disposition: attachment; filename=export_".date("Ymd", $start)."_".date("Ymd", $end).".".$extension); header("Pragma: no-cache"); header("Expires: 0"); - - // *************************************************** + + //****************************************************************** // Data processing - // *************************************************** - + //****************************************************************** + $data = array (); // Show header echo $datastart; - + foreach ($module as $selected) { - + $output = ""; $work_period = 120000; if ($work_period > $period) { $work_period = $period; } - + $work_end = $end - $period + $work_period; //Buffer to get data, anyway this will report a memory exhaustin - + while ($work_end <= $end) { - + $data = array (); // Reinitialize array for each module chunk if ($export_type == "avg") { $arr = array (); @@ -157,10 +157,9 @@ if (!empty ($module)) { unset ($output); $output = ""; } // main foreach - echo $dataend; + echo $dataend; } else { ui_print_error_message (__('No modules specified')); } - -?> +?> \ No newline at end of file diff --git a/pandora_console/operation/agentes/exportdata.php b/pandora_console/operation/agentes/exportdata.php index 43a0bff5d9..db0ce6c809 100644 --- a/pandora_console/operation/agentes/exportdata.php +++ b/pandora_console/operation/agentes/exportdata.php @@ -68,7 +68,7 @@ if (!empty ($export_btn) && !empty ($module)) { $start = strtotime ($start_date." ".$start_time); $end = strtotime ($end_date." ".$end_time); $period = $end - $start; - $data = array (); + $data = array (); //If time is negative or zero, don't process - it's invalid if ($start < 1 || $end < 1) { @@ -79,7 +79,6 @@ if (!empty ($export_btn) && !empty ($module)) { //****************************************************************** // Starts, ends and dividers //****************************************************************** - switch ($export_type) { case "data": case "avg": @@ -96,7 +95,6 @@ if (!empty ($export_btn) && !empty ($module)) { //****************************************************************** // Data processing //****************************************************************** - $data = array (); switch ($export_type) { case "data": diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 5a8ce2da82..adc7c719f2 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -803,23 +803,23 @@ switch($tab) { break; case "inventory": $header_description = ' - ' . __('Inventory'); - break; + break; case "collection": $header_description = ' - ' . __('Collection'); - break; + break; case "gis": $header_description = ' - ' . __('Gis'); - break; + break; case "custom_fields": $header_description = ' - ' . __('Custom fields'); - break; + break; case "graphs": $header_description = ' - ' . __('Graphs'); - break; + break; case "policy": $header_description = ' - ' . __('Policy'); break; - case "incident": + case "incident": $header_description = ' - ' . __('Incident'); break; case "url_address": diff --git a/pandora_console/operation/events/events_validate.php b/pandora_console/operation/events/events_validate.php index 303a7bbea5..bf44770cfa 100644 --- a/pandora_console/operation/events/events_validate.php +++ b/pandora_console/operation/events/events_validate.php @@ -70,13 +70,13 @@ foreach($ids as $key => $id) { case 1: $img_st = "images/tick.png"; $title_st = __('Event validated'); - break; + break; case 2: $img_st = "images/hourglass.png"; $title_st = __('Event in process'); break; } - + $icon = html_print_image ($img_st, true, array ("class" => "image_status", "width" => 16, @@ -112,7 +112,7 @@ $string .= ''; if($any_alert) { $string .= ''; } -$string .= ''; +$string .= ''; echo $string; diff --git a/pandora_console/operation/gis_maps/ajax.php b/pandora_console/operation/gis_maps/ajax.php index 23c2e31fbc..b945c873cc 100644 --- a/pandora_console/operation/gis_maps/ajax.php +++ b/pandora_console/operation/gis_maps/ajax.php @@ -139,11 +139,12 @@ switch ($opt) { $returnJSON = array(); $returnJSON['correct'] = 1; $returnJSON['content'] = __('Agent') . ': '.agents_get_name($row['tagente_id_agente']).'
    '; - $returnJSON['content'] .= __('Position (Long, Lat, Alt)') . ': (' . $row['longitude'] . ', ' . $row['latitude'] . ', ' . $row['altitude'] . ')
    '; + $returnJSON['content'] .= __('Position (Long, Lat, Alt)') . ': (' . $row['longitude'] . ', ' . $row['latitude'] . ', ' . $row['altitude'] . ')
    '; $returnJSON['content'] .= __('Start contact') . ': ' . $row['start_timestamp'] . '
    '; $returnJSON['content'] .= __('Last contact') . ': ' . $row['end_timestamp'] . '
    '; $returnJSON['content'] .= __('Num reports') . ': '.$row['number_of_packages'].'
    '; - if ($row['manual_placemen']) $returnJSON['content'] .= '
    ' . __('Manual placement') . '
    '; + if ($row['manual_placemen']) + $returnJSON['content'] .= '
    ' . __('Manual placement') . '
    '; echo json_encode($returnJSON); diff --git a/pandora_console/operation/incidents/incident.php b/pandora_console/operation/incidents/incident.php index 2cd0e1a93d..43cc659bac 100755 --- a/pandora_console/operation/incidents/incident.php +++ b/pandora_console/operation/incidents/incident.php @@ -91,9 +91,9 @@ elseif ($action == "update") { $id_agent = get_parameter ("id_agent"); $sql = sprintf ("UPDATE tincidencia SET titulo = '%s', origen = '%s', estado = %d, id_grupo = %d, id_usuario = '%s', prioridad = %d, descripcion = '%s', id_lastupdate = '%s', id_agent = %d WHERE id_incidencia = %d", - $titulo, $origen, $estado, $grupo, $usuario, $prioridad, $descripcion, $config["id_user"], $id_agent, $id_inc); + $titulo, $origen, $estado, $grupo, $usuario, $prioridad, $descripcion, $config["id_user"], $id_agent, $id_inc); $result = db_process_sql ($sql); - + if ($result !== false) { db_pandora_audit("Incident updated","User ".$config['id_user']." updated incident #".$id_inc); } @@ -101,7 +101,6 @@ elseif ($action == "update") { ui_print_result_message ($result, __('Successfully updated'), __('Could not be updated')); - } elseif ($action == "insert") { //Create incident @@ -112,7 +111,7 @@ elseif ($action == "insert") { require ("general/noaccess.php"); exit; } - + // Read input variables $titulo = get_parameter ("titulo"); $titulo = io_safe_input(strip_tags(io_safe_output($titulo))); @@ -123,11 +122,11 @@ elseif ($action == "insert") { $estado = get_parameter ("estado_form"); $id_agent = get_parameter ("id_agent"); $sql = sprintf ("INSERT INTO tincidencia (inicio, actualizacion, titulo, descripcion, id_usuario, origen, estado, prioridad, id_grupo, id_creator, id_agent, id_agente_modulo) VALUES - (NOW(), NOW(), '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', %d, 0)", $titulo, $descripcion, $config["id_user"], $origen, $estado, $prioridad, $grupo, $config["id_user"], $id_agent); + (NOW(), NOW(), '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', %d, 0)", $titulo, $descripcion, $config["id_user"], $origen, $estado, $prioridad, $grupo, $config["id_user"], $id_agent); $id_inc = db_process_sql ($sql, "insert_id"); - + if ($id_inc === false) { - echo '

    '.__('Error creating incident').'

    '; + echo '

    '.__('Error creating incident').'

    '; } else { db_pandora_audit("Incident created", "User ".$config["id_user"]." created incident #".$id_inc); @@ -254,7 +253,7 @@ html_print_select_groups($config["id_user"], "IR", true, "grupo", $grupo, 'javas echo "    "; -html_print_input_text ('texto', $texto, '', 45); +html_print_input_text ('texto', $texto, '', 45); echo ' '; html_print_input_image ("submit", "images/zoom.png", __('Search'), 'padding:0;', false, array ("alt" => __('Search'))); @@ -283,7 +282,7 @@ else { $url .= "&texto=".$texto; // Show pagination - ui_pagination ($count, $url, $offset, 0, false); //($count + $offset) it's real count of incidents because it's use LIMIT $offset in query. + ui_pagination ($count, $url, $offset, 0, false); //($count + $offset) it's real count of incidents because it's use LIMIT $offset in query. echo '
    '; // Show headers @@ -366,7 +365,9 @@ else { echo ''; unset ($table); } - echo '

    '; + +echo '

    '; + if (check_acl ($config["id_user"], 0, "IW")) { echo '
    '; echo '
    '; @@ -375,4 +376,4 @@ if (check_acl ($config["id_user"], 0, "IW")) { echo '
    '; } echo '
     
    '; -?> +?> \ No newline at end of file diff --git a/pandora_console/operation/messages/message_edit.php b/pandora_console/operation/messages/message_edit.php index 8084b3f755..f9d1db29cb 100644 --- a/pandora_console/operation/messages/message_edit.php +++ b/pandora_console/operation/messages/message_edit.php @@ -137,7 +137,7 @@ if (($new_msg) && (!empty ($dst_user)) && (!$reply)) { // Create message (destination group) if (($new_msg) && ($dst_group!='') && (!$reply)) { $return = messages_create_group ($config["id_user"], $dst_group, $subject, $message); - + ui_print_result_message ($return, __('Message successfully sent'), __('Error sending message to group %s', groups_get_name ($dst_group))); @@ -172,7 +172,7 @@ foreach ($users_full as $user_id => $user_info) { if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) $return_all_groups = true; else - $return_all_groups = false; + $return_all_groups = false; $groups = users_get_groups ($config["id_user"], "AR"); //Get a list of all groups @@ -190,7 +190,7 @@ echo ''; - html_print_submit_button (__('Send message'), 'send_mes', false, 'class="sub wand"'); + html_print_submit_button (__('Send message'), 'send_mes', false, 'class="sub wand"'); echo ''; echo ''; ?> diff --git a/pandora_console/operation/messages/message_list.php b/pandora_console/operation/messages/message_list.php index e6d6c5af4f..ff1d7abeff 100644 --- a/pandora_console/operation/messages/message_list.php +++ b/pandora_console/operation/messages/message_list.php @@ -28,16 +28,16 @@ if ($show_sent) { } $buttons['message_list'] = array('active' => $active_list, - 'text' => '' . - html_print_image("images/email.png", true, array ("title" => __('Message list'))) .''); - + 'text' => '' . + html_print_image("images/email.png", true, array ("title" => __('Message list'))) .''); + $buttons['sent_messages'] = array('active' => $active_sent, - 'text' => '' . - html_print_image("images/email_go.png", true, array ("title" => __('Sent messages'))) .''); - + 'text' => '' . + html_print_image("images/email_go.png", true, array ("title" => __('Sent messages'))) .''); + $buttons['create_message'] = array('active' => false, - 'text' => '' . - html_print_image("images/email_edit.png", true, array ("title" => __('Create message'))) .''); + 'text' => '' . + html_print_image("images/email_edit.png", true, array ("title" => __('Create message'))) .''); if (!is_ajax ()) { ui_print_page_header (__('Messages'), "images/email.png", false, "", false, $buttons); @@ -65,7 +65,7 @@ if ($multiple_delete) { foreach ($ids as $id) { $result = db_process_sql_delete ('tmensajes', array ('id_mensaje' => $id)); - + if ($result === false) { db_process_sql_rollback(); break; @@ -190,15 +190,15 @@ else { if ($show_sent) { $data[4] = '' . - html_print_image ('images/cross.png', true, array("title" => __('Delete'))) . ''. - html_print_checkbox_extended ('delete_multiple[]', $message_id, false, false, '', 'class="check_delete"', true); + onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">' . + html_print_image ('images/cross.png', true, array("title" => __('Delete'))) . ''. + html_print_checkbox_extended ('delete_multiple[]', $message_id, false, false, '', 'class="check_delete"', true); } else { $data[4] = '' . - html_print_image ('images/cross.png', true, array("title" => __('Delete'))) . ''. - html_print_checkbox_extended ('delete_multiple[]', $message_id, false, false, '', 'class="check_delete"', true); + onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">' . + html_print_image ('images/cross.png', true, array("title" => __('Delete'))) . ''. + html_print_checkbox_extended ('delete_multiple[]', $message_id, false, false, '', 'class="check_delete"', true); } array_push ($table->data, $data); } @@ -210,7 +210,7 @@ else { echo "
    "; html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); echo "
    "; - echo ""; + echo ""; } echo '
    '; @@ -221,14 +221,12 @@ echo "
    "; ?> diff --git a/pandora_console/operation/netflow/nf_live_view.php b/pandora_console/operation/netflow/nf_live_view.php index 9b2578efc0..57ef87d7d9 100644 --- a/pandora_console/operation/netflow/nf_live_view.php +++ b/pandora_console/operation/netflow/nf_live_view.php @@ -308,22 +308,22 @@ if ($draw != '') { //displayNormalFilter (); $("#table2-3").css('display', ''); $("#table2-4").css('display', ''); - $("#table2-5").css('display', 'none'); + $("#table2-5").css('display', 'none'); // Check right filter type $("#radiobtn0001").attr("checked", "checked"); - $("#radiobtn0002").attr("checked", ""); + $("#radiobtn0002").attr("checked", ""); $("#text-ip_dst").val(''); $("#text-ip_src").val(''); $("#text-dst_port").val(''); $("#text-src_port").val(''); - $("#textarea_advanced_filter").val(''); - $("#aggregate").val(''); + $("#textarea_advanced_filter").val(''); + $("#aggregate").val(''); $("#output").val(''); // Hide update filter button - $("#submit-update_button").css("visibility", "hidden"); + $("#submit-update_button").css("visibility", "hidden"); } else { @@ -354,12 +354,12 @@ if ($draw != '') { // Check right filter type $("#radiobtn0001").attr("checked", ""); - $("#radiobtn0002").attr("checked", "checked"); + $("#radiobtn0002").attr("checked", "checked"); } }); - + // Shows update filter button - $("#submit-update_button").css("visibility", ""); + $("#submit-update_button").css("visibility", ""); // Get filter values from DB jQuery.post ("ajax.php", @@ -368,22 +368,22 @@ if ($draw != '') { "id" : $("#filter_id").val() }, function (data) { - jQuery.each (data, function (i, val) { - if (i == 'ip_dst') - $("#text-ip_dst").val(val); - if (i == 'ip_src') - $("#text-ip_src").val(val); - if (i == 'dst_port') - $("#text-dst_port").val(val); - if (i == 'src_port') - $("#text-src_port").val(val); - if (i == 'advanced_filter') - $("#textarea_advanced_filter").val(val); - if (i == 'aggregate') - $("#aggregate").val(val); - if (i == 'output') - $("#output").val(val); - }); + jQuery.each (data, function (i, val) { + if (i == 'ip_dst') + $("#text-ip_dst").val(val); + if (i == 'ip_src') + $("#text-ip_src").val(val); + if (i == 'dst_port') + $("#text-dst_port").val(val); + if (i == 'src_port') + $("#text-src_port").val(val); + if (i == 'advanced_filter') + $("#textarea_advanced_filter").val(val); + if (i == 'aggregate') + $("#aggregate").val(val); + if (i == 'output') + $("#output").val(val); + }); }, "json"); } @@ -393,21 +393,21 @@ if ($draw != '') { $(document).ready( function() { // Hide update filter button if ($("#filter_id").val() == 0) { - $("#submit-update_button").css("visibility", "hidden"); + $("#submit-update_button").css("visibility", "hidden"); } else { - $("#submit-update_button").css("visibility", ""); + $("#submit-update_button").css("visibility", ""); } // Change color of name and group if save button has been pushed $("#submit-save_button").click(function () { if ($("#text-name").val() == "") { $('#filter_name_color').css('color', '#CC0000'); - $('#filter_group_color').css('color', '#CC0000'); + $('#filter_group_color').css('color', '#CC0000'); } else { $('#filter_name_color').css('color', '#000000'); - $('#filter_group_color').css('color', '#000000'); + $('#filter_group_color').css('color', '#000000'); } }); }); diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php index 8747431466..fb23f61714 100644 --- a/pandora_console/operation/reporting/reporting_viewer.php +++ b/pandora_console/operation/reporting/reporting_viewer.php @@ -92,11 +92,11 @@ else { if ($config['metaconsole'] == 1 and defined('METACONSOLE')) { // Bread crumbs ui_meta_add_breadcrumb(array('link' => 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder', 'text' => __('Reporting'))); - - ui_meta_print_page_header($nav_bar); + + ui_meta_print_page_header($nav_bar); // Print header - ui_meta_print_header(__('Reporting'), "", $options); + ui_meta_print_header(__('Reporting'), "", $options); } else ui_print_page_header (__('Reporting'). " » ". __('Custom reporting'). " - ".$report["name"], diff --git a/pandora_console/operation/search_modules.php b/pandora_console/operation/search_modules.php index 28356d2ac5..175503caf3 100644 --- a/pandora_console/operation/search_modules.php +++ b/pandora_console/operation/search_modules.php @@ -165,7 +165,7 @@ else { '&sort_field=module_name&sort=up">'. html_print_image("images/sort_up.png", true, array("style" => $selectModuleNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleNameDown)) . ''; + '&sort_field=module_name&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleNameDown)) . ''; $table->head[1] = __('Agent') . ' ' . ''.$trap["source"].''; + $data[1] = ''.$trap["source"].''; } else { if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR")) { @@ -563,7 +563,7 @@ if ($traps !== false) { break; default: $desc_trap_type = __('Other'); - break; + break; } $string .= '' . '' . __('Type:') . '' . $desc_trap_type . ''; } @@ -586,7 +586,7 @@ if ($idx == 0) { echo '
    '.__('No matching traps found').'
    '; } else { - html_print_table ($table); + html_print_table ($table); } unset ($table); diff --git a/pandora_console/operation/tree.php b/pandora_console/operation/tree.php index 0e9313de3c..bf2dc65b99 100644 --- a/pandora_console/operation/tree.php +++ b/pandora_console/operation/tree.php @@ -92,7 +92,7 @@ if (is_ajax ()) //Skip agents which only have not init modules $search_sql .= " AND id_agente NOT IN (SELECT tagente_estado.id_agente FROM - tagente_estado GROUP BY id_agente HAVING SUM(utimestamp) = 0)"; + tagente_estado GROUP BY id_agente HAVING SUM(utimestamp) = 0)"; $sql = agents_get_agents(array ( 'order' => 'nombre COLLATE utf8_general_ci ASC', @@ -386,7 +386,7 @@ if (is_ajax ()) if ($lessBranchs == 1) html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;')); else - html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;')); + html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;')); echo $img; echo ""; @@ -504,20 +504,20 @@ if (is_ajax ()) echo "
  • "; switch ($lessBranchs) { case 0: - html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;')); - html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;')); + html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;')); + html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;')); break; case 1: - html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;')); - html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;')); + html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;')); + html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;')); break; case 2: - html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;')); - html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;')); + html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;')); + html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;')); break; case 3: - html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;')); - html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;')); + html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;')); + html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;')); break; } echo "" . __("Empty") . ""; diff --git a/pandora_console/operation/users/user_edit.php b/pandora_console/operation/users/user_edit.php index 5973228d9a..a371ad51f0 100644 --- a/pandora_console/operation/users/user_edit.php +++ b/pandora_console/operation/users/user_edit.php @@ -60,7 +60,7 @@ if (is_ajax ()){ } // Activate shortcut var else { - db_process_sql_update('tusuario', array('shortcut' => 1), array('id_user' => $id)); + db_process_sql_update('tusuario', array('shortcut' => 1), array('id_user' => $id)); } } @@ -83,7 +83,7 @@ if (isset ($_GET["modified"]) && !$view_mode) { $upd_info["phone"] = get_parameter_post ("phone", $user_info["phone"]); $upd_info["comments"] = get_parameter_post ("comments", $user_info["comments"]); $upd_info["language"] = get_parameter_post ("language", $user_info["language"]); - $upd_info["id_skin"] = get_parameter ("skin", $user_info["id_skin"]); + $upd_info["id_skin"] = get_parameter ("skin", $user_info["id_skin"]); $upd_info["block_size"] = get_parameter ("block_size", $config["block_size"]); $default_block_size = get_parameter ("default_block_size", 0); if($default_block_size) {