From 977f9b081f2c28d764595c05e2795c6d88b88e90 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Mon, 9 Dec 2024 10:55:14 -0800 Subject: [PATCH 1/6] other fields appear in modal of model --- app/Http/Controllers/AssetModelsController.php | 1 - app/Http/Controllers/ModalController.php | 7 ++++++- resources/views/modals/model.blade.php | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/AssetModelsController.php b/app/Http/Controllers/AssetModelsController.php index aa083e1ae329..daf0509732b3 100755 --- a/app/Http/Controllers/AssetModelsController.php +++ b/app/Http/Controllers/AssetModelsController.php @@ -56,7 +56,6 @@ public function create() : View $this->authorize('create', AssetModel::class); return view('models/edit')->with('category_type', 'asset') - ->with('depreciation_list', Helper::depreciationList()) ->with('item', new AssetModel); } diff --git a/app/Http/Controllers/ModalController.php b/app/Http/Controllers/ModalController.php index fab491a5f444..0067b8acb75f 100644 --- a/app/Http/Controllers/ModalController.php +++ b/app/Http/Controllers/ModalController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers; use App\Helpers\Helper; +use App\Models\AssetModel; class ModalController extends Controller { @@ -41,7 +42,11 @@ public function show ($type, $itemId = null) { if ($type == "statuslabel") { $view->with('statuslabel_types', Helper::statusTypeList()); - } + } + if ($type == "model") { + $view->with('depreciation_list', Helper::depreciationList()) + ->with('item', new AssetModel); + } if (in_array($type, ['kit-model', 'kit-license', 'kit-consumable', 'kit-accessory'])) { $view->with('kitId', $itemId); } diff --git a/resources/views/modals/model.blade.php b/resources/views/modals/model.blade.php index fb1650eee7d2..fb9104494e8a 100644 --- a/resources/views/modals/model.blade.php +++ b/resources/views/modals/model.blade.php @@ -13,7 +13,11 @@ @include('modals.partials.categories-select', ['required' => 'true']) @include('modals.partials.manufacturer-select') @include('modals.partials.model-number') + @include ('partials.forms.edit.depreciation') + @include ('partials.forms.edit.minimum_quantity') @include('modals.partials.fieldset-select') + @include ('partials.forms.edit.notes') + @include ('partials.forms.edit.requestable', ['requestable_text' => trans('admin/models/general.requestable')]) @include('modals.partials.footer') From 5c34fb1bd5dddcf7958d91e77d0ea7383e88e020 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Mon, 9 Dec 2024 11:43:29 -0800 Subject: [PATCH 2/6] modal partials made and inputs align --- resources/views/modals/model.blade.php | 10 +++---- .../modals/partials/depreciation.blade.php | 17 ++++++++++++ .../partials/minimum_quantity.blade.php | 27 +++++++++++++++++++ .../views/modals/partials/notes.blade.php | 17 ++++++++++++ .../modals/partials/requestable.blade.php | 17 ++++++++++++ .../forms/edit/depreciation.blade.php | 4 +-- 6 files changed, 85 insertions(+), 7 deletions(-) create mode 100644 resources/views/modals/partials/depreciation.blade.php create mode 100644 resources/views/modals/partials/minimum_quantity.blade.php create mode 100644 resources/views/modals/partials/notes.blade.php create mode 100644 resources/views/modals/partials/requestable.blade.php diff --git a/resources/views/modals/model.blade.php b/resources/views/modals/model.blade.php index fb9104494e8a..b0fe3dccbc20 100644 --- a/resources/views/modals/model.blade.php +++ b/resources/views/modals/model.blade.php @@ -5,7 +5,7 @@ -