You are here

function tmgmt_rules_job_checkout in Translation Management Tool 7

Rules callback to redirect to a translation job.

File

./tmgmt.rules.inc, line 174
Rules integration.

Code

function tmgmt_rules_job_checkout(TMGMTJob $job) {
  $redirects = tmgmt_ui_job_checkout_multiple(array(
    $job,
  ));

  // If necessary, do a redirect.
  if ($redirects) {
    tmgmt_ui_redirect_queue_set($redirects, current_path());
    drupal_goto(tmgmt_ui_redirect_queue_dequeue());

    // Count of the job messages is one less due to the final redirect.
    drupal_set_message(format_plural(count($redirects), t('One job needs to be checked out.'), t('@count jobs need to be checked out.')));
  }
}