Merge branch 'master' into merge_work_on_zms
This commit is contained in:
commit
a679455a0b
|
@ -9,6 +9,7 @@ $raw = isset($_REQUEST['raw']);
|
||||||
$data = array();
|
$data = array();
|
||||||
|
|
||||||
if ($raw) {
|
if ($raw) {
|
||||||
|
$data['raw'] = array();
|
||||||
$sql = 'SELECT S.*,E.*,Z.Name AS ZoneName,Z.Units,Z.Area,M.Name AS MonitorName
|
$sql = 'SELECT S.*,E.*,Z.Name AS ZoneName,Z.Units,Z.Area,M.Name AS MonitorName
|
||||||
FROM Stats AS S LEFT JOIN Events AS E ON S.EventId = E.Id LEFT JOIN Zones AS Z ON S.ZoneId = Z.Id LEFT JOIN Monitors AS M ON E.MonitorId = M.Id
|
FROM Stats AS S LEFT JOIN Events AS E ON S.EventId = E.Id LEFT JOIN Zones AS Z ON S.ZoneId = Z.Id LEFT JOIN Monitors AS M ON E.MonitorId = M.Id
|
||||||
WHERE S.EventId = ? AND S.FrameId = ? ORDER BY S.ZoneId';
|
WHERE S.EventId = ? AND S.FrameId = ? ORDER BY S.ZoneId';
|
||||||
|
|
|
@ -11,19 +11,24 @@ class ZM_Object {
|
||||||
$class = get_class($this);
|
$class = get_class($this);
|
||||||
|
|
||||||
$row = NULL;
|
$row = NULL;
|
||||||
if ( $IdOrRow ) {
|
if ($IdOrRow) {
|
||||||
|
|
||||||
if ( is_integer($IdOrRow) or ctype_digit($IdOrRow) ) {
|
if (is_integer($IdOrRow) or ctype_digit($IdOrRow)) {
|
||||||
$table = $class::$table;
|
$table = $class::$table;
|
||||||
$row = dbFetchOne("SELECT * FROM `$table` WHERE `Id`=?", NULL, array($IdOrRow));
|
$row = dbFetchOne("SELECT * FROM `$table` WHERE `Id`=?", NULL, array($IdOrRow));
|
||||||
if ( !$row ) {
|
if (!$row) {
|
||||||
Error("Unable to load $class record for Id=$IdOrRow");
|
Error("Unable to load $class record for Id=$IdOrRow");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} else if ( is_array($IdOrRow) ) {
|
} else if (is_array($IdOrRow)) {
|
||||||
$row = $IdOrRow;
|
$row = $IdOrRow;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $row ) {
|
if ( $row ) {
|
||||||
|
if (!isset($row['Id'])) {
|
||||||
|
Error("No Id in " . print_r($row, true));
|
||||||
|
return;
|
||||||
|
}
|
||||||
foreach ($row as $k => $v) {
|
foreach ($row as $k => $v) {
|
||||||
$this->{$k} = $v;
|
$this->{$k} = $v;
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,10 @@ xhtmlHeaders(__FILE__, translate('Frame').' - '.$Event->Id().' - '.$Frame->Frame
|
||||||
<p id="image">
|
<p id="image">
|
||||||
<?php
|
<?php
|
||||||
if ( $imageData['hasAnalImage'] ) {
|
if ( $imageData['hasAnalImage'] ) {
|
||||||
echo sprintf('<a href="?view=frame&eid=%d&fid=%d&scale=%d&show=%s">', $Event->Id(), $Frame->FrameId(), $scale, ( $show=='anal'?'capt':'anal' ) );
|
echo sprintf('<a href="?view=frame&eid=%d&fid=%d&scale=%d&show=%s" title="Click to display frame %s analysis">',
|
||||||
|
$Event->Id(), $Frame->FrameId(), $scale, ( $show=='anal'?'capt':'anal' ),
|
||||||
|
( $show=='anal'?'without':'with' ),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<img id="frameImg"
|
<img id="frameImg"
|
||||||
|
|
|
@ -40,8 +40,8 @@ function changeScale() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFrameStatsCookie() {
|
function getFrameStatsCookie() {
|
||||||
var cookie = 'zmFrameStats';
|
const cookie = 'zmFrameStats';
|
||||||
var stats = getCookie(cookie);
|
let stats = getCookie(cookie);
|
||||||
|
|
||||||
if (!stats) {
|
if (!stats) {
|
||||||
stats = 'on';
|
stats = 'on';
|
||||||
|
@ -53,7 +53,7 @@ function getFrameStatsCookie() {
|
||||||
function getStat(params) {
|
function getStat(params) {
|
||||||
$j.getJSON(thisUrl + '?view=request&request=stats&raw=true', params)
|
$j.getJSON(thisUrl + '?view=request&request=stats&raw=true', params)
|
||||||
.done(function(data) {
|
.done(function(data) {
|
||||||
var stats = data.raw;
|
const stats = data.raw;
|
||||||
|
|
||||||
|
|
||||||
$j('#frameStatsTable').empty().append('<tbody>');
|
$j('#frameStatsTable').empty().append('<tbody>');
|
||||||
|
|
Loading…
Reference in New Issue