function workflow_tab_form_submit in Workflow 7
Same name and namespace in other branches
- 5.2 workflow.module \workflow_tab_form_submit()
- 5 workflow.module \workflow_tab_form_submit()
- 6.2 workflow.pages.inc \workflow_tab_form_submit()
- 6 workflow.pages.inc \workflow_tab_form_submit()
Submit handler for the form on the workflow tab.
See also
File
- ./
workflow.pages.inc, line 276 - 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'];
if (isset($form_state['values']['workflow'])) {
$node->workflow = $form_state['values']['workflow'];
$node->workflow_comment = isset($form_state['values']['workflow_comment']) ? $form_state['values']['workflow_comment'] : '';
if (!empty($form_state['values']['workflow_scheduled'])) {
$node->workflow_scheduled = $form_state['values']['workflow_scheduled'];
}
if (!empty($form_state['values']['workflow_scheduled_date'])) {
$node->workflow_scheduled_date = $form_state['values']['workflow_scheduled_date'];
}
if (!empty($form_state['values']['workflow_scheduled_hour'])) {
$node->workflow_scheduled_hour = $form_state['values']['workflow_scheduled_hour'];
}
if (!empty($form_state['values']['workflow_scheduled_timezone'])) {
$node->workflow_scheduled_timezone = $form_state['values']['workflow_scheduled_timezone'];
}
}
// 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);
}