Introduced ALLOW_OVERLAP setting
authorNik Okuntseff <support@anuko.com>
Sat, 12 Mar 2016 23:27:20 +0000 (23:27 +0000)
committerNik Okuntseff <support@anuko.com>
Sat, 12 Mar 2016 23:27:38 +0000 (23:27 +0000)
ALLOW_OVERLAP can be set to true in config.php to allow time entries to overlap

WEB-INF/config.php.dist
WEB-INF/lib/ttTimeHelper.class.php
WEB-INF/templates/footer.tpl

index 25ba2c0..bca0da0 100644 (file)
@@ -86,11 +86,17 @@ define('COST_ON_REPORTS', true);
 //
 // define('READONLY_START_FINISH', false);
 
+
 // FUTURE_ENTRIES - defines whether users can create entries for future dates. Defaults to true.
 //
 // define('FUTURE_ENTRIES', false);
 
 
+// ALLOW_OVERLAP - defines whether overlapping time entries are allowed. Defaults to false.
+//
+// define('ALLOW_OVERLAP', true);
+
+
 // WEEKEND_START_DAY
 //
 // This option defines which days are highlighted with weekend color.
index 1333894..f743e61 100644 (file)
@@ -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;
@@ -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);
index cbdfffd..05ec360 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.9.14.3412 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.9.15.3413 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>