diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index aa9b346cb6..b1e01f4da9 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,20 @@ +2013-02-19 Miguel de Dios + + * godmode/alerts/configure_alert_command.php, + godmode/reporting/reporting_builder.item_editor.php, + godmode/reporting/reporting_builder.list_items.php, + godmode/agentes/agent_template.php, + godmode/snmpconsole/snmp_alert.php, index.php, + operation/search_users.php, + operation/integria_incidents/incident.php, + operation/reporting/reporting_xml.php, + operation/agentes/exportdata.csv.php: cleaned source code style. + + * general/login_help_dialog.php, general/login_page.php: fixed the + set to hidden window of info. + + Fixes: #3604645 + 2013-02-19 Sergio Martin * include/javascript/pandora_modules.js: Fixed str_warning and diff --git a/pandora_console/general/login_help_dialog.php b/pandora_console/general/login_help_dialog.php index e138a18af0..8fbd133818 100644 --- a/pandora_console/general/login_help_dialog.php +++ b/pandora_console/general/login_help_dialog.php @@ -35,10 +35,12 @@ if (is_ajax()) { } // Prints help dialog information -echo '
'; +echo '
'; echo '
'; - echo '' . __('If this is your first time with Pandora FMS, we propose you a few links to learn more about Pandora FMS. Monitoring could be overwhelm, but take your time to learn how to use the power of Pandora!') . ''; + echo '' . + __('If this is your first time with Pandora FMS, we propose you a few links to learn more about Pandora FMS. Monitoring could be overwhelm, but take your time to learn how to use the power of Pandora!') . ''; echo '
'; echo '
'; @@ -117,10 +119,10 @@ $(document).ready (function () { $("#login_help_dialog" ).dialog('close'); - var skip_login_help = $("#checkbox-skip_login_help").attr('checked'); + var skip_login_help = $("#checkbox-skip_login_help").is(':checked'); // Update config['skip_login_help_dialog'] to don't display more this message - if (skip_login_help == 'checked') { + if (skip_login_help) { jQuery.get ("ajax.php", {"page": "general/login_help_dialog", "skip_login_help": 1}, diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 93e8af215a..1d0138f945 100644 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -94,13 +94,13 @@ if (isset ($login_failed)) { echo html_print_image('images/error_login.png', true, array("alt" => __('Login failed'), "border" => 0)); echo '
'; - echo '
'; + echo '
'; html_print_submit_button("Ok", 'hide-login-error', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only" style="width:100px;"'); echo '
'; echo '
'; - echo '
'; + echo '
'; } ui_require_css_file ('jquery-ui-1.10.0.custom'); diff --git a/pandora_console/godmode/agentes/agent_template.php b/pandora_console/godmode/agentes/agent_template.php index 3fd7001d29..b4df37d059 100644 --- a/pandora_console/godmode/agentes/agent_template.php +++ b/pandora_console/godmode/agentes/agent_template.php @@ -52,7 +52,7 @@ if (isset ($_POST["template_id"])) { $npc = array (); } - $success_count = $error_count = 0; + $success_count = $error_count = 0; $modules_already_added = array(); foreach ($npc as $row) { diff --git a/pandora_console/godmode/alerts/configure_alert_command.php b/pandora_console/godmode/alerts/configure_alert_command.php index f427cfdf84..1118edfada 100644 --- a/pandora_console/godmode/alerts/configure_alert_command.php +++ b/pandora_console/godmode/alerts/configure_alert_command.php @@ -28,7 +28,7 @@ if (! check_acl ($config['id_user'], 0, "LM")) { } $id = (int) get_parameter ('id'); -$pure = get_parameter('pure', 0); +$pure = get_parameter('pure', 0); $name = ''; $command = ''; @@ -81,16 +81,16 @@ $table->colspan[2][1] = 3; $table->data[2][0] = __('Description'); $table->data[2][1] = html_print_textarea ('description', 10, 30, $description, '', true); -for($i=1;$i<=10;$i++) { +for ($i=1; $i<=10; $i++) { $table->data['field'.$i][0] = sprintf(__('Field %s description'), $i); // Only show help on first row - if($i == 1) { + if ($i == 1) { $table->data['field'.$i][0] .= ui_print_help_icon ('alert_fields_description', true, ui_get_full_url(false, false, false, false)); } - if(!empty($fields_descriptions)) { + if (!empty($fields_descriptions)) { $field_description = $fields_descriptions[$i-1]; } else { @@ -101,11 +101,11 @@ for($i=1;$i<=10;$i++) { $table->data['field'.$i][2] = sprintf(__('Field %s values'), $i); // Only show help on first row - if($i == 1) { + if ($i == 1) { $table->data['field'.$i][2] .= ui_print_help_icon ('alert_fields_values', true, ui_get_full_url(false, false, false, false)); } - - if(!empty($fields_values)) { + + if (!empty($fields_values)) { $field_values = $fields_values[$i-1]; } else { diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 54de893c7a..aaea0f6251 100644 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -802,7 +802,7 @@ html_print_input_hidden('id_item', $idItem); } else { // If there are not metaconsole servers don't allow to create new custom graphs - $style_button_create_custom_graph = 'style="display: none;"'; + $style_button_create_custom_graph = 'style="display: none;"'; } } } diff --git a/pandora_console/godmode/reporting/reporting_builder.list_items.php b/pandora_console/godmode/reporting/reporting_builder.list_items.php index 1eb0dc4cd7..5ec404f993 100644 --- a/pandora_console/godmode/reporting/reporting_builder.list_items.php +++ b/pandora_console/godmode/reporting/reporting_builder.list_items.php @@ -110,7 +110,7 @@ else { $where_types = ' AND ((server_name IS NOT NULL AND length(server_name) != 0) OR type IN (\'general\',\'SLA\',\'exception\',\'top_n\'))'; } else - $where_types = ' AND ((server_name IS NULL OR length(server_name) = 0) OR type IN (\'general\',\'SLA\',\'exception\',\'top_n\'))'; + $where_types = ' AND ((server_name IS NULL OR length(server_name) = 0) OR type IN (\'general\',\'SLA\',\'exception\',\'top_n\'))'; $rows = db_get_all_rows_sql(' SELECT DISTINCT(type) diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php index 96813ef872..fd9006c1ed 100644 --- a/pandora_console/godmode/snmpconsole/snmp_alert.php +++ b/pandora_console/godmode/snmpconsole/snmp_alert.php @@ -476,7 +476,7 @@ else { html_print_table ($table); } - unset ($table); + unset ($table); echo '
'; echo '
'; diff --git a/pandora_console/index.php b/pandora_console/index.php index 83e43842d1..2b849b46ac 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -396,7 +396,8 @@ if ($old_global_counter_chat != $now_global_counter_chat) { if (get_parameter ('login', 0) == 1) { // If it's configured to not skip this - if (!isset($config['skip_login_help_dialog']) or $config['skip_login_help_dialog'] == 0) { + if (!isset($config['skip_login_help_dialog']) || + $config['skip_login_help_dialog'] == 0) { include_once("general/login_help_dialog.php"); diff --git a/pandora_console/operation/agentes/exportdata.csv.php b/pandora_console/operation/agentes/exportdata.csv.php index e9c02b7015..f903dc7899 100644 --- a/pandora_console/operation/agentes/exportdata.csv.php +++ b/pandora_console/operation/agentes/exportdata.csv.php @@ -51,28 +51,28 @@ $export_type = get_parameter_post ('export_type', 'data'); $export_btn = get_parameter ('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 // *************************************************** - + //Pure CSV is comma delimited $datastart = __('Agent').','.__('Module').','.__('Data').','.__('Timestamp')."\n"; $rowstart = '"'; @@ -80,8 +80,8 @@ if (!empty ($module)) { $rowend = '"'."\n"; $dataend = "\n"; $extension = "csv"; - - + + // *************************************************** // Header output // *************************************************** @@ -92,13 +92,13 @@ 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; @@ -125,7 +125,7 @@ if (!empty ($module)) { $arr["module_name"] = modules_get_agentmodule_name ($selected); $arr["agent_name"] = modules_get_agentmodule_agent_name ($selected); $arr["agent_id"] = modules_get_agentmodule_agent ($selected); - $arr["utimestamp"] = $end; + $arr["utimestamp"] = $end; array_push ($data, $arr); } else { diff --git a/pandora_console/operation/integria_incidents/incident.php b/pandora_console/operation/integria_incidents/incident.php index 3c530803cf..41f1265d8a 100755 --- a/pandora_console/operation/integria_incidents/incident.php +++ b/pandora_console/operation/integria_incidents/incident.php @@ -256,7 +256,7 @@ switch ($tab) { $search_group = get_parameter('search_group', 1); $params[2] = $search_group; - + $params = implode($token,$params); $url = $integria_api."&op=get_incidents&token=".$token."¶ms=".$params; @@ -271,7 +271,7 @@ switch ($tab) { $url = $integria_api."&op=get_incident_details¶ms=".$id_incident; } else { - $url = $integria_api."&op=get_incident_details"; + $url = $integria_api."&op=get_incident_details"; } $url_resolutions = $integria_api."&op=get_incidents_resolutions"; $url_status = $integria_api."&op=get_incidents_status"; diff --git a/pandora_console/operation/reporting/reporting_xml.php b/pandora_console/operation/reporting/reporting_xml.php index c445facc36..da27467caa 100644 --- a/pandora_console/operation/reporting/reporting_xml.php +++ b/pandora_console/operation/reporting/reporting_xml.php @@ -312,7 +312,7 @@ foreach ($contents as $content) { case 'simple_baseline_graph': $data["module"] = io_safe_output_xml (db_get_value ('nombre', 'tagente_modulo', 'id_agente_modulo', $content['id_agent_module'])); - $data["agent"] = io_safe_output_xml (modules_get_agentmodule_agent_name ($content['id_agent_module'])); + $data["agent"] = io_safe_output_xml (modules_get_agentmodule_agent_name ($content['id_agent_module'])); $data["title"] = __('Simple baseline graph'); $data["objdata"] = array(); diff --git a/pandora_console/operation/search_users.php b/pandora_console/operation/search_users.php index 27894579e6..d4769dbe06 100755 --- a/pandora_console/operation/search_users.php +++ b/pandora_console/operation/search_users.php @@ -160,15 +160,15 @@ if ($searchUsers) { firstname LIKE '%" . $stringSearchSQL . "%' OR lastname LIKE '%" . $stringSearchSQL . "%' OR middlename LIKE '%" . $stringSearchSQL . "%' OR - email LIKE '%" . $stringSearchSQL . "%')".$user_condition; + email LIKE '%" . $stringSearchSQL . "%')".$user_condition; $totalUsers = db_get_row_sql($sql); - + $totalUsers = $totalUsers['count']; } } if (!$users) { - echo "
" . __("Zero results found") . "
\n"; + echo "
" . __("Zero results found") . "
\n"; } else { $table->cellpadding = 4; @@ -196,12 +196,12 @@ else { '' . html_print_image("images/sort_up.png", true, array("style" => $selectProfileUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectProfileDown)) . ''; $table->head[5] = __('Description'); - + $table->data = array (); foreach ($users as $user) { $userIDCell = "" . $user['id_user'] . ""; + $user['id_user'] . "'>" . $user['id_user'] . ""; if ($user["is_admin"]) { $profileCell = html_print_image ("images/user_suit.png", true, @@ -236,7 +236,7 @@ else { $profileCell, $user['comments'])); } - + echo "
";ui_pagination ($totalUsers); html_print_table ($table); unset($table); ui_pagination ($totalUsers);