Skip to content

A free open source IT asset/license management system

Assorted licenses UI fixes while testing.

Daniel Meltzera6f90cb3fc03
diff --git a/app/Events/CheckoutableCheckedIn.php b/app/Events/CheckoutableCheckedIn.php
index 2edb6888c3..54e3db6abc 100644
--- a/app/Events/CheckoutableCheckedIn.php
+++ b/app/Events/CheckoutableCheckedIn.php
@@ -21,12 +21,12 @@ class CheckoutableCheckedIn
*
* @return void
*/
- public function __construct($checkoutable, $checkedOutTo, User $checkedInBy, $note, $action_date)
+ public function __construct($checkoutable, $checkedOutTo, User $checkedInBy, $note, $action_date = null)
{
$this->checkoutable = $checkoutable;
$this->checkedOutTo = $checkedOutTo;
$this->checkedInBy = $checkedInBy;
$this->note = $note;
- $this->action_date = $action_date;
+ $this->action_date = $action_date ?? date('Y-m-d');
}
}
diff --git a/app/Http/Controllers/Api/LicensesController.php b/app/Http/Controllers/Api/LicensesController.php
index 3985e20890..2a3d004d1f 100644
--- a/app/Http/Controllers/Api/LicensesController.php
+++ b/app/Http/Controllers/Api/LicensesController.php
@@ -245,10 +245,12 @@ class LicensesController extends Controller
$offset = (($seats) && (request('offset') > $seats->count())) ? 0 : request('offset', 0);
$limit = request('limit', 50);
+ $total = $seats->count();
+
$seats = $seats->skip($offset)->take($limit)->get();
if ($seats) {
- return (new LicenseSeatsTransformer)->transformLicenseSeats($seats, $seats->count());
+ return (new LicenseSeatsTransformer)->transformLicenseSeats($seats, $total);
}
}
diff --git a/app/Http/Controllers/Licenses/LicenseCheckinController.php b/app/Http/Controllers/Licenses/LicenseCheckinController.php
index 768e69f4ae..a5be968cad 100644
--- a/app/Http/Controllers/Licenses/LicenseCheckinController.php
+++ b/app/Http/Controllers/Licenses/LicenseCheckinController.php
@@ -69,8 +69,7 @@ class LicenseCheckinController extends Controller
// Declare the rules for the form validation
$rules = [
- 'note' => 'string',
- 'notes' => 'string',
+ 'note' => 'string|nullable',
];
// Create a new validator instance from our validation rules
diff --git a/resources/views/users/view.blade.php b/resources/views/users/view.blade.php
index f278eb7638..3194a90bbf 100755
--- a/resources/views/users/view.blade.php
+++ b/resources/views/users/view.blade.php
@@ -417,7 +417,7 @@
</td>
<td class="hidden-print">
@can('update', $license)
- <a href="{{ route('licenses.checkin', array('licenseseat_id'=> $license->pivot->id, 'backto'=>'user')) }}" class="btn btn-primary btn-sm hidden-print">{{ trans('general.checkin') }}</a>
+ <a href="{{ route('licenses.checkin', array('licenseSeatId'=> $license->pivot->id, 'backto'=>'user')) }}" class="btn btn-primary btn-sm hidden-print">{{ trans('general.checkin') }}</a>
@endcan
</td>
</tr>
diff --git a/routes/web/licenses.php b/routes/web/licenses.php
index 44ed0f5ace..ce046c3a3c 100644
--- a/routes/web/licenses.php
+++ b/routes/web/licenses.php
@@ -18,7 +18,7 @@ Route::group([ 'prefix' => 'licenses', 'middleware' => ['auth'] ], function () {
'{licenseId}/checkout/{seatId?}',
[ 'as' => 'licenses.checkout', 'uses' => 'Licenses\LicenseCheckoutController@store' ]
);
- Route::get('{licenseId}/checkin/{backto?}', [
+ Route::get('{licenseSeatId}/checkin/{backto?}', [
'as' => 'licenses.checkin',
'uses' => 'Licenses\LicenseCheckinController@create'
]);