I've a form view that only allow one action only to be performed.
I've made some changes to allow it, so that if only one action is enabled for this view, then it can do preview, submit and select different nodes at the same page, much like drupal node creation.

I've added a "done" op for action too, for the purpose of customizing the message set by drupal_set_message

Please take a look, I'd love for this functionality to be included.

Comments

harry slaughter’s picture

looks like this patch applies to an older version of the module.

could you also explain a little more clearly what the purpose of the patch is? i don't get it :)

wuf31’s picture

StatusFileSize
new7.27 KB

Ok, i'll make myself more clear on this. I've also updated the patch for the new version of this module.

Normally, even if only one action is enabled the user is still presented with a select box with only one action, then after submitting the form, the user is asked to configure the action, after that, there come the confirmation page. Only then can the user really submit the form. CMIIW.

Well, with this patch, if there is only one action enabled, the form not only has the node selector, but also come with the action form above it. If the user submit the form then there is a preview displaying the selected nodes above the form, much like the standard drupal node preview and submit.

For example, i've got myself two CCK type, product and customer, and one action to sell products to a customer. I then created a view of type bulk operations, page titled 'Bulk Sell'. With this patch, on that page, there is a list of products not yet sold, and a select box listing the customer list. IMO, this is for the better user experience.

The area where need work is the preview (I need to custom theme the preview).
This is what I do

  $elements = module_invoke_all('views_bulk_operations_preview', $form_values['nodes']['selected']);

Another one is the drupal_set_message which happened on form submission. I moved it to the action function op 'done' (Well, i don't think actions have this, i just kindda add it myself)

  call_user_func($action, 'done', $form_values, NULL);

Any feedback :) ?

harry slaughter’s picture

Priority: Normal » Minor

I don't understand what this patch does. It hides the dropdown if only one action is enabled?

I don't see a huge benefit in that. A dropdown with one item in it is fine, and it's consistent.

The action configuration page only appears for configurable actions. So if your action is not configurable, then you are taken only to the confirmation screen.

Because we have no idea what types of actions/node operations may be available, we really need to keep the UI generic so it can support the widest possible array of actions/operations.

And right now, we're still awaiting the views patch and so this is not released. I'd like to keep the code as simple/basic as possible until it is released and has some testing behind it.

wuf31’s picture

Status: Needs work » Postponed

Whether this patch is of huge benefit or not, IMO depends on the specific need of each case.

I design this patch for a specific view, let's call it "Bulk Sell", wouldn't it be awkward if the user then is asked again to select 'Bulk Sell' from the dropdown, especially since it is the only option available?
And the user interface would be smoother if we could just present the customer list (the action configuration form) at the same page with the node selector.

Nevertheless since we're still waiting for the views patch, let's postpone it first.
Meanwhile I'd like to hear any feedback. Am I the only one who think that it does has its benefit, given the case above?

infojunkie’s picture

Version: » 5.x-1.x-dev
Assigned: Unassigned » infojunkie
Status: Postponed » Fixed

I recently ran into a situation similar to what wuf31 described, and the concept of simplifying the UI for the special case of having just one action made sense. so I went ahead and integrated *some* of the changes in that patch. The original patch made the following, unrelated IMO, changes:
* Handle one-action scenarios where the VBO multistep form is collapsed onto one page
* Preview functionality

I just checked in the first one. We'll need to think of the Preview functionality separately.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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