Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Events index view is now at a semi-usable state, similar to the origi…
…nal skin. In the interest of releasing something, I am not going to use ajax here for now. Goal is to have this view behave similar to the original Events view in the original skin. Currently you can: * Paginate events * Filter events using the sidebar Bug: Filter elements are unset when paginating.
- Loading branch information
1 parent
ad0aaa6
commit 46deb93
Showing
4 changed files
with
137 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,98 @@ | ||
<h2>Events</h2> | ||
<?php $count = 0; ?> | ||
<div id="sidebar"> | ||
<?php | ||
echo $this->Form->create('Events', array('default' => false, 'inputDefaults' => array( | ||
'legend' => false, | ||
'label' => false, | ||
'div' => false, | ||
'fieldset' => false | ||
))); | ||
?> | ||
<div id="events_monitors"> | ||
<fieldset> | ||
<legend>Monitors</legend> | ||
<ol id="selectable"> | ||
<?php foreach ($monitors as $monitor): ?> | ||
<li id="Monitor_<?php echo $monitor['Monitor']['Id']; ?>"> | ||
<?php echo $monitor['Monitor']['Name']; ?> | ||
<?php echo count($monitor['Event']); ?> | ||
<?php echo $eventsLastHour[$count][0]['count']; ?> | ||
<?php echo $eventsLastDay[$count][0]['count']; ?> | ||
<?php echo $eventsLastWeek[$count][0]['count']; ?> | ||
<?php echo $eventsLastMonth[$count][0]['count']; ?> | ||
<?php echo $eventsArchived[$count][0]['count']; ?> | ||
</li> | ||
<?php $count++; ?> | ||
<?php endforeach; ?> | ||
<?php unset($monitor); ?> | ||
<li id="Monitor_<?php echo $monitor['Monitor']['Id']; ?>"><?php echo $this->Form->input($monitor['Monitor']['Name'], array('type' => 'checkbox', 'label' => $monitor['Monitor']['Name'])); ?></li> | ||
<?php | ||
endforeach; | ||
unset($monitor); | ||
?> | ||
</ol> | ||
</fieldset> | ||
</div> | ||
|
||
<div id="events_date_time"> | ||
<fieldset> | ||
<legend>Date Range</legend> | ||
<fieldset> | ||
<?php | ||
$prepend = array('00','01','02','03','04','05','06','07','08','09'); | ||
$hours = array_merge($prepend,range(10, 23)); | ||
$minutes = array_merge($prepend,range(10, 59)); | ||
$seconds = $minutes; | ||
echo $this->Form->input('Start Date', array('id' => 'EventStartDate', 'required' => true)); | ||
echo $this->Form->inputs(array( | ||
'legend' => false, | ||
'fieldset' => false, | ||
'Hour' => array('type' => 'select', 'id' => 'EventStartHour', 'options' => $hours), | ||
'Minute' => array('type' => 'select', 'id' => 'EventStartMinute', 'options' => $minutes) | ||
)); | ||
?> | ||
</fieldset> | ||
<fieldset> | ||
<?php | ||
echo $this->Form->input('End Date', array('id' => 'EventEndDate', 'required' => true)); | ||
echo $this->Form->inputs(array( | ||
'legend' => false, | ||
'fieldset' => false, | ||
'Hour' => array('type' => 'select', 'id' => 'EventEndHour', 'options' => $hours), | ||
'Minute' => array('type' => 'select', 'id' => 'EventEndMinute', 'options' => $minutes) | ||
)); | ||
?> | ||
</fieldset> | ||
</div> | ||
<?php echo $this->Form->end(array('label' => 'Search', 'id' => 'EventsButtonSearch')); ?> | ||
</div> | ||
|
||
<div id="Events"> | ||
<div style="clear:both;"><?php echo $this->Paginator->numbers(); ?></div> | ||
<table> | ||
<tr> | ||
<th>Event Name</th> | ||
<th>Monitor Name</th> | ||
<th>Length</th> | ||
</tr> | ||
<tr> | ||
<th>Thumbnail</th> | ||
<th>Id</th> | ||
<th>Name</th> | ||
<th>Monitor</th> | ||
<th>Cause</th> | ||
<th>Time</th> | ||
<th>Duration</th> | ||
<th>Alarm Frames</th> | ||
<th>Total Score</th> | ||
<th>Avg. Score</th> | ||
<th>Max Score</th> | ||
</tr> | ||
|
||
<?php foreach ($events as $key => $value): ?> | ||
<tr> | ||
<td> | ||
<?php | ||
echo $this->Html->link($this->Html->image('/events/'.$thumbData[$key]['Path'], array( | ||
'alt' => $thumbData[$key]['Frame']['FrameId'].'/'.$thumbData[$key]['Event']['MaxScore'], | ||
'width' => $thumbData[$key]['Width'], | ||
'height' => $thumbData[$key]['Height'] | ||
)), array('controller' => 'events', 'action' => 'view', $value['Event']['Id']), | ||
array('escape' => false)); | ||
<?php | ||
foreach ($events as $key => $value) { | ||
echo $this->Html->tableCells(array( | ||
$this->Html->link($this->Html->image('/events/'.$thumbData[$key]['Path'], array( | ||
'alt' => $thumbData[$key]['Frame']['FrameId'].'/'.$thumbData[$key]['Event']['MaxScore'], | ||
'width' => $thumbData[$key]['Width'], | ||
'height' => $thumbData[$key]['Height'] | ||
)), | ||
array('controller' => 'events', 'action' => 'view', $value['Event']['Id']), array('escape' => false)), | ||
$value['Event']['Id'], | ||
$value['Event']['Name'], | ||
$value['Monitor']['Name'], | ||
$value['Event']['Cause'], | ||
$value['Event']['StartTime'], | ||
$value[0]['Duration'], | ||
$value['Event']['AlarmFrames'], | ||
$value['Event']['TotScore'], | ||
$value['Event']['AvgScore'], | ||
$value['Event']['MaxScore'] | ||
)); | ||
} | ||
?> | ||
</td> | ||
<td><?php echo $value['Monitor']['Name']; ?></td> | ||
<td><?php echo $value['Event']['Length']; ?></td> | ||
</tr> | ||
<?php endforeach; ?> | ||
<?php unset($key); ?> | ||
</table> | ||
<div><?php echo $this->Paginator->numbers(); ?></div> | ||
<div style="clear:both;"><?php echo $this->Paginator->numbers(); ?></div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46deb93
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit introduced #25