| 1 |
<?php |
<?php |
| 2 |
// $Id: workflow.module,v 1.62 2008/07/31 22:22:52 jvandyk Exp $ |
// $Id: workflow.module,v 1.63 2008/08/01 02:29:46 jvandyk Exp $ |
| 3 |
|
|
| 4 |
define('WORKFLOW_CREATION', 1); |
define('WORKFLOW_CREATION', 1); |
| 5 |
define('WORKFLOW_CREATION_DEFAULT_WEIGHT', -50); |
define('WORKFLOW_CREATION_DEFAULT_WEIGHT', -50); |
| 556 |
$choices = workflow_field_choices($node); |
$choices = workflow_field_choices($node); |
| 557 |
$wid = workflow_get_workflow_for_type($node->type); |
$wid = workflow_get_workflow_for_type($node->type); |
| 558 |
$states = workflow_get_states($wid); |
$states = workflow_get_states($wid); |
| 559 |
$current = workflow_node_current_state($node); |
// If this is a preview, the current state should come from |
| 560 |
|
// the form values, not the node, as the user may have changed |
| 561 |
|
// the state. |
| 562 |
|
$current = isset($form_state['values']['workflow']) ? $form_state['values']['workflow'] : workflow_node_current_state($node); |
| 563 |
$min = $states[$current] == t('(creation)') ? 1 : 2; |
$min = $states[$current] == t('(creation)') ? 1 : 2; |
| 564 |
// Stop if user has no new target state(s) to choose. |
// Stop if user has no new target state(s) to choose. |
| 565 |
if (count($choices) < $min) { |
if (count($choices) < $min) { |
| 1130 |
$form['permissions'] = array( |
$form['permissions'] = array( |
| 1131 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 1132 |
'#title' => t('Permissions Summary'), |
'#title' => t('Permissions Summary'), |
| 1133 |
|
'#collapsible' => TRUE, |
| 1134 |
); |
); |
| 1135 |
$form['permissions']['summary'] = array( |
$form['permissions']['summary'] = array( |
| 1136 |
'#value' => workflow_permissions($workflow->wid), |
'#value' => workflow_permissions($workflow->wid), |