Fixes #3776 - adds Company to Dept UI

This commit is contained in:
snipe
2017-07-29 16:42:17 -07:00
parent 0408509fdc
commit a2d63dd3e4
4 changed files with 15 additions and 3 deletions
@@ -27,8 +27,9 @@ class DepartmentsController extends Controller
'id',
'name',
'location_id',
'company_id',
'manager_id'
])->with('users')->with('location')->with('manager')->withCount('users');
])->with('users')->with('location')->with('manager')->with('company')->withCount('users');
if ($request->has('search')) {
$departments = $departments->TextSearch($request->input('search'));
@@ -91,7 +91,10 @@ class DepartmentsController extends Controller
*/
public function create()
{
return view('departments/edit')->with('item', new Department)->with('manager_list', Helper::managerList())->with('location_list', Helper::locationsList());
return view('departments/edit')->with('item', new Department)
->with('manager_list', Helper::managerList())
->with('location_list', Helper::locationsList())
->with('company_list', Helper::companyList());
}
@@ -132,7 +135,10 @@ class DepartmentsController extends Controller
if (is_null($item = Department::find($id))) {
return redirect()->back()->with('error', trans('admin/locations/message.does_not_exist'));
}
return view('departments/edit', compact('item'))->with('manager_list', Helper::managerList())->with('location_list', Helper::locationsList());
return view('departments/edit', compact('item'))
->with('manager_list', Helper::managerList())
->with('location_list', Helper::locationsList())
->with('company_list', Helper::companyList());
}