CustomvarQuery: Remove COLLATE from query columns

...and provide case-insensitive filter columns alternatively.

refs #8613
This commit is contained in:
Johannes Meyer 2015-04-10 12:56:18 +02:00
parent 0628efb4cd
commit b8efe01170
2 changed files with 16 additions and 7 deletions

View File

@ -13,14 +13,14 @@ class CustomvarQuery extends IdoQuery
), ),
'objects' => array( 'objects' => array(
'host' => 'cvo.name1 COLLATE latin1_general_ci', 'host' => 'cvo.name1 COLLATE latin1_general_ci',
'host_name' => 'cvo.name1 COLLATE latin1_general_ci', 'host_name' => 'cvo.name1',
'service_host_name' => 'cvo.name1 COLLATE latin1_general_ci', 'service' => 'cvo.name2 COLLATE latin1_general_ci',
'service' => 'cvo.name2 COLLATE latin1_general_ci', 'service_description' => 'cvo.name2',
'service_description' => 'cvo.name2 COLLATE latin1_general_ci', 'contact' => 'cvo.name1 COLLATE latin1_general_ci',
'contact_name' => 'cvo.name1 COLLATE latin1_general_ci', 'contact_name' => 'cvo.name1',
'object_type' => "CASE cvo.objecttype_id WHEN 1 THEN 'host' WHEN 2 THEN 'service' WHEN 10 THEN 'contact' ELSE 'invalid' END", 'object_type' => "CASE cvo.objecttype_id WHEN 1 THEN 'host' WHEN 2 THEN 'service' WHEN 10 THEN 'contact' ELSE 'invalid' END",
'object_type_id' => 'cvo.objecttype_id' 'object_type_id' => 'cvo.objecttype_id'
// 'object_type' => "CASE cvo.objecttype_id WHEN 1 THEN 'host' WHEN 2 THEN 'service' WHEN 3 THEN 'hostgroup' WHEN 4 THEN 'servicegroup' WHEN 5 THEN 'hostescalation' WHEN 6 THEN 'serviceescalation' WHEN 7 THEN 'hostdependency' WHEN 8 THEN 'servicedependency' WHEN 9 THEN 'timeperiod' WHEN 10 THEN 'contact' WHEN 11 THEN 'contactgroup' WHEN 12 THEN 'command' ELSE 'other' END" // 'object_type' => "CASE cvo.objecttype_id WHEN 1 THEN 'host' WHEN 2 THEN 'service' WHEN 3 THEN 'hostgroup' WHEN 4 THEN 'servicegroup' WHEN 5 THEN 'hostescalation' WHEN 6 THEN 'serviceescalation' WHEN 7 THEN 'hostdependency' WHEN 8 THEN 'servicedependency' WHEN 9 THEN 'timeperiod' WHEN 10 THEN 'contact' WHEN 11 THEN 'contactgroup' WHEN 12 THEN 'command' ELSE 'other' END"
), ),
); );

View File

@ -19,7 +19,11 @@ class Customvar extends DataView
'varname', 'varname',
'varvalue', 'varvalue',
'is_json', 'is_json',
'object_type' 'host_name',
'service_description',
'contact_name',
'object_type',
'object_type_id'
); );
} }
@ -37,4 +41,9 @@ class Customvar extends DataView
) )
); );
} }
public function getFilterColumns()
{
return array('host', 'service', 'contact');
}
} }