You are here

function workflow_comment in Workflow 6

Same name and namespace in other branches
  1. 5.2 workflow.module \workflow_comment()
  2. 6.2 workflow.module \workflow_comment()

Implementation of hook_comment().

File

./workflow.module, line 148
Support workflows made up of arbitrary states.

Code

function workflow_comment($a1, $op) {
  if (($op == 'insert' || $op == 'update') && isset($a1['workflow'])) {
    $node = node_load($a1['nid']);
    $sid = $a1['workflow'];
    $node->workflow_comment = $a1['workflow_comment'];
    if (isset($a1['workflow_scheduled'])) {
      $node->workflow_scheduled = $a1['workflow_scheduled'];
      $node->workflow_scheduled_date = $a1['workflow_scheduled_date'];
      $node->workflow_scheduled_hour = $a1['workflow_scheduled_hour'];
    }
    workflow_transition($node, $sid);
  }
}