function casetracker_case_state_edit in Case Tracker 5
Same name and namespace in other branches
- 6 casetracker_admin.inc \casetracker_case_state_edit()
- 7 casetracker_admin.inc \casetracker_case_state_edit()
Displays a form for adding or editing a case state.
1 string reference to 'casetracker_case_state_edit'
- casetracker_menu in ./
casetracker.module - Implementation of hook_menu().
File
- ./
casetracker.module, line 606 - Enables the handling of projects and their cases.
Code
function casetracker_case_state_edit($csid = NULL) {
$case_state = isset($csid) ? casetracker_case_state_load(NULL, $csid) : NULL;
$form = array();
$form['case_state'] = array(
'#type' => 'fieldset',
'#title' => t('Case state'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['case_state']['name'] = array(
'#type' => 'textfield',
'#title' => t('State name'),
'#required' => TRUE,
'#default_value' => isset($case_state) ? $case_state['name'] : NULL,
'#description' => t('The name for this case state. Example: "Resolved".'),
);
$form['case_state']['realm'] = array(
'#type' => 'select',
'#title' => t('State realm'),
'#required' => TRUE,
'#default_value' => isset($case_state) ? $case_state['realm'] : NULL,
'#description' => t('The realm in which this case state will appear.'),
'#options' => array(
'priority' => t('priority'),
'status' => t('status'),
'type' => t('type'),
),
);
$form['case_state']['weight'] = array(
'#type' => 'weight',
'#title' => t('Weight'),
'#default_value' => isset($case_state) ? $case_state['weight'] : 0,
'#description' => t('States are ordered first by weight and then by state name.'),
);
if ($case_state) {
$form['csid'] = array(
'#type' => 'hidden',
'#default_value' => $csid,
);
}
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
);
return $form;
}