function globallink_clear_cancelled_documents in GlobalLink Connect for Drupal 7.5
Same name and namespace in other branches
- 7.6 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 2189
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;
}