Skip to content

Commit

Permalink
GroupsummaryQuery: Provide case insensitive filter columns for group …
Browse files Browse the repository at this point in the history
…names

I've renamed those and made them case sensitive as part of #8613 but
missed that they are required by the global search.

fixes #9056
  • Loading branch information
Johannes Meyer committed Apr 14, 2015
1 parent 2618d4a commit 923bc11
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Expand Up @@ -20,7 +20,8 @@ class GroupSummaryQuery extends IdoQuery
'hosts_down_unhandled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
'hosts_pending' => 'SUM(CASE WHEN object_type = \'host\' AND state = 99 THEN 1 ELSE 0 END)',
'hostgroup_name' => 'hostgroup_name',
'hostgroup_alias' => 'hostgroup_alias'
'hostgroup_alias' => 'hostgroup_alias',
'hostgroup' => 'hostgroup'
),
'servicestatussummary' => array(
'services_total' => 'SUM(CASE WHEN object_type = \'service\' THEN 1 ELSE 0 END)',
Expand All @@ -45,7 +46,8 @@ class GroupSummaryQuery extends IdoQuery
'services_critical_last_state_change_unhandled' => 'MAX(CASE WHEN object_type = \'service\' AND state = 2 AND acknowledged + in_downtime + host_state = 0 THEN state_change ELSE 0 END)',
'services_unknown_last_state_change_unhandled' => 'MAX(CASE WHEN object_type = \'service\' AND state = 3 AND acknowledged + in_downtime + host_state = 0 THEN state_change ELSE 0 END)',
'servicegroup_name' => 'servicegroup_name',
'servicegroup_alias' => 'servicegroup_alias'
'servicegroup_alias' => 'servicegroup_alias',
'servicegroup' => 'servicegroup'
)
);

Expand All @@ -56,11 +58,13 @@ protected function joinBaseTables()
'host_state'
);

if (in_array('servicegroup_name', $this->desiredColumns)) {
if (in_array('servicegroup', $this->desiredColumns) || in_array('servicegroup_name', $this->desiredColumns)) {
$columns[] = 'servicegroup';
$columns[] = 'servicegroup_name';
$columns[] = 'servicegroup_alias';
$groupColumns = array('servicegroup_name', 'servicegroup_alias');
} else {
$columns[] = 'hostgroup';
$columns[] = 'hostgroup_name';
$columns[] = 'hostgroup_alias';
$groupColumns = array('hostgroup_name', 'hostgroup_alias');
Expand Down
Expand Up @@ -83,10 +83,12 @@ class HoststatusQuery extends IdoQuery
END'
),
'hostgroups' => array(
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
'hostgroup_name' => 'hgo.name1',
'hostgroup_alias' => 'hg.alias'
),
'servicegroups' => array(
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
'servicegroup_name' => 'sgo.name1',
'servicegroup_alias' => 'sg.alias'
),
Expand Down
Expand Up @@ -58,4 +58,9 @@ public function getSortRules()
)
);
}

public function getFilterColumns()
{
return array('hostgroup', 'servicegroup');
}
}

0 comments on commit 923bc11

Please sign in to comment.