function globallink_check_no_pending_submission in GlobalLink Connect for Drupal 7.7
Checks pending submission by locale.
Parameters
string $locale: The locale.
Return value
bool TRUE if the submission has not yet been sent. FALSE otherwise.
1 call to globallink_check_no_pending_submission()
- globallink_locale_submit in ./
globallink_locale_mapping.inc - Handles submission of globallink_locale form.
File
- ./
globallink_locale_mapping.inc, line 194 - Globallink_locale_mapping.inc is a file that contains most functions needed on the Locale Mapping UI.
Code
function globallink_check_no_pending_submission($locale) {
$query1 = db_select('globallink_submission', 'gs')
->fields('gs', array(
'rid',
))
->condition('gs.status', array(
GLOBALLINK_STATUS_TRANSLATION_SENT,
GLOBALLINK_STATUS_TRANSLATION_ERROR,
GLOBALLINK_STATUS_TRANSLATION_COMPLETED,
), 'IN')
->condition(db_or()
->condition('gs.source_lang_code', $locale)
->condition('gs.sub_target_lang_code', $locale));
$result = $query1
->execute()
->fetchAll();
if (empty($result)) {
return TRUE;
}
return FALSE;
}