Get the grid fields for registrations that are:
completed, unconfirmed, incomplete, cancelled
@return FormField
170649
protected function getRegistrationsFields() {

		$tabset = new TabSet("Registrations");

		//common config
		$regGridFieldConfig = GridFieldConfig_RecordEditor::create()
			->removeComponentsByType('GridFieldAddNewButton')
			->removeComponentsByType('GridFieldDeleteAction')
			->addComponents(
				new GridFieldButtonRow('after'),
				new GridFieldPrintButton('buttons-after-left'),
				new GridFieldExportButton('buttons-after-left')
			);

		//complete
		$registrationsGrid = new GridField('Registrations',
			_t('Registripe.REGISTRATIONS', 'Registrations'),
			$this->getCompletedRegistrations()
				->sort("LastEdited", "DESC"),
			$regGridFieldConfig
		);
		$tabset->push(new Tab("Completed", $registrationsGrid));

		//incomplete
		$incomplete = $this->getIncompleteRegistrations()
						->sort("LastEdited", "DESC");
		if($incomplete->exists()){
			$incompleteGrid = new GridField('IncompleteRegistrations',
				_t('Registripe.INCOMPLETE', 'Incomplete'),
				$incomplete,
				$regGridFieldConfig
			);
			$tabset->push(new Tab("Incomplete", $incompleteGrid));
		}		

		//cancelled
		$cancelled = $this->getCancelledRegistrations()
						->sort("LastEdited", "DESC");
		if($cancelled->exists()){
			$cancelledGrid = new GridField('CancelledRegistrations',
				_t('Registripe.CANCELLATIONS', 'Cancellations'),
				$cancelled,
				$regGridFieldConfig
			);
			$tabset->push(new Tab("Cancelled", $cancelledGrid));
		}

		return $tabset;
	}
872688
public function getGridParentOptions(): array
    {
        $columns[] = 'tl_form_field.type = ?';
        $columns[] = 'tl_form_field.pid = ?';

        $values[] = 'bs_gridStart';
        $values[] = CURRENT_ID;

        $collection = FormFieldModel::findBy($columns, $values);
        $options    = [];

        if ($collection) {
            foreach ($collection as $model) {
                $options[$model->id] = sprintf(
                    '%s [%s]',
                    $model->bs_grid_name,
                    $model->getRelated('bs_grid')->title
                );
            }
        }

        return $options;
    }
5858
public function getHTMLFragments($gridField)
    {
        // permission check
        if (!singleton($gridField->getModelClass())->canEdit()) {
            return array();
        }

        // get uploadField
        $uploadField = $this->bulkUploadField($gridField);

        $data = ArrayData::create(array(
            'Colspan' => (count($gridField->getColumns())),
            'UploadField' => $uploadField->Field() // call ->Field() to get requirements in right order
        ));

        Requirements::javascript('colymba/gridfield-bulk-editing-tools:client/dist/js/main.js');
        Requirements::css('colymba/gridfield-bulk-editing-tools:client/dist/styles/main.css');
        Requirements::add_i18n_javascript('colymba/gridfield-bulk-editing-tools:client/lang');

        return array(
            'before' => $data->renderWith('Colymba\\BulkUpload\\BulkUploader'),
        );
    }
1213583
public function Form()
    {
        $crumbs = $this->Breadcrumbs();
        
        if ($crumbs && $crumbs->count()>=2) {
            $one_level_up = $crumbs->offsetGet($crumbs->count()-2);
        }
        
        $record_ids = "";
        $query_string = "";
        $recordList = $this->getRecordIDList();
        
        foreach ($this->getRecordIDList() as $id) {
            $record_ids .= $id . ',';
            $query_string .= "records[]={$id}&";
        }
        
        // Cut off the last 2 parts of the string
        $record_ids = substr($record_ids, 0, -1);
        $query_string = substr($query_string, 0, -1);
        
        $form = new Form(
            $this,
            'Form',
            $fields = FieldList::create(
                HiddenField::create("RecordIDs", "", $record_ids),
                TagField::create(
                    'Tags',
                    null,
                    ContactTag::get()
                )->setDescription(_t(
                    "Contacts.TagDescription",
                    "List of tags related to this contact, seperated by a comma."
                ))->setShouldLazyLoad(true)
            ),
            $actions = FieldList::create(
                FormAction::create('doAddTags', _t("Contacts.Add", 'Add'))
                    ->setAttribute('id', 'bulkEditingSaveBtn')
                    ->addExtraClass('btn btn-success')
                    ->setAttribute('data-icon', 'accept')
                    ->setUseButtonTag(true),
                    
                FormAction::create('Cancel', _t('GRIDFIELD_BULKMANAGER_EDIT_HANDLER.CANCEL_BTN_LABEL', 'Cancel'))
                    ->setAttribute('id', 'bulkEditingUpdateCancelBtn')
                    ->addExtraClass('btn btn-danger cms-panel-link')
                    ->setAttribute('data-icon', 'decline')
                    ->setAttribute('href', $one_level_up->Link)
                    ->setUseButtonTag(true)
                    ->setAttribute('src', '')
            )
        );
        
        if ($crumbs && $crumbs->count() >= 2) {
            $form->Backlink = $one_level_up->Link;
        }
        
        // override form action URL back to bulkEditForm
        // and add record ids GET var
        $form->setFormAction(
            $this->Link('Form?records[]='.implode('&', $recordList))
        );

        return $form;
    }
1300629
public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->addFieldsToTab(
            'Root.Main',
            array(
                DropdownField::create(
                    'ClassName',
                    _t('Placeable.TYPE', 'Type'),
                    singleton('RegionObject_Preset')->SubClassNames
                )->setEmptyString(_t('Placeable.NONE', 'None'))
            )
        );

        $fields->removeByName('PageTypes');
        $fields->addFieldsToTab(
            'Root.PageTypes',
            array(
                LabelField::create(
                    'PageTypesDescription',
                    _t('RegionObject_Preset.PAGETYPESDESCRIPTION', 'List of all page types that use this use this preset.')
                ),
                GridField::create(
                    'PageTypes',
                    _t('RegionObject_Preset.PAGETYPES', 'Page Types'),
                    $this->Objects(),
                    GridFieldConfig_Base::create()
                )
            )
        );

        $this->extend('updateCMSFields', $fields);
        return $fields;
    }
407733
public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->addFieldsToTab(
            "Root.Main",
            array(
                UploadField::create(
                    'Image'
                )->setFolderName('Person'),
                TextField::create(
                    'Name'
                ),
                TextField::create(
                    'Title'
                ),
                TextField::create(
                    'Email'
                ),
                TextField::create(
                    'Phone'
                ),
                TextField::create(
                    'Mobile'
                ),
                HTMLEditorField::create(
                    'Description'
                ),
            )
        );
        $this->extend('updateCMSFields', $fields);
        return $fields;
    }
1167313
public function getFieldsActivationCss()
    {
        $cssBlocks = [];
        $formConfiguration = $this->getFormObject()->getConfiguration();

        foreach ($formConfiguration->getFields() as $field) {
            $formName = $this->getFormObject()->getName();
            $fieldContainerSelector = $field->getSettings()->getFieldContainerSelector();

            $cssTree = $this->getConditionTreeForField($field)->getCssConditions();

            if (false === empty($cssTree)) {
                $fullNodeData = [];

                foreach ($cssTree as $node) {
                    $fullNodeData[] = 'form[name="' . $formName . '"]' . $node . ' ' . $fieldContainerSelector;
                }

                $nodesSelector = implode(',' . CRLF, $fullNodeData);

                $cssBlocks[] = $this->getSingleFieldCssBlock($formName, $field, $fieldContainerSelector, $nodesSelector);
            }
        }

        return implode(CRLF, $cssBlocks);
    }
47359
public function getCMSFields()
    {
        $this->beforeUpdateCMSFields(function (FieldList $fields) {
            $fields->removeByName('ElementPromos');

            $config = GridFieldConfig_RecordViewer::create();
            $fields->addFieldToTab(
                'Root.Elements',
                GridField::create(
                    'ElementPromos',
                    'Elements',
                    $this->ElementPromos(),
                    $config
                )
            );

            $fields->dataFieldByName('Image')
                ->setFolderName('Uploads/Elements/Promos');
        });

        return parent::getCMSFields();
    }
931316
protected function getNameFromParent()
    {
        $base = $this->gridField;
        $name = array();

        do {
            array_unshift($name, $base->getName());
            $base = $base->getForm();
        } while ($base && !($base instanceof Form));

        return implode('.', $name);
    }
479688
public function getFieldEditorGrid()
    {
        Requirements::javascript('silverstripe/userforms:client/dist/js/userforms-cms.js');

        $fields = $this->owner->Fields();

        $this->createInitialFormStep(true);

        $editableColumns = new GridFieldEditableColumns();
        $fieldClasses = singleton(EditableFormField::class)->getEditableFieldClasses();
        $editableColumns->setDisplayFields([
            'ClassName' => function ($record, $column, $grid) use ($fieldClasses) {
                if ($record instanceof EditableFormField) {
                    return $record->getInlineClassnameField($column, $fieldClasses);
                }
            },
            'Title' => function ($record, $column, $grid) {
                if ($record instanceof EditableFormField) {
                    return $record->getInlineTitleField($column);
                }
            }
        ]);

        $config = GridFieldConfig::create()
            ->addComponents(
                $editableColumns,
                new GridFieldButtonRow(),
                (new GridFieldAddClassesButton(EditableTextField::class))
                    ->setButtonName(_t(__CLASS__.'.ADD_FIELD', 'Add Field'))
                    ->setButtonClass('btn-primary'),
                (new GridFieldAddClassesButton(EditableFormStep::class))
                    ->setButtonName(_t(__CLASS__.'.ADD_PAGE_BREAK', 'Add Page Break'))
                    ->setButtonClass('btn-secondary'),
                (new GridFieldAddClassesButton([EditableFieldGroup::class, EditableFieldGroupEnd::class]))
                    ->setButtonName(_t(__CLASS__.'.ADD_FIELD_GROUP', 'Add Field Group'))
                    ->setButtonClass('btn-secondary'),
                $editButton = new GridFieldEditButton(),
                new GridFieldDeleteAction(),
                new GridFieldToolbarHeader(),
                new GridFieldOrderableRows('Sort'),
                new GridFieldDetailForm()
            );

        $editButton->removeExtraClass('grid-field__icon-action--hidden-on-hover');

        $fieldEditor = GridField::create(
            'Fields',
            '',
            $fields,
            $config
        )->addExtraClass('uf-field-editor');

        return $fieldEditor;
    }
781104
protected function getAdvancedConfigLinkFields()
    {
        return array(
            'tellAboutAdvancedSettings' => array(
                'type' => 'markup',
                'value' => sprintf($this->t('desc_advancedSettings'), $this->t('advanced_form_link_text'), $this->t('menu_advancedSettings')),
            ),
            'advancedSettingsLink' => array(
                'type' => 'markup',
                'value' => sprintf($this->t('button_link'), $this->t('advanced_form_link_text'), $this->shopCapabilities->getLink('advanced')),
            ),
        );
    }
663224
public static function get_new_registration_fields() {
        $fieldsneedconfirm = [];
        if (!self::is_registered()) {
            // Nothing to update if site is not registered.
            return $fieldsneedconfirm;
        }

        $cleanhuburl = clean_param(HUB_MOODLEORGHUBURL, PARAM_ALPHANUMEXT);
        $lastupdated = (int)get_config('hub', 'site_regupdateversion_' . $cleanhuburl);
        foreach (self::CONFIRM_NEW_FIELDS as $version => $fields) {
            if ($version > $lastupdated) {
                $fieldsneedconfirm = array_merge($fieldsneedconfirm, $fields);
            }
        }
        return $fieldsneedconfirm;
    }
692185
public function getFormFields(): array
    {
        $properties = $this->getProperties();

        $fields = array_diff($properties, ['id']);

        $fieldsWithTypes = [];
        foreach ($fields as $field) {
            $fieldsWithTypes[$field] = null;
        }

        return $fieldsWithTypes;
    }
133568
protected function getRulesConfig()
    {
        if (!$this->getFormParent()) {
            return null;
        }
        $formFields = $this->getFormParent()->Fields();

        $config = GridFieldConfig::create()
            ->addComponents(
                new GridFieldButtonRow('before'),
                new GridFieldToolbarHeader(),
                new GridFieldAddNewInlineButton(),
                new GridFieldDeleteAction(),
                $columns = new GridFieldEditableColumns()
            );

        $columns->setDisplayFields(array(
            'ConditionFieldID' => function ($record, $column, $grid) use ($formFields) {
                return DropdownField::create($column, false, $formFields->map('ID', 'Title'));
            },
            'ConditionOption' => function ($record, $column, $grid) {
                $options = EmailRecipientCondition::config()->condition_options;
                return DropdownField::create($column, false, $options);
            },
            'ConditionValue' => function ($record, $column, $grid) {
                return TextField::create($column);
            }
        ));

        return $config;
    }
121401
public function getCMSFields()
    {
        $fields = $this->scaffoldFormFields(
            array(
                // Don't allow has_many/many_many relationship editing before the record is first saved
                'includeRelations' => ($this->ID > 0),
                'tabbed' => true,
                'ajaxSafe' => true
            )
        );
        $fields->removeByName('HasMain');
        $fields->addFieldsToTab(
            'Root.Main',
            array(
                TextField::create(
                    'Title',
                    _t('PlaceablePageType.TITLE', 'Title')
                )->setMaxLength(17),
                TextField::create(
                    'Description',
                    _t('PlaceablePageType.DESCRIPTION', 'Description')
                ),
                UploadField::create(
                    'Icon',
                    _t('PlaceablePageType.ICON', 'Icon')
                )
            )
        );

        $fields->addFieldToTab(
            'Root.Pages',
            GridField::create(
                'Pages',
                _t('PlaceablePageType.PAGES', 'Pages'),
                $this->Pages()
            )
        );

        $fields->addFieldToTab(
            'Root.Regions',
            GridField::create(
                'Regions',
                _t('PlaceablePageType.SECTIONS', 'Regions'),
                $this->Regions(),
                GridFieldConfig_MultiClass::create(
                    $this->Regions(),
                    singleton('RegionObject_Preset')->SubClassNames
                )
            )
        );
        return $fields;
    }
201752
protected function getDisplayRuleFields()
    {
        // Check display rules
        if ($this->Required) {
            return FieldList::create(
                LiteralField::create(
                    'DisplayRulesNotEnabled',
                    '<div class="alert alert-warning">' . _t(
                        __CLASS__.'.DISPLAY_RULES_DISABLED',
                        'Display rules are not enabled for required fields. Please uncheck "Is this field Required?" under "Validation" to re-enable.'
                    ) . '</div>'
                )
            );
        }

        $allowedClasses = array_keys($this->getEditableFieldClasses(false));
        $editableColumns = new GridFieldEditableColumns();
        $editableColumns->setDisplayFields([
            'ConditionFieldID' => function ($record, $column, $grid) use ($allowedClasses) {
                    return DropdownField::create($column, '', EditableFormField::get()->filter([
                            'ParentID' => $this->ParentID,
                            'ClassName' => $allowedClasses,
                        ])->exclude([
                            'ID' => $this->ID,
                        ])->map('ID', 'Title'));
            },
            'ConditionOption' => function ($record, $column, $grid) {
                $options = Config::inst()->get(EditableCustomRule::class, 'condition_options');

                return DropdownField::create($column, '', $options);
            },
            'FieldValue' => function ($record, $column, $grid) {
                return TextField::create($column);
            }
        ]);

        // Custom rules
        $customRulesConfig = GridFieldConfig::create()
            ->addComponents(
                $editableColumns,
                new GridFieldButtonRow(),
                new GridFieldToolbarHeader(),
                new GridFieldAddNewInlineButton(),
                new GridFieldDeleteAction()
            );

        return new FieldList(
            DropdownField::create(
                'ShowOnLoad',
                _t(__CLASS__.'.INITIALVISIBILITY', 'Initial visibility'),
                [
                    1 => 'Show',
                    0 => 'Hide',
                ]
            ),
            DropdownField::create(
                'DisplayRulesConjunction',
                _t(__CLASS__.'.DISPLAYIF', 'Toggle visibility when'),
                [
                    'Or'  => _t('SilverStripe\\UserForms\\Model\\UserDefinedForm.SENDIFOR', 'Any conditions are true'),
                    'And' => _t('SilverStripe\\UserForms\\Model\\UserDefinedForm.SENDIFAND', 'All conditions are true'),
                ]
            ),
            GridField::create(
                'DisplayRules',
                _t(__CLASS__.'.CUSTOMRULES', 'Custom Rules'),
                $this->DisplayRules(),
                $customRulesConfig
            )
        );
    }
208335
protected function getDefaultFormValues()
    {
        $defaultValues = $this->acumulusConfig->getCredentials()
             + $this->acumulusConfig->getShopSettings()
             + $this->acumulusConfig->getShopEventSettings()
             + $this->acumulusConfig->getCustomerSettings()
             + $this->acumulusConfig->getInvoiceSettings()
             + $this->acumulusConfig->getEmailAsPdfSettings()
             + $this->acumulusConfig->getPluginSettings();
        return $defaultValues;
    }