diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index 09cb3ae8f2..2f1d45feac 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -142,9 +142,11 @@ class CheckoutableListener $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 diff --git a/resources/assets/js/snipeit.js b/resources/assets/js/snipeit.js index 70e4f80a8f..a834e22ba0 100755 --- a/resources/assets/js/snipeit.js +++ b/resources/assets/js/snipeit.js @@ -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(); @@ -470,6 +476,8 @@ $(document).ready(function () { } $('.notification-callout').fadeIn(); + $('[name="assigned_asset"]').val('').trigger('change.select2'); + $('[name="assigned_location"]').val('').trigger('change.select2'); } }); });