Merge remote-tracking branch 'origin/develop'
This commit is contained in:
@@ -34,7 +34,7 @@ class LicenseSeatsController extends Controller
|
||||
if ($request->input('sort') == 'department') {
|
||||
$seats->OrderDepartments($order);
|
||||
} else {
|
||||
$seats->orderBy('id', $order);
|
||||
$seats->orderBy('updated_at', $order);
|
||||
}
|
||||
|
||||
$total = $seats->count();
|
||||
|
||||
@@ -13,16 +13,15 @@ class LicenseSeatsTransformer
|
||||
public function transformLicenseSeats(Collection $seats, $total)
|
||||
{
|
||||
$array = [];
|
||||
$seat_count = 0;
|
||||
|
||||
foreach ($seats as $seat) {
|
||||
$seat_count++;
|
||||
$array[] = self::transformLicenseSeat($seat, ($total - $seat_count));
|
||||
$array[] = self::transformLicenseSeat($seat);
|
||||
}
|
||||
|
||||
return (new DatatablesTransformer)->transformDatatables($array, $total);
|
||||
}
|
||||
|
||||
public function transformLicenseSeat(LicenseSeat $seat, $seat_count = 0)
|
||||
public function transformLicenseSeat(LicenseSeat $seat)
|
||||
{
|
||||
$array = [
|
||||
'id' => (int) $seat->id,
|
||||
@@ -55,10 +54,6 @@ class LicenseSeatsTransformer
|
||||
'user_can_checkout' => (($seat->assigned_to == '') && ($seat->asset_id == '')),
|
||||
];
|
||||
|
||||
if ($seat_count != 0) {
|
||||
$array['name'] = trans('admin/licenses/general.seat_count', ['count' => $seat_count]);
|
||||
}
|
||||
|
||||
$permissions_array['available_actions'] = [
|
||||
'checkout' => Gate::allows('checkout', License::class),
|
||||
'checkin' => Gate::allows('checkin', License::class),
|
||||
|
||||
@@ -656,6 +656,8 @@ class Asset extends Depreciable
|
||||
return Storage::disk('public')->url(app('assets_upload_path').e($this->image));
|
||||
} elseif ($this->model && ! empty($this->model->image)) {
|
||||
return Storage::disk('public')->url(app('models_upload_path').e($this->model->image));
|
||||
} elseif ($this->model->category && ! empty($this->model->category->image)) {
|
||||
return Storage::disk('public')->url(app('categories_upload_path').e($this->model->category->image));
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -230,16 +230,7 @@ class LicensePresenter extends Presenter
|
||||
'switchable' => true,
|
||||
'title' => trans('general.id'),
|
||||
'visible' => false,
|
||||
],
|
||||
[
|
||||
'field' => 'name',
|
||||
'searchable' => false,
|
||||
'sortable' => false,
|
||||
'sorter' => 'numericOnly',
|
||||
'switchable' => true,
|
||||
'title' => trans('admin/licenses/general.seat'),
|
||||
'visible' => true,
|
||||
], [
|
||||
],[
|
||||
'field' => 'assigned_user',
|
||||
'searchable' => false,
|
||||
'sortable' => false,
|
||||
@@ -285,7 +276,7 @@ class LicensePresenter extends Presenter
|
||||
'searchable' => false,
|
||||
'sortable' => true,
|
||||
'visible' => false,
|
||||
'title' => trans('general.date'),
|
||||
'title' => trans('general.updated_at'),
|
||||
'formatter' => 'dateDisplayFormatter',
|
||||
],
|
||||
[
|
||||
|
||||
@@ -99,7 +99,7 @@ use Carbon\Carbon;
|
||||
{{ trans('admin/asset_maintenances/form.cost') }}
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ trans( 'general.currency' ) . Helper::formatCurrencyOutput($assetMaintenance->cost) }}
|
||||
{{ \App\Models\Setting::getSettings()->default_currency .' '. Helper::formatCurrencyOutput($assetMaintenance->cost) }}
|
||||
</div>
|
||||
</div> <!-- /row -->
|
||||
@endif
|
||||
|
||||
@@ -106,11 +106,11 @@
|
||||
<div class="form-group">
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<label class="form-control">
|
||||
{{ Form::radio('update_default_location', '1', old('update_default_location'), ['checked'=> 'checked', 'aria-label'=>'update_default_location']) }}
|
||||
<input name="update_default_location" type="radio" value="1" checked="checked" aria-label="update_default_location" />
|
||||
{{ trans('admin/hardware/form.asset_location') }}
|
||||
</label>
|
||||
<label class="form-control">
|
||||
{{ Form::radio('update_default_location', '0', old('update_default_location'), ['aria-label'=>'update_default_location']) }}
|
||||
<input name="update_default_location" type="radio" value="0" aria-label="update_default_location" />
|
||||
{{ trans('admin/hardware/form.asset_location_update_default_current') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@@ -40,11 +40,11 @@
|
||||
<div class="form-group">
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<label class="form-control">
|
||||
{{ Form::radio('update_default_location', '1', old('update_default_location'), ['checked'=> 'checked', 'aria-label'=>'update_default_location']) }}
|
||||
<input name="update_default_location" type="radio" value="1" checked="checked" aria-label="update_default_location" />
|
||||
{{ trans('admin/hardware/form.asset_location') }}
|
||||
</label>
|
||||
<label class="form-control">
|
||||
{{ Form::radio('update_default_location', '0', old('update_default_location'), ['aria-label'=>'update_default_location']) }}
|
||||
<input name="update_default_location" type="radio" value="0" aria-label="update_default_location" />
|
||||
{{ trans('admin/hardware/form.asset_location_update_default_current') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user