X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttTimeHelper.class.php;h=e1b2470fbb83cc7125f413247afb13efc187ac7e;hb=c46106d305d91e93fb63c0d601a5a006a02bb63a;hp=6b76f9f70b10f57b219ddece9f763029143dd56f;hpb=9a23a8c0a51b7ec38a96f525484134f3cb85dc7e;p=timetracker.git diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index 6b76f9f7..e1b2470f 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -365,7 +365,10 @@ class ttTimeHelper { $duration = ttTimeHelper::normalizeDuration($duration); if (!$timestamp) { - $timestamp = date('YmdHis');//yyyymmddhhmmss + $timestamp = date('YmdHis'); //yyyymmddhhmmss + // TODO: this timestamp could be illegal if we hit inside DST switch deadzone, such as '2016-03-13 02:30:00' + // Anything between 2am and 3am on DST introduction date will not work if we run on a system with DST on. + // We need to address this properly to avoid potential complications. } if (!$billable) $billable = 0; @@ -489,7 +492,7 @@ class ttTimeHelper { static function getUncompleted($user_id) { $mdb2 = getConnection(); - $sql = "select id from tt_log + $sql = "select id, start from tt_log where user_id = $user_id and start is not null and time_to_sec(duration) = 0 and status = 1"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { @@ -512,6 +515,10 @@ class ttTimeHelper { // $finish - new record finish time, may be null // $record_id - optional record id we may be editing, excluded from overlap set static function overlaps($user_id, $date, $start, $finish, $record_id = null) { + // Do not bother checking if we allow overlaps. + if (defined('ALLOW_OVERLAP') && ALLOW_OVERLAP == true) + return false; + $mdb2 = getConnection(); $start = ttTimeHelper::to24HourFormat($start); @@ -636,4 +643,3 @@ class ttTimeHelper { } } -?> \ No newline at end of file