Skip to content

Commit

Permalink
Merge pull request #13597 from marcusmoore/bug/sc-23681
Browse files Browse the repository at this point in the history
Reset checkout to value when navigating away from type
  • Loading branch information
snipe authored Sep 14, 2023
2 parents 56c7da7 + 74c7f10 commit 104219e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/Listeners/CheckoutableListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@ private function getNotifiables($event)
$notifiables = collect();

/**
* Notify the user who checked out the item
* Notify who checked out the item as long as the model can route notifications
*/
$notifiables->push($event->checkedOutTo);
if (method_exists($event->checkedOutTo, 'routeNotificationFor')) {
$notifiables->push($event->checkedOutTo);
}

/**
* Notify Admin users if the settings is activated
Expand Down
8 changes: 8 additions & 0 deletions resources/assets/js/snipeit.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,18 @@ $(document).ready(function () {
$('#assigned_location').hide();
$('.notification-callout').fadeOut();

$('[name="assigned_location"]').val('').trigger('change.select2');
$('[name="assigned_user"]').val('').trigger('change.select2');

} else if (assignto_type == 'location') {
$('#current_assets_box').fadeOut();
$('#assigned_asset').hide();
$('#assigned_user').hide();
$('#assigned_location').show();
$('.notification-callout').fadeOut();

$('[name="assigned_asset"]').val('').trigger('change.select2');
$('[name="assigned_user"]').val('').trigger('change.select2');
} else {

$('#assigned_asset').hide();
Expand All @@ -470,6 +476,8 @@ $(document).ready(function () {
}
$('.notification-callout').fadeIn();

$('[name="assigned_asset"]').val('').trigger('change.select2');
$('[name="assigned_location"]').val('').trigger('change.select2');
}
});
});
Expand Down

0 comments on commit 104219e

Please sign in to comment.