From 3ba9db5d24a8f67232cad1e771d56b4d6c3483eb Mon Sep 17 00:00:00 2001 From: James Brooks Date: Tue, 25 Nov 2014 09:18:22 +0000 Subject: [PATCH] Use lang to lookup the status of components and incidents --- app/lang/en/component.php | 10 ++++++++++ app/lang/en/incident.php | 10 ++++++++++ app/models/Component.php | 7 +------ app/models/Incident.php | 7 +------ 4 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 app/lang/en/component.php create mode 100644 app/lang/en/incident.php diff --git a/app/lang/en/component.php b/app/lang/en/component.php new file mode 100644 index 00000000..634fe05f --- /dev/null +++ b/app/lang/en/component.php @@ -0,0 +1,10 @@ + array( + 1 => 'Operational', + 2 => 'Performance Issues', + 3 => 'Partial Outage', + 4 => 'Major Outage' + ) + ); diff --git a/app/lang/en/incident.php b/app/lang/en/incident.php new file mode 100644 index 00000000..dd83d715 --- /dev/null +++ b/app/lang/en/incident.php @@ -0,0 +1,10 @@ + array( + 1 => 'Investigating', + 2 => 'Identified', + 3 => 'Watching', + 4 => 'Fixed' + ) + ); diff --git a/app/models/Component.php b/app/models/Component.php index 1a850e29..9c429b8e 100644 --- a/app/models/Component.php +++ b/app/models/Component.php @@ -14,12 +14,7 @@ * @return string */ public function getHumanStatusAttribute() { - switch ($this->status) { - case 1: return 'Operational'; - case 2: return 'Performance Issues'; - case 3: return 'Partial Outage'; - case 4: return 'Major Outage'; - } + return Lang::get('component.status.' . $this->status); } /** diff --git a/app/models/Incident.php b/app/models/Incident.php index 15a1e1c1..a92a5b12 100644 --- a/app/models/Incident.php +++ b/app/models/Incident.php @@ -14,12 +14,7 @@ * @return string */ public function getHumanStatusAttribute() { - switch ($this->status) { - case 1: return 'Investigating'; - case 2: return 'Identified'; - case 3: return 'Watching'; - case 4: return 'Fixed'; - } + return Lang::get('incident.status' . $this->status); } /**