You are here

function casetracker_project_options in Case Tracker 7

Same name and namespace in other branches
  1. 6 casetracker.module \casetracker_project_options()

API function that returns valid project options.

3 calls to casetracker_project_options()
casetracker_actions_set_project_action_form in casetracker_actions/casetracker_actions.module
Select a project for the Set Project action
casetracker_case_form_common in ./casetracker.module
Common form elements for cases, generic enough for use either in a full node display, or in comment displays and updating. Default values are calculated based on an existing $form['nid']['#value'].
casetracker_views_handler_filter_project_options::get_value_options in includes/casetracker_views_handler_filter_project_options.inc
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.
3 string references to 'casetracker_project_options'
casetracker_settings in ./casetracker_admin.inc
Configures the various Case Tracker options; system_settings_form().
casetracker_views_default_views in ./casetracker.views_default.inc
Implements hook_views_default_views().
_view_casetracker_project_options in ./casetracker.views_default.inc

File

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

Code

function casetracker_project_options() {
  $projects = array();

  // Fetch the views list of projects, which is space-aware.
  if ($view = views_get_view(variable_get('casetracker_view_project_options', 'casetracker_project_options'))) {
    $view
      ->set_display();
    $view
      ->set_items_per_page(0);
    $view
      ->execute();
    foreach ($view->result as $row) {
      $projects[$row->nid] = $row->node_title;
    }
  }
  return $projects;
}