]> wagnertech.de Git - timetracker.git/blobdiff - WEB-INF/lib/ttFavReportHelper.class.php
A fix for fav reports sent to clients.
[timetracker.git] / WEB-INF / lib / ttFavReportHelper.class.php
index 97f7e47aefde606bc6c31b16e5af3efb520a985a..694bb59475491b1626b1fa05bc527690140f49bb 100644 (file)
@@ -414,7 +414,7 @@ class ttFavReportHelper {
     return $options;
   }
 
-  // adjustOptions takes and array or report options and adjusts them for current user
+  // adjustOptions takes an array or report options and adjusts them for current user
   // (and group) settings. This is needed in situations when a fav report is stored in db
   // long ago, but user or group attributes are now changed, so we have to adjust.
   static function adjustOptions($options) {
@@ -457,6 +457,9 @@ class ttFavReportHelper {
       // TODO: add checking the existing user list for potentially changed access rights for user.
     }
 
+    if ($user->isPluginEnabled('ap') && $user->isClient() && !$user->can('view_client_unapproved'))
+      $options['approved'] = 1; // Restrict clients to approved records only.
+
     return $options;
   }
 }