X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttFavReportHelper.class.php;h=8b9f4052ee572a4fd44c3fb4e5a524f1e9adae6c;hb=137822b2c8874dd8a5b56b58774d50f09c122220;hp=97f7e47aefde606bc6c31b16e5af3efb520a985a;hpb=da31afab09f45aa188f4a6a8c939715a80216992;p=timetracker.git diff --git a/WEB-INF/lib/ttFavReportHelper.class.php b/WEB-INF/lib/ttFavReportHelper.class.php index 97f7e47a..8b9f4052 100644 --- a/WEB-INF/lib/ttFavReportHelper.class.php +++ b/WEB-INF/lib/ttFavReportHelper.class.php @@ -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) { @@ -448,8 +448,8 @@ class ttFavReportHelper { $user_ids[] = $single_user['id']; } foreach ($users_to_adjust as $user_to_adjust) { - if (in_array($user_to_adjust['id'], $user_ids)) { - $adjusted_user_ids[] = $user_to_adjust['id']; + if (in_array($user_to_adjust, $user_ids)) { + $adjusted_user_ids[] = $user_to_adjust; } } $options['users'] = implode(',', $adjusted_user_ids); @@ -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; } }