/[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.2.1, Fri Jun 5 22:05:30 2009 UTC revision 1.83.2.2, Fri Oct 23 15:02:38 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: workflow.module,v 1.83 2009/01/01 21:09:16 jvandyk Exp $  // $Id: workflow.module,v 1.83.2.1 2009/06/05 22:05:30 jvandyk Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 979  function workflow_get_all() { Line 979  function workflow_get_all() {
979    $workflows = array();    $workflows = array();
980    $result = db_query("SELECT wid, name FROM {workflows} ORDER BY name ASC");    $result = db_query("SELECT wid, name FROM {workflows} ORDER BY name ASC");
981    while ($data = db_fetch_object($result)) {    while ($data = db_fetch_object($result)) {
982      $workflows[$data->wid] = $data->name;      $workflows[$data->wid] = check_plain(t($data->name));
983    }    }
984    return $workflows;    return $workflows;
985  }  }
# Line 1067  function workflow_get_states($wid = NULL Line 1067  function workflow_get_states($wid = NULL
1067    if (isset($wid)) {    if (isset($wid)) {
1068      $result = db_query("SELECT sid, state FROM {workflow_states} WHERE wid = %d AND status = 1 ORDER BY weight, sid", $wid);      $result = db_query("SELECT sid, state FROM {workflow_states} WHERE wid = %d AND status = 1 ORDER BY weight, sid", $wid);
1069      while ($data = db_fetch_object($result)) {      while ($data = db_fetch_object($result)) {
1070        $states[$data->sid] = $data->state;        $states[$data->sid] = check_plain(t($data->state));
1071      }      }
1072    }    }
1073    else {    else {
1074      $result = db_query("SELECT ws.sid, ws.state, w.name FROM {workflow_states} ws INNER JOIN {workflows} w ON ws.wid = w.wid WHERE status = 1 ORDER BY sid");      $result = db_query("SELECT ws.sid, ws.state, w.name FROM {workflow_states} ws INNER JOIN {workflows} w ON ws.wid = w.wid WHERE status = 1 ORDER BY sid");
1075      while ($data = db_fetch_object($result)) {      while ($data = db_fetch_object($result)) {
1076        $states[$data->sid] = $data->name .': '. $data->state;        $states[$data->sid] = check_plain(t($data->name)) .': '. check_plain(t($data->state));
1077      }      }
1078    }    }
1079    
# Line 1243  function workflow_allowable_transitions( Line 1243  function workflow_allowable_transitions(
1243      if ($roles == 'ALL'  // Superuser.      if ($roles == 'ALL'  // Superuser.
1244        || $sid == $t->state_id // Include current state for same-state transitions.        || $sid == $t->state_id // Include current state for same-state transitions.
1245        || workflow_transition_allowed($t->tid, $roles)) {        || workflow_transition_allowed($t->tid, $roles)) {
1246        $transitions[$t->state_id] = $t->state_name;        $transitions[$t->state_id] = check_plain(t($t->state_name));
1247      }      }
1248    }    }
1249    
# Line 1354  function workflow_get_roles() { Line 1354  function workflow_get_roles() {
1354      $result = db_query('SELECT * FROM {role} ORDER BY name');      $result = db_query('SELECT * FROM {role} ORDER BY name');
1355      $roles = array('author' => 'author');      $roles = array('author' => 'author');
1356      while ($data = db_fetch_object($result)) {      while ($data = db_fetch_object($result)) {
1357        $roles[$data->rid] = $data->name;        $roles[$data->rid] = check_plain($data->name);
1358      }      }
1359    }    }
1360    return $roles;    return $roles;

Legend:
Removed from v.1.83.2.1  
changed lines
  Added in v.1.83.2.2

  ViewVC Help
Powered by ViewVC 1.1.2