You are here

function casetracker_dashboard_admin_form in Case Tracker 5

Form callback Configure the CaseTracker dashboard

Parameters

void:

Return value

string

1 string reference to 'casetracker_dashboard_admin_form'
casetracker_dashboard_menu in ./casetracker_dashboard.module
Implementation of hook_menu().

File

./casetracker_dashboard.module, line 101

Code

function casetracker_dashboard_admin_form() {
  $form = array();
  $form['casetracker_dashboard_admin'] = array(
    '#type' => 'fieldset',
    '#title' => t('Dashboard settings'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
    '#description' => t('Assign the case status that need to be counted as Done'),
  );
  $states = casetracker_case_state_load('status');
  $statesChecked = variable_get('casetracker_dashboard_states_done', array());
  foreach ($states as $csid => $title) {
    $checked = isset($statesChecked[$csid]) ? $statesChecked[$csid] : false;
    $form['casetracker_dashboard_admin'][$csid] = array(
      '#type' => 'checkbox',
      '#title' => check_plain(t($title)),
      '#default_value' => $checked,
    );
  }
  $form['buttons']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  return $form;
}