1 <?php
defined('SYSPATH') OR die('No direct access allowed.');
3 * Report options for alert history reports. Alert history reports are specialized summary reports.
5 class Alert_history_options
extends Summary_options
{
6 public static $type = 'alert_history';
9 * Callback helper for getting the bitmask host/service states into array form
11 function rewrite_states($name, $value, $obj) {
15 foreach ($obj->properties
[$name]['options'] as $bit => $_) {
22 public function setup_properties() {
23 parent
::setup_properties();
24 $this->properties
['host_states']['type'] = 'array';
25 $this->properties
['service_states']['type'] = 'array';
27 $this->properties
['report_period']['default'] = 'forever';
28 $this->properties
['report_type']['default'] = 'hosts';
29 $this->properties
['summary_items']['default'] = config
::get('pagination.default.items_per_page', '*');
30 $this->properties
['objects']['default'] = Report_options
::ALL_AUTHORIZED
;
31 if(ninja
::has_module('synergy')) {
32 $this->properties
['synergy_events'] = array('type' => 'boolean', 'default' => false);
34 $this->properties
['host_states']['options'] = array(
37 4 => _('Unreachable'),
39 $this->properties
['service_states']['options'] = array(
46 $this->properties
['page'] = array('type' => 'int', 'default' => 1); /**< Warning! 1 indexed */
47 $this->properties
['include_downtime'] = array('type' => 'bool', 'default' => false);
48 $this->properties
['include_process'] = array('type' => 'bool', 'default' => false);
49 $this->properties
['oldest_first'] = array('type' => 'bool', 'default' => false);
50 $this->properties
['filter_output'] = array('type' => 'string', 'default' => false);
52 $this->rename_options
['service_states'] = array($this, 'rewrite_states');
53 $this->rename_options
['host_states'] = array($this, 'rewrite_states');
56 protected function update_value($name, $value)
60 case 'service_states':
61 $value = array_sum(array_keys($value));
64 parent
::update_value($name, $value);