create new report sla weekly

This commit is contained in:
daniel 2016-12-01 15:36:14 +01:00
parent 8025855493
commit ec848acc18
6 changed files with 46 additions and 9 deletions

View File

@ -133,6 +133,7 @@ switch ($action) {
switch ($type) {
case 'SLA_monthly':
case 'SLA_weekly':
case 'SLA_services':
case 'SLA':
case 'top_n':
@ -264,6 +265,24 @@ switch ($action) {
// 'top_n' filed will be reused for SLA sort option
$sla_sorted_by = $item['top_n'];
break;
case 'SLA_weekly':
$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 'SLA_services':
$description = $item['description'];
$period = $item['period'];
@ -2528,7 +2547,7 @@ function chooseType() {
$("#row_working_time").show();
$("#row_only_display_wrong").show();
$("#row_show_graph").show();
$("#row_show_in_two_columns").show();
//$("#row_show_in_two_columns").show();
$("#row_sort").show();
$('#row_hide_notinit_agents').show();
break;
@ -2537,7 +2556,15 @@ function chooseType() {
$("#row_description").show();
$("#sla_list").show();
$("#row_working_time").show();
$("#row_show_in_two_columns").show();
//$("#row_show_in_two_columns").show();
$("#row_sort").show();
break;
case 'SLA_weekly':
$("#row_description").show();
$("#sla_list").show();
$("#row_working_time").show();
//$("#row_show_in_two_columns").show();
$("#row_sort").show();
break;

View File

@ -223,7 +223,7 @@ if ($moduleFilter != 0) {
// Filter report items created from metaconsole in normal console list and the opposite
if (defined('METACONSOLE') and $config['metaconsole'] == 1) {
$where .= ' AND ((server_name IS NOT NULL AND length(server_name) != 0) ' .
'OR ' . $type_escaped . ' IN (\'general\', \'SLA\', \'exception\', \'availability\', \'top_n\',\'SLA_monthly\'))';
'OR ' . $type_escaped . ' IN (\'general\', \'SLA\', \'exception\', \'availability\', \'top_n\',\'SLA_monthly\',\'SLA_weekly\'))';
}
else
$where .= ' AND ((server_name IS NULL OR length(server_name) = 0) ' .

View File

@ -936,6 +936,7 @@ switch ($action) {
$values['text'] = $intervals;
break;
case 'SLA_monthly':
case 'SLA_weekly':
case 'SLA_services':
case 'SLA':
$values['period'] = get_parameter('period');

View File

@ -449,6 +449,11 @@ function reporting_make_reporting_data($report = null, $id_report,
$report,
$content);
break;
case 'SLA_weekly':
$report['contents'][] = reporting_enterprise_sla_weekly(
$report,
$content);
break;
case 'SLA_services':
$report['contents'][] = reporting_enterprise_sla_services_refactoriced(
$report,
@ -4764,12 +4769,11 @@ function reporting_availability($report, $content, $date=false, $time=false) {
$text = $row['data']['agent'] . " (" . $text . ")";
/*
//Restore dbconnection
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
metaconsole_restore_db();
}
*/
//Restore dbconnection
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
metaconsole_restore_db();
}
//find order
$row['data']['order'] = $row['data']['SLA'];

View File

@ -275,6 +275,9 @@ function reporting_html_print_report($report, $mini = false) {
case 'SLA_monthly':
reporting_enterprise_html_SLA_monthly($table, $item, $mini);
break;
case 'SLA_weekly':
reporting_enterprise_html_SLA_weekly($table, $item, $mini);
break;
case 'SLA_services':
reporting_enterprise_html_SLA_services($table, $item, $mini);
break;

View File

@ -537,6 +537,8 @@ function reports_get_report_types ($template = false, $not_editor = false) {
if ($config['enterprise_installed']) {
$types['SLA_monthly'] = array('optgroup' => __('SLA'),
'name' => __('Monthly S.L.A.'));
$types['SLA_weekly'] = array('optgroup' => __('SLA'),
'name' => __('Weekly S.L.A.'));
if (!$config['metaconsole'] && !$template) {
$types['SLA_services'] = array('optgroup' => __('SLA'),