You are here

function workflow_tab_form_submit in Workflow 6.2

Same name and namespace in other branches
  1. 5.2 workflow.module \workflow_tab_form_submit()
  2. 5 workflow.module \workflow_tab_form_submit()
  3. 6 workflow.pages.inc \workflow_tab_form_submit()
  4. 7 workflow.pages.inc \workflow_tab_form_submit()

Submit handler for the form on the workflow tab.

See also

workflow_tab_form

File

./workflow.pages.inc, line 166
Provide user interface for changing workflow state.

Code

function workflow_tab_form_submit($form, &$form_state) {

  // The entire node object was stashed in the form.
  $node = $form_state['values']['node'];
  $node->workflow = $form_state['values']['workflow'];
  $node->workflow_comment = $form_state['values']['workflow_comment'];
  $node->workflow_scheduled = $form_state['values']['workflow_scheduled'];
  $node->workflow_scheduled_date = $form_state['values']['workflow_scheduled_date'];
  $node->workflow_scheduled_hour = $form_state['values']['workflow_scheduled_hour'];

  // ALERT: Rules that use node_save to check the node transition are going to be missed if
  // the tab form is used to check for the change. It is *always* better practice to use
  // the transition change itself as your value to check for changes with Rules and other
  // behaviors. Do NOT rely on node_save() to drive transition changes.
  workflow_transition($node, $node->workflow);
  $form_state['redirect'] = 'node/' . $node->nid;
}