From 096581b7f16d5c5642f6d4337755ebe72eb0c40e Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 28 May 2021 12:29:30 -0400 Subject: [PATCH] add getMonitorStatuses function to return string values for status numbers --- web/includes/Monitor.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/web/includes/Monitor.php b/web/includes/Monitor.php index ad3e95a0d..37f231528 100644 --- a/web/includes/Monitor.php +++ b/web/includes/Monitor.php @@ -10,7 +10,7 @@ require_once('Group.php'); $FunctionTypes = null; function getMonitorFunctionTypes() { - if ( !isset($FunctionTypes ) ) { + if (!isset($FunctionTypes)) { $FunctionTypes = array( 'None' => translate('FnNone'), 'Monitor' => translate('FnMonitor'), @@ -23,6 +23,21 @@ function getMonitorFunctionTypes() { return $FunctionTypes; } +$Statuses = null; +function getMonitorStatuses() { + if (!isset($Statuses)) { + $Statuses = array( + -1 => 'Unknown', + 0 => 'Idle', + 1 => 'PreAlarm', + 2 => 'Alarm', + 3 => 'Alert', + 4 => 'Tape' + ); + } + return $Statuses; +} + class Monitor extends ZM_Object { protected static $table = 'Monitors';