You are here

public function TaskActionsForm::buildForm in General Data Protection Regulation 8

Same name and namespace in other branches
  1. 8.2 modules/gdpr_tasks/src/Form/TaskActionsForm.php \Drupal\gdpr_tasks\Form\TaskActionsForm::buildForm()
  2. 3.0.x modules/gdpr_tasks/src/Form/TaskActionsForm.php \Drupal\gdpr_tasks\Form\TaskActionsForm::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides EntityForm::buildForm

File

modules/gdpr_tasks/src/Form/TaskActionsForm.php, line 96

Class

TaskActionsForm
Form controller for Task edit forms.

Namespace

Drupal\gdpr_tasks\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildForm($form, $form_state);

  /* @var $entity \Drupal\gdpr_tasks\Entity\Task */
  $entity = $this->entity;
  if (in_array($entity
    ->getStatus(), [
    'processed',
    'closed',
  ])) {
    $form['manual_data']['#access'] = FALSE;
    $form['field_sar_export']['#access'] = FALSE;
    $form['sar_export_assets']['#access'] = FALSE;
    $form['sar_export_parts']['#access'] = FALSE;
    $form['actions']['#access'] = FALSE;
  }
  return $form;
}