Form callback for the checkout settings form.
Overrides TranslatorPluginUiBase::checkoutSettingsForm
public function checkoutSettingsForm(array $form, FormStateInterface $form_state, JobInterface $job) {
if ($translators = tmgmt_local_assignees($job
->getSourceLangcode(), array(
$job
->getTargetLangcode(),
))) {
$form['translator'] = array(
'#title' => t('Assign job to'),
'#type' => 'select',
'#options' => array(
'' => t('- Select user -'),
) + $translators,
'#default_value' => $job
->getSetting('translator'),
);
}
else {
$form['message'] = array(
'#markup' => t('There are no users available to assign.'),
);
}
$form['job_comment'] = array(
'#type' => 'textarea',
'#title' => t('Comment for the translation'),
'#description' => t('You can provide a comment so that the assigned user will better understand your requirements.'),
'#default_value' => $job
->getSetting('job_comment'),
);
return $form;
}