diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3237d00c9d..ae8e5d3e06 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,15 @@ +2014-05-12 Sergio Martin + + * godmode/reporting/reporting_builder.php + godmode/reporting/reporting_builder.item_editor.php + include/functions_reporting.php + include/functions_reports.php: Added SLA Monthly reports. Its + an enterprise feature, so here is only the code to hook it and + some forms logic + + * include/functions_html.php: Add support to header styles in + html_print_table function. Used in SLA monthly reports + 2014-05-12 Vanessa Gil * include/functions_config.php: Added alert in header diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 4626879078..af457600af 100644 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -119,6 +119,7 @@ switch ($action) { // If we are creating a new report item then clean interface and display creation view $type = get_parameter('type', 'SLA'); switch ($type) { + case 'SLA_monthly': case 'SLA': case 'top_n': case 'exception': @@ -218,6 +219,22 @@ switch ($action) { // 'top_n' filed will be reused for SLA sort option $sla_sorted_by = $item['top_n']; break; + case 'SLA_monthly': + $description = $item['description']; + $only_display_wrong = $item['only_display_wrong']; + $monday = $item['monday']; + $tuesday = $item['tuesday']; + $wednesday = $item['wednesday']; + $thursday = $item['thursday']; + $friday = $item['friday']; + $saturday = $item['saturday']; + $sunday = $item['sunday']; + $time_from = $item['time_from']; + $time_to = $item['time_to']; + $show_graph = $item['show_graph']; + // 'top_n' filed will be reused for SLA sort option + $sla_sorted_by = $item['top_n']; + break; case 'monitor_report': $description = $item['description']; $idAgentModule = $item['id_agent_module']; @@ -1866,6 +1883,13 @@ function chooseType() { $("#row_show_in_two_columns").show(); $("#row_sort").show(); break; + case 'SLA_monthly': + $("#row_description").show(); + $("#sla_list").show(); + $("#row_working_time").show(); + $("#row_show_in_two_columns").show(); + $("#row_sort").show(); + break; case 'monitor_report': $("#row_description").show(); $("#row_agent").show(); diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index c6eb2ec618..1c398d0966 100644 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -743,6 +743,7 @@ switch ($action) { $intervals = get_parameter('max_interval') . ';' . get_parameter('min_interval'); $values['text'] = $intervals; break; + case 'SLA_monthly': case 'SLA': $values['period'] = get_parameter('period'); $values['top_n'] = get_parameter('combo_sla_sort_options',0); diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 10e8b36148..606536c3a1 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -1197,6 +1197,7 @@ function html_get_predefined_table ($model = 'transparent', $columns = 4) { * @param object Object with several properties: * $table->head - An array of heading names. * $table->head_colspan - An array of colspans of each head column. + * $table->headstyle - An array of styles of each head column. * $table->align - An array of column alignments * $table->valign - An array of column alignments * $table->size - An array of column sizes @@ -1400,8 +1401,12 @@ function html_print_table (&$table, $return = false) { $headColspan = 'colspan = "' . $table->head_colspan[$key] . '"'; } else $headColspan = ''; + + if (isset ($table->headstyle[$key])) { + $headStyle = ' style = "' . $table->headstyle[$key] . '" '; + } - $output .= ''. $heading .''; + $output .= ''. $heading .''; } $output .= ''."\n"; } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index e1bbf26f2f..e3d53efdd1 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -3262,6 +3262,9 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f ui_get_full_url(false) . '/'); array_push ($table->data, $data); + break; + case 'SLA_monthly': + reporting_enterprise_sla_monthly($mini, $content, $report, $table, $item_title); break; case 3: case 'SLA': diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php index 63f0e008b6..16250f784e 100644 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -528,7 +528,10 @@ function reports_get_report_types ($template = false, $not_editor = false) { $types['SLA'] = array('optgroup' => __('SLA'), 'name' => __('S.L.A.')); - + if ($config['enterprise_installed']) { + $types['SLA_monthly'] = array('optgroup' => __('SLA'), + 'name' => __('Monthly S.L.A.')); + } $types['prediction_date'] = array('optgroup' => __('Forecasting'),