mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
cc4f1a1485
|
@ -26,7 +26,7 @@ class LocationsController extends Controller
|
|||
$allowed_columns = [
|
||||
'id','name','address','address2','city','state','country','zip','created_at',
|
||||
'updated_at','manager_id','image',
|
||||
'assigned_assets_count','users_count','assets_count','currency'];
|
||||
'assigned_assets_count','users_count','assets_count','currency','ldap_ou'];
|
||||
|
||||
$locations = Location::with('parent', 'manager', 'children')->select([
|
||||
'locations.id',
|
||||
|
@ -42,6 +42,7 @@ class LocationsController extends Controller
|
|||
'locations.created_at',
|
||||
'locations.updated_at',
|
||||
'locations.image',
|
||||
'locations.ldap_ou',
|
||||
'locations.currency'
|
||||
])->withCount('assignedAssets as assigned_assets_count')
|
||||
->withCount('assets as assets_count')
|
||||
|
|
|
@ -47,6 +47,7 @@ class LocationsTransformer
|
|||
'assets_count' => (int) $location->assets_count,
|
||||
'users_count' => (int) $location->users_count,
|
||||
'currency' => ($location->currency) ? e($location->currency) : null,
|
||||
'ldap_ou' => ($location->ldap_ou) ? e($location->ldap_ou) : null,
|
||||
'created_at' => Helper::getFormattedDateObject($location->created_at, 'datetime'),
|
||||
'updated_at' => Helper::getFormattedDateObject($location->updated_at, 'datetime'),
|
||||
'parent' => ($location->parent) ? [
|
||||
|
|
|
@ -76,7 +76,7 @@ class Location extends SnipeModel
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $searchableAttributes = ['name', 'address', 'city', 'state', 'zip', 'created_at'];
|
||||
protected $searchableAttributes = ['name', 'address', 'city', 'state', 'zip', 'created_at', 'ldap_ou'];
|
||||
|
||||
/**
|
||||
* The relations and their attributes that should be included when searching the model.
|
||||
|
|
|
@ -123,7 +123,16 @@ class LocationPresenter extends Presenter
|
|||
"switchable" => true,
|
||||
"title" => trans('admin/locations/table.country'),
|
||||
"visible" => false,
|
||||
],[
|
||||
],
|
||||
[
|
||||
"field" => "ldap_ou",
|
||||
"searchable" => true,
|
||||
"sortable" => true,
|
||||
"switchable" => true,
|
||||
"title" => trans('admin/locations/table.ldap_ou'),
|
||||
"visible" => false,
|
||||
],
|
||||
[
|
||||
"field" => "manager",
|
||||
"searchable" => false,
|
||||
"sortable" => true,
|
||||
|
|
|
@ -512,8 +512,8 @@ Form::macro('customfield_elements', function ($name = "customfield_elements", $s
|
|||
'text' => 'Text Box',
|
||||
'listbox' => 'List Box',
|
||||
'textarea' => 'Textarea (multi-line) ',
|
||||
// 'checkbox' => 'Checkbox',
|
||||
// 'radio' => 'Radio Buttons',
|
||||
'checkbox' => 'Checkbox',
|
||||
'radio' => 'Radio Buttons',
|
||||
);
|
||||
|
||||
$select = '<select name="'.$name.'" class="'.$class.'" style="width: 100%" aria-label="'.$name.'">';
|
||||
|
|
|
@ -141,12 +141,15 @@
|
|||
@if (($location->city!='') || ($location->state!='') || ($location->zip!=''))
|
||||
<li>{{ $location->city }} {{ $location->state }} {{ $location->zip }}</li>
|
||||
@endif
|
||||
@if (($location->manager))
|
||||
@if ($location->manager)
|
||||
<li>{{ trans('admin/users/table.manager') }}: {!! $location->manager->present()->nameUrl() !!}</li>
|
||||
@endif
|
||||
@if (($location->parent))
|
||||
@if ($location->parent)
|
||||
<li>{{ trans('admin/locations/table.parent') }}: {!! $location->parent->present()->nameUrl() !!}</li>
|
||||
@endif
|
||||
@if ($location->ldap_ou)
|
||||
<li>{{ trans('admin/locations/table.ldap_ou') }}: {{ $location->ldap_ou }}</li>
|
||||
@endif
|
||||
</ul>
|
||||
|
||||
@if (($location->state!='') && ($location->country!='') && (config('services.google.maps_api_key')))
|
||||
|
|
Loading…
Reference in a new issue