/[drupal]/contributions/modules/workflow/workflow.module
ViewVC logotype

Diff of /contributions/modules/workflow/workflow.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.83, Thu Jan 1 21:09:16 2009 UTC revision 1.84, Thu Sep 24 23:02:50 2009 UTC
# Line 1  Line 1 
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
# Line 455  function workflow_form_alter(&$form, $fo Line 455  function workflow_form_alter(&$form, $fo
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;
# Line 467  function workflow_form_alter(&$form, $fo Line 470  function workflow_form_alter(&$form, $fo
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    
# Line 708  function workflow_field_choices($node) { Line 711  function workflow_field_choices($node) {
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);

Legend:
Removed from v.1.83  
changed lines
  Added in v.1.84

  ViewVC Help
Powered by ViewVC 1.1.2