mirror of
https://github.com/snipe/snipe-it.git
synced 2026-03-29 20:04:21 +00:00
Modify Helper::categoryList() to take a category type parameter.
This allows for centralizing the category fetching code more and fixes an error in asset model viewing (#2118). Also add a few translated strings and standardize on a base of 'Select a *' for the default value in our lists.
This commit is contained in:
@ -55,9 +55,9 @@ class AssetModelsController extends Controller
|
||||
public function getCreate()
|
||||
{
|
||||
// Show the page
|
||||
$depreciation_list = \App\Helpers\Helper::depreciationList();
|
||||
$manufacturer_list = \App\Helpers\Helper::manufacturerList();
|
||||
$category_list = \App\Helpers\Helper::categoryList();
|
||||
$depreciation_list = Helper::depreciationList();
|
||||
$manufacturer_list = Helper::manufacturerList();
|
||||
$category_list = Helper::categoryList('asset');
|
||||
return View::make('models/edit')
|
||||
->with('category_list', $category_list)
|
||||
->with('depreciation_list', $depreciation_list)
|
||||
@ -181,9 +181,9 @@ class AssetModelsController extends Controller
|
||||
return redirect()->to('assets/models')->with('error', trans('admin/models/message.does_not_exist'));
|
||||
}
|
||||
|
||||
$depreciation_list = \App\Helpers\Helper::depreciationList();
|
||||
$manufacturer_list = \App\Helpers\Helper::manufacturerList();
|
||||
$category_list = \App\Helpers\Helper::categoryList();
|
||||
$depreciation_list = Helper::depreciationList();
|
||||
$manufacturer_list = Helper::manufacturerList();
|
||||
$category_list = Helper::categoryList('asset');
|
||||
$view = View::make('models/edit', compact('model'));
|
||||
$view->with('category_list', $category_list);
|
||||
$view->with('depreciation_list', $depreciation_list);
|
||||
@ -371,9 +371,9 @@ class AssetModelsController extends Controller
|
||||
$model->id = null;
|
||||
|
||||
// Show the page
|
||||
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
|
||||
$manufacturer_list = array('' => 'Select One') + Manufacturer::lists('name', 'id');
|
||||
$category_list = array('' => '') + DB::table('categories')->whereNull('deleted_at')->lists('name', 'id');
|
||||
$depreciation_list = Helper::depreciationList();
|
||||
$manufacturer_list = Helper::manufacturerList();
|
||||
$category_list = Helper::categoryList('asset');
|
||||
$view = View::make('models/edit');
|
||||
$view->with('category_list', $category_list);
|
||||
$view->with('depreciation_list', $depreciation_list);
|
||||
|
||||
Reference in New Issue
Block a user