Added the model info back in
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
187d3abeb4
commit
6ae03a204b
1 changed files with 14 additions and 1 deletions
|
@ -53,6 +53,17 @@ class BulkAssetsController extends Controller
|
||||||
$asset_ids = $request->input('ids');
|
$asset_ids = $request->input('ids');
|
||||||
$assets = Asset::with('assignedTo', 'location', 'model')->find($asset_ids);
|
$assets = Asset::with('assignedTo', 'location', 'model')->find($asset_ids);
|
||||||
|
|
||||||
|
//custom fields logic
|
||||||
|
$asset_custom_field = Asset::with(['model.fieldset.fields', 'model'])->whereIn('id', $asset_ids)->whereHas('model', function ($query) {
|
||||||
|
return $query->where('fieldset_id', '!=', null);
|
||||||
|
})->get();
|
||||||
|
|
||||||
|
$models = $asset_custom_field->unique('model_id');
|
||||||
|
$modelNames = [];
|
||||||
|
foreach($models as $model) {
|
||||||
|
$modelNames[] = $model->model->name;
|
||||||
|
}
|
||||||
|
|
||||||
if ($request->filled('bulk_actions')) {
|
if ($request->filled('bulk_actions')) {
|
||||||
|
|
||||||
|
|
||||||
|
@ -86,6 +97,8 @@ class BulkAssetsController extends Controller
|
||||||
|
|
||||||
return view('hardware/bulk')
|
return view('hardware/bulk')
|
||||||
->with('assets', $asset_ids)
|
->with('assets', $asset_ids)
|
||||||
|
->with('models', $models->pluck(['model']))
|
||||||
|
->with('modelNames', $modelNames)
|
||||||
->with('statuslabel_list', Helper::statusLabelList());
|
->with('statuslabel_list', Helper::statusLabelList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue