public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->replaceField('URLSegment', new ReadonlyField('URLSegment', _t('Product.URLSEGMENT', 'URL segment for product')));
     $fields->removeByName('Categories');
     $fields->addFieldToTab('Root.Main', new TreeMultiselectField('Categories', _t('Product.CATEGORIES', 'Categories this product belongs to'), 'ProductCategoryPage'), 'Content');
     $fields->removeByName('Variations');
     if ($this->ID) {
         $summaryFields = ProductVariation::$summary_fields;
         $fieldTypes = ProductVariation::$field_types;
         $variationsTable = new TableField('Variations', 'ProductVariation', $summaryFields, $fieldTypes, 'ProductID', $this->ID);
         $variationsTable->setExtraData(array('ProductID' => $this->ID));
         $fields->addFieldToTab('Root.Main', new HeaderField(_t('Product.PRODVARIATIONS', 'Product variations'), 3), 'Content');
         $fields->addFieldToTab('Root.Main', $variationsTable, 'Content');
     }
     return $fields;
 }
 private function getExceptionsTable()
 {
     $table = new TableField('Exceptions', 'RecurringException', array('ExceptionDate' => _t('CalendarEvent.DATE', 'Date')), array('ExceptionDate' => 'DatePickerField'), null, "CalendarEventID = {$this->ID}");
     $table->setExtraData(array('CalendarEventID' => $this->ID));
     return $table;
 }
예제 #3
0
 public function getDateTimeTable($eventID)
 {
     $this->extendTable();
     $name = 'DateTimes';
     $titles = $this->getTableTitles();
     $filter = "`CalendarDateTime`.EventID = {$eventID}";
     if ($this->isComplex()) {
         $fields = $this->getPopupFields();
         $fields->push(new HiddenField('EventID', '', $eventID));
         $fields->push(new HiddenField('is_announcement', '', '0'));
         $obj = class_exists("DataObjectManager") ? "DataObjectManager" : "ComplexTableField";
         $table = Object::create($obj, $this->getEventObject(), $name, get_class($this), $titles, $fields, $filter);
         $table->setAddTitle(_t("CalendarDateTime.ADATE", "a Date"));
     } else {
         $fields = $this->getTableFields();
         $table = new TableField($name, get_class($this), $titles, $fields, null, $filter);
         $table->setExtraData(array('EventID' => $eventID));
         //$table->showAddRow = false;
     }
     return $table;
 }