You are here

function support_invoice_ui_form in Support Ticketing System 6

Provide form for selecting projects.

1 string reference to 'support_invoice_ui_form'
support_support_timer_client_report_alter in ./support.module
Allow projects to be selected.

File

./support.module, line 3838
support.module

Code

function support_invoice_ui_form() {
  $form = array();
  if (count(_support_client_terms(_support_current_client()))) {
    $tags = array(
      -1 => t('-- no tag --'),
      0 => t('-- all tags --'),
    ) + _support_client_terms(_support_current_client());
    $term = isset($_GET['tid']) ? $_GET['tid'] : '';
    if ($term && $term == preg_replace('/[^0-9,]/', '', $term)) {
      $selected = explode(',', $term);
    }
    else {
      if ($_GET['tid'] == 'null') {
        $selected = -1;
      }
      else {
        $selected = 0;
      }
    }
    $form['tags'] = array(
      '#type' => 'fieldset',
      '#title' => t('Tags'),
      '#collapsible' => TRUE,
      '#collapsed' => $selected ? FALSE : TRUE,
    );
    $form['tags']['tids'] = array(
      '#title' => t('Tag'),
      '#type' => 'select',
      '#multiple' => TRUE,
      '#options' => $tags,
      '#default_value' => $selected,
      '#description' => t('Filter report by selected tag(s).'),
    );
    $form['tags']['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Update filter'),
    );
  }
  return $form;
}