You are here

function support_overview_summary_settings in Support Ticketing System 7

Same name and namespace in other branches
  1. 6 support_overview/support_overview.module \support_overview_summary_settings()

Configure what to display on the summary page.

1 string reference to 'support_overview_summary_settings'
support_overview_menu in support_overview/support_overview.module
Implements hook_menu().

File

support_overview/support_overview.module, line 297
support_overview.module

Code

function support_overview_summary_settings() {
  drupal_set_title(t('Support overview settings'));
  $form = array();
  $clients = _support_available_clients();
  $form['clients'] = array(
    '#type' => 'select',
    '#multiple' => TRUE,
    '#title' => t('Include selected client(s)'),
    '#options' => $clients,
    '#size' => count($clients) > 10 ? 10 : count($clients),
    '#description' => t('If no clients are selected, all clients will be included on the overview page.  Otherwise, only the selected clients will be included on the overview page.'),
    '#default_value' => variable_get('support_overview_clients', array()),
  );
  $states = _support_states();
  $states[0] = t('all');
  $form['states'] = array(
    '#type' => 'select',
    '#multiple' => TRUE,
    '#title' => t('List selected state(s)'),
    '#options' => $states,
    '#size' => count($states) > 10 ? 10 : count($states),
    '#description' => t('If no states are selected, all states will be broken out on the overview page.  Otherwise, only the selected states will be broken out on the overview page.'),
    '#default_value' => variable_get('support_overview_states', array()),
  );
  $priorities = _support_priorities();
  $form['priorities'] = array(
    '#type' => 'select',
    '#multiple' => TRUE,
    '#title' => t('Break out selected priorities'),
    '#options' => $priorities,
    '#size' => count($priorities) > 10 ? 10 : count($priorities),
    '#description' => t('Select one or more priorities to display an extra column showing tickets of this priority.  If no priorities are selected, tickets won\'t be displayed by priority.'),
    '#default_value' => variable_get('support_overview_priorities', array()),
  );
  $form['alerts'] = array(
    '#type' => 'fieldset',
    '#title' => t('Alerts'),
    '#collapsible' => TRUE,
  );
  $options = array(
    '0' => t('Never'),
  ) + drupal_map_assoc(array(
    86400,
    86400 * 2,
    86400 * 3,
    86400 * 4,
    86400 * 5,
    86400 * 6,
    86400 * 7,
    86400 * 14,
    86400 * 21,
    86400 * 28,
  ), 'format_interval');
  $form['alerts']['alert1'] = array(
    '#type' => 'select',
    '#title' => 'Alert level 1',
    '#options' => $options,
    '#default_value' => variable_get('support_overview_alert1', 0),
    '#description' => t('Tickets that haven\'t been updated for more than the specified time will be marked with a "alert1" CSS class.'),
  );
  $form['alerts']['alert2'] = array(
    '#type' => 'select',
    '#title' => 'Alert level 2',
    '#options' => $options,
    '#default_value' => variable_get('support_overview_alert2', 0),
    '#description' => t('Tickets that haven\'t been updated for more than the specified time will be marked with a "alert2" CSS class.'),
  );
  $form['alerts']['alert3'] = array(
    '#type' => 'select',
    '#title' => 'Alert level 3',
    '#options' => $options,
    '#default_value' => variable_get('support_overview_alert3', 0),
    '#description' => t('Tickets that haven\'t been updated for more than the specified time will be marked with a "alert3" CSS class.'),
  );
  $form['user'] = array(
    '#type' => 'fieldset',
    '#title' => t('User overview settings'),
    '#collapsible' => TRUE,
  );
  $form['user']['roles'] = array(
    '#type' => 'select',
    '#multiple' => TRUE,
    '#title' => t('Display user from selected role(s)'),
    '#options' => user_roles(),
    '#default_value' => variable_get('support_overview_roles', 0),
    '#description' => t('Optionally select one or more roles to limit users displayed on user overview pages.'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  return $form;
}