mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-14 01:24:06 -08:00
Merge branch 'develop'
This commit is contained in:
commit
648531f4cc
|
@ -244,6 +244,8 @@ class AssetsController extends Controller
|
||||||
break;
|
break;
|
||||||
case 'location':
|
case 'location':
|
||||||
$assets->OrderLocation($order);
|
$assets->OrderLocation($order);
|
||||||
|
case 'rtd_location':
|
||||||
|
$assets->OrderRtdLocation($order);
|
||||||
break;
|
break;
|
||||||
case 'status_label':
|
case 'status_label':
|
||||||
$assets->OrderStatus($order);
|
$assets->OrderStatus($order);
|
||||||
|
|
|
@ -624,7 +624,7 @@ class ReportsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request->has('category')) {
|
if ($request->has('category')) {
|
||||||
$row[] = ($asset->model->category) ? $asset->model->category->name : '';
|
$row[] = (($asset->model) && ($asset->model->category)) ? $asset->model->category->name : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request->has('manufacturer')) {
|
if ($request->has('manufacturer')) {
|
||||||
|
|
|
@ -1162,6 +1162,18 @@ class Asset extends Depreciable
|
||||||
return $query->leftJoin('locations as asset_locations', 'asset_locations.id', '=', 'assets.location_id')->orderBy('asset_locations.name', $order);
|
return $query->leftJoin('locations as asset_locations', 'asset_locations.id', '=', 'assets.location_id')->orderBy('asset_locations.name', $order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query builder scope to order on default
|
||||||
|
* @param \Illuminate\Database\Query\Builder $query Query builder instance
|
||||||
|
* @param text $order Order
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Database\Query\Builder Modified query builder
|
||||||
|
*/
|
||||||
|
public function scopeOrderRtdLocation($query, $order)
|
||||||
|
{
|
||||||
|
return $query->leftJoin('locations as rtd_asset_locations', 'rtd_asset_locations.id', '=', 'assets.rtd_location_id')->orderBy('rtd_asset_locations.name', $order);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query builder scope to order on supplier name
|
* Query builder scope to order on supplier name
|
||||||
|
|
|
@ -113,6 +113,13 @@ class AssetPresenter extends Presenter
|
||||||
"title" => trans('admin/hardware/table.location'),
|
"title" => trans('admin/hardware/table.location'),
|
||||||
"visible" => true,
|
"visible" => true,
|
||||||
"formatter" => "deployedLocationFormatter"
|
"formatter" => "deployedLocationFormatter"
|
||||||
|
], [
|
||||||
|
"field" => "rtd_location",
|
||||||
|
"searchable" => true,
|
||||||
|
"sortable" => true,
|
||||||
|
"title" => trans('admin/hardware/form.default_location'),
|
||||||
|
"visible" => false,
|
||||||
|
"formatter" => "deployedLocationFormatter"
|
||||||
], [
|
], [
|
||||||
"field" => "manufacturer",
|
"field" => "manufacturer",
|
||||||
"searchable" => true,
|
"searchable" => true,
|
||||||
|
|
|
@ -80,6 +80,7 @@
|
||||||
id="table"
|
id="table"
|
||||||
data-advanced-search="true"
|
data-advanced-search="true"
|
||||||
data-show-export="true"
|
data-show-export="true"
|
||||||
|
data-cookie="true"
|
||||||
data-id-table="advancedTable"
|
data-id-table="advancedTable"
|
||||||
data-url="{{ route('api.assets.index',
|
data-url="{{ route('api.assets.index',
|
||||||
array('status' => e(Input::get('status')),
|
array('status' => e(Input::get('status')),
|
||||||
|
|
Loading…
Reference in a new issue