mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Fixes #3776 - adds Company to Dept UI
This commit is contained in:
parent
0408509fdc
commit
a2d63dd3e4
|
@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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')
|
||||
|
||||
<!-- Manager -->
|
||||
<div class="form-group {{ $errors->has('manager_id') ? 'has-error' : '' }}">
|
||||
<label class="col-md-3 control-label" for="manager_id">{{ trans('admin/users/table.manager') }}</label>
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
|
||||
<th data-sortable="true" data-field="company" data-visible="false" data-formatter="companiesLinkObjFormatter">{{ trans('general.company') }}</th>
|
||||
|
||||
<th data-sortable="true" data-formatter="departmentsLinkFormatter" data-field="name" data-searchable="false">{{ trans('admin/departments/table.name') }}</th>
|
||||
<th data-sortable="false" data-formatter="usersLinkObjFormatter" data-field="manager" data-searchable="false">{{ trans('admin/departments/table.manager') }}</th>
|
||||
<th data-sortable="false" data-field="users_count" data-searchable="false">{{ trans('general.users') }}</th>
|
||||
|
|
Loading…
Reference in a new issue