You are here

function globallink_validate_project_director_details in GlobalLink Connect for Drupal 7.7

Same name and namespace in other branches
  1. 7.5 globallink_settings.inc \globallink_validate_project_director_details()
  2. 7.6 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.

1 call to globallink_validate_project_director_details()
globallink_create_submission_form_validate in ./globallink_send_translations.inc
Validates form actions for GlobalLink submissions.

File

./globallink_settings.inc, line 518

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;
}