You are here

function globallink_validate_project_director_details in GlobalLink Connect for Drupal 7.6

Same name and namespace in other branches
  1. 7.7 globallink_settings.inc \globallink_validate_project_director_details()
  2. 7.5 globallink_settings.inc \globallink_validate_project_director_details()

Validates project director details.

Parameters

object $pd4: The project director object.

Return value

bool TRUE if the project director details are valid. FALSE otherwise.

27 calls to globallink_validate_project_director_details()
globallink_beans_active_form_validate in globallink_beans/globallink_beans_active_submissions.inc
Validates form actions for active beans submissions.
globallink_beans_dashboard_form_validate in globallink_beans/globallink_beans_send.inc
Validates fieldable panels form input.
globallink_beans_receive_form_validate in globallink_beans/globallink_beans_receive.inc
Validates beans form input.
globallink_block_active_form_validate in globallink_block/globallink_block_active_submissions.inc
Validates form actions for active block submissions.
globallink_block_dashboard_form_validate in globallink_block/globallink_block_send.inc
Validates block form input.

... See full list

File

./globallink_settings.inc, line 485

Code

function globallink_validate_project_director_details($pd4) {
  if (empty($pd4->url)) {
    form_set_error('', t('GlobalLink URL is undefined.'));
    return FALSE;
  }
  elseif (empty($pd4->username)) {
    form_set_error('', t('GlobalLink User Id is undefined.'));
    return FALSE;
  }
  elseif (empty($pd4->password)) {
    form_set_error('', t('GlobalLink Password is undefined.'));
    return FALSE;
  }
  elseif (empty($pd4->projectShortCode)) {
    form_set_error('', t('GlobalLink Project Code is undefined.'));
    return FALSE;
  }
  elseif (empty($pd4->classifier)) {
    form_set_error('', t('GlobalLink Classifier is undefined.'));
    return FALSE;
  }
  elseif (empty($pd4->maxTargetCount)) {
    form_set_error('', t('GlobalLink Max Target Count is undefined.'));
    return FALSE;
  }
  elseif (!is_numeric($pd4->maxTargetCount)) {
    form_set_error('', t('GlobalLink Max Target Count is not a number.'));
    return FALSE;
  }
  return TRUE;
}