mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Fixes bug #3086 - unabel to create asset from asset model screen
This commit is contained in:
parent
d6b7036518
commit
fc18aa7f6d
|
@ -106,10 +106,9 @@ class AssetsController extends Controller
|
|||
* @param integer $model_id
|
||||
* @return View
|
||||
*/
|
||||
public function create($model_id = null)
|
||||
public function create(Request $request)
|
||||
{
|
||||
$this->authorize('create', Asset::class);
|
||||
// Grab the dropdown lists
|
||||
$view = View::make('hardware/edit');
|
||||
$view->with('supplier_list', Helper::suppliersList());
|
||||
$view->with('company_list', Helper::companyList());
|
||||
|
@ -122,9 +121,10 @@ class AssetsController extends Controller
|
|||
$view->with('category', Helper::categoryList('asset'));
|
||||
$view->with('statuslabel_types', Helper::statusTypeList());
|
||||
|
||||
if (!is_null($model_id)) {
|
||||
$selected_model = AssetModel::find($model_id);
|
||||
if ($request->has('model_id')) {
|
||||
$selected_model = AssetModel::find($request->input('model_id'));
|
||||
$view->with('selected_model', $selected_model);
|
||||
} else {
|
||||
}
|
||||
|
||||
return $view;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
@if ($model->deleted_at=='')
|
||||
<li><a href="{{ route('models.edit', $model->id) }}">{{ trans('admin/models/table.edit') }}</a></li>
|
||||
<li><a href="{{ route('clone/model', $model->id) }}">{{ trans('admin/models/table.clone') }}</a></li>
|
||||
<li><a href="{{ route('hardware.create', $model->id) }}">{{ trans('admin/hardware/form.create') }}</a></li>
|
||||
<li><a href="{{ route('hardware.create', ['model_id' => $model->id]) }}">{{ trans('admin/hardware/form.create') }}</a></li>
|
||||
@else
|
||||
<li><a href="{{ route('restore/model', $model->id) }}">{{ trans('admin/models/general.restore') }}</a></li>
|
||||
@endif
|
||||
|
|
Loading…
Reference in a new issue