I have a new node type, which has 4 possible workflow states. So the nodes can be "(created)", "submitted", "approved", and the last one is "completed". With the excellent views module, I can list the nodes by state for each individual state, but I'd also like to be able to list nodes for all states except those in "completed" state. This seems simple enough, and it almost works except.... I created a view with a filter on "workflow: state" "is one of", and select "approved", "submitted", "(created)", but not "completed", and then add another filter on Node: distinct This almost gives me what I want, except because of the the way workflow works, a node actually has entries for all states, so the "completed" items still show up with their earlier entry. Same problem if you do "workflow: state" "is none of" and select "completed". I can create a view the exact opposite of what I want, with the "completed" status, but not "all except completed" to do a queue of outstanding requests. Is there a way to do this i'm missing? TIA Simon
Simon Lindsay wrote:
I have a new node type, which has 4 possible workflow states. So the nodes can be "(created)", "submitted", "approved", and the last one is "completed".
With the excellent views module, I can list the nodes by state for each individual state, but I'd also like to be able to list nodes for all states except those in "completed" state.
This seems simple enough, and it almost works except....
I created a view with a filter on "workflow: state" "is one of", and select "approved", "submitted", "(created)", but not "completed", and then add another filter on Node: distinct
This almost gives me what I want, except because of the the way workflow works, a node actually has entries for all states, so the "completed" items still show up with their earlier entry.
Same problem if you do "workflow: state" "is none of" and select "completed".
I can create a view the exact opposite of what I want, with the "completed" status, but not "all except completed" to do a queue of outstanding requests.
Is there a way to do this i'm missing?
Umm. Sounds like a bug. I will have to look into it; perhaps I misunderstood the table when I wrote the workflow integration.
Earl Miles wrote:
Umm. Sounds like a bug. I will have to look into it; perhaps I misunderstood the table when I wrote the workflow integration.
Thought this might help, but you wont have a "job" table.. $view = new stdClass(); $view->name = 'Open Jobs'; $view->description = ''; $view->access = array ( 0 => '4', 1 => '5', 2 => '3', ); $view->page = TRUE; $view->page_title = ''; $view->page_header = ''; $view->page_header_format = '1'; $view->page_type = 'table'; $view->url = 'job/open'; $view->use_pager = TRUE; $view->nodes_per_page = '20'; $view->menu = TRUE; $view->menu_title = 'open'; $view->menu_tab = FALSE; $view->menu_tab_default = FALSE; $view->menu_weight = ''; $view->sort = array ( ); $view->argument = array ( ); $view->field = array ( array ( 'tablename' => 'job', 'field' => 'job_id', 'label' => '', 'sortable' => '1', ), array ( 'tablename' => 'node', 'field' => 'title', 'label' => '', 'handler' => 'views_handler_field_nodelink', 'sortable' => '1', ), array ( 'tablename' => 'job', 'field' => 'cid', 'label' => '', 'sortable' => '1', ), array ( 'tablename' => 'workflow_states', 'field' => 'state', 'label' => '', 'sortable' => '1', 'defaultsort' => 'DESC', ), array ( 'tablename' => 'job', 'field' => 'job_next_workflow', 'label' => '', ), ); $view->filter = array ( array ( 'tablename' => 'workflow_node', 'field' => 'sid', 'operator' => 'OR', 'options' => '', 'value' => array ( 0 => '12', 1 => '14', 2 => '13', ), ), array ( 'tablename' => 'node', 'field' => 'distinct', 'operator' => '=', 'options' => '', 'value' => '', ), ); $view->requires = array(job, node, workflow_states, workflow_node); $views[$view->name] = $view;
Earl Miles wrote:
Simon Lindsay wrote:
I have a new node type, which has 4 possible workflow states. So the nodes can be "(created)", "submitted", "approved", and the last one is "completed".
Umm. Sounds like a bug. I will have to look into it; perhaps I misunderstood the table when I wrote the workflow integration.
Ok, this is definitely a bug, and jvandyk and I are discussing the best way to fix it.
Earl Miles wrote:
Ok, this is definitely a bug, and jvandyk and I are discussing the best way to fix it.
Bummer, but thanks! This is the code used in the workflow module to get the current state. function workflow_node_current_state($node) { $sid = db_result(db_query("SELECT sid FROM {workflow_node} WHERE nid=%d ". "ORDER BY start DESC LIMIT 1", $node->nid)); if (!$sid) { $wid = workflow_get_workflow_for_type($node->type); $sid = _workflow_creation_state($wid); } return $sid; } I guess the view needs to be able to limit the query results from the workflow table to achieve the same sort of result, rather than retrieve them all. Simon
Hi all, I'm going to change the schema for the buddylist module in 4.7 to normalize the relationship between user, buddy and buddy group. This will open the door for some extra features I have in mind. In order to provide and upgrade path, I need some real 4.6 buddylist data. Please send me dumps of your buddylist tables so that I can test on real data. thanks Robert
participants (3)
-
Earl Miles -
Robert Douglass -
Simon Lindsay