http://drupal.org/project/views_bulk_operations seems like a perfect tool to implement node/N/signups/admin as a view. We already have a way to embed a custom view (we provide a default) for node/N/signups/list. We could do the same for node/N/signups/admin.

Or, perhaps we should just simplify the code a bit and require views for both. ;)

I think scottrigby proposed this idea in IRC to me, but I couldn't find an issue about it, so I'm creating it here for discussion and tracking. At the very least, I'd like to make it *possible* to use a VBO view for this tab.

Comments

dww’s picture

Assigned: Unassigned » dww

I worked on this during my flight home. I've basically got it all working, though there are some issues to resolve before I can commit it. I'm too tired now to post patches and all that, but I wanted to comment here to assign to myself so no one else duplicates effort on this.

dww’s picture

Status: Active » Needs review
StatusFileSize
new6.63 KB

- One part of this is #355152: Allow User views of signup data by exposing more JOIN + relationship data

- After using VBO, it seems also need to support "Signup" views, so that we can have actions/operations directly on signups, instead of users or nodes. That way, the operation happens on the selected signup, not the user or the node that signup points to. This is working, but I need to properly define the default view for this before I upload it. The actual operations still need some thought, since without patching VBO, you can't define VBO "operations" for anything other than node and user views. The only way to do it is to actually expose these as core "actions", and I'm not sure about the implications of that. ;) I'm going to ask around in IRC a bit and see what folks think.

- We also need settings for optionally embedding a view at node/N/signups/admin, which is what the attached patch does. Note that this patch currently only provides the option to embed a view there if you've got VBO installed. Not sure if I should impose that restriction or not.

dww’s picture

StatusFileSize
new2.33 KB

Unless #355164: Invoke hooks to gather custom operations for *any* object type, not just user and node lands in VBO, we're going to have to handle the operations on signups as core actions, instead of custom VBO operations (since we're going to need a "Signup view", neither a user nor node view for this to work). Attached patch does this (though it could use some more PHPDoc comments).

dww’s picture

Assuming we stick with core actions instead of VBO custom operations, here's 2 patches:

352328_signup_vbo_default_view.4.patch adds views support for using {signup_log} as a base table, giving us "Signup" views. Also includes a default VBO view to embed at node/N/signups/admin.

352328_signup_vbo_embedded_view_all.4.patch just contains all of the patches in this issue rolled into one.

dww’s picture

StatusFileSize
new23.79 KB

New patch with some improvements:

A) We only define the default VBO-based view if VBO is enabled.

B) We always define a table-based admin view that could be embedded for this, regardless of VBO.

C) The setting for which view to embed at node/%/signups/admin is smart about defaulting to the VBO view if VBO is enabled, otherwise, to default to the non-VBO view.

D) The selector for which view to embed allows you to use the default display now, too.

E) All the default views that are meant to be embedded *only* provide a default display, no page displays with menu items that could screw things up. This simplifies some help text, too.

F) Renamed signup_load() to signup_load_signup() to hopefully be more obvious. ;)

G) Added PHPDoc to all the new functions.

I'm thinking this is pretty close to RTBC. Anyone else care to play with it and provide feedback, and/or review the actual code? ;)

dww’s picture

StatusFileSize
new24.7 KB

The confirm form usability still sucked, which deviantintegral reminded me of via IRC. This adds a little hack to not display the "Signup details" stuff if we're on the confirm form for bulk operations (or dealing with a validation error like not selecting an operation or any rows).

geodaniel’s picture

I've test this patch (#6) out and it works fine. I did have to embed it explicitly though... It looks like the new view is only used if the settings form hasn't already been saved, or if the change is made explicitly. Should we maybe highlight to users enabling VBO that they should change the default view for Signup to use this new one?

miglius’s picture

This patch works nicely. I was able to add additional actions in the signup_status module.

dww’s picture

Status: Needs review » Fixed

I don't think geodaniel's concern about a warning if an admin enables VBO and is still using the non-VBO view for this is worth spending code on. If they're motivated to use VBO for this list, they can find the setting. ;)

Therefore, I committed this to HEAD and DRUPAL-6--1. Thanks for all the testing/reviews, folks.

Status: Fixed » Closed (fixed)

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