function globallink_block_clear_cancelled_documents in GlobalLink Connect for Drupal 7.5
Same name and namespace in other branches
- 7.6 globallink_block/globallink_block.inc \globallink_block_clear_cancelled_documents()
Clears cancelled block documents.
Return value
int Number of cancelled block documents.
1 call to globallink_block_clear_cancelled_documents()
- globallink_block_active_form_submit in globallink_block/
globallink_block_active_submissions.inc - Handles submission of active block form.
File
- globallink_block/
globallink_block.inc, line 943
Code
function globallink_block_clear_cancelled_documents() {
$count = 0;
$query = db_select('globallink_core_block', 'tcb')
->fields('tcb', array(
'submission_ticket',
))
->distinct()
->condition('status', 'Cancelled', '=');
$results = $query
->execute();
foreach ($results as $item) {
globallink_block_update_submission_status($item->submission_ticket, 'Pending Translations');
$count++;
}
return $count;
}