X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/862774685f3a45de5b783627a66fc8b65839d7c7..55c8f6a2bce9518c28337b18823b8300d1875ab8:/mobile/time_delete.php diff --git a/mobile/time_delete.php b/mobile/time_delete.php index 9e818e78..e9f0e223 100644 --- a/mobile/time_delete.php +++ b/mobile/time_delete.php @@ -38,12 +38,6 @@ if (!ttAccessCheck(right_data_entry)) { exit(); } -// Use Custom Fields plugin if we have one. -// if (file_exists("plugins/CustomFields.class.php")) { -// require_once("plugins/CustomFields.class.php"); -// $custom_fields = new CustomFields($user->team_id); -// } - $cl_id = $request->getParameter('id'); $time_rec = ttTimeHelper::getRecord($cl_id, $user->getActiveUser()); @@ -59,19 +53,11 @@ if ($request->isPost()) { // Determine if it's okay to delete the record. $item_date = new DateAndTime(DB_DATEFORMAT, $time_rec['date']); - // Determine lock date. - $lock_interval = $user->lock_interval; - $lockdate = 0; - if ($lock_interval > 0) { - $lockdate = new DateAndTime(); - $lockdate->decDay($lock_interval); - } // Determine if the record is uncompleted. $uncompleted = ($time_rec['duration'] == '0:00'); - if($lockdate && $item_date->before($lockdate) && !$uncompleted) { + if ($user->isDateLocked($item_date) && !$uncompleted) $err->add($i18n->getKey('error.period_locked')); - } if ($err->no()) {