diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 7c3468537d..8ebbc9fb16 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -557,12 +557,17 @@ } function licenseInOutFormatter(value, row) { - if(row.disabled || row.user_can_checkout === false) { - return '{{ trans('general.checkout') }}'; + + // check that checkin is not disabled + if (row.user_can_checkout === false) { + return '{{ trans('general.checkout') }}'; + } else if (row.disabled === true) { + return '{{ trans('general.checkout') }}'; + } else // The user is allowed to check the license seat out and it's available - if ((row.available_actions.checkout === true) && (row.user_can_checkout === true)) { - return '{{ trans('general.checkout') }}'; + if ((row.available_actions.checkout === true) && (row.user_can_checkout === true) && (row.disabled === false)) { + return '{{ trans('general.checkout') }}'; } } // We need a special formatter for license seats, since they don't work exactly the same @@ -572,7 +577,7 @@ if (row.disabled && (row.assigned_user || row.assigned_asset)) { return '{{ trans('general.checkin') }}'; } - if(row.disabled) { + if (row.disabled) { return '{{ trans('general.checkout') }}'; } // The user is allowed to check the license seat out and it's available @@ -580,6 +585,11 @@ return '{{ trans('general.checkout') }}'; } + // The user is allowed to check the license seat in and it's available + if ((row.available_actions.checkin === true) && ((row.assigned_asset) || (row.assigned_user))) { + return '{{ trans('general.checkin') }}'; + } + } function genericCheckinCheckoutFormatter(destination) { @@ -1775,7 +1785,19 @@ attributes: { title: '{{ trans('general.export') }}' } - } + }, + + btnShowInactive: { + text: '{{ (request()->input('status') == "inactive") ? trans('general.list_all') : trans('general.show_inactive') }}', + icon: 'fas fa-clock {{ (request()->input('status') == "inactive") ? ' text-danger' : '' }}', + event () { + window.location.href = '{{ (request()->input('status') == "inactive") ? route('licenses.index') : route('licenses.index', ['status' => 'inactive']) }}'; + }, + attributes: { + title: '{{ (request()->input('status') == "inactive") ? trans('general.list_all') : trans('general.show_inactive') }}', + + } + }, });