function globallink_menu_clear_cancelled_documents in GlobalLink Connect for Drupal 7.6
Same name and namespace in other branches
- 7.5 globallink_menu/globallink_menu.inc \globallink_menu_clear_cancelled_documents()
Clears cancelled menu documents.
Return value
int Number of cancelled menu documents.
1 call to globallink_menu_clear_cancelled_documents()
- globallink_menu_active_form_submit in globallink_menu/
globallink_menu_active_submissions.inc - Handles submission of active menu form.
File
- globallink_menu/
globallink_menu.inc, line 1041
Code
function globallink_menu_clear_cancelled_documents() {
$count = 0;
$query = db_select('globallink_core_menu', 'tc')
->fields('tc', array(
'submission_ticket',
))
->distinct()
->condition('status', 'Cancelled', '=');
$results = $query
->execute();
foreach ($results as $item) {
globallink_menu_update_submission_status($item->submission_ticket, 'Pending Translations');
$count++;
}
return $count;
}