You are here

function support_form in Support Ticketing System 6

Same name and namespace in other branches
  1. 7 support.module \support_form()

Implementation of hook_form().

File

./support.module, line 738
support.module

Code

function support_form(&$node) {
  $type = node_get_types('type', $node);
  $form['title'] = array(
    '#type' => 'textfield',
    '#title' => check_plain($type->title_label),
    '#required' => TRUE,
    '#default_value' => !empty($node->title) ? $node->title : NULL,
    '#weight' => -5,
  );
  $reference = array();
  $form = array_merge($form, support_status_form($reference, $node, ''));
  $form['body_field'] = node_body_field($node, $type->body_label, $type->min_word_count);
  if (isset($node->nid) && $node->nid) {
    $form['ticket'] = array(
      '#type' => 'fieldset',
      '#title' => t('Support ticket'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#access' => user_access('administer support'),
    );
    $form['ticket']['move'] = array(
      '#type' => 'textfield',
      '#title' => t('Move ticket'),
      '#maxlength' => 12,
      '#size' => 8,
      '#description' => t('Optionally specify another ticket id to move this ticket and all of its updates.  When moved, this ticket and all of its updates will become updates to the specified ticket and this ticket will be removed.  This action can not be undone.'),
      '#access' => user_access('administer support') || user_access('move ticket'),
    );
  }
  $form = array_merge($form, support_subscribe_form($reference, $node, ''));
  return $form;
}