Closed (fixed)
Project:
Signup Status
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
12 Jan 2009 at 08:28 UTC
Updated:
16 Mar 2009 at 21:40 UTC
Jump to comment: Most recent file
Part of the job for #330943: Drupal 6.x port of signup_status is porting signup_status to Views2. Miglius wanted me to take care of this, since I'm very familiar with the Views2 API at this point.
This patch exposes the {signup_log}.status column to views, provides a field handler for it, a filter handler, and an argument handler. I should probably provide a default admin view for this, too, but that can be another patch... (and it should probably wait until #352328: Replace (optionally?) node/N/signups/admin with a views bulk operations view? lands, anyway -- see #330943-6: Drupal 6.x port of signup_status).
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 357565_signup_status.views_default.8.patch | 5.78 KB | dww |
| #8 | 357565_signup_status_configurable_action.8.patch | 3.34 KB | dww |
| #2 | 357565_signup_status_vbo_actions.2.patch | 1.89 KB | dww |
| signup_status.views2_.patch | 7.09 KB | dww |
Comments
Comment #1
dwwOk, committed that (with minor changes -- I moved the handlers into a signup_status/views/handlers subdir). However, I realized that doesn't include views support for the per-status limit data, so that's coming next...
Comment #2
dwwHere's a port of the proof-of-concept VBO integration I originally posted at #330943-6: Drupal 6.x port of signup_status to the latest HEAD code. This still depends on #352328: Replace (optionally?) node/N/signups/admin with a views bulk operations view? in signup to really be useful, but this should be pretty close now.
Comment #3
dwwCommitted #2 to HEAD of signup_status, now that #352328: Replace (optionally?) node/N/signups/admin with a views bulk operations view? landed in signup. Setting this issue back to active, since now we should provide a default VBO view in signup_status to use at node/N/signups/admin which includes the status column, the alter status operation, and an exposed filter for the status. Speaking of exposed filters: #358787: Exposed filters don't work on embedded views without overriding the path ...
Comment #4
dwwOver at #330943: Drupal 6.x port of signup_status miglius committed code to HEAD that wiped out my changes from #2 and replaced it with:
I really don't think that's a good idea. A) It makes the code more complicated. B) It makes the UI more complicated, since now there's an explosion of actions for each signup status you might define. C) This makes it more unwieldy to define a default signup_status admin VBO view, since we can't know ahead of time what status codes will be defined on the site that should be selected as distinct operations.
I'd strongly suggest removing this code, and restoring what I had from patch #2:
@Miglius: can you explain why you made this change? Do you mind if we put it back how I had it originally?
Thanks,
-Derek
Comment #5
miglius commentedMy idea was to ease the configuration of the signup status module by auto creation of the actions for each signup status change. With my code you don't have to create each action, they automatically appear under vbo view style settings actions list.
A) I don't think that the code is more complicated. Using eval() might look not as nice, but that is the limitation of php of the dynamical creation of functions.
B) I don't think that UI got more complicated - on the contrary - now there is a list of all actions under vbo view configuration displayed automatically - one for each signup status, so creation actions for the statuses steps are skipped. The name of the status is automatically put in the action's name. Otherwise all this has to be done manually.
C) signup status does not have it's own vbo view, it just adds actions to signup's view. Why it's more unwieldy than when you manually create signup status actions?
Anyways, this does not change the functionality of the signup_status module, but rather influence the configuration. For me both scenarios would work, but your code would require more manual configuration of the signup status I was trying to avoid.
Comment #6
dwwThanks for replying.
It seems that you misunderstand how configurable actions work, and what I've said about how signup_status should interface with VBO and signup...
"My idea was to ease the configuration of the signup status module by auto creation of the actions for each signup status change. With my code you don't have to create each action, they automatically appear under vbo view style settings actions list."
My code just had a single action, which lets you dynamically choose the status to use. So, when you bulk select N signups at node/%/signups/admin, choose the "Alter signup status" action and press "execute", you go to a page with a drop-down select for all status codes and choose the one you want to alter to. You never have to create multiple actions this way, and, most importantly, you don't have to change your views when you add/remove status codes.
"B) I don't think that UI got more complicated - on the contrary - now there is a list of all actions under vbo view configuration displayed automatically - one for each signup status, so creation actions for the statuses steps are skipped. The name of the status is automatically put in the action's name. Otherwise all this has to be done manually."
The UI is more complicated because whenever you see a list of actions, you now have N actions related to signup_status when you really only need one. Any time you modify your list of status values, you have to change all the VBO views to add these new actions to your views, even if the actions themselves are created automatically. This action-per-status is what actually requires the manual effort, not the original configurable action code.
C) signup status does not have it's own vbo view, it just adds actions to signup's view. Why it's more unwieldy than when you manually create signup status actions?
signup_status doesn't yet have a default view -- that's why I set this issue back to active instead of fixed. ;) The idea is that signup_status should provide a single default view ("signup_status_user_vbo_admin_list") complete with a column to display the signup status, and the VBO actions to modify the status. It'd be a trivial drop-in replacement for the existing signup_user_vbo_admin_list view using the setting to control which view to embed at node/%/signups/admin. When a site turns on signup_status, all they have to do is visit admin/settings/signup, select this different default view, and they're done.
If there's no signup_status default view, they have to manually go in and reconfigure signup's default view. If there are separate actions per status, every time they change their set of status codes, they have to change this view (and any other views that let you modify the status), since the set of VBO actions each view is configured to support will have to be updated. You should look at signup/views/signup.views_default.inc and scroll down to signup_user_vbo_admin_list and the "selected_operations" attribute for a concrete example.
I hope that helps clarify why I think the current action code will actually cause a lot more trouble and work for site admins than the code that was present in revision 1.4 of signup_status.module. I also hope the plan for signup_status VBO integration is more clear.
Let me know what you think... If you agree, I'll revert the actions code, and work on the signup_status_user_vbo_admin_list default view as originally planned.
Thanks,
-Derek
Comment #7
dwwOh, and a single configurable action also makes it possible to do cool things like have a single view with this exposed action which can enforce permissions on which status values a given user is allowed to set. signup_status_alter_action_form(), which would re-use _signup_status_status_form_element() (from #227643-4: Allow each node to specify which status values should appear on its signup form ) would then have the same logic built in to limit the choices based on the permissions of the current user, etc.
If we have separate actions per status, there's no way to do this -- the actions a given view supports are global across all users and roles...
Comment #8
dwwHere's 2 patches:
357565_signup_status_configurable_action.8.patch: Convert these actions back into a single configurable action
357565_signup_status.views_default.8.patch: Provide a default 'signup_status_user_vbo_admin' view
Please install these, try them out, and let me know what you think.
Thanks,
-Derek
Comment #9
dwwHere's my dream for how the VBO UI should work for this view, though it's not possible yet: #363780: 1 configurable action and N non-configurable actions on the same page?. ;)
Comment #10
miglius commentedYou have convinced me with that configurable actions and default view will ease administration and setup of the module :). I have committed both patches to the cvs.
Only one backside I can see now is that changing the status for a selected users has become a three steps process - select users and alter status action, then selecting the particular status and the last one is confirmation.
I also did following changes in the code:
* Ensured that only statuses with 'show_on_form' property are listed in the action form;
* Changed default view name to 'signup_status_user_vbo_admin_list' to be consistent with corresponding signup's default view;
* Added check if vbo module is installed before providing default vbo view;
Comment #11
dwwThe patch was committed, everything is happy now. Just cleaning up the issue status accordingly.