function getCMSFields()
 {
     $fields = new FieldList();
     $fields = parent::getCMSFields();
     $authors = $this->Authors();
     $sortString = "";
     if ($authors) {
         $authorsArray = $authors->map("ID", "ScreenName")->toArray();
         $sortStringEnd = "";
         if (is_array($authorsArray) && count($authorsArray)) {
             foreach ($authorsArray as $ID => $ScreenName) {
                 $sortString .= "IF(Member.ID = {$ID}, 1, ";
                 $sortStringEnd .= ")";
             }
             $sortString .= " 0" . $sortStringEnd . " DESC, \"Email\"";
         }
     }
     $fields->addFieldToTab('Root.Software', new TextField('Code', 'Code (this should be the same as the recommended folder name)'));
     $fields->addFieldToTab('Root.Software', new TextareaField('MetaDescription', 'Three sentence introduction'));
     $fields->addFieldToTab('Root.Software', new TextField('MainURL', 'Link to home page for the module - e.g. http://www.mymodule.com/'));
     $fields->addFieldToTab('Root.Software', new TextField('ReadMeURL', 'Link to read me file - e.g. http://www.mymodule.com/readme.md'));
     $fields->addFieldToTab('Root.Software', new TextField('DemoURL', 'Link to a demo - e.g. http://demo.mymodule.com/'));
     $fields->addFieldToTab('Root.Software', new TextField('SvnURL', 'Link to the SVN URL - allowing you to checkout trunk or latest version directly - e.g. http://svn.mymodule.com/svn/trunk/'));
     $fields->addFieldToTab('Root.Software', new TextField('GitURL', 'Link to the GIT URL - e.g. https://github.com/my-git-username/silverstripe-my-module'));
     $fields->addFieldToTab('Root.Software', new TextField('OtherURL', 'Link to other repository or download URL - e.g. http://www.mymodule.com/downloads/'));
     $fields->addFieldToTab('Root.Software', new ReadonlyField('ImportID', 'Import Identifier'));
     $fields->addFieldToTab('Root.Software', new HeaderField("AuthorsHeading", "Authors"));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName("Weight");
     $fields->removeByName("PackSize");
     $fields->addFieldToTab("Root.Settings", UploadField::create("File")->setFolderName("downloadable"));
     return $fields;
 }
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab("Root.Components", $this->getIncludedProductsFormField());
     $fields->replaceField("Price", new ReadOnlyField("Price", "Full Price"));
     $fields->addFieldToTab("Root.Details", new NumericField("NewPrice", "New Price"), "Price");
     $fields->addFieldToTab("Root.Details", new ReadOnlyField("Savings", "Savings", $this->getPrice() - $this->NewPrice), "Price");
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab("Root.Children", $grid = GridField::create("Products", null, $this->ChildProducts()));
     $config = GridfieldConfig_RelationEditor::create();
     $grid->setConfig($config);
     $config->getComponentByType("GridFieldDataColumns")->setDisplayFields(array("CMSThumbnail" => "Thumbnail", "ClassName" => "Product", "Title" => "Title", "StockID" => "StockID", "Price" => "Price", "Disabled" => "Disabled"));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab("Root.Pricing", new OptionsetField("VariableAmount", "Price", array(0 => "Fixed", 1 => "Allow customer to choose")), "BasePrice");
     $fields->addFieldsToTab("Root.Pricing", array($minimumamount = new TextField("MinimumAmount", "Minimum Amount")));
     $fields->removeByName("CostPrice");
     $fields->removeByName("Variations");
     $fields->removeByName("Model");
     return $fields;
 }
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $exampleLink = Director::absoluteURL($this->Link("setamount")) . "/123.45";
     $exampleLinkExplanation = sprintf(_t("AnyPriceProductPage.EXPLANATION", '<br /><br /><h5>How to preset the amount?</h5><p>The link <a href="%1$s">%1$s</a> will pre-set the amount to 123.45. You can use this link (and vary the amount as needed) to cutomers to receive payments.</p>.'), $exampleLink);
     $fields->addFieldsToTab("Root.AddAmountForm", array(new TextField("AmountFieldLabel", "Amount Field Label (what amount would you like to pay?)"), new TextField("ActionFieldLabel", "Action Field Label (e.g. pay entered amount now)"), new NumericField("MinimumAmount", "Minimum Amount"), new NumericField("MaximumAmount", "Maximum Amount"), new TextField("RecommendedAmounts", "Hinted amounts, separated by commas (e.g. <i>5,10,100</i>)"), new LiteralField("ExampleLinkExplanation", $exampleLinkExplanation)));
     // Standard product detail fields
     $fields->removeFieldsFromTab('Root.Details', array('Weight', 'Price', 'Model'));
     // Flags for this product which affect it's behaviour on the site
     $fields->removeFieldsFromTab('Root.Details', array('FeaturedProduct'));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName("Root.Customisations");
     $fields->addFieldToTab('Root', new Tab('Customisations', 'Customisations'), 'Settings');
     // Deal with customisations
     $add_button = new GridFieldAddNewButton('toolbar-header-left');
     $add_button->setButtonName('Add Customisation');
     $custom_config = GridFieldConfig::create()->addComponents(new GridFieldToolbarHeader(), $add_button, new GridFieldSortableHeader(), new GridFieldDataColumns(), new GridFieldPaginator(20), new GridFieldEditButton(), new GridFieldDeleteAction(), new GridFieldDetailForm(), new GridFieldOrderableRows('Sort'));
     $custom_field = GridField::create('Customisations', '', $this->Customisations(), $custom_config);
     $fields->addFieldToTab('Root.Customisations', $custom_field);
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName("Root.Customisations");
     // Only add fields if the object exists
     if ($this->ID) {
         $fields->addFieldToTab('Root', new Tab('Customisations', 'Customisations'), 'Settings');
         // Deal with customisations
         $add_button = new GridFieldAddNewButton('toolbar-header-left');
         $add_button->setButtonName(_t("CustomisableProduct.AddCustomisation", "Add Customisation"));
         $custom_config = GridFieldConfig::create()->addComponents(new GridFieldToolbarHeader(), $add_button, new GridFieldSortableHeader(), new GridFieldDataColumns(), new GridFieldPaginator(20), new GridFieldEditButton(), new GridFieldDeleteAction(), new GridFieldDetailForm(), new GridFieldOrderableRows('Sort'));
         $fields->addFieldsToTab('Root.Customisations', array(DropdownField::create("CustomisationListID", _t("CustomisableProduct.UseCustomisationList", "Use a Customisation List"), ProductCustomisationList::get()->map())->setEmptyString(_t("CustomisableProduct.SelectList", "Select List")), GridField::create('Customisations', '', $this->Customisations(), $custom_config)));
     }
     return $fields;
 }
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('AlsoShowHere');
     $fields->replaceField('Content', new TextareaField('Content', _t('MerchantProduct.CONTENT', 'Content')));
     $categories = DataObject::get('Category');
     if ($categories) {
         $categories = $categories->map('ID', 'Name');
         $fields->addFieldToTab('Root.Content.Main', new CheckboxSetField('Categories', _t('MerchantProduct.CATEGORIES', 'Categories'), $categories));
     }
     if ($this->ID) {
         $parent = $this->Parent();
         $locations = $parent->Locations();
         if ($locations) {
             $fields->addFieldToTab('Root.Content.Main', new CheckboxSetField('ProductGroups', _t('MerchantProduct.PRODUCTGROUPS', 'Locations'), $locations->map("ID", "Title")));
         }
     }
     return $fields;
 }
 /**
  * Standard SS Method
  */
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.Details', new UploadField('DownloadFiles', _t('ElectronicDownloadProduct.DOWNLOADFILES', 'Download Files')));
     return $fields;
 }