diff --git a/app/Http/Controllers/Users/UsersController.php b/app/Http/Controllers/Users/UsersController.php index c67cbcb286..d7372627b6 100755 --- a/app/Http/Controllers/Users/UsersController.php +++ b/app/Http/Controllers/Users/UsersController.php @@ -23,6 +23,7 @@ use Redirect; use Str; use Symfony\Component\HttpFoundation\StreamedResponse; use View; +use App\Notifications\CurrentInventory; /** * This controller handles all actions related to Users for @@ -614,6 +615,19 @@ class UsersController extends Controller ->with('show_user', $show_user) ->with('settings', Setting::getSettings()); } + public function emailAssetList($id) + { + $this->authorize('view', User::class); + + if( User::where('id', $id)->first()->exists()) + { + $user= User::where('id', $id)->first(); + $user->notify((new CurrentInventory($user))); + return redirect()->back()->with('success', 'admin/users/general.user_notified'); + } + + return redirect()->back()->with('error', 'admin/accessories/message.user_does_not_exist'); + } /** * Send individual password reset email diff --git a/resources/lang/en/admin/users/general.php b/resources/lang/en/admin/users/general.php index 66c9699064..c77ff8f8c7 100644 --- a/resources/lang/en/admin/users/general.php +++ b/resources/lang/en/admin/users/general.php @@ -17,6 +17,8 @@ return [ 'last_login' => 'Last Login', 'ldap_config_text' => 'LDAP configuration settings can be found Admin > Settings. The (optional) selected location will be set for all imported users.', 'print_assigned' => 'Print All Assigned', + 'email_assigned' => 'Email List of All Assigned', + 'user_notified' => 'User has been emailed a list of their currently assigned items.', 'software_user' => 'Software Checked out to :name', 'send_email_help' => 'You must provide an email address for this user to send them credentials. Emailing credentials can only be done on user creation. Passwords are stored in a one-way hash and cannot be retrieved once saved.', 'view_user' => 'View User :name', diff --git a/resources/views/users/print.blade.php b/resources/views/users/print.blade.php index 1da8353f28..76b4767682 100644 --- a/resources/views/users/print.blade.php +++ b/resources/views/users/print.blade.php @@ -67,6 +67,7 @@