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 @@
-
+

Site Status History: {$service->name|escape:html} - {$site->name|escape:html}

This page details the incident history for a site

- {foreach from=array(0,1,2,3,4,5,6) item=day} - {if $day == 0} -
-
-

Today {mktime(0,0,0,date("n"),date("j"))|date_format:"d M Y"}

-

x incidents

-
-
- {$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)} - {if $incidentsDuring} - - - - - - - - - - {foreach from=$incidentsDuring item=incident} - - - - - - - - {/foreach} - {else} -

There were no recorded incidents on this day

- {/if} - -
IncidentDescriptionTime OpenedStatusTime Closed
{$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} -
-
-
- {else} -
-
-

{mktime(0,0,0,date("n"),date("j")-$day)|date_format:"d M Y"}

-

x incidents

+ {if $start && $end} + {$incidentsDuring=$site->openIncidentsDuring($start, $end)} + {$incidentCount=count($incidentsDuring)} +

{$start|date_format:'d-M H:i'} to {$end|date_format:'d-M H:i'}

+ {foreach from=$incidentsDuring item=incident} + {$statuses=$incident->statusChanges()} +
+
+

{$incident->reference|escape:html}

+

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}
-
- {$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)} - {if $incidentsDuring} - - - - - - - - - - {foreach from=$incidentsDuring item=incident} - - - - - - - {/foreach} - {else} -

There were no recorded incidents on this day

- {/if} - -
IncidentDescriptionTime OpenedStatusTime Closed
{$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} -
-
-
- {/if} - {/foreach} +
+ + + + + + + + {foreach from=$statuses item=status} + + + + + + {/foreach} + +
StatusTimeDescription
{$status->status|escape:html}{$status->ctime|date_format:'d-M H:i'}{$status->description|escape:html}
+
+
+ {foreachelse} +

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)} +
+
+

{if $day == 0}Today {/if}{$start|date_format:"d M Y"}

+

{$incidentCount} {StatusBoard_Formatting::pluralise('incident','incidents',$incidentCount)}

+
+
+ {if $incidentsDuring} + + + + + + + + + + {foreach from=$incidentsDuring item=incident} + + + + + + + + {/foreach} + +
IncidentDescriptionTime OpenedStatusTime Closed
{$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} +
+ {else} +

There were no recorded incidents on this day

+ {/if} +
+
+ {/foreach} + {/if}
\ No newline at end of file