You are here

function globallink_beans_clear_cancelled_documents in GlobalLink Connect for Drupal 7.6

Clears cancelled beans documents.

Return value

int Number of cancelled beans documents.

1 call to globallink_beans_clear_cancelled_documents()
globallink_beans_active_form_submit in globallink_beans/globallink_beans_active_submissions.inc
Handles submission of active beans form.

File

globallink_beans/globallink_beans.inc, line 798

Code

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