Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2023-02-28 16:57:59 -08:00
commit 3a4e20ae82
2 changed files with 12 additions and 2 deletions

View file

@ -59,6 +59,12 @@ class LicenseCheckinController extends Controller
}
$license = License::find($licenseSeat->license_id);
// LicenseSeat is not assigned, it can't be checked in
if (is_null($licenseSeat->assignedTo) && is_null($licenseSeat->asset_id)) {
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.checkin.error'));
}
$this->authorize('checkout', $license);
if (! $license->reassignable) {

View file

@ -93,8 +93,12 @@ trait Loggable
{
$settings = Setting::getSettings();
$log = new Actionlog;
$log->target_type = get_class($target);
$log->target_id = $target->id;
if($target != null){
$log->target_type = get_class($target);
$log->target_id = $target->id;
}
if (static::class == LicenseSeat::class) {
$log->item_type = License::class;