You are here

function _support_priorities in Support Ticketing System 7

Same name and namespace in other branches
  1. 6 support.module \_support_priorities()

Helper function to list available priorities.

11 calls to _support_priorities()
support_comment_view in ./support.module
Implementation of hook_comment_view().
support_form_alter in ./support.module
Customize comment form for ticket followups.
support_mailcmd_support_fetch_message_alter in support_mailcmd/support_mailcmd.module
Implementation of hook_support_fetch_message_alter().
support_mail_tokens in ./support.module
Return an array of token to value mappings for support e-mail messages.
support_overview_summary in support_overview/support_overview.module
Display support ticket overview, highlighting ticket queues with tickets older than a configurable age limit.

... See full list

File

./support.module, line 3047
support.module

Code

function _support_priorities($pid = NULL) {
  static $priorities = array();
  if (empty($priorities)) {
    $result = db_query('SELECT pid, priority FROM {support_priority} ORDER BY weight');
    foreach ($result as $priority) {
      $priorities[$priority->pid] = $priority->priority;
    }
  }
  if ($pid && isset($priorities[$pid])) {
    return $priorities[$pid];
  }
  if ($pid === 0) {
    return '';
  }
  else {
    return $priorities;
  }
}