Fix some bugs in the TimelineController

refs #4190
This commit is contained in:
Johannes Meyer 2013-10-24 17:48:34 +02:00
parent 103d43ea77
commit 8e65fc7281

View File

@ -211,6 +211,7 @@ class Monitoring_TimelineController extends ActionController
$urlTemplate = $attributes['detailUrl']; $urlTemplate = $attributes['detailUrl'];
foreach ($groupCounts as $timeframeIdentifier => $groupCount) { foreach ($groupCounts as $timeframeIdentifier => $groupCount) {
$timeframe = $range->getTimeframe($timeframeIdentifier); $timeframe = $range->getTimeframe($timeframeIdentifier);
$attributes['dateTime'] = $timeframe->start;
$attributes['value'] = $groupCount; $attributes['value'] = $groupCount;
$attributes['detailUrl'] = sprintf( $attributes['detailUrl'] = sprintf(
$urlTemplate, $urlTemplate,
@ -276,7 +277,9 @@ class Monitoring_TimelineController extends ActionController
$result, $result,
array( array(
'name' => t('Notifications'), 'name' => t('Notifications'),
'detailUrl' => 'monitoring/list/eventhistory?timestamp<=%s&timestamp>%s&type=notify&state!=0' 'detailUrl' => $this->view->baseUrl(
'monitoring/list/eventhistory?timestamp<=%s&timestamp>=%s&type=notify&state>0'
)
) )
); );
} }
@ -307,7 +310,9 @@ class Monitoring_TimelineController extends ActionController
$result, $result,
array( array(
'name' => t('Hard states'), 'name' => t('Hard states'),
'detailUrl' => 'monitoring/list/eventhistory?timestamp<=%s&timestamp>%s&type=hard_state&state!=0' 'detailUrl' => $this->view->baseUrl(
'monitoring/list/eventhistory?timestamp<=%s&timestamp>=%s&type=hard_state&state>0'
)
) )
); );
} }
@ -337,7 +342,9 @@ class Monitoring_TimelineController extends ActionController
$result, $result,
array( array(
'name' => t('Comments'), 'name' => t('Comments'),
'detailUrl' => 'monitoring/list/eventhistory?timestamp<=%s&timestamp>%s&type=comment' 'detailUrl' => $this->view->baseUrl(
'monitoring/list/eventhistory?timestamp<=%s&timestamp>=%s&type=comment'
)
) )
); );
} }
@ -367,7 +374,9 @@ class Monitoring_TimelineController extends ActionController
$result, $result,
array( array(
'name' => t('Acknowledgements'), 'name' => t('Acknowledgements'),
'detailUrl' => 'monitoring/list/eventhistory?timestamp<=%s&timestamp>%s&type=ack' 'detailUrl' => $this->view->baseUrl(
'monitoring/list/eventhistory?timestamp<=%s&timestamp>=%s&type=ack'
)
) )
); );
} }
@ -397,7 +406,9 @@ class Monitoring_TimelineController extends ActionController
$result, $result,
array( array(
'name' => t('Initiated downtimes'), 'name' => t('Initiated downtimes'),
'detailUrl' => 'monitoring/list/eventhistory?timestamp<=%s&timestamp>%s&type=dt_start' 'detailUrl' => $this->view->baseUrl(
'monitoring/list/eventhistory?timestamp<=%s&timestamp>=%s&type=dt_start'
)
) )
); );
} }
@ -427,7 +438,9 @@ class Monitoring_TimelineController extends ActionController
$result, $result,
array( array(
'name' => t('Finished downtimes'), 'name' => t('Finished downtimes'),
'detailUrl' => 'monitoring/list/eventhistory?timestamp<=%s&timestamp>%s&type=dt_end' 'detailUrl' => $this->view->baseUrl(
'monitoring/list/eventhistory?timestamp<=%s&timestamp>=%s&type=dt_end'
)
) )
); );
} }