Merge branch 'master' of ../otherbranch

This commit is contained in:
Isaac Connor
2023-01-24 21:17:45 -05:00
2 changed files with 22 additions and 10 deletions

View File

@@ -8,6 +8,7 @@ class Filter extends ZM_Object {
protected static $table = 'Filters';
protected static $attrTypes = null;
protected static $opTypes = null;
protected static $archiveTypes = null;
protected $defaults = array(
'Id' => null,
@@ -795,9 +796,21 @@ class Filter extends ZM_Object {
return self::$opTypes;
}
public static function archiveTypes() {
if (!self::$archiveTypes) {
self::$archiveTypes = array(
'' => translate('All'),
'0' => translate('ArchUnarchived'),
'1' => translate('ArchArchived')
);
}
return self::$archiveTypes;
}
public function widget() {
$html = '<table id="fieldsTable" class="filterTable"><tbody>';
$opTypes = $this->opTypes();
$archiveTypes = $this->archiveTypes();
$terms = $this->terms();
$obracketTypes = array();
@@ -814,10 +827,6 @@ class Filter extends ZM_Object {
'IS NOT' => translate('OpIsNot'),
);
$archiveTypes = array(
'0' => translate('ArchUnarchived'),
'1' => translate('ArchArchived')
);
$booleanValues = array(
'false' => translate('False'),
@@ -942,10 +951,7 @@ class Filter extends ZM_Object {
$terms = $this->terms();
$attrTypes = $this->attrTypes();
$opTypes = $this->opTypes();
$archiveTypes = array(
'0' => translate('ArchUnarchived'),
'1' => translate('ArchArchived')
);
$archiveTypes = $this->archiveTypes();
for ($i=0; $i < count($terms); $i++) {
$term = $terms[$i];
@@ -1033,5 +1039,12 @@ class Filter extends ZM_Object {
return $html;
} # end function widget()
public function has_term($attr, $op=null) {
foreach ($this->terms() as $term) {
if (($term['attr'] == $attr) and ((!$op) or ($term['op']==$op)) ) return true;
}
return false;
}
} # end class Filter
?>

View File

@@ -120,7 +120,6 @@ function renderAlarmCues(containerEl) {
const span_count = 10;
const span_seconds = parseInt(event_length / span_count);
const span_width = parseInt(containerEl.width() / span_count);
console.log('span_width', span_width, 'container width', containerEl.width(), 'span count', span_count);
const date = new Date(eventData.StartDateTime);
for (let i=0; i < span_count; i += 1) {
html += '<span style="left:'+(i*span_width)+'px; width: '+span_width+'px;">'+date.toLocaleTimeString()+'</span>';
@@ -163,7 +162,7 @@ function renderAlarmCues(containerEl) {
alarmHtml += '<span class="noneCue" style="left: '+left+'px; width: ' + pix + 'px;"></span>';
left = parseInt((frame.Delta / event_length) * containerEl.width());
console.log(left, frame.Delta, event_length, containerEl.width());
//console.log(left, frame.Delta, event_length, containerEl.width());
spanTimeStart = spanTimeEnd;
} else if ( (frame.Type !== 'Alarm') && (alarmed == 1) ) { //from alarm to nothing. End alarm and start nothing.
futNone = 0;