Skip to content

Commit 54b1d65

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents f764849 + 0d5dca6 commit 54b1d65

File tree

7 files changed

+13
-25
lines changed

7 files changed

+13
-25
lines changed

app/Http/Controllers/Api/LicenseSeatsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function index(Request $request, $licenseId) : JsonResponse | array
3434
if ($request->input('sort') == 'department') {
3535
$seats->OrderDepartments($order);
3636
} else {
37-
$seats->orderBy('id', $order);
37+
$seats->orderBy('updated_at', $order);
3838
}
3939

4040
$total = $seats->count();

app/Http/Transformers/LicenseSeatsTransformer.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ class LicenseSeatsTransformer
1313
public function transformLicenseSeats(Collection $seats, $total)
1414
{
1515
$array = [];
16-
$seat_count = 0;
16+
1717
foreach ($seats as $seat) {
18-
$seat_count++;
19-
$array[] = self::transformLicenseSeat($seat, ($total - $seat_count));
18+
$array[] = self::transformLicenseSeat($seat);
2019
}
2120

2221
return (new DatatablesTransformer)->transformDatatables($array, $total);
2322
}
2423

25-
public function transformLicenseSeat(LicenseSeat $seat, $seat_count = 0)
24+
public function transformLicenseSeat(LicenseSeat $seat)
2625
{
2726
$array = [
2827
'id' => (int) $seat->id,
@@ -55,10 +54,6 @@ public function transformLicenseSeat(LicenseSeat $seat, $seat_count = 0)
5554
'user_can_checkout' => (($seat->assigned_to == '') && ($seat->asset_id == '')),
5655
];
5756

58-
if ($seat_count != 0) {
59-
$array['name'] = trans('admin/licenses/general.seat_count', ['count' => $seat_count]);
60-
}
61-
6257
$permissions_array['available_actions'] = [
6358
'checkout' => Gate::allows('checkout', License::class),
6459
'checkin' => Gate::allows('checkin', License::class),

app/Models/Asset.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,8 @@ public function getImageUrl()
656656
return Storage::disk('public')->url(app('assets_upload_path').e($this->image));
657657
} elseif ($this->model && ! empty($this->model->image)) {
658658
return Storage::disk('public')->url(app('models_upload_path').e($this->model->image));
659+
} elseif ($this->model->category && ! empty($this->model->category->image)) {
660+
return Storage::disk('public')->url(app('categories_upload_path').e($this->model->category->image));
659661
}
660662

661663
return false;

app/Presenters/LicensePresenter.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,7 @@ public static function dataTableLayoutSeats()
230230
'switchable' => true,
231231
'title' => trans('general.id'),
232232
'visible' => false,
233-
],
234-
[
235-
'field' => 'name',
236-
'searchable' => false,
237-
'sortable' => false,
238-
'sorter' => 'numericOnly',
239-
'switchable' => true,
240-
'title' => trans('admin/licenses/general.seat'),
241-
'visible' => true,
242-
], [
233+
],[
243234
'field' => 'assigned_user',
244235
'searchable' => false,
245236
'sortable' => false,
@@ -285,7 +276,7 @@ public static function dataTableLayoutSeats()
285276
'searchable' => false,
286277
'sortable' => true,
287278
'visible' => false,
288-
'title' => trans('general.date'),
279+
'title' => trans('general.updated_at'),
289280
'formatter' => 'dateDisplayFormatter',
290281
],
291282
[

resources/views/asset_maintenances/view.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
{{ trans('admin/asset_maintenances/form.cost') }}
100100
</div>
101101
<div class="col-md-9">
102-
{{ trans( 'general.currency' ) . Helper::formatCurrencyOutput($assetMaintenance->cost) }}
102+
{{ \App\Models\Setting::getSettings()->default_currency .' '. Helper::formatCurrencyOutput($assetMaintenance->cost) }}
103103
</div>
104104
</div> <!-- /row -->
105105
@endif

resources/views/hardware/checkin.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@
106106
<div class="form-group">
107107
<div class="col-md-9 col-md-offset-3">
108108
<label class="form-control">
109-
{{ Form::radio('update_default_location', '1', old('update_default_location'), ['checked'=> 'checked', 'aria-label'=>'update_default_location']) }}
109+
<input name="update_default_location" type="radio" value="1" checked="checked" aria-label="update_default_location" />
110110
{{ trans('admin/hardware/form.asset_location') }}
111111
</label>
112112
<label class="form-control">
113-
{{ Form::radio('update_default_location', '0', old('update_default_location'), ['aria-label'=>'update_default_location']) }}
113+
<input name="update_default_location" type="radio" value="0" aria-label="update_default_location" />
114114
{{ trans('admin/hardware/form.asset_location_update_default_current') }}
115115
</label>
116116
</div>

resources/views/partials/forms/edit/location-select.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@
4040
<div class="form-group">
4141
<div class="col-md-9 col-md-offset-3">
4242
<label class="form-control">
43-
{{ Form::radio('update_default_location', '1', old('update_default_location'), ['checked'=> 'checked', 'aria-label'=>'update_default_location']) }}
43+
<input name="update_default_location" type="radio" value="1" checked="checked" aria-label="update_default_location" />
4444
{{ trans('admin/hardware/form.asset_location') }}
4545
</label>
4646
<label class="form-control">
47-
{{ Form::radio('update_default_location', '0', old('update_default_location'), ['aria-label'=>'update_default_location']) }}
47+
<input name="update_default_location" type="radio" value="0" aria-label="update_default_location" />
4848
{{ trans('admin/hardware/form.asset_location_update_default_current') }}
4949
</label>
5050
</div>

0 commit comments

Comments
 (0)