Fixed usage of isDateLocked()
authorNik Okuntseff <support@anuko.com>
Thu, 31 Mar 2016 20:57:01 +0000 (20:57 +0000)
committerNik Okuntseff <support@anuko.com>
Thu, 31 Mar 2016 20:57:01 +0000 (20:57 +0000)
WEB-INF/templates/footer.tpl
expense_edit.php
mobile/timer.php

index a4a6e97..d18884c 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.21.3466 | 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.21.3467 | 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>
index e4d1d05..2a99654 100644 (file)
@@ -178,7 +178,7 @@ if ($request->isPost()) {
   // Save as new record.
   if ($request->getParameter('btn_copy')) {
     // We need to prohibit saving into locked interval.
-    if($lockdate && $new_date->before($lockdate))
+    if ($user->isDateLocked($new_date))
       $err->add($i18n->getKey('error.period_locked'));
 
     // Now, a new insert.
index 1ccc789..752ebca 100644 (file)
@@ -179,14 +179,6 @@ if ($custom_fields && $custom_fields->fields[0]) {
   }
 }
 
-// Determine lock date. Time entries earlier than lock date cannot be created or modified.
-$lock_interval = $user->lock_interval;
-$lockdate = 0;
-if ($lock_interval > 0) {
-  $lockdate = new DateAndTime();
-  $lockdate->decDay($lock_interval);
-}
-
 // Submit.
 if ($request->isPost()) {
   if ($request->getParameter('btn_start')) {
@@ -215,7 +207,7 @@ if ($request->isPost()) {
     }
 
     // Prohibit creating time entries in locked interval.
-    if($lockdate && $selected_date->before($lockdate))
+    if ($user->isDateLocked($selected_date))
       $err->add($i18n->getKey('error.period_locked'));
 
     // Prohibit creating another uncompleted record.