X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/fa6508ac21c30d6bfef008387fabd29a843d7b66..11868a92089a10db070993b89e595f45fac3f6ff:/mobile/time_delete.php diff --git a/mobile/time_delete.php b/mobile/time_delete.php index 55bdffe6..f5305bc6 100644 --- a/mobile/time_delete.php +++ b/mobile/time_delete.php @@ -38,7 +38,8 @@ if (!ttAccessAllowed('track_own_time')) { exit(); } $cl_id = (int)$request->getParameter('id'); -$time_rec = ttTimeHelper::getRecord($cl_id, $user->getUser()); +$user_id = $user->getUser(); +$time_rec = ttTimeHelper::getRecord($cl_id, $user_id); if (!$time_rec || $time_rec['invoice_id']) { // Prohibit deleting not ours or invoiced records. header('Location: access_denied.php'); @@ -62,11 +63,8 @@ if ($request->isPost()) { $err->add($i18n->get('error.range_locked')); if ($err->no()) { - // Delete the record. - $result = ttTimeHelper::delete($cl_id, $user->getUser()); - - if ($result) { + if (ttTimeHelper::delete($cl_id, $user_id)) { header('Location: time.php'); exit(); } else {