You are here

public function TMGMTLocalTranslatorUIController::checkoutInfo in Translation Management Tool 7

Retrieves information about a translation job.

Services based translators with remote states should place a Poll button here to sync the job state.

Parameters

TMGMTJob $job: The translation job.

Overrides TMGMTDefaultTranslatorUIController::checkoutInfo

File

translators/tmgmt_local/includes/tmgmt_local.plugin.ui.inc, line 37
Provides the user translator UI plugin controller.

Class

TMGMTLocalTranslatorUIController
Local translator plugin UI controller.

Code

public function checkoutInfo(TMGMTJob $job) {
  $label = $job
    ->getTranslator()
    ->label();
  $form['#title'] = t('@translator translation job information', array(
    '@translator' => $label,
  ));
  $form['#type'] = 'fieldset';
  $tuid = $job
    ->getSetting('translator');
  if ($tuid && ($translator = user_load($tuid))) {
    $form['job_status'] = array(
      '#type' => 'item',
      '#title' => t('Job status'),
      '#markup' => t('Translation job is assigned to %name.', array(
        '%name' => entity_label('user', $translator),
      )),
    );
  }
  else {
    $form['job_status'] = array(
      '#type' => 'item',
      '#title' => t('Job status'),
      '#markup' => t('Translation job is not assigned to any translator.'),
    );
  }
  if ($job
    ->getSetting('job_comment')) {
    $form['job_comment'] = array(
      '#type' => 'item',
      '#title' => t('Job comment'),
      '#markup' => filter_xss($job
        ->getSetting('job_comment')),
    );
  }
  return $form;
}