You are here

function casetracker_default_assign_to_validate in Case Tracker 6

Same name and namespace in other branches
  1. 7 casetracker_admin.inc \casetracker_default_assign_to_validate()

Element validate for the default assign to value.

1 string reference to 'casetracker_default_assign_to_validate'
casetracker_settings in ./casetracker_admin.inc
Configures the various Case Tracker options; system_settings_form().

File

./casetracker_admin.inc, line 102

Code

function casetracker_default_assign_to_validate($element, &$form_state) {

  // Switch Unassigned to Anonymous so things are saved properly.
  if ($form_state['values']['casetracker_default_assign_to'] == t('Unassigned')) {
    $form_state['values']['casetracker_default_assign_to'] = variable_get('anonymous', t('Anonymous'));
  }
  else {
    if (!casetracker_get_uid($element['#value'])) {
      form_error($element, t('"Default assigned user" must be "Unassigned" or an existing user.'));
    }
  }
}