public function buildForm(array $form, FormStateInterface $form_state) {
parent::buildForm($form, $form_state);
$roles = tmgmt_local_translator_roles();
if (empty($roles)) {
$this
->messenger()
->addWarning(t('No user role has the "provide translation services" permission. <a href="@url">Configure permissions</a> for the Drupal user module.', array(
'@url' => URL::fromRoute('user.admin_permissions'),
)));
}
$form['tuid'] = array(
'#title' => t('Assign to'),
'#type' => 'select',
'#empty_option' => t('- Select user -'),
'#options' => tmgmt_local_get_assignees_for_tasks([
$this
->getEntity()
->id(),
]),
'#required' => TRUE,
);
$form['actions']['#type'] = 'actions';
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Assign tasks'),
);
return $form;
}