Some background information: I want to build a view which lists nodes that are governed by a certain workflow. I also want this view to provide some links which allow to change the state of each node quickly. For example, the nodes in question have 4 possible states: 'pending', 'in progress', 'posted' and 'ignored', so I would like to provide 'Mark as posted', 'Mark as ignored', ... links.
Ideally these links would be available in the form of Views fields, much like the 'Node: Edit link' and 'Node: Delete link' that are available by default.
I found this module that I could probably use to accomplish what I want: 'Views Action Links' (http://drupal.org/project/views_actions_links). Unfortunately, this is Drupal 5 only and I'm using Drupal 6. In addition, there seems to have been no activity for almost two years.
I also had a look at 'Views Bulk Operations' (http://drupal.org/project/views_bulk_operations) but this doesn't allow me to show action links per node - it only provides a drop down box or a set of buttons at the top of the page, and then check boxes for each node.
It's a bit baffling to me that this is so hard to accomplish... I've been looking for a clean solution all day (another possible avenue I explored was assigning URLs to Actions and then using Views' "Rewrite this field" functionality to create the links myself) but nothing seems to do precisely what I want it to do.
Hence this feature request: I think it would be cool if Workflow had a configurable 'Workflow: Change state link' Views field. The configuration options would let you choose the target state. The link would be displayed only if the current user has the correct permissions to change the state of the given node to this target state (and if the node type is governed by the corresponding workflow).
I would then be able to add multiple instances of this field to my view (one for each target state). Damn, that would be neat :)
If anybody knows another solution (using functionality that is already available on some module or other), that would be great as well. Thanks!
Comments
Comment #1
pbrough commentedSubscribe
This would be great. There are a couple of projects that I am working on as well where this feature would be really good.
Comment #2
nouriassafi commentedInstructions courtesy of Infojunkie:
* Create an advanced action (admin/settings/actions/manage) from "Change workflow state of post to new state" with the desired state. [Alternatively, you can use "Change workflow state of post to next state".]
* Use Actions REST (http://drupal.org/project/actions_rest) to expose the new workflow action as a URL. Make sure to use the actions_permissions module as explained on the module's page.
* Use Views PHP (http://drupal.org/project/views_php) to create a new Views field that creates a URL to the action above - you will need to use a one-line PHP script to achieve that.
I used this code:
Comment #3
swamiman commentedAnyway to do this in using Drupal 7? Actions REST is not supported above 6.
Comment #4
ezteiw commentedI would like this too!
Comment #5
nancydruCouldn't you do this with Views Bulk Operations? There is an add-on that allows VBO to change states.
Comment #6
nancydruNo update in 10 weeks. If someone wants to do a patch, please re-open this issue.
Comment #7
johnvIn version 7.x-2.x, the Workflow Form is now available as a Formatter, which you can use in a Views display.
Comment #8
johnvComment #10
doxigo commentedThis function still not working in 7.x2.x for some reason!
Comment #11
johnvComment #12
johnv@doxigo, the requested functionality is not provided, see #6.
But there is an alternative, see #7.
Comment #13
doxigo commented@johnv, I checked the solution at #7, but still there's no
tag in the rendered output. I'll try to get a live drupal version up so I can demonstrate the issue more properly.
Comment #14
pareen commentedAny update on this?