mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
custom fields display, need to get saving
+some clean up
This commit is contained in:
parent
804a788a27
commit
032ae4348e
|
@ -47,6 +47,10 @@ class BulkAssetsController extends Controller
|
|||
$asset_custom_field = Asset::whereIn('id', $asset_ids)->whereHas('model', function ($query) {
|
||||
return $query->where('fieldset_id', '!=', null);
|
||||
})->get();
|
||||
|
||||
$models1 = $asset_custom_field->unique('model_id');
|
||||
$models = $models1->pluck('model');
|
||||
|
||||
$custom_fields = new Collection();
|
||||
foreach ($asset_custom_field as $asset_key => $asset) {
|
||||
$custom_fields->push($asset->model->fieldset->fields);
|
||||
|
@ -72,7 +76,8 @@ class BulkAssetsController extends Controller
|
|||
return view('hardware/bulk')
|
||||
->with('assets', $asset_ids)
|
||||
->with('statuslabel_list', Helper::statusLabelList())
|
||||
->with('custom_fields', $custom_fields);
|
||||
->with('custom_fields', $custom_fields)
|
||||
->with('models', $models);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -183,13 +183,20 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($custom_fields as $key => $value)
|
||||
<p>
|
||||
{{-- @foreach ($custom_fields as $key => $value)
|
||||
<p>
|
||||
<label>
|
||||
({{ $value->id }}) | {{ $value->name}} - {{ $value->format }}
|
||||
</label>
|
||||
</p>
|
||||
@endforeach
|
||||
</p>
|
||||
@endforeach --}}
|
||||
|
||||
@foreach ($models as $model)
|
||||
<label>
|
||||
{{ $model->name }} asset model
|
||||
</label>
|
||||
@include("models/custom_fields_form",["model" => $model])
|
||||
@endforeach
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue