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:
@@ -52,7 +52,7 @@ class ConsumablesController extends Controller
|
||||
public function getCreate()
|
||||
{
|
||||
// Show the page
|
||||
$category_list = array('' => '') + DB::table('categories')->where('category_type', '=', 'consumable')->whereNull('deleted_at')->orderBy('name', 'ASC')->lists('name', 'id');
|
||||
$category_list = Helper::categoryList('consumable');
|
||||
$company_list = Helper::companyList();
|
||||
$location_list = Helper::locationsList();
|
||||
$manufacturer_list = Helper::manufacturerList();
|
||||
@@ -132,7 +132,7 @@ class ConsumablesController extends Controller
|
||||
return redirect()->to('admin/consumables')->with('error', trans('general.insufficient_permissions'));
|
||||
}
|
||||
|
||||
$category_list = Helper::categoryList();
|
||||
$category_list = Helper::categoryList('consumable');
|
||||
$company_list = Helper::companyList();
|
||||
$location_list = Helper::locationsList();
|
||||
$manufacturer_list = Helper::manufacturerList();
|
||||
|
||||
Reference in New Issue
Block a user