You are here

function _support_get_state in Support Ticketing System 6

Same name and namespace in other branches
  1. 7 support.module \_support_get_state()
4 calls to _support_get_state()
support_page_form in ./support.module
Display tickets
support_page_user in ./support.user.inc
_support_client_terms in ./support.module
Return an alphabetized list of all terms used with this client.
_support_state_query_filter in ./support.module

File

./support.module, line 2714
support.module

Code

function _support_get_state($state) {
  if ($state == 'all') {
    return 0;
  }
  else {
    if ($state == 'all open') {
      return -1;
    }
    else {
      if ($state == 'my open') {
        return -2;
      }
      else {
        if ($state == SUPPORT_STATE_CLOSED) {
          $result = db_query("SELECT sid FROM {support_states} WHERE isclosed = 1");
          $states = array();
          while ($state = db_fetch_object($result)) {
            $states[$state->sid] = $state->sid;
          }
          return $states;
        }
      }
    }
  }
  $sid = db_result(db_query("SELECT sid FROM {support_states} WHERE state = '%s'", $state));
  if (!$sid) {
    $sid = _support_state_default();
  }
  return $sid;
}