| 1 |
<?php |
<?php |
| 2 |
// $Id: workflow.module,v 1.82 2009/01/01 20:53:21 jvandyk Exp $ |
// $Id: workflow.module,v 1.83 2009/01/01 21:09:16 jvandyk Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 455 |
); |
); |
| 456 |
} |
} |
| 457 |
|
|
| 458 |
|
$timestamp = NULL; |
| 459 |
|
$comment = ''; |
| 460 |
|
|
| 461 |
// See if scheduling information is present. |
// See if scheduling information is present. |
| 462 |
if ($node->_workflow_scheduled_timestamp && $node->_workflow_scheduled_sid) { |
if (isset($node->_workflow_scheduled_timestamp) && isset($node->_workflow_scheduled_sid)) { |
| 463 |
// The default value should be the upcoming sid. |
// The default value should be the upcoming sid. |
| 464 |
$current = $node->_workflow_scheduled_sid; |
$current = $node->_workflow_scheduled_sid; |
| 465 |
$timestamp = $node->_workflow_scheduled_timestamp; |
$timestamp = $node->_workflow_scheduled_timestamp; |
| 470 |
$comment = $form_state['values']['workflow_comment']; |
$comment = $form_state['values']['workflow_comment']; |
| 471 |
} |
} |
| 472 |
|
|
| 473 |
workflow_node_form($form, $form_state, $name, $name, $current, $choices, $timestamp, $comment); |
workflow_node_form($form, $form_state, '', '', $current, $choices, $timestamp, $comment); |
| 474 |
} |
} |
| 475 |
} |
} |
| 476 |
|
|
| 711 |
* The ID of the current state. |
* The ID of the current state. |
| 712 |
*/ |
*/ |
| 713 |
function workflow_node_current_state($node) { |
function workflow_node_current_state($node) { |
| 714 |
$sid = db_result(db_query('SELECT sid FROM {workflow_node} WHERE nid = %d', $node->nid)); |
$sid = FALSE; |
| 715 |
|
|
| 716 |
|
if (!empty($node->nid)) { |
| 717 |
|
$sid = db_result(db_query('SELECT sid FROM {workflow_node} WHERE nid = %d', $node->nid)); |
| 718 |
|
} |
| 719 |
|
|
| 720 |
if (!$sid) { |
if (!$sid && !empty($node->type)) { |
| 721 |
// No current state. Use creation state. |
// No current state. Use creation state. |
| 722 |
$wid = workflow_get_workflow_for_type($node->type); |
$wid = workflow_get_workflow_for_type($node->type); |
| 723 |
$sid = _workflow_creation_state($wid); |
$sid = _workflow_creation_state($wid); |