diff --git a/source/webui/pages/status.php b/source/webui/pages/status.php index 22216e9..90a8ac2 100644 --- a/source/webui/pages/status.php +++ b/source/webui/pages/status.php @@ -1,6 +1,19 @@ request(); +$service_id = $request->get('service', 'Sihnon_Exception_InvalidParameters'); +$site_id = $request->get('id', 'Sihnon_Exception_InvalidParameters'); +$service = null; +$site = null; + +try { + $service = StatusBoard_Service::fromId($service_id); + $site = StatusBoard_Site::fromId($site_id); +} catch (Sihnon_Exception_ResultCountMismatch $e) { + throw new StatusBoard_Exception_FileNotFound(); +} $services = StatusBoard_Service::all(); -$this->smarty->assign('services', $services); - +$this->smarty->assign('service', $service); +$this->smarty->assign('site', $site); ?> \ No newline at end of file diff --git a/source/webui/templates/fragments/site-status.tpl b/source/webui/templates/fragments/site-status.tpl index 46164c1..c1f667a 100644 --- a/source/webui/templates/fragments/site-status.tpl +++ b/source/webui/templates/fragments/site-status.tpl @@ -15,6 +15,6 @@ {assign var=img_src value="{$base_uri}images/Status_Icons/cross-circle.png"} {/case} {/switch} - + \ No newline at end of file diff --git a/source/webui/templates/status.tpl b/source/webui/templates/status.tpl index c69abb1..4134ed4 100644 --- a/source/webui/templates/status.tpl +++ b/source/webui/templates/status.tpl @@ -1,79 +1,92 @@
-
-
-

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

-

This page details the incident history for a Site related to a Service

+
+
+

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

-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
IncidentDescriptionTime OpenedStatusTime Closed
123456Loss of power on remote site14:00Major Incident-
123457Loss of power on remote site14:00Major Incident-
-
-
- {else} + {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

+
+

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

+

x incidents

- -
- - - - - - - - - - - - - - - - - - - - - - - -
IncidentDescriptionTime OpenedStatusTime Closed
123456Loss of power on remote site14:00Major Incident-
123457Loss of power on remote site14:00Major Incident-
-
-
- {/if} - {/foreach} - -
+
+ {$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} +
+
\ No newline at end of file