public function getSettingsFields()
 {
     $dataTypes = $this->getAvailableTypes();
     $reportable = $this->getReportableFields();
     $converted = array();
     foreach ($reportable as $k => $v) {
         $converted[$this->dottedFieldToUnique($k)] = $v;
     }
     $dataTypes = array_merge(array('' => ''), $dataTypes);
     $types = new MultiValueDropdownField('DataTypes', _t('AdvancedReport.DATA_TYPES', 'Data types'), $dataTypes);
     $fieldsGroup = new FieldGroup('Fields', $reportFieldsSelect = new MultiValueDropdownField('ReportFields', _t('AdvancedReport.REPORT_FIELDS', 'Report Fields'), $reportable));
     $fieldsGroup->push(new MultiValueTextField('ReportHeaders', _t('AdvancedReport.HEADERS', 'Header labels')));
     $fieldsGroup->addExtraClass('reportMultiField');
     $reportFieldsSelect->addExtraClass('reportFieldsSelection');
     $fieldsGroup->setName('FieldsGroup');
     $fieldsGroup->addExtraClass('advanced-report-fields dropdown');
     $conditions = new FieldGroup('Conditions', new MultiValueDropdownField('ConditionFields', _t('AdvancedReport.CONDITION_FIELDS', 'Condition Fields'), $reportable), new MultiValueDropdownField('ConditionOps', _t('AdvancedReport.CONDITION_OPERATIONS', 'Op'), $this->config()->allowed_conditions), new MultiValueTextField('ConditionValues', _t('AdvancedReport.CONDITION_VALUES', 'Value')));
     $conditions->setName('ConditionsGroup');
     $conditions->addExtraClass('dropdown');
     // define the group for the sort field
     $sortGroup = new FieldGroup('Sort', new MultiValueDropdownField('SortBy', _t('AdvancedReport.SORTED_BY', 'Sorted By'), $reportable), new MultiValueDropdownField('SortDir', _t('AdvancedReport.SORT_DIRECTION', 'Sort Direction'), array('ASC' => _t('AdvancedReport.ASC', 'Ascending'), 'DESC' => _t('AdvancedReport.DESC', 'Descending'))));
     $sortGroup->setName('SortGroup');
     $sortGroup->addExtraClass('dropdown');
     // build a list of the formatters
     $formatters = ClassInfo::implementorsOf('ReportFieldFormatter');
     $fmtrs = array();
     foreach ($formatters as $formatterClass) {
         $formatter = new $formatterClass();
         $fmtrs[$formatterClass] = $formatter->label();
     }
     // define the group for the custom field formatters
     $fieldFormattingGroup = new FieldGroup(_t('AdvancedReport.FORMAT_FIELDS', 'Custom field formatting'), new MultiValueDropdownField('FieldFormattingField', _t('AdvancedReport.FIELDFORMATTING', 'Field'), $converted), new MultiValueDropdownField('FieldFormattingFormatter', _t('AdvancedReport.FIELDFORMATTINGFORMATTER', 'Formatter'), $fmtrs));
     $fieldFormattingGroup->setName('FieldFormattingGroup');
     $fieldFormattingGroup->addExtraClass('dropdown');
     // assemble the fieldlist
     $fields = new FieldList(new TextField('Title', _t('AdvancedReport.TITLE', 'Title')), new TextareaField('Description', _t('AdvancedReport.DESCRIPTION', 'Description')), $types, $fieldsGroup, $conditions, new KeyValueField('ReportParams', _t('AdvancedReport.REPORT_PARAMETERS', 'Default report parameters')), $sortGroup, new MultiValueDropdownField('NumericSort', _t('AdvancedReport.SORT_NUMERICALLY', 'Sort these fields numerically'), $reportable), DropdownField::create('PaginateBy')->setTitle(_t('AdvancedReport.PAGINATE_BY', 'Paginate By'))->setSource($reportable)->setHasEmptyDefault(true), TextField::create('PageHeader')->setTitle(_t('AdvancedReport.HEADER_TEXT', 'Header text'))->setDescription(_t('AdvancedReport.USE_NAME_FOR_PAGE_NAME', 'use $name for the page name'))->setValue('$name'), new MultiValueDropdownField('AddInRows', _t('AdvancedReport.ADD_IN_ROWS', 'Add these columns for each row'), $converted), new MultiValueDropdownField('AddCols', _t('AdvancedReport.ADD_IN_ROWS', 'Provide totals for these columns'), $converted), $fieldFormattingGroup, new MultiValueDropdownField('ClearColumns', _t('AdvancedReport.CLEARED_COLS', '"Cleared" columns'), $converted));
     if ($this->config()->allow_grouping) {
         // GroupBy
         $groupingGroup = new FieldGroup('Grouping', new MultiValueDropdownField('GroupBy', _t('AdvancedReport.GROUPBY_FIELDS', 'Group by fields'), $reportable), new MultiValueDropdownField('SumFields', _t('AdvancedReport.SUM_FIELDS', 'SUM fields'), $reportable));
         $groupingGroup->addExtraClass('dropdown');
         $fields->insertAfter($groupingGroup, 'ConditionsGroup');
     }
     if ($this->hasMethod('updateReportFields')) {
         Deprecation::notice('3.0', 'The updateReportFields method is deprecated, instead overload getSettingsFields');
         $this->updateReportFields($fields);
     }
     $this->extend('updateSettingsFields', $fields);
     return $fields;
 }