-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds ability to mass email all assigned list to #11821
Adds ability to mass email all assigned list to #11821
Conversation
Ah yes it is, I re-seeded my db so your email is back in there. I will remove that now. (also you have no assets assigned to you on my local 😄 ) |
All good :) Just that if nothing is assigned to a user, they probably shouldn't get an email, right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably not send emails to users who do not have anything assigned to them.
260b4dc
to
87a1af9
Compare
Signed-off-by: snipe <snipe@snipe.net> (cherry picked from commit 7c21158)
…l-assigned-list-to
Emailing users only if they have assets has been implemented. we just have a crappy Ux placement for right now 🙁 |
Hi, is this script will be added to the new version? also can we select specific people to send the assets? |
That would only imply it only affects the visible users on that page (since everything else in that menu does that), which isn't what that functionality does. |
@@ -254,7 +254,7 @@ public function getImageUrl() | |||
*/ | |||
public function users() | |||
{ | |||
return $this->belongsToMany(\App\Models\User::class, 'accessories_users', 'accessory_id', 'assigned_to')->withPivot('id', 'created_at', 'note')->withTrashed(); | |||
return $this->belongsToMany(\App\Models\User::class, 'accessories_users', 'accessory_id', 'assigned_to')->withPivot('id', 'created_at' , 'note')->withTrashed(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this extra space was put in here?
@@ -249,4 +251,38 @@ protected function logItemCheckinAndDelete($items, $itemType) | |||
$logAction->logaction('checkin from'); | |||
} | |||
} | |||
protected function findAssetOwners() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this method is needed here. We have existing methods on the model that we can likely use instead of duplicating code here, esp since this method is only used once.
@@ -249,4 +251,38 @@ protected function logItemCheckinAndDelete($items, $itemType) | |||
$logAction->logaction('checkin from'); | |||
} | |||
} | |||
protected function findAssetOwners() | |||
{ | |||
$asset_owners= Asset::all()->where('assigned_to', '!=', null)->pluck('assigned_to')->toArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This call as it is now would erroneously include the ids of users when it shouldn't, for example if an asset is checked out to a location.
@MajorBlackbird until this gets added into the GUI, you can use this cli command to accomplish what this PR does: https://snipe-it.readme.io/docs/user-inventory
|
Wow thank you very much and sorry for missing that in the documentation!
|
This pull request has been linked to Shortcut Story #19519: Ability to mass email "All Assigned" list to each user. |
Closing this for housekeeping for now - we can discuss and possibly re-open later |
Description
Adds the ability to send all users a list of their devices.
There are a lot of buttons in the picture above. Open to placing the button in another suggested place.
Fixes # sc-19519 fd-30564
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: