From a2d63dd3e474e6a0c730bd8515c6b353954663c0 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 29 Jul 2017 16:42:17 -0700 Subject: [PATCH] Fixes #3776 - adds Company to Dept UI --- app/Http/Controllers/Api/DepartmentsController.php | 3 ++- app/Http/Controllers/DepartmentsController.php | 10 ++++++++-- resources/views/departments/edit.blade.php | 3 +++ resources/views/departments/index.blade.php | 2 ++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Api/DepartmentsController.php b/app/Http/Controllers/Api/DepartmentsController.php index 1d1e1a60ce..47c14c4906 100644 --- a/app/Http/Controllers/Api/DepartmentsController.php +++ b/app/Http/Controllers/Api/DepartmentsController.php @@ -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')); diff --git a/app/Http/Controllers/DepartmentsController.php b/app/Http/Controllers/DepartmentsController.php index c4993be939..d5050e8286 100644 --- a/app/Http/Controllers/DepartmentsController.php +++ b/app/Http/Controllers/DepartmentsController.php @@ -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()); } diff --git a/resources/views/departments/edit.blade.php b/resources/views/departments/edit.blade.php index c061ab42b0..7412a8d126 100644 --- a/resources/views/departments/edit.blade.php +++ b/resources/views/departments/edit.blade.php @@ -8,8 +8,11 @@ {{-- Page content --}} @section('inputFields') + @include ('partials.forms.edit.name', ['translated_name' => trans('admin/departments/table.name')]) + @include ('partials.forms.edit.company') +
diff --git a/resources/views/departments/index.blade.php b/resources/views/departments/index.blade.php index 784c110004..4f9c884e49 100644 --- a/resources/views/departments/index.blade.php +++ b/resources/views/departments/index.blade.php @@ -28,6 +28,8 @@ {{ trans('general.id') }} + {{ trans('general.company') }} + {{ trans('admin/departments/table.name') }} {{ trans('admin/departments/table.manager') }} {{ trans('general.users') }}