You are here

function _casetracker_getCaseTypes in Case Tracker 5

Function to get all the case types where the user has access to

Parameters

void:

Return value

array

3 calls to _casetracker_getCaseTypes()
casetracker_cases_overview in ./casetracker.module
Menu callback; displays a list of all cases in a table. See the README.txt for the various URLs we support.
casetracker_projects_overview in ./casetracker.module
Menu callback; displays a list of all projects in a table. See the README.txt for the various URLs we support.
theme_casetracker_project_summary in ./casetracker.module
Theme the project summary shown at the beginning of a project's node.

File

./casetracker.module, line 1495
Enables the handling of projects and their cases.

Code

function _casetracker_getCaseTypes() {
  $allCases = array_filter(variable_get('casetracker_case_node_types', array(
    'casetracker_basic_case',
  )));

  /*
     $cases = array();
     foreach($allCases AS $key => $value)
     {
       if(user_access('administer nodes'))
       {
         $cases[$key] = $value;
       }
       else
       {
         switch($key)
         {
           case 'casetracker_basic_case':
             $accessCheck = 'create cases';
             break;

           default:
             $accessCheck = 'create ' . $value . ' content';
             break;
         }
         if(user_access($accessCheck))
         {
           $cases[$key] = $value;
         }
       }
     }
  */
  return $allCases;
}