mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Updated blades to add byod as a “status”
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
fce620b54f
commit
0c39c7a53d
|
@ -271,6 +271,11 @@ class AssetsController extends Controller
|
|||
// more sad, horrible workarounds for laravel bugs when doing full text searches
|
||||
$assets->where('assets.assigned_to', '>', '0');
|
||||
break;
|
||||
case 'byod':
|
||||
// This is kind of redundant, since we already check for byod=1 above, but this keeps the
|
||||
// sidebar nav links a little less chaotic
|
||||
$assets->where('assets.byod', '=', '1');
|
||||
break;
|
||||
default:
|
||||
|
||||
if ((! $request->filled('status_id')) && ($settings->show_archived_in_list != '1')) {
|
||||
|
|
|
@ -52,6 +52,13 @@ class AssetCountForSidebar
|
|||
\Log::debug($e);
|
||||
}
|
||||
|
||||
try {
|
||||
$total_byod_sidebar = Asset::where('byod', '=', '1')->count();
|
||||
view()->share('total_byod_sidebar', $total_byod_sidebar);
|
||||
} catch (\Exception $e) {
|
||||
\Log::debug($e);
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
{{ trans('general.archived') }}
|
||||
@elseif (Request::get('status')=='Deleted')
|
||||
{{ trans('general.deleted') }}
|
||||
@elseif (Request::get('status')=='byod')
|
||||
{{ trans('general.byod') }}
|
||||
@endif
|
||||
@else
|
||||
{{ trans('general.all') }}
|
||||
|
|
|
@ -454,6 +454,12 @@
|
|||
({{ (isset($total_undeployable_sidebar)) ? $total_undeployable_sidebar : '' }})
|
||||
</a>
|
||||
</li>
|
||||
<li{!! (Request::query('status') == 'byod' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=byod') }}"><i class="fas fa-times text-red fa-fw"></i>
|
||||
{{ trans('general.all') }}
|
||||
{{ trans('general.byod') }}
|
||||
({{ (isset($total_byod_sidebar)) ? $total_byod_sidebar : '' }})
|
||||
</a>
|
||||
</li>
|
||||
<li{!! (Request::query('status') == 'Archived' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=Archived') }}"><i class="fas fa-times text-red fa-fw"></i>
|
||||
{{ trans('general.all') }}
|
||||
{{ trans('admin/hardware/general.archived') }}
|
||||
|
|
Loading…
Reference in a new issue