Needs review
Project:
User Points
Version:
7.x-2.x-dev
Component:
Code: userpoints
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
23 Aug 2011 at 23:36 UTC
Updated:
27 Jan 2016 at 03:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
berdirComment #2
BenK commentedSubscribing
Comment #3
valante commentedSubscribing.
I'm going to be building these views for my personal use, because I need them now. When I'm done, I can export them as a feature and upload them here if you'd like?
Comment #4
berdirSure, that would be great.
Note that not everything will be possible with Views. For example the current operations column which displays the correct operations (depending on the state of the transaction) with the correct link (depending on the context). We'll need to implement new views handlers for that.
Comment #5
valante commentedI suck at patching things, but here are some new files for your module.
These are views handlers for View and Edit links, as well as a link-able transaction ID field. The info file is edited to include them, and the views.inc file is edited to declare them. (I believe there should also be a "delete" function for transactions, with very carefully-given permissions for it, but that's probably another issue.)
In short, everything you need in order to switch all UP pages over to views.
Actual views coming soon.
Comment #6
berdirNo, we do not want a delete action. In fact, even edit is now severly limited in 7.x-2.x as it is only possible to change transactions as long as their in pending state.
This is just like accounting, if you want to adjust the total points a user has, you need to create a new transaction to revert another one and not trying to rewrite history.
Comment #7
valante commentedExcept even in accounting I get to scratch out a receipt if it was wrongly issued . . .
I find I'm missing a couple of other things for views: the referenced entity, and a display-suitable status (currently shows 0 or 1). Will be working on these next.
Comment #8
valante commentedOkay, did the following:
- Added a handler for the status field and filter, to display it as text.
- Added a handler for the description field, to go through the create_description function that links it to the entity.
The info file and the views.inc file are now updated to include all handlers I've listed in this thread. All handlers are contained in the zip file (and should be added to the "views" folder).
Hopefully this bunch will enable me to create meaningful Userpoints views.
Again, sorry for not offering a patch, I'm working on Windows (yeah, I know) and I can't afford the time to look into patching tools.
Comment #9
mradcliffeI took most of this and incorporated it into the entity views controller class. Condensed the link handler into one class with a definition in views data and added configuration option for menu router path (admin or myuserpoints).
I didn't include the status, description, transaction field and status filter in this patch.
Originally I had thought just to include VBO modify entity values operation in the Moderate tab of the default view, but I changed it out for the operation links here (this removes VBO as a potential dependency). VBO can always be added in later after all.
Edit: this may not be separatable from the entity field improvement patch I submitted, but I think it should be.
Comment #10
mradcliffeEdit: double post.
Edit 2: Typo'd the admin path. So patch is bad.
Comment #11
socialnicheguru commented@mradcliffe can you share where the typo is?