' . t('About') . ''; $output .= '
' . t('OpenCase Default Configuration') . '
'; return $output; default: } } /** * Implements hook_theme(). */ function opencase_defaults_theme() { return [ 'opencase_defaults' => [ 'render element' => 'children', ], ]; } function opencase_defaults_entity_base_field_info($entity_type) { $fields = array(); // Add consent field to person if ($entity_type->id() === 'oc_actor') { $fields['consent'] = BaseFieldDefinition::create('boolean') ->setLabel(t('Consent to data storage')) ->setDescription(t('Has this person explicitly consented to having their personal data stored on this system?')) ->setRevisionable(TRUE) ->setDefaultValue(FALSE) ->setRequired(TRUE) ->setDisplayOptions('form', array( 'type' => 'boolean_checkbox', 'weight' => -6, )); } return $fields; } /** * Implements hook_form_ID_alter */ function opencase_defaults_form_oc_case_type_add_form_alter(&$form, $form_state) { $widget = new EntityTypeRelationsWidget(); $widget->setup($form); } /** * Implements hook_form_ID_alter */ function opencase_defaults_form_oc_case_type_edit_form_alter(&$form, $form_state) { $widget = new EntityTypeRelationsWidget(); $widget->setup($form); $widget->populate($form); }