diff --git a/app/Http/Controllers/Accessories/AccessoryCheckoutController.php b/app/Http/Controllers/Accessories/AccessoryCheckoutController.php index 02107bcd2f..13bc9e8fd2 100644 --- a/app/Http/Controllers/Accessories/AccessoryCheckoutController.php +++ b/app/Http/Controllers/Accessories/AccessoryCheckoutController.php @@ -80,7 +80,7 @@ class AccessoryCheckoutController extends Controller DB::table('accessories_users')->where('assigned_to', '=', $accessory->assigned_to)->where('accessory_id', '=', $accessory->id)->first(); - event(new AccessoryCheckedOut($accessory, $user, Auth::user(), $request->input('note')); + event(new AccessoryCheckedOut($accessory, $user, Auth::user(), $request->input('note'))); // Redirect to the new accessory page return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.checkout.success')); diff --git a/app/Http/Controllers/Components/ComponentCheckinController.php b/app/Http/Controllers/Components/ComponentCheckinController.php index 24c684c4b6..fd91daa841 100644 --- a/app/Http/Controllers/Components/ComponentCheckinController.php +++ b/app/Http/Controllers/Components/ComponentCheckinController.php @@ -94,7 +94,7 @@ class ComponentCheckinController extends Controller DB::table('components_assets')->where('id', '=', $component_asset_id)->delete(); } - event(new ComponentCheckedIn($component, $component_assets, $request->input('checkin_qty'), $request->input('note'))); + event(new ComponentCheckedIn($component, $component_assets, Auth::user(), $request->input('checkin_qty'), $request->input('note'))); return redirect()->route('components.index')->with('success', trans('admin/components/message.checkout.success')); diff --git a/app/Listeners/LogListener.php b/app/Listeners/LogListener.php index c3dfe76220..2b35e63658 100644 --- a/app/Listeners/LogListener.php +++ b/app/Listeners/LogListener.php @@ -47,7 +47,8 @@ class LogListener } public function onComponentCheckedOut(ComponentCheckedOut $event) { - $event->component->logCheckout($event->note, $event->checkedOutTo); + // Since components don't have a "note" field, submit empty note + $event->component->logCheckout(null, $event->checkedOutTo); } public function onConsumableCheckedOut(ConsumableCheckedOut $event) { @@ -71,7 +72,7 @@ class LogListener { $list = [ 'AccessoryCheckedIn', - 'AccessoryCheckedout', + 'AccessoryCheckedOut', 'AssetCheckedIn', 'AssetCheckedOut', 'ComponentCheckedIn', diff --git a/app/Notifications/CheckoutAccessoryNotification.php b/app/Notifications/CheckoutAccessoryNotification.php index 3b29a21984..c00da8d633 100644 --- a/app/Notifications/CheckoutAccessoryNotification.php +++ b/app/Notifications/CheckoutAccessoryNotification.php @@ -20,15 +20,14 @@ class CheckoutAccessoryNotification extends Notification /** * Create a new notification instance. */ - public function __construct(Accessory $accessory, $checkedOutTo, User $checkedOutBy, $acceptance, $note) + public function __construct(Accessory $accessory, $checkedOutTo, User $checkedOutBy, $note) { $this->item = $accessory; $this->admin = $checkedOutBy; $this->note = $note; $this->target = $checkedOutTo; - $this->acceptance = $acceptance; - + $this->settings = Setting::getSettings(); }