This may end up a feature request since I didn't see a clean way to implement, but I want to check with others first in case I missed something or someone has a twist I hadn't thought of.

Basically what I want to do is allow users on the site to join teams(one team per user for now) and have their received userpoints also allocated to the chosen teams total. I want to have groups of users taking individual actions for which they will be allocated points, but I also want them to be able to be part of a team whose points are the total of all the points that teams members have received.

Is there a field that can safely be used to store a team ID(associated with points received) that won't interfere with other functions but would then allow me to generate reports and leaderboards based on both the individual and the teams?

===
Fallback options I'd probably like to avoid

- Create a taxonomy for each team and allocate points to both the standard ID and a unique ID for each team. Unfortunately this would artificially inflate the points given metric and double the data storage used.

- just code the users team in their user/profile record, and re-pull all the data each time a leaderboard/statistic for a team is displayed. Probably a big I/O performance hit, not sure about memory

Comments

berdir’s picture

Status: Active » Fixed

Right now, only users can have points.

One of the (many) goals of the 7.x-2.x branch is to make userpoints a field, that is by default attached to users but can also be attached to other entities. You could then e.g. connect users with a node/entity reference field to a team and create rules to track the team's points as well by creating corresponding transactions for the team of the user.

You can actually do this already right now, with the main limitation that you need to use a simple integer field and will not have the other features of userpoints like a transaction list and so on for teams. You might or might not need that. By using transactions, you could e.g. create a corresponding transaction that links to the user that gained the points and the original transaction but would otherwise be equal to the original transaction. This would give you an out of the box overview of the points of a team.

If you're interested in that, you're welcome to help with the 7.x-2.x branch by testing/reviewing patches, help writing documentation to push it forward. I plan to work in it a bit in the next few days. See #1158692: Userpoints Roadmap to 7.x-2.x.

Setting to fixed as there is no specific feature required to get this working.

MacRonin’s picture

Sorry for the delay, I thought I had replied before, but I don't see so I guess not.

It looks like will be going forward with the project that will need the Team functionality, so I hope to be able to jump in and do what I can to help give it a hand.

Since I'm not sure how much time I'll be given for the Teams, I appreciate your mentioning a method for the current release in addition to 2.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

clarify a few items