You are here

function globallink_clear_cancelled_documents in GlobalLink Connect for Drupal 7.6

Same name and namespace in other branches
  1. 7.5 globallink_node.inc \globallink_clear_cancelled_documents()

Clears cancelled documents.

Return value

int Number of cancelled documents that have been cleared.

1 call to globallink_clear_cancelled_documents()
globallink_dashboard_active_submit in ./globallink_active_submissions.inc
Handles submission of active GlobalLink form.

File

./globallink_node.inc, line 2268

Code

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