diff --git a/include/class.orm.php b/include/class.orm.php index 3e8f9830c55f53d446278a6b7a6709f96e43189f..08c2f209c324ab32f7272435d29e6855abfa3e64 100644 --- a/include/class.orm.php +++ b/include/class.orm.php @@ -2753,8 +2753,10 @@ class MySqlCompiler extends SqlCompiler { } function __range($a, $b) { - // XXX: Crash if $b is not array of two items - return sprintf('%s BETWEEN %s AND %s', $a, $this->input($b[0]), $this->input($b[1])); + return sprintf('%s BETWEEN %s AND %s', + $a, + $b[2] ? $b[0] : $this->input($b[0]), + $b[2] ? $b[1] : $this->input($b[1])); } function compileJoin($tip, $model, $alias, $info, $extra=false) { diff --git a/include/class.report.php b/include/class.report.php index fb284fc6290733e3dd2cfb6b540ccaf0b312fbe7..179dd8e13fcaf35b2c0d2ed928ee4ba9e8135f26 100644 --- a/include/class.report.php +++ b/include/class.report.php @@ -165,7 +165,7 @@ class OverviewReport { $stats = ThreadEvent::objects() ->filter(array( 'annulled' => 0, - 'timestamp__range' => array($start, $stop), + 'timestamp__range' => array($start, $stop, true), 'thread__object_type' => 'T', )) ->aggregate(array( diff --git a/include/staff/dashboard.inc.php b/include/staff/dashboard.inc.php index 3409726e5961358d439adddff369cde045e8ca37..8bf11959560114bc18514d9d494aa3312e35d8d7 100644 --- a/include/staff/dashboard.inc.php +++ b/include/staff/dashboard.inc.php @@ -75,7 +75,8 @@ $plots = $report->getPlotData(); $date = str_ireplace('FROM_UNIXTIME(', '',$date); $date = str_ireplace(')', '',$date); $date = new DateTime('@'.$date); - $date->setTimeZone(new DateTimeZone($thisstaff->getTimezone())); + if ($thisstaff->getTimezone()) + $date->setTimeZone(new DateTimeZone($thisstaff->getTimezone())); $range[] = $date->format('F j, Y'); } echo __($range[0] . ' - ' . $range[1]); diff --git a/include/upgrader/streams/core/86707325-526c601b.cleanup.sql b/include/upgrader/streams/core/86707325-526c601b.cleanup.sql new file mode 100644 index 0000000000000000000000000000000000000000..caa1687c5ca775f23d91aff96ce829a4e705663d --- /dev/null +++ b/include/upgrader/streams/core/86707325-526c601b.cleanup.sql @@ -0,0 +1,7 @@ +-- set thread entry pid's to show Service/Response time in Dashboard +UPDATE `%TABLE_PREFIX%thread_entry` AS this +INNER JOIN ( + SELECT `%TABLE_PREFIX%thread_entry`.`id`,`%TABLE_PREFIX%thread_entry`.`thread_id`,`%TABLE_PREFIX%thread_entry`.`type` + FROM `%TABLE_PREFIX%thread_entry` WHERE `%TABLE_PREFIX%thread_entry`.`type` = 'M') AS that +SET this.`pid` = that.`id` +WHERE this.`thread_id` = that.`thread_id` AND that.`type` = 'M' AND this.type = 'R' AND this.`id` > that.`id` AND this.`pid` = 0