Closed (fixed)
Project:
User Points
Version:
7.x-1.0-rc1
Component:
Code: userpoints
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Nov 2011 at 14:43 UTC
Updated:
20 Jul 2012 at 15:21 UTC
Hi all,
I am trying to add the same type of points to multiple users. Is there a way so that the admin can put commas between different user names and have the module take care of adding the same user point to all specified users? Thanks!
Comments
Comment #1
berdirNope, not yet.
What you could try is building something with Views, VBO and Rules.
Comment #2
guybrush commentedI've achieved this recently with Views/VBO + either Rules or a custom action.
In the Rules case, you attach the rule via the VBO field.
The main disadvantages I've found with this are:
1. The form that appears allow you to enter number of points, etc, is in a rather user-unfriendly format (with options for data selections/replacement patterns that would confuse a user)
2. If you need a reason to be entered, I couldn't find a way of assigning the inputted reason to the reason field, because it doesn't seem to support tokens.
In the case of the custom action, you have to write the code for the form yourself - so it can be tailored to the exact look and feel you want - but requires the extra effort to write this code.
Comment #3
Lloyd commentedAny additional information on this? For example, where would one start to create a custom action per #3?
Comment #4
guybrush commentedOne example of how to implement custom actions can be found in http://dharmatech.org/ideas/2012/vbo-actions-civicrm-custom-fields. Note that this is not in a Userpoints context, but the principle is the same
Comment #5
Lloyd commentedThanks
Comment #6
rogical commentedI want to do this in module, also be difficult.
Comment #7
marcoka commenteda tip for everyone, watch the screencasts of johan falk aka itanglo about rules. now its possible for everyone to understand rules. if you get rules you will stop coding a lot of small things and even see that some modules can be replicated with rules.
see this for how to make a VBO and apply an action-set. I did it with an actionset where i added points X to all users that have role Y.
http://nodeone.se/sv/node/775
attention, i tested it first with the entity user, but that works only for ONE USER, actually you need a "list of users"
http://www.root.artwaves.de/screensnapr/1341587665-C3cIX2.jpg
http://www.root.artwaves.de/screensnapr/1341587715-gqgUSA.jpg
works great and you do not need to code. be creative with rules