From 6e5bb3dfd810fcb0119c4cbfcf3dc5ec50392055 Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Tue, 20 Dec 2011 01:06:00 +0000 Subject: [PATCH] Add description to IncidentStatus Adds a new column to the IncidentStatus to permit the user to explain why the status change was made. Also exported this and Incident data into the demo sql file. --- build/schema/mysql.demo.sql | 19 +++++++++++++++++++ build/schema/mysql.sql | 1 + .../lib/StatusBoard/IncidentStatus.class.php | 1 + source/webui/templates/admin/incident.tpl | 2 ++ 4 files changed, 23 insertions(+) diff --git a/build/schema/mysql.demo.sql b/build/schema/mysql.demo.sql index 44ce0f6..bf4605f 100644 --- a/build/schema/mysql.demo.sql +++ b/build/schema/mysql.demo.sql @@ -39,6 +39,25 @@ INSERT INTO `site` (`id`, `service`, `name`, `description`) VALUES (6, 5, 'Local', 'Local LDAP services'), (7, 5, 'Offsite', 'Offsite LDAP services'); +-- +-- Dumping data for table `incident` +-- + +INSERT INTO `incident` (`id`, `site`, `reference`, `description`, `start_time`, `estimated_end_time`, `actual_end_time`) VALUES +(1, 1, 'UK:0001', 'Intermittent packetloss on primary internet connection', 1324079805, 1324079805, NULL), +(2, 1, 'UK:0002', 'Full outage', 1324079805, 1324079805, NULL), +(3, 4, 'UK:0003', 'DNS zone maintenance', 1324082411, 1324082411, NULL); + +-- +-- Dumping data for table `incidentstatus` +-- + +INSERT INTO `incidentstatus` (`id`, `incident`, `status`, `description`, `ctime`) VALUES +(1, 1, 2, 'Initial classification', 1324079864), +(2, 2, 4, 'Initial classification', 1324079864), +(3, 1, 3, 'Status upgraded due to increasing impact from the ongoing issue.', 1324080307), +(4, 3, 1, 'Initial classification', 1324082426); + -- -- Dumping data for table `user` -- diff --git a/build/schema/mysql.sql b/build/schema/mysql.sql index 950d814..d62eb72 100644 --- a/build/schema/mysql.sql +++ b/build/schema/mysql.sql @@ -117,6 +117,7 @@ CREATE TABLE IF NOT EXISTS `incidentstatus` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `incident` int(10) unsigned NOT NULL, `status` int(10) unsigned NOT NULL, + `description` text NOT NULL, `ctime` int(10) unsigned NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; diff --git a/source/lib/StatusBoard/IncidentStatus.class.php b/source/lib/StatusBoard/IncidentStatus.class.php index 6b1e590..f5fe80f 100644 --- a/source/lib/StatusBoard/IncidentStatus.class.php +++ b/source/lib/StatusBoard/IncidentStatus.class.php @@ -7,6 +7,7 @@ class StatusBoard_IncidentStatus extends StatusBoard_DatabaseObject { protected $_db_id; protected $_db_incident; protected $_db_status; + protected $_db_description; protected $_db_ctime; protected function all_for_incident(StatusBoard_Incident $incident) { diff --git a/source/webui/templates/admin/incident.tpl b/source/webui/templates/admin/incident.tpl index fb01cd7..9ff7a58 100644 --- a/source/webui/templates/admin/incident.tpl +++ b/source/webui/templates/admin/incident.tpl @@ -72,6 +72,7 @@ Date/Time Status + Description {foreach from=$statuses item=status} @@ -81,6 +82,7 @@ {$status->ctime|date_format:'y-m-d h:i:s'} {StatusBoard_Status::name($status->status)} + {$status->description|escape:html} {/foreach}