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
{
7 * Callback helper for getting the bitmask host/service states into array form
9 function rewrite_states($name, $value, $obj) {
13 foreach ($obj->properties
[$name]['options'] as $bit => $_) {
20 public function setup_properties() {
21 parent
::setup_properties();
22 $this->properties
['host_states']['type'] = 'array';
23 $this->properties
['service_states']['type'] = 'array';
25 $this->properties
['report_period']['default'] = 'forever';
26 $this->properties
['report_type']['default'] = 'hosts';
27 $this->properties
['summary_items']['default'] = config
::get('pagination.default.items_per_page', '*');
28 $this->properties
['host_name']['default'] = Report_options
::ALL_AUTHORIZED
;
29 if(ninja
::has_module('synergy')) {
30 $this->properties
['synergy_events'] = array('type' => 'boolean', 'default' => false);
32 $this->properties
['host_states']['options'] = array(
35 4 => _('Unreachable'),
37 $this->properties
['service_states']['options'] = array(
44 $this->properties
['page'] = array('type' => 'int', 'default' => 1); /**< Warning! 1 indexed */
45 $this->properties
['include_downtime'] = array('type' => 'bool', 'default' => false);
46 $this->properties
['include_process'] = array('type' => 'bool', 'default' => false);
47 $this->properties
['oldest_first'] = array('type' => 'bool', 'default' => false);
48 $this->properties
['filter_output'] = array('type' => 'string', 'default' => false);
50 $this->rename_options
['service_states'] = array($this, 'rewrite_states');
51 $this->rename_options
['host_states'] = array($this, 'rewrite_states');
54 protected function update_value($name, $value)
58 case 'service_states':
59 $value = array_sum(array_keys($value));
62 parent
::update_value($name, $value);