Use helper for company selectlist, added missing language strings

This commit is contained in:
snipe
2016-02-12 14:08:35 -08:00
parent 9f899ee878
commit e5b2163ffe
11 changed files with 47 additions and 15 deletions
@@ -42,7 +42,7 @@ class AccessoriesController extends AdminController
{
// Show the page
$category_list = array('' => '') + DB::table('categories')->where('category_type','=','accessory')->whereNull('deleted_at')->orderBy('name','ASC')->lists('name', 'id');
$company_list = Company::getSelectList();
$company_list = companyList();
$location_list = locationsList();
return View::make('backend/accessories/edit')
->with('accessory', new Accessory)
@@ -125,7 +125,7 @@ class AccessoriesController extends AdminController
}
$category_list = array('' => '') + DB::table('categories')->where('category_type','=','accessory')->whereNull('deleted_at')->orderBy('name','ASC')->lists('name', 'id');
$company_list = Company::getSelectList();
$company_list = companyList();
$location_list = locationsList();
return View::make('backend/accessories/edit', compact('accessory'))
+3 -3
View File
@@ -68,7 +68,7 @@ class AssetsController extends AdminController
$manufacturer_list = manufacturerList();
$category_list = categoryList();
$supplier_list = suppliersList();
$company_list = Company::getSelectList();
$company_list = companyList();
$assigned_to = usersList();
$statuslabel_types = statusTypeList();
@@ -253,7 +253,7 @@ class AssetsController extends AdminController
$manufacturer_list = manufacturerList();
$category_list = categoryList();
$supplier_list = suppliersList();
$company_list = Company::getSelectList();
$company_list = companyList();
$assigned_to = usersList();
$statuslabel_types = statusTypeList();
@@ -883,7 +883,7 @@ class AssetsController extends AdminController
$supplier_list = suppliersList();
$assigned_to = usersList();
$statuslabel_types = statusTypeList();
$company_list = Company::getSelectList();
$company_list = companyList();
$asset = clone $asset_to_clone;
$asset->id = null;
@@ -42,7 +42,7 @@ class ConsumablesController extends AdminController
{
// Show the page
$category_list = array('' => '') + DB::table('categories')->where('category_type','=','consumable')->whereNull('deleted_at')->orderBy('name','ASC')->lists('name', 'id');
$company_list = Company::getSelectList();
$company_list = companyList();
$location_list = locationsList();
return View::make('backend/consumables/edit')
@@ -126,7 +126,7 @@ class ConsumablesController extends AdminController
}
$category_list = array('' => '') + DB::table('categories')->where('category_type','=','consumable')->whereNull('deleted_at')->orderBy('name','ASC')->lists('name', 'id');
$company_list = Company::getSelectList();
$company_list = companyList();
$location_list = locationsList();
return View::make('backend/consumables/edit', compact('consumable'))
+3 -3
View File
@@ -56,7 +56,7 @@ class LicensesController extends AdminController
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
$supplier_list = array('' => 'Select Supplier') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
$maintained_list = array('' => 'Maintained', '1' => 'Yes', '0' => 'No');
$company_list = Company::getSelectList();
$company_list = companyList();
return View::make('backend/licenses/edit')
->with('license_options',$license_options)
@@ -203,7 +203,7 @@ class LicensesController extends AdminController
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
$supplier_list = array('' => 'Select Supplier') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
$maintained_list = array('' => 'Maintained', '1' => 'Yes', '0' => 'No');
$company_list = Company::getSelectList();
$company_list = companyList();
return View::make('backend/licenses/edit', compact('license'))
->with('license_options',$license_options)
@@ -782,7 +782,7 @@ class LicensesController extends AdminController
// Show the page
$license_options = array('0' => 'Top Level') + License::lists('name', 'id');
$maintained_list = array('' => 'Maintained', '1' => 'Yes', '0' => 'No');
$company_list = Company::getSelectList();
$company_list = companyList();
//clone the orig
$license = clone $license_to_clone;
$license->id = null;
+3 -3
View File
@@ -86,7 +86,7 @@ class UsersController extends AdminController {
$location_list = locationsList();
$manager_list = managerList();
$company_list = Company::getSelectList();
$company_list = companyList();
/* echo '<pre>';
print_r($userPermissions);
@@ -285,7 +285,7 @@ class UsersController extends AdminController {
$this->encodeAllPermissions($permissions);
$location_list = locationsList();
$company_list = Company::getSelectList();
$company_list = companyList();
$manager_list = array('' => 'Select a User') + DB::table('users')
->select(DB::raw('concat(last_name,", ",first_name," (",email,")") as full_name, id'))
->whereNull('deleted_at')
@@ -737,7 +737,7 @@ class UsersController extends AdminController {
$this->encodeAllPermissions($permissions);
$location_list = array('' => '') + Location::lists('name', 'id');
$company_list = Company::getSelectList();
$company_list = companyList();
$manager_list = array('' => 'Select a User') + DB::table('users')
->select(DB::raw('concat(last_name,", ",first_name," (",email,")") as full_name, id'))
->whereNull('deleted_at')
+1 -1
View File
@@ -27,7 +27,7 @@ function modelList() {
}
function companyList() {
$company_list = array('' => '') + DB::table('companies')
$company_list = array('0' => Lang::get('general.select_company')) + DB::table('companies')
->orderBy('name', 'asc')
->lists('name', 'id');
return $company_list;
+4
View File
@@ -0,0 +1,4 @@
<?php
return [
'select_company' => 'Select Company',
];
+18
View File
@@ -0,0 +1,18 @@
<?php
return array(
'does_not_exist' => 'Company does not exist.',
'assoc_users' => 'This company is currently associated with at least one model and cannot be deleted. Please update your models to no longer reference this company and try again. ',
'create' => array(
'error' => 'Company was not created, please try again.',
'success' => 'Company created successfully.'
),
'update' => array(
'error' => 'Company was not updated, please try again',
'success' => 'Company updated successfully.'
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this company?',
'error' => 'There was an issue deleting the company. Please try again.',
'success' => 'The Company was deleted successfully.'
)
);
+9
View File
@@ -0,0 +1,9 @@
<?php
return array(
'companies' => 'Companies',
'create' => 'Create Company',
'title' => 'Company',
'update' => 'Update Company',
'name' => 'Company Name',
'id' => 'ID',
);
+1
View File
@@ -120,6 +120,7 @@
'select_user' => 'Select a User',
'select_date' => 'Select Date',
'select_statuslabel' => 'Select Status',
'select_company' => 'Select Company',
'settings' => 'Settings',
'sign_in' => 'Sign in',
'site_name' => 'Site Name',
+1 -1
View File
@@ -30,7 +30,7 @@ final class Company extends Elegant
public static function getSelectList()
{
$select_company = Lang::get('admin/companies/general.select_company');
$select_company = Lang::get('general.select_company');
return ['0' => $select_company] + DB::table('companies')->orderBy('name', 'ASC')->lists('name', 'id');
}