You are here

function globallink_pending_submission_exists_for_content_type in GlobalLink Connect for Drupal 7.7

Same name and namespace in other branches
  1. 7.5 globallink.inc \globallink_pending_submission_exists_for_content_type()
  2. 7.6 globallink.inc \globallink_pending_submission_exists_for_content_type()

Checks to see if a pending submission exists for a specified content type.

Parameters

string $type: The content type.

Return value

True if the submission exists.

2 calls to globallink_pending_submission_exists_for_content_type()
globallink_entity_form_node_type_form_validate in globallink_entity/globallink_entity.module
Validation to check if any active submission exists for this content type only if there is a change in multilingual options.
globallink_form_node_type_form_validate in ./globallink.module
Validation to check if any active submission exists for this content type. Only if there is a change in multilingual options.

File

./globallink.inc, line 598
Miscellaneous GlobalLink functions for node translations (non-entity).

Code

function globallink_pending_submission_exists_for_content_type($type) {
  $result = db_select('globallink_document', 'gd')
    ->fields('gd')
    ->condition('target_status', array(
    GLOBALLINK_STATUS_TRANSLATION_SENT,
    GLOBALLINK_STATUS_TRANSLATION_ERROR,
    GLOBALLINK_STATUS_TRANSLATION_COMPLETED,
  ), 'IN')
    ->condition('object_type', $type, '=')
    ->execute()
    ->fetchAll();
  if (!empty($result)) {
    return TRUE;
  }
  return FALSE;
}