You are here

function globallink_interface_clear_cancelled_documents in GlobalLink Connect for Drupal 7.6

Clears cancelled interface documents.

Return value

int Number of cancelled interface documents.

1 call to globallink_interface_clear_cancelled_documents()
globallink_interface_active_form_submit in globallink_interface/globallink_interface_active_submissions.inc
Handles submission of active interface form.

File

globallink_interface/globallink_interface.inc, line 862

Code

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