You are here

function casetracker_actions_set_project_action_form in Case Tracker 7

Same name and namespace in other branches
  1. 6 casetracker_actions/casetracker_actions.module \casetracker_actions_set_project_action_form()

Select a project for the Set Project action

File

casetracker_actions/casetracker_actions.module, line 229
casetracker_actions.module

Code

function casetracker_actions_set_project_action_form($context) {
  $project_options = casetracker_project_options();

  // if there's no project ID from the URL, or more than one project,
  // we'll create a select menu for the user; otherwise, we'll save
  // the passed (or only) project ID into a hidden field.
  if (count($project_options) > 1) {
    $form['casetracker_actions_pid'] = array(
      '#title' => t('Project'),
      '#type' => 'select',
      '#options' => $project_options,
    );
  }
  else {
    $form['casetracker']['pid'] = array(
      '#type' => 'value',
      '#value' => !empty($default_project) ? $default_project : key($project_options),
    );
  }
  return $form;
}