mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 21:54:14 -08:00
Merge pull request #11190 from inietov/fixes/requested_assets_models_workflow
Adjust requested assets and models workflow a little bit.
This commit is contained in:
commit
a243823e5e
|
@ -1187,7 +1187,9 @@ class Asset extends Depreciable
|
||||||
|
|
||||||
public function scopeRequestableAssets($query)
|
public function scopeRequestableAssets($query)
|
||||||
{
|
{
|
||||||
return Company::scopeCompanyables($query->where('requestable', '=', 1))
|
$table = $query->getModel()->getTable();
|
||||||
|
|
||||||
|
return Company::scopeCompanyables($query->where($table.'.requestable', '=', 1))
|
||||||
->whereHas('assetstatus', function ($query) {
|
->whereHas('assetstatus', function ($query) {
|
||||||
$query->where(function ($query) {
|
$query->where(function ($query) {
|
||||||
$query->where('deployable', '=', 1)
|
$query->where('deployable', '=', 1)
|
||||||
|
|
|
@ -109,8 +109,14 @@
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
@can('view', \App\Models\AssetModel::class)
|
||||||
|
<a href='{{ url("/models/{$requestableModel->id}") }}'>{{ $requestableModel->name }}</a>
|
||||||
|
@else
|
||||||
|
{{ $requestableModel->name }}
|
||||||
|
@endcan
|
||||||
|
</td>
|
||||||
|
|
||||||
<td>{{$requestableModel->name}}</td>
|
|
||||||
<td>{{$requestableModel->assets->where('requestable', '1')->count()}}</td>
|
<td>{{$requestableModel->assets->where('requestable', '1')->count()}}</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
|
|
|
@ -51,8 +51,7 @@
|
||||||
<th class="col-md-2" data-sortable="true">{{ trans('admin/hardware/form.expected_checkin') }}</th>
|
<th class="col-md-2" data-sortable="true">{{ trans('admin/hardware/form.expected_checkin') }}</th>
|
||||||
<th class="col-md-3" data-sortable="true">{{ trans('admin/hardware/table.requesting_user') }}</th>
|
<th class="col-md-3" data-sortable="true">{{ trans('admin/hardware/table.requesting_user') }}</th>
|
||||||
<th class="col-md-2">{{ trans('admin/hardware/table.requested_date') }}</th>
|
<th class="col-md-2">{{ trans('admin/hardware/table.requested_date') }}</th>
|
||||||
<th class="col-md-1"></th>
|
<th class="col-md-1">{{ trans('general.checkin').'/'.trans('general.checkout') }}</th>
|
||||||
<th class="col-md-1"></th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
Loading…
Reference in a new issue