2014-05-12 Sergio Martin <sergio.martin@artica.es>

* 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



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2014-05-12 15:56:02 +00:00
parent 0f0a181ede
commit 4a7d2dbea4
6 changed files with 50 additions and 2 deletions

View File

@ -1,3 +1,15 @@
2014-05-12 Sergio Martin <sergio.martin@artica.es>
* 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 <vanessa.gil@artica.es> 2014-05-12 Vanessa Gil <vanessa.gil@artica.es>
* include/functions_config.php: Added alert in header * include/functions_config.php: Added alert in header

View File

@ -119,6 +119,7 @@ switch ($action) {
// If we are creating a new report item then clean interface and display creation view // If we are creating a new report item then clean interface and display creation view
$type = get_parameter('type', 'SLA'); $type = get_parameter('type', 'SLA');
switch ($type) { switch ($type) {
case 'SLA_monthly':
case 'SLA': case 'SLA':
case 'top_n': case 'top_n':
case 'exception': case 'exception':
@ -218,6 +219,22 @@ switch ($action) {
// 'top_n' filed will be reused for SLA sort option // 'top_n' filed will be reused for SLA sort option
$sla_sorted_by = $item['top_n']; $sla_sorted_by = $item['top_n'];
break; 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': case 'monitor_report':
$description = $item['description']; $description = $item['description'];
$idAgentModule = $item['id_agent_module']; $idAgentModule = $item['id_agent_module'];
@ -1866,6 +1883,13 @@ function chooseType() {
$("#row_show_in_two_columns").show(); $("#row_show_in_two_columns").show();
$("#row_sort").show(); $("#row_sort").show();
break; 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': case 'monitor_report':
$("#row_description").show(); $("#row_description").show();
$("#row_agent").show(); $("#row_agent").show();

View File

@ -743,6 +743,7 @@ switch ($action) {
$intervals = get_parameter('max_interval') . ';' . get_parameter('min_interval'); $intervals = get_parameter('max_interval') . ';' . get_parameter('min_interval');
$values['text'] = $intervals; $values['text'] = $intervals;
break; break;
case 'SLA_monthly':
case 'SLA': case 'SLA':
$values['period'] = get_parameter('period'); $values['period'] = get_parameter('period');
$values['top_n'] = get_parameter('combo_sla_sort_options',0); $values['top_n'] = get_parameter('combo_sla_sort_options',0);

View File

@ -1197,6 +1197,7 @@ function html_get_predefined_table ($model = 'transparent', $columns = 4) {
* @param object Object with several properties: * @param object Object with several properties:
* $table->head - An array of heading names. * $table->head - An array of heading names.
* $table->head_colspan - An array of colspans of each head column. * $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->align - An array of column alignments
* $table->valign - An array of column alignments * $table->valign - An array of column alignments
* $table->size - An array of column sizes * $table->size - An array of column sizes
@ -1401,7 +1402,11 @@ function html_print_table (&$table, $return = false) {
} }
else $headColspan = ''; else $headColspan = '';
$output .= '<th class="'.$table->headclass[$key].'" ' . $headColspan . ' scope="col">'. $heading .'</th>'; if (isset ($table->headstyle[$key])) {
$headStyle = ' style = "' . $table->headstyle[$key] . '" ';
}
$output .= '<th class="'.$table->headclass[$key].'" ' . $headColspan . $headStyle . ' scope="col">'. $heading .'</th>';
} }
$output .= '</tr></thead>'."\n"; $output .= '</tr></thead>'."\n";
} }

View File

@ -3262,6 +3262,9 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
ui_get_full_url(false) . '/'); ui_get_full_url(false) . '/');
array_push ($table->data, $data); array_push ($table->data, $data);
break;
case 'SLA_monthly':
reporting_enterprise_sla_monthly($mini, $content, $report, $table, $item_title);
break; break;
case 3: case 3:
case 'SLA': case 'SLA':

View File

@ -528,7 +528,10 @@ function reports_get_report_types ($template = false, $not_editor = false) {
$types['SLA'] = array('optgroup' => __('SLA'), $types['SLA'] = array('optgroup' => __('SLA'),
'name' => __('S.L.A.')); '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'), $types['prediction_date'] = array('optgroup' => __('Forecasting'),