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:
Daniel Meltzer
2016-06-05 09:47:44 -05:00
parent 9f6eb02afc
commit cd9cca9c6b
7 changed files with 31 additions and 28 deletions
@@ -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();