diff --git a/modules/monitoring/application/views/scripts/list/hostgroups.phtml b/modules/monitoring/application/views/scripts/list/hostgroups.phtml index 7018795a79..156a276d14 100644 --- a/modules/monitoring/application/views/scripts/list/hostgroups.phtml +++ b/modules/monitoring/application/views/scripts/list/hostgroups.phtml @@ -146,216 +146,121 @@ if (! $this->compact): ?> ) ?> - services_ok): ?> - - qlink( - $hostgroup->services_ok, - 'monitoring/list/services', - array( - 'service_state' => 0, - 'hostgroup_name' => $hostgroup->hostgroup_name, - 'sort' => 'service_severity' - ), - array( - 'title' => sprintf( - $this->translatePlural( + setUrl('monitoring/list/services') + ->add( + StateBadges::STATE_OK, + array( + 'service_state' => 0, + 'hostgroup_name' => $hostgroup->hostgroup_name, + 'sort' => 'service_severity' + ), + $hostgroup->services_ok, 'List %u service that is currently in state OK on hosts in the host group "%s"', 'List %u services which are currently in state OK on hosts in the host group "%s"', - $hostgroup->services_ok - ), - $hostgroup->services_ok, - $hostgroup->hostgroup_alias + array($hostgroup->services_ok, $hostgroup->hostgroup_alias) ) - ) - ) ?> - - - services_critical_unhandled): ?> - - qlink( - $hostgroup->services_critical_unhandled, - 'monitoring/list/services', - array( - 'service_state' => 2, - 'service_acknowledged' => 0, - 'service_in_downtime' => 0, - 'host_problem' => 0, - 'hostgroup_name' => $hostgroup->hostgroup_name, - 'sort' => 'service_severity' - ), - array( - 'title' => sprintf( - $this->translatePlural( + ->add( + StateBadges::STATE_CRITICAL, + array( + 'service_state' => 2, + 'service_acknowledged' => 0, + 'service_in_downtime' => 0, + 'host_problem' => 0, + 'hostgroup_name' => $hostgroup->hostgroup_name, + 'sort' => 'service_severity' + ), + $hostgroup->services_critical_unhandled, 'List %u service that is currently in state CRITICAL on hosts in the host group "%s"', 'List %u services which are currently in state CRITICAL on hosts in the host group "%s"', - $hostgroup->services_critical_unhandled - ), - $hostgroup->services_critical_unhandled, - $hostgroup->hostgroup_alias + array($hostgroup->services_critical_unhandled, $hostgroup->hostgroup_alias) ) - ) - ) ?> - - services_critical_handled): ?> - - qlink( - $hostgroup->services_critical_handled, - 'monitoring/list/services', - array( - 'service_state' => 2, - 'service_handled' => 1, - 'hostgroup_name' => $hostgroup->hostgroup_name, - 'sort' => 'service_severity' - ), - array( - 'title' => sprintf( - $this->translatePlural( - 'List %u service that is currently in state CRITICAL (Acknowledged) on hosts in the host group "%s"', - 'List %u services which are currently in state CRITICAL (Acknowledged) on hosts in the host group "%s"', - $hostgroup->services_critical_handled + ->add( + StateBadges::STATE_CRITICAL_HANDLED, + array( + 'service_state' => 2, + 'service_handled' => 1, + 'hostgroup_name' => $hostgroup->hostgroup_name, + 'sort' => 'service_severity' ), $hostgroup->services_critical_handled, - $hostgroup->hostgroup_alias - ) + 'List %u service that is currently in state CRITICAL (Acknowledged) on hosts in the host group "%s"', + 'List %u services which are currently in state CRITICAL (Acknowledged) on hosts in the host group "%s"', + array($hostgroup->services_critical_unhandled, $hostgroup->hostgroup_alias) ) - ) ?> - - - services_critical_unhandled): ?> - - - services_unknown_unhandled): ?> - - qlink( - $hostgroup->services_unknown_unhandled, - 'monitoring/list/services', - array( - 'service_state' => 3, - 'service_acknowledged' => 0, - 'service_in_downtime' => 0, - 'host_problem' => 0, - 'hostgroup_name' => $hostgroup->hostgroup_name, - 'sort' => 'service_severity' - ), - array( - 'title' => sprintf( - $this->translatePlural( + ->add( + StateBadges::STATE_UNKNOWN, + array( + 'service_state' => 3, + 'service_acknowledged' => 0, + 'service_in_downtime' => 0, + 'host_problem' => 0, + 'hostgroup_name' => $hostgroup->hostgroup_name, + 'sort' => 'service_severity' + ), + $hostgroup->services_unknown_unhandled, 'List %u service that is currently in state UNKNOWN on hosts in the host group "%s"', 'List %u services which are currently in state UNKNOWN on hosts in the host group "%s"', - $hostgroup->services_unknown_unhandled - ), - $hostgroup->services_unknown_unhandled, - $hostgroup->hostgroup_alias + array($hostgroup->services_unknown_unhandled, $hostgroup->hostgroup_alias) ) - ) - ) ?> - - services_unknown_handled): ?> - - qlink( - $hostgroup->services_unknown_handled, - 'monitoring/list/services', - array( - 'service_state' => 3, - 'service_handled' => 1, - 'hostgroup_name' => $hostgroup->hostgroup_name, - 'sort' => 'service_severity' - ), - array( - 'title' => sprintf( - $this->translatePlural( - 'List %u service that is currently in state UNKNOWN (Acknowledged) on hosts in the host group "%s"', - 'List %u services which are currently in state UNKNOWN (Acknowledged) on hosts in the host group "%s"', - $hostgroup->services_unknown_handled + ->add( + StateBadges::STATE_UNKNOWN_HANDLED, + array( + 'service_state' => 3, + 'service_handled' => 1, + 'hostgroup_name' => $hostgroup->hostgroup_name, + 'sort' => 'service_severity' ), $hostgroup->services_unknown_handled, - $hostgroup->hostgroup_alias - ) + 'List %u service that is currently in state UNKNOWN (Acknowledged) on hosts in the host group "%s"', + 'List %u services which are currently in state UNKNOWN (Acknowledged) on hosts in the host group "%s"', + array($hostgroup->services_unknown_handled, $hostgroup->hostgroup_alias) + ) - ) ?> - - - services_unknown_unhandled): ?> - - - services_warning_unhandled): ?> - - qlink( - $hostgroup->services_warning_unhandled, - 'monitoring/list/services', - array( - 'service_state' => 1, - 'service_acknowledged' => 0, - 'service_in_downtime' => 0, - 'host_problem' => 0, - 'hostgroup_name' => $hostgroup->hostgroup_name, - 'sort' => 'service_severity' - ), - array( - 'title' => sprintf( - $this->translatePlural( + ->add( + StateBadges::STATE_WARNING, + array( + 'service_state' => 1, + 'service_acknowledged' => 0, + 'service_in_downtime' => 0, + 'host_problem' => 0, + 'hostgroup_name' => $hostgroup->hostgroup_name, + 'sort' => 'service_severity' + ), + $hostgroup->services_warning_unhandled, 'List %u service that is currently in state WARNING on hosts in the host group "%s"', 'List %u services which are currently in state WARNING on hosts in the host group "%s"', - $hostgroup->services_warning_unhandled - ), - $hostgroup->services_warning_unhandled, - $hostgroup->hostgroup_alias + array($hostgroup->services_warning_unhandled, $hostgroup->hostgroup_alias) ) - ) - ) ?> - - services_warning_handled): ?> - - qlink( - $hostgroup->services_warning_handled, - 'monitoring/list/services', - array( - 'service_state' => 1, - 'service_handled' => 1, - 'hostgroup_name' => $hostgroup->hostgroup_name, - 'sort' => 'service_severity' - ), - array( - 'title' => sprintf( - $this->translatePlural( - 'List %u service that is currently in state WARNING (Acknowledged) on hosts in the host group "%s"', - 'List %u services which are currently in state WARNING (Acknowledged) on hosts in the host group "%s"', - $hostgroup->services_warning_handled + ->add( + StateBadges::STATE_WARNING_HANDLED, + array( + 'service_state' => 1, + 'service_handled' => 1, + 'hostgroup_name' => $hostgroup->hostgroup_name, + 'sort' => 'service_severity' ), $hostgroup->services_warning_handled, - $hostgroup->hostgroup_alias - ) + 'List %u service that is currently in state WARNING (Acknowledged) on hosts in the host group "%s"', + 'List %u services which are currently in state WARNING (Acknowledged) on hosts in the host group "%s"', + array($hostgroup->services_warning_handled, $hostgroup->hostgroup_alias) ) - ) ?> - - - services_warning_unhandled): ?> - - - services_pending): ?> - - qlink( - $hostgroup->services_pending, - 'monitoring/list/services', - array( - 'service_state' => 99, - 'hostgroup_name' => $hostgroup->hostgroup_name, - 'sort' => 'service_severity' - ), - array( - 'title' => sprintf( - $this->translatePlural( + ->add( + StateBadges::STATE_PENDING, + array( + 'service_state' => 99, + 'hostgroup_name' => $hostgroup->hostgroup_name, + 'sort' => 'service_severity' + ), + $hostgroup->services_pending, 'List %u service that is currently in state PENDING on hosts in the host group "%s"', 'List %u services which are currently in state PENDING on hosts in the host group "%s"', - $hostgroup->services_pending - ), - $hostgroup->services_pending, - $hostgroup->hostgroup_alias - ) - ) - ) ?> - - + array($hostgroup->services_pending, $hostgroup->hostgroup_alias) + ); + echo $stateBadges->render(); + ?>