You are here

function gdpr_task_edit_gdpr_remove_form in General Data Protection Regulation 7

Form callback for removal tasks.

File

modules/gdpr_tasks/gdpr_tasks.admin.inc, line 72
Administrative page and form callbacks for the GDPR Tasks module.

Code

function gdpr_task_edit_gdpr_remove_form($form, &$form_state) {
  $task = $form_state['task'] = $form_state['build_info']['args'][0];
  $form = gdpr_task_form($form, $form_state);
  $header_table = array(
    'Name',
    'Data',
    'Notes',
    'Right to access',
  );
  $rows = gdpr_tasks_collect_rtf_data(user_load($task->user_id));
  $data_table = array(
    '#theme' => 'table',
    '#header' => $header_table,
    '#rows' => $rows,
    '#caption' => 'Export data',
  );
  $form['data'] = array(
    '#markup' => drupal_render($data_table),
  );
  $form['actions']['submit']['#value'] = t('Remove and Anonymise Data');
  $form['actions']['submit']['#name'] = 'remove';
  if ($task->status == 'closed') {
    $form['actions']['#access'] = FALSE;
  }
  return $form;
}