You are here

function globallink_block_get_submission_status in GlobalLink Connect for Drupal 7.6

Same name and namespace in other branches
  1. 7.5 globallink_block/globallink_block.inc \globallink_block_get_submission_status()

Gets block submission status.

1 call to globallink_block_get_submission_status()
globallink_block_active_select_form in globallink_block/globallink_block_active_submissions.inc
Builds form to allow selection of specific block submission by ID.

File

globallink_block/globallink_block.inc, line 868

Code

function globallink_block_get_submission_status() {
  module_load_include('inc', 'globallink', 'globallink_settings');
  module_load_include('inc', 'globallink', 'gl_ws/gl_ws_common');
  $query = db_select('globallink_core_block', 'tcb');
  $query
    ->fields('tcb', array(
    'submission_ticket',
  ));
  $query
    ->distinct();
  $query
    ->condition('status', 'Sent for Translations', '=');
  $results = $query
    ->execute();
  foreach ($results as $row) {
    if ($row->submission_ticket) {
      try {
        $pd4 = globallink_get_project_director_details();
        $status = globallink_get_status($pd4, $row->submission_ticket);
        if (!$status || $status == 'CANCELLED') {
          globallink_block_update_submission_status($row->submission_ticket);
        }
      } catch (SoapFault $se) {
        globallink_block_update_submission_status($row->submission_ticket);
      } catch (Exception $ex) {
        globallink_block_update_submission_status($row->submission_ticket);
      }
    }
  }
}