/**
  * stardard SS metbod
  * @return FieldList
  */
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName("Sort");
     $fields->removeByName("GroupSort");
     $fields->replaceField("Name", $nameField = new ReadonlyField("Name"));
     $nameField->dontEscape = true;
     $fields->removeByName("TableValue");
     $fields->removeByName("CalculatedTotal");
     $fields->removeByName("HasBeenRemoved");
     $fields->addFieldToTab("Root", new Tab("Debug", new ReadonlyField("CreatedShown", "Created", $this->Created), new ReadonlyField("LastEditedShown", "Last Edited", $this->LastEdited), new ReadonlyField("TableValueShown", "Table Value", $this->TableValue), new ReadonlyField("CalculatedTotal", "Raw Value", $this->CalculatedTotal)));
     $fields->addFieldToTab("Root.Main", new CheckboxField("HasBeenRemoved", "Has been removed"));
     $fields->removeByName("OrderAttribute_GroupID");
     //OrderID Field
     if ($this->OrderID && $this->exists()) {
         $fields->replaceField("OrderID", $fields->dataFieldByName("OrderID")->performReadonlyTransformation());
     } else {
         $fields->replaceField("OrderID", new NumericField("OrderID"));
     }
     //ClassName Field
     $availableModifiers = EcommerceConfig::get("Order", "modifiers");
     if ($this->exists()) {
         $fields->addFieldToTab("Root.Main", new LiteralField("MyClassName", "<h2>" . $this->singular_name() . "</h2>"), "Name");
     } else {
         $ecommerceClassNameOrTypeDropdownField = EcommerceClassNameOrTypeDropdownField::create("ClassName", "Type", "OrderModifier", $availableModifiers);
         $fields->addFieldToTab("Root.Main", $ecommerceClassNameOrTypeDropdownField, "Name");
     }
     return $fields;
 }
 /**
  * Determine which properties on the DataObject are
  * searchable, and map them to their default {@link FormField}
  * representations. Used for scaffolding a searchform for {@link ModelAdmin}.
  *
  * Some additional logic is included for switching field labels, based on
  * how generic or specific the field type is.
  *
  * Used by {@link SearchContext}.
  *
  * @param array $_params
  * 	'fieldClasses': Associative array of field names as keys and FormField classes as values
  * 	'restrictFields': Numeric array of a field name whitelist
  * @return FieldList
  */
 public function scaffoldSearchFields($_params = null)
 {
     $fields = parent::scaffoldSearchFields($_params);
     $fields->replaceField("OrderID", new NumericField("OrderID", "Order Number"));
     $availableLogs = EcommerceConfig::get("OrderStatusLog", "available_log_classes_array");
     $availableLogs = array_merge($availableLogs, array(EcommerceConfig::get("OrderStatusLog", "order_status_log_class_used_for_submitting_order")));
     $ecommerceClassNameOrTypeDropdownField = EcommerceClassNameOrTypeDropdownField::create("ClassName", "Type", "OrderStatusLog", $availableLogs);
     $ecommerceClassNameOrTypeDropdownField->setIncludeBaseClass(true);
     $fields->replaceField("ClassName", $ecommerceClassNameOrTypeDropdownField);
     return $fields;
 }