Exemplo n.º 1
0
 /**
  * Set CMS fields for viewing this Order in the CMS
  * Cannot change status of an order in the CMS
  * 
  * @see DataObject::getCMSFields()
  */
 public function getCMSFields()
 {
     $fields = new FieldList();
     $fields->push(new TabSet('Root', Tab::create('Order')));
     //Override this in updateOrderCMSFields to change the order template in the CMS
     $htmlSummary = $this->customise(array('MemberEmail' => $this->Member()->Email))->renderWith('OrderAdmin');
     $fields->addFieldToTab('Root.Order', new LiteralField('MainDetails', $htmlSummary));
     //Updates
     $listField = new GridField('Updates', 'Updates', $this->Updates(), GridFieldConfig_Basic::create());
     $fields->addFieldToTab('Root.Updates', $listField);
     //Ability to edit fields added to CMS here
     $this->extend('updateOrderCMSFields', $fields);
     return $fields;
 }
Exemplo n.º 2
0
 function getCMSFields()
 {
     $fields = new FieldList($rootTab = new TabSet('Root', $tabMain = new Tab('Attribute', TextField::create('Title')->setRightTitle('For displaying on the product page'), TextField::create('Description')->setRightTitle('For displaying on the order'), HiddenField::create('ProductID'))));
     if ($this->ID) {
         $fields->addFieldToTab('Root.Options', GridField::create('Options', 'Options', $this->Options(), GridFieldConfig_Basic::create()));
     }
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }