diff --git a/source/lib/StatusBoard/Main.class.php b/source/lib/StatusBoard/Main.class.php index c2753e4..4d8c7b8 100644 --- a/source/lib/StatusBoard/Main.class.php +++ b/source/lib/StatusBoard/Main.class.php @@ -36,7 +36,8 @@ class StatusBoard_Main extends SihnonFramework_Main { $this->smarty->registerPlugin('modifier', 'formatDuration', array('StatusBoard_Main', 'formatDuration')); $this->smarty->registerPlugin('modifier', 'formatFilesize', array('StatusBoard_Main', 'formatFilesize')); - + $this->smarty->registerPlugin('modifier', 'fuzzyTime', array('StatusBoard_DateTime', 'fuzzyTime')); + $this->smarty->assign('version', '0.1.0'); $this->smarty->assign('version_codename', 'Acai'); $this->smarty->assign('messages', array()); diff --git a/source/webui/pages/status.php b/source/webui/pages/status.php index 90a8ac2..e1a6426 100644 --- a/source/webui/pages/status.php +++ b/source/webui/pages/status.php @@ -1,8 +1,12 @@ request(); + $service_id = $request->get('service', 'Sihnon_Exception_InvalidParameters'); -$site_id = $request->get('id', 'Sihnon_Exception_InvalidParameters'); +$site_id = $request->get('id', 'Sihnon_Exception_InvalidParameters'); + +$start = $request->get('start'); +$end = $request->get('end'); $service = null; $site = null; @@ -13,7 +17,12 @@ try { } catch (Sihnon_Exception_ResultCountMismatch $e) { throw new StatusBoard_Exception_FileNotFound(); } + $services = StatusBoard_Service::all(); + $this->smarty->assign('service', $service); $this->smarty->assign('site', $site); +$this->smarty->assign('start', $start); +$this->smarty->assign('end', $end); + ?> \ No newline at end of file diff --git a/source/webui/templates/status.tpl b/source/webui/templates/status.tpl index 4134ed4..d28f328 100644 --- a/source/webui/templates/status.tpl +++ b/source/webui/templates/status.tpl @@ -1,92 +1,91 @@
This page details the incident history for a site
- {foreach from=array(0,1,2,3,4,5,6) item=day} - {if $day == 0} -x incidents
-| Incident | -Description | -Time Opened | -Status | -Time Closed | - - - {foreach from=$incidentsDuring item=incident} -
|---|---|---|---|---|
| {$incident->reference|escape:html} | -{$incident->description|truncate|escape:html} | -{date('d-M H:i', $incident->start_time)} | -{StatusBoard_Status::name($incident->currentStatus())} | -{if $incident->actual_end_time} - {date('d-M H:i', $incident->actual_end_time)} - {else} - Still Open - {/if} - | -
x incidents
+ {if $start && $end} + {$incidentsDuring=$site->openIncidentsDuring($start, $end)} + {$incidentCount=count($incidentsDuring)} +Opened: {$incident->start_time|date:"r"}
+ {if $incident->estimated_end_time} + {$time_difference=time()-$incident->estimated_end_time} +
Estimated End Time: {$time_difference|fuzzyTime}
+ {/if}| Incident | -Description | -Time Opened | -Status | -Time Closed | - - - {foreach from=$incidentsDuring item=incident} -
|---|---|---|---|---|
| {$incident->reference|escape:html} | -{$incident->description|truncate|escape:html} | -{date('d-M H:i', $incident->start_time)} | -{StatusBoard_Status::name($incident->currentStatus())} | -{if $incident->actual_end_time} - {date('d-M H:i', $incident->actual_end_time)} - {else} - Still Open - {/if} - |
| Status | +Time | +Description | + + + {foreach from=$statuses item=status} +
|---|---|---|
| {$status->status|escape:html} | +{$status->ctime|date_format:'d-M H:i'} | +{$status->description|escape:html} | +
There were no recorded incidents during this time period.
+ {/foreach} + {else} + {foreach from=array(0,1,2,3,4,5,6) item=day} + {$start=mktime(0,0,0,date("n"),date("j")-$day)} + {$end=mktime(0,0,0,date("n"),date("j")-$day+1)} + {$incidentsDuring=$site->openIncidentsDuring($start, $end)} + {$incidentCount=count($incidentsDuring)} +{$incidentCount} {StatusBoard_Formatting::pluralise('incident','incidents',$incidentCount)}
+| Incident | +Description | +Time Opened | +Status | +Time Closed | + + + {foreach from=$incidentsDuring item=incident} +
|---|---|---|---|---|
| {$incident->reference|escape:html} | +{$incident->description|truncate|escape:html} | +{date('d-M H:i', $incident->start_time)} | +{StatusBoard_Status::name($incident->currentStatus())} | ++ {if $incident->actual_end_time} + {date('d-M H:i', $incident->actual_end_time)} + {else} + Still Open + {/if} + | +
There were no recorded incidents on this day
+ {/if} +