From 92f516484eb0aab569a3a3a735753b397265645f Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 18 Apr 2023 12:54:06 -0700 Subject: [PATCH 1/2] Small tooltip improvements for undeployable items Signed-off-by: snipe --- resources/lang/en/admin/hardware/general.php | 1 + resources/lang/en/general.php | 1 + resources/views/partials/bootstrap-table.blade.php | 12 ++++++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/resources/lang/en/admin/hardware/general.php b/resources/lang/en/admin/hardware/general.php index 3d1e43c2df..b0a48f2ce4 100644 --- a/resources/lang/en/admin/hardware/general.php +++ b/resources/lang/en/admin/hardware/general.php @@ -23,6 +23,7 @@ return [ 'restore' => 'Restore Asset', 'pending' => 'Pending', 'undeployable' => 'Undeployable', + 'undeployable_tooltip' => 'This asset has a status label that is undeployable and cannot be checked out at this time.', 'view' => 'View Asset', 'csv_error' => 'You have an error in your CSV file:', 'import_text' => ' diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php index 1b9d9b623a..328eb32090 100644 --- a/resources/lang/en/general.php +++ b/resources/lang/en/general.php @@ -446,5 +446,6 @@ return [ 'no_autoassign_licenses_help' => 'Do not include user for bulk-assigning through the license UI or cli tools.', 'modal_confirm_generic' => 'Are you sure?', 'cannot_be_deleted' => 'This item cannot be deleted', + 'undeployable_tooltip' => 'This item cannot be checked out. Check the quantity remaining.', ]; diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 122e547bad..51008c241c 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -376,11 +376,19 @@ // The user is allowed to check items out, AND the item is deployable if ((row.available_actions.checkout == true) && (row.user_can_checkout == true) && ((!row.asset_id) && (!row.assigned_to))) { + return '{{ trans('general.checkout') }}'; - // The user is allowed to check items out, but the item is not deployable + // The user is allowed to check items out, but the item is not able to be checked out } else if (((row.user_can_checkout == false)) && (row.available_actions.checkout == true) && (!row.assigned_to)) { - return '{{ trans('general.checkout') }}'; + + // We use slightly different language for assets versus other things, since they are the only + // item that has a status label + if (destination =='assets') { + return '{{ trans('general.checkout') }}'; + } else { + return '{{ trans('general.checkout') }}'; + } // The user is allowed to check items in } else if (row.available_actions.checkin == true) { From d3bdaf7cd36fab6a5049aa30de0b1e281ea6ffc4 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 18 Apr 2023 12:59:46 -0700 Subject: [PATCH 2/2] Fixed destination name Signed-off-by: snipe --- resources/views/partials/bootstrap-table.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 51008c241c..21a4f29349 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -384,7 +384,7 @@ // We use slightly different language for assets versus other things, since they are the only // item that has a status label - if (destination =='assets') { + if (destination =='hardware') { return '{{ trans('general.checkout') }}'; } else { return '{{ trans('general.checkout') }}';