From 908289ae851db1c7d8bc454df5a00746e776728a Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 31 Mar 2016 20:57:01 +0000 Subject: [PATCH] Fixed usage of isDateLocked() --- WEB-INF/templates/footer.tpl | 2 +- expense_edit.php | 2 +- mobile/timer.php | 10 +--------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index a4a6e970..d18884c2 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.9.21.3466 | Copyright © Anuko | +  Anuko Time Tracker 1.9.21.3467 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/expense_edit.php b/expense_edit.php index e4d1d056..2a996543 100644 --- a/expense_edit.php +++ b/expense_edit.php @@ -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. diff --git a/mobile/timer.php b/mobile/timer.php index 1ccc7893..752ebca9 100644 --- a/mobile/timer.php +++ b/mobile/timer.php @@ -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. -- 2.20.1