mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Merge pull request #13520 from inietov/fixes/licenses_reassignable_feature
Fixed Not reassignable Licenses shouldn't show 'Checkin All Seats' button [sc-23506]
This commit is contained in:
commit
b92327eb40
|
@ -128,6 +128,13 @@ class LicenseCheckinController extends Controller
|
|||
$license = License::findOrFail($licenseId);
|
||||
$this->authorize('checkin', $license);
|
||||
|
||||
if (! $license->reassignable) {
|
||||
// Not allowed to checkin
|
||||
Session::flash('error', 'License not reassignable.');
|
||||
|
||||
return redirect()->back()->withInput();
|
||||
}
|
||||
|
||||
$licenseSeatsByUser = LicenseSeat::where('license_id', '=', $licenseId)
|
||||
->whereNotNull('assigned_to')
|
||||
->with('user')
|
||||
|
|
|
@ -26,6 +26,7 @@ return array(
|
|||
'modal' => 'This will action checkin one seat. | This action will checkin all :checkedout_seats_count seats for this license.',
|
||||
'enabled_tooltip' => 'Checkin ALL seats for this license from both users and assets',
|
||||
'disabled_tooltip' => 'This is disabled because there are no seats currently checked out',
|
||||
'disabled_tooltip_reassignable' => 'This is disabled because the License is not reassignable',
|
||||
'success' => 'License successfully checked in! | All licenses were successfully checked in!',
|
||||
'log_msg' => 'Checked in via bulk license checkout in license GUI',
|
||||
],
|
||||
|
|
|
@ -582,17 +582,23 @@
|
|||
@endcan
|
||||
|
||||
@can('checkin', $license)
|
||||
|
||||
@if (($license->seats - $license->availCount()->count()) > 0 )
|
||||
<a href="#" class="btn btn-block bg-purple" style="margin-bottom: 25px;" data-toggle="modal" data-tooltip="true" data-target="#checkinFromAllModal" data-content="{{ trans('general.sure_to_delete') }} data-title="{{ trans('general.delete') }}" onClick="return false;">
|
||||
{{ trans('admin/licenses/general.bulk.checkin_all.button') }}
|
||||
</a>
|
||||
@else
|
||||
|
||||
@if (($license->seats - $license->availCount()->count()) <= 0 )
|
||||
<span data-tooltip="true" title=" {{ trans('admin/licenses/general.bulk.checkin_all.disabled_tooltip') }}">
|
||||
<a href="#" class="btn btn-block bg-purple disabled" style="margin-bottom: 25px;">
|
||||
{{ trans('admin/licenses/general.bulk.checkin_all.button') }}
|
||||
</a>
|
||||
</span>
|
||||
</span>
|
||||
@elseif (! $license->reassignable)
|
||||
<span data-tooltip="true" title=" {{ trans('admin/licenses/general.bulk.checkin_all.disabled_tooltip_reassignable') }}">
|
||||
<a href="#" class="btn btn-block bg-purple disabled" style="margin-bottom: 25px;">
|
||||
{{ trans('admin/licenses/general.bulk.checkin_all.button') }}
|
||||
</a>
|
||||
</span>
|
||||
@else
|
||||
<a href="#" class="btn btn-block bg-purple" style="margin-bottom: 25px;" data-toggle="modal" data-tooltip="true" data-target="#checkinFromAllModal" data-content="{{ trans('general.sure_to_delete') }} data-title="{{ trans('general.delete') }}" onClick="return false;">
|
||||
{{ trans('admin/licenses/general.bulk.checkin_all.button') }}
|
||||
</a>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
|
|
Loading…
Reference in a new issue