You are here

function _support_access_tickets in Support Ticketing System 7

Same name and namespace in other branches
  1. 6 support.module \_support_access_tickets()
2 calls to _support_access_tickets()
support_access_clients in ./support.module
Custom permissions function.
support_page_user in ./support.user.inc

File

./support.module, line 3786
support.module

Code

function _support_access_tickets() {
  static $count = NULL;
  if (is_null($count)) {
    $count = 0;
    $result = db_query('SELECT name FROM {support_client} WHERE status = :status', array(
      ':status' => 1,
    ));
    foreach ($result as $client) {
      if (user_access('administer support') || user_access("access {$client->name} tickets")) {
        $count++;
      }
    }
  }
  return $count;
}