More work in progress integrating attachments in reports.
[timetracker.git] / time_files.php
index 2ba0efc..40a0c50 100644 (file)
@@ -36,17 +36,16 @@ if (!(ttAccessAllowed('track_own_time') || ttAccessAllowed('track_time'))) {
   header('Location: access_denied.php');
   exit();
 }
+if (!$user->isPluginEnabled('at')) {
+  header('Location: feature_disabled.php');
+  exit();
+}
 $cl_id = (int)$request->getParameter('id');
-$time_rec = ttTimeHelper::getRecord($cl_id);
+$time_rec = ttTimeHelper::getRecordForFileView($cl_id);
 if (!$time_rec) {
   header('Location: access_denied.php');
   exit();
 }
-if (!$user->isPluginEnabled('at')) {
-  header('Location: feature_disabled.php');
-  exit();
-}
-// TODO: review access checks, specifically for on behalf operations.
 // End of access checks.
 
 if ($request->isPost()) {