You are here

function globallink_entity_clear_cancelled_documents in GlobalLink Connect for Drupal 7.6

Same name and namespace in other branches
  1. 7.5 globallink_entity/globallink_entity.inc \globallink_entity_clear_cancelled_documents()

Clears cancelled entity documents.

Return value

int Number of cancelled entity documents.

1 call to globallink_entity_clear_cancelled_documents()
globallink_entity_active_form_submit in globallink_entity/globallink_entity_active_submissions.inc
Handles submission of active entity form.

File

globallink_entity/globallink_entity.inc, line 1874

Code

function globallink_entity_clear_cancelled_documents() {
  $count = 0;
  $query = db_select('globallink_core_entity', 'tc')
    ->fields('tc', array(
    'submission_ticket',
  ))
    ->distinct()
    ->condition('status', 'Cancelled', '=');
  $results = $query
    ->execute();
  foreach ($results as $item) {
    globallink_entity_update_submission_status($item->submission_ticket, 'Pending Translations');
    $count++;
  }
  return $count;
}