diff --git a/application/views/scripts/about/index.phtml b/application/views/scripts/about/index.phtml index 47b76a8d25..8118e8e103 100644 --- a/application/views/scripts/about/index.phtml +++ b/application/views/scripts/about/index.phtml @@ -101,7 +101,7 @@ ) ?>

translate('Loaded modules') ?>

- +
diff --git a/application/views/scripts/config/modules.phtml b/application/views/scripts/config/modules.phtml index 89e51296ad..ae4b1c99e2 100644 --- a/application/views/scripts/config/modules.phtml +++ b/application/views/scripts/config/modules.phtml @@ -8,7 +8,7 @@
-
translate('Name') ?>
+
diff --git a/application/views/scripts/config/resource.phtml b/application/views/scripts/config/resource.phtml index 6a32cca670..82d4e0cdcd 100644 --- a/application/views/scripts/config/resource.phtml +++ b/application/views/scripts/config/resource.phtml @@ -13,7 +13,7 @@ 'title' => $this->translate('Create a new resource') ) ) ?> -
translate('Module') ?>
+
diff --git a/application/views/scripts/form/reorder-authbackend.phtml b/application/views/scripts/form/reorder-authbackend.phtml index 8461844931..bdda71dee1 100644 --- a/application/views/scripts/form/reorder-authbackend.phtml +++ b/application/views/scripts/form/reorder-authbackend.phtml @@ -1,5 +1,5 @@ -
translate('Resource') ?>
+
diff --git a/application/views/scripts/group/list.phtml b/application/views/scripts/group/list.phtml index e0b806069c..6ad5557b53 100644 --- a/application/views/scripts/group/list.phtml +++ b/application/views/scripts/group/list.phtml @@ -49,7 +49,7 @@ $firstRow = true; foreach ($groups as $group): ?> -
translate('Backend') ?>
+
diff --git a/application/views/scripts/group/show.phtml b/application/views/scripts/group/show.phtml index f76ecdf3ff..2d030b0a93 100644 --- a/application/views/scripts/group/show.phtml +++ b/application/views/scripts/group/show.phtml @@ -70,7 +70,7 @@ $firstRow = true; foreach ($members as $member): ?> -
translate('Group'); ?>
+
diff --git a/application/views/scripts/navigation/index.phtml b/application/views/scripts/navigation/index.phtml index 16a36ce187..877414675a 100644 --- a/application/views/scripts/navigation/index.phtml +++ b/application/views/scripts/navigation/index.phtml @@ -23,7 +23,7 @@

translate('You did not create any navigation item yet.') ?>

-
translate('Username'); ?>
+
diff --git a/application/views/scripts/navigation/shared.phtml b/application/views/scripts/navigation/shared.phtml index cf8450fda0..c927260eeb 100644 --- a/application/views/scripts/navigation/shared.phtml +++ b/application/views/scripts/navigation/shared.phtml @@ -14,7 +14,7 @@ if (! $this->compact): ?>

translate('There are currently no navigation items being shared'); ?>

-
translate('Navigation') ?>
+
diff --git a/application/views/scripts/role/list.phtml b/application/views/scripts/role/list.phtml index 00b9c7579d..7923f865cb 100644 --- a/application/views/scripts/role/list.phtml +++ b/application/views/scripts/role/list.phtml @@ -16,7 +16,7 @@ isEmpty()): ?>

translate('No roles found.') ?>

-
translate('Shared Navigation'); ?> translate('Type'); ?>
+
diff --git a/application/views/scripts/user/list.phtml b/application/views/scripts/user/list.phtml index c389c20f7c..ead9609040 100644 --- a/application/views/scripts/user/list.phtml +++ b/application/views/scripts/user/list.phtml @@ -43,7 +43,7 @@ $reducible = $this->hasPermission('config/authentication/users/remove') && $back ) ) ?> -
translate('Name') ?>
+
diff --git a/application/views/scripts/user/show.phtml b/application/views/scripts/user/show.phtml index ee3aa6809f..2902cc0e26 100644 --- a/application/views/scripts/user/show.phtml +++ b/application/views/scripts/user/show.phtml @@ -71,7 +71,7 @@ $firstRow = true; foreach ($memberships as $membership): ?> -
translate('Username') ?>
+
diff --git a/application/views/scripts/usergroupbackend/list.phtml b/application/views/scripts/usergroupbackend/list.phtml index fd688d80d7..65bcee8193 100644 --- a/application/views/scripts/usergroupbackend/list.phtml +++ b/application/views/scripts/usergroupbackend/list.phtml @@ -14,7 +14,7 @@ ) ) ?> -
translate('Group'); ?>
+
diff --git a/modules/monitoring/application/views/scripts/config/index.phtml b/modules/monitoring/application/views/scripts/config/index.phtml index 709a847d95..cf3e7ac464 100644 --- a/modules/monitoring/application/views/scripts/config/index.phtml +++ b/modules/monitoring/application/views/scripts/config/index.phtml @@ -15,7 +15,7 @@ 'title' => $this->translate('Create a new monitoring backend') ) ) ?> -
translate('Backend') ?>
+
@@ -70,7 +70,7 @@ 'title' => $this->translate('Create a new command transport') ) ) ?> -
translate('Monitoring Backend') ?>
+
diff --git a/modules/monitoring/application/views/scripts/list/contactgroups.phtml b/modules/monitoring/application/views/scripts/list/contactgroups.phtml index a377ebacc2..2e62d5a00d 100644 --- a/modules/monitoring/application/views/scripts/list/contactgroups.phtml +++ b/modules/monitoring/application/views/scripts/list/contactgroups.phtml @@ -18,7 +18,7 @@ if (count($groupData) === 0) { return; } ?> -
translate('Transport') ?>
+
diff --git a/modules/monitoring/application/views/scripts/list/contacts.phtml b/modules/monitoring/application/views/scripts/list/contacts.phtml index 6ece9e8dfc..69bf07c376 100644 --- a/modules/monitoring/application/views/scripts/list/contacts.phtml +++ b/modules/monitoring/application/views/scripts/list/contacts.phtml @@ -11,7 +11,7 @@
hasResult()): ?> -
+
diff --git a/modules/monitoring/application/views/scripts/list/hostgroups.phtml b/modules/monitoring/application/views/scripts/list/hostgroups.phtml index 4d6d235bc1..c67963ada8 100644 --- a/modules/monitoring/application/views/scripts/list/hostgroups.phtml +++ b/modules/monitoring/application/views/scripts/list/hostgroups.phtml @@ -18,7 +18,7 @@ if (! $this->compact): ?>

translate('No host groups found matching the filter.') ?>

-
translate('Name') ?>
+
diff --git a/modules/monitoring/application/views/scripts/list/servicegroups.phtml b/modules/monitoring/application/views/scripts/list/servicegroups.phtml index 5e9500bea5..5893734348 100644 --- a/modules/monitoring/application/views/scripts/list/servicegroups.phtml +++ b/modules/monitoring/application/views/scripts/list/servicegroups.phtml @@ -16,7 +16,7 @@ if (! $this->compact): ?>

translate('No service groups found matching the filter.') ?>

-
+
diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostobjectSubquery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostobjectSubquery.php new file mode 100644 index 0000000000..ebb6324546 --- /dev/null +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostobjectSubquery.php @@ -0,0 +1,239 @@ + array( + 'hostgroup' => 'hgo.name1', + ), + 'hosts' => array( + 'host' => 'ho.name1', + ), + 'servicegroups' => array( + 'servicegroup' => 'sgo.name1', + ), + 'services' => array( + 'service' => 'so.name2', + ) + ); + + /** + * Create a sub query to join comments into status query + * + * @param int $entryType + * @param string $alias + * + * @return Zend_Db_Expr + */ + protected function createLastCommentSubQuery($entryType, $alias) + { + $sql = <<select->from( + array('h' => $this->prefix . 'hosts'), + array() + )->join( + array('ho' => $this->prefix . 'objects'), + 'ho.object_id = h.host_object_id AND ho.is_active = 1 AND ho.objecttype_id = 1', + array() + ); + $this->joinedVirtualTables['hosts'] = true; + } + + /** + * Join host groups + */ + protected function joinHostgroups() + { + $this->select->joinLeft( + array('hgm' => $this->prefix . 'hostgroup_members'), + 'hgm.host_object_id = ho.object_id', + array() + )->joinLeft( + array('hg' => $this->prefix . 'hostgroups'), + 'hg.hostgroup_id = hgm.hostgroup_id', + array() + )->joinLeft( + array('hgo' => $this->prefix . 'objects'), + 'hgo.object_id = hg.hostgroup_object_id AND hgo.is_active = 1 AND hgo.objecttype_id = 3', + array() + ); + $this->group('ho.name1'); + } + + /** + * Join host status + */ + protected function joinHoststatus() + { + $this->select->join( + array('hs' => $this->prefix . 'hoststatus'), + 'hs.host_object_id = ho.object_id', + array() + ); + } + + /** + * Join last host acknowledgement comment + */ + protected function joinLasthostackcomment() + { + $this->select->joinLeft( + array('hlac' => $this->createLastCommentSubQuery(4, 'last_ack_data')), + 'hlac.object_id = ho.object_id', + array() + ); + } + + /** + * Join last host comment + */ + protected function joinLasthostcomment() + { + $this->select->joinLeft( + array('hlc' => $this->createLastCommentSubQuery(1, 'last_comment_data')), + 'hlc.object_id = ho.object_id', + array() + ); + } + + /** + * Join last host downtime comment + */ + protected function joinLasthostdowntimeComment() + { + $this->select->joinLeft( + array('hldc' => $this->createLastCommentSubQuery(2, 'last_downtime_data')), + 'hldc.object_id = ho.object_id', + array() + ); + } + + /** + * Join last host flapping comment + */ + protected function joinLasthostflappingcomment() + { + $this->select->joinLeft( + array('hlfc' => $this->createLastCommentSubQuery(3, 'last_flapping_data')), + 'hlfc.object_id = ho.object_id', + array() + ); + } + + /** + * Join service groups + */ + protected function joinServicegroups() + { + $this->requireVirtualTable('services'); + $this->select->joinLeft( + array('sgm' => $this->prefix . 'servicegroup_members'), + 'sgm.service_object_id = s.service_object_id', + array() + )->joinLeft( + array('sg' => $this->prefix . 'servicegroups'), + 'sgm.servicegroup_id = sg.' . $this->servicegroup_id, + array() + )->joinLeft( + array('sgo' => $this->prefix . 'objects'), + 'sgo.object_id = sg.servicegroup_object_id AND sgo.is_active = 1 AND sgo.objecttype_id = 4', + array() + ); + $this->group('ho.name1'); + } + + /** + * Join services + */ + protected function joinServices() + { + $this->requireVirtualTable('hosts'); + $this->select->joinLeft( + array('s' => $this->prefix . 'services'), + 's.host_object_id = h.host_object_id', + array() + )->joinLeft( + array('so' => $this->prefix . 'objects'), + 'so.object_id = s.service_object_id AND so.is_active = 1 AND so.objecttype_id = 2', + array() + ); + $this->group('ho.name1'); + } + + /** + * Join service problem summary + */ + protected function joinServiceproblemsummary() + { + $select = <<<'SQL' +SELECT + SUM( + CASE WHEN(ss.problem_has_been_acknowledged + ss.scheduled_downtime_depth + COALESCE(hs.current_state, 0)) > 0 + THEN 0 + ELSE 1 + END + ) AS unhandled_services_count, + SUM( + CASE WHEN (ss.problem_has_been_acknowledged + ss.scheduled_downtime_depth + COALESCE(hs.current_state, 0) ) > 0 + THEN 1 + ELSE 0 + END + ) AS handled_services_count, + s.host_object_id +FROM + icinga_servicestatus ss + JOIN icinga_objects o ON o.object_id = ss.service_object_id + JOIN icinga_services s ON s.service_object_id = o.object_id + JOIN icinga_hoststatus hs ON hs.host_object_id = s.host_object_id +WHERE + o.is_active = 1 + AND o.objecttype_id = 2 + AND ss.current_state > 0 +GROUP BY + s.host_object_id +SQL; + $this->select->joinLeft( + array('sps' => new Zend_Db_Expr('(' . $select . ')')), + 'sps.host_object_id = ho.object_id', + array() + ); + } +} diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/PermsQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/PermsQuery.php new file mode 100644 index 0000000000..c63cabea29 --- /dev/null +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/PermsQuery.php @@ -0,0 +1,158 @@ + array( + 'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci', + 'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci', + 'hostgroup_name' => 'hgo.name1' + ), + 'hosts' => array( + 'host' => 'ho.name1 COLLATE latin1_general_ci', + 'host_name' => 'ho.name1', + 'host_alias' => 'h.alias', + 'host_display_name' => 'h.display_name COLLATE latin1_general_ci' + ), + 'servicegroups' => array( + 'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci', + 'servicegroup_name' => 'sgo.name1', + 'servicegroup_alias' => 'sg.alias COLLATE latin1_general_ci' + ), + 'services' => array( + 'service' => 'so.name2 COLLATE latin1_general_ci', + 'service_host_name' => 'so.name1' + ) + ); + + /** + * {@inheritdoc} + */ + protected function joinBaseTables() + { + $this->select->from( + array('c' => $this->prefix . 'contacts'), + array() + )->join( + array('co' => $this->prefix . 'objects'), + 'co.object_id = c.contact_object_id AND co.is_active = 1', + array() + ); + $this->joinedVirtualTables['contacts'] = true; + } + + /** + * Join timeperiods + */ + protected function joinTimeperiods() + { + $this->select->joinLeft( + array('ht' => $this->prefix . 'timeperiods'), + 'ht.timeperiod_object_id = c.host_timeperiod_object_id', + array() + ); + $this->select->joinLeft( + array('st' => $this->prefix . 'timeperiods'), + 'st.timeperiod_object_id = c.service_timeperiod_object_id', + array() + ); + } + + /** + * Join host groups + */ + protected function joinHostgroups() + { + $this->requireVirtualTable('hosts'); + $this->select->joinLeft( + array('hgm' => $this->prefix . 'hostgroup_members'), + 'hgm.host_object_id = ho.object_id', + array() + )->joinLeft( + array('hg' => $this->prefix . 'hostgroups'), + 'hg.hostgroup_id = hgm.hostgroup_id', + array() + )->joinLeft( + array('hgo' => $this->prefix . 'objects'), + 'hgo.object_id = hg.hostgroup_object_id AND hgo.is_active = 1 AND hgo.objecttype_id = 3', + array() + ); + } + + /** + * Join hosts + */ + protected function joinHosts() + { + $this->select->joinLeft( + array('hc' => $this->prefix . 'host_contacts'), + 'hc.contact_object_id = c.contact_object_id', + array() + )->joinLeft( + array('h' => $this->prefix . 'hosts'), + 'h.host_id = hc.host_id', + array() + )->joinLeft( + array('ho' => $this->prefix . 'objects'), + 'ho.object_id = h.host_object_id AND ho.is_active = 1', + array() + ); + $this->group(array('c.contact_id')); + } + + /** + * Join service groups + */ + protected function joinServicegroups() + { + $this->requireVirtualTable('services'); + $this->select->joinLeft( + array('sgm' => $this->prefix . 'servicegroup_members'), + 'sgm.service_object_id = s.service_object_id', + array() + )->joinLeft( + array('sg' => $this->prefix . 'servicegroups'), + 'sg.servicegroup_id = sgm.servicegroup_id', + array() + )->joinLeft( + array('sgo' => $this->prefix . 'objects'), + 'sgo.object_id = sg.servicegroup_object_id AND sgo.is_active = 1 AND sgo.objecttype_id = 4', + array() + ); + } + + /** + * Join services + */ + protected function joinServices() + { + $this->select->joinLeft( + array('sc' => $this->prefix . 'service_contacts'), + 'sc.contact_object_id = c.contact_object_id', + array() + )->joinLeft( + array('s' => $this->prefix . 'services'), + 's.service_id = sc.service_id', + array() + )->joinLeft( + array('so' => $this->prefix . 'objects'), + 'so.object_id = s.service_object_id AND so.is_active = 1 AND so.objecttype_id = 2', + array() + ); + $this->group(array('c.contact_id')); + } +}
translate('Service Group') ?>