function _support_priorities in Support Ticketing System 6
Same name and namespace in other branches
- 7 support.module \_support_priorities()
Helper function to list available priorities.
13 calls to _support_priorities()
- support_comment_view in ./
support.module - Display state, priority and client when viewing comments for support nodes.
- support_filter_form in ./
support.module - Form builder; Return form for support ticket listing filters.
- 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.
File
- ./
support.module, line 2632 - 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');
while ($priority = db_fetch_object($result)) {
$priorities[$priority->pid] = $priority->priority;
}
}
if ($pid && isset($priorities[$pid])) {
return $priorities[$pid];
}
if ($pid === 0) {
return '';
}
else {
return $priorities;
}
}