Smal improvements to scoping displays
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
d1be13e7d4
commit
0a29e90701
4 changed files with 15 additions and 3 deletions
|
@ -5,6 +5,8 @@ namespace App\Http\Controllers\Api;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Transformers\ActionlogsTransformer;
|
use App\Http\Transformers\ActionlogsTransformer;
|
||||||
use App\Models\Actionlog;
|
use App\Models\Actionlog;
|
||||||
|
use App\Models\Company;
|
||||||
|
use App\Models\Setting;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
|
|
||||||
|
@ -18,10 +20,11 @@ class ReportsController extends Controller
|
||||||
*/
|
*/
|
||||||
public function index(Request $request) : JsonResponse | array
|
public function index(Request $request) : JsonResponse | array
|
||||||
{
|
{
|
||||||
$this->authorize('reports.view');
|
$this->authorize('activity.view');
|
||||||
|
|
||||||
$actionlogs = Actionlog::with('item', 'user', 'adminuser', 'target', 'location');
|
$actionlogs = Actionlog::with('item', 'user', 'adminuser', 'target', 'location');
|
||||||
|
|
||||||
|
|
||||||
if ($request->filled('search')) {
|
if ($request->filled('search')) {
|
||||||
$actionlogs = $actionlogs->TextSearch(e($request->input('search')));
|
$actionlogs = $actionlogs->TextSearch(e($request->input('search')));
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ class LocationPresenter extends Presenter
|
||||||
'switchable' => true,
|
'switchable' => true,
|
||||||
'title' => trans('general.company'),
|
'title' => trans('general.company'),
|
||||||
'visible' => false,
|
'visible' => false,
|
||||||
'formatter' => 'locationCompanyObjFilterFormatter'
|
'formatter' => 'companiesLinkObjFormatter'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'field' => 'name',
|
'field' => 'name',
|
||||||
|
|
|
@ -168,6 +168,15 @@ class AuthServiceProvider extends ServiceProvider
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// -----------------------------------------
|
||||||
|
// Activity
|
||||||
|
// -----------------------------------------
|
||||||
|
Gate::define('activity.view', function ($user) {
|
||||||
|
if (($user->hasAccess('reports.view')) || ($user->hasAccess('admin'))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
// Self
|
// Self
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
|
|
|
@ -292,7 +292,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
|
||||||
@if ($snipeSettings->full_multiple_companies_support=='1')
|
@if ((($snipeSettings->scope_locations_fmcs!='1') && ($snipeSettings->full_multiple_companies_support=='1')))
|
||||||
<!-- Companies -->
|
<!-- Companies -->
|
||||||
<div class="box box-default">
|
<div class="box box-default">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
|
|
Loading…
Add table
Reference in a new issue