Example #1
0
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $HSEAScore = GroupedList::create(Score::get()->sort('ClassName'));
     $fields->addFieldToTab("Root.Main", new OptionSetField('Status', 'Status', singleton('Project')->dbObject('Status')->enumValues()));
     $fields->addFieldToTab("Root.Main", new CheckboxsetField('Scores', 'Check List', $HSEAScore));
     $impact = GroupedList::create(Impact::get()->sort('Title'));
     $fields->addFieldToTab("Root.Main", new CheckboxsetField('Impacts', 'Impact', $impact));
     //$FinScore= DataObject::get('Score' ,"ClassName = 'Financial'");
     //		$fields->addFieldToTab("Root.Main", new CheckboxsetField('Scores', 'Financial', $FinScore));
     //		$ServScore= DataObject::get('Score', "ClassName = 'Service'");
     //		$fields->addFieldToTab("Root.Main", new CheckboxsetField('Scores', 'Service', $ServScore));
     /*$gridFieldConfig = GridFieldConfig::create()->addComponents(
     			new GridFieldToolbarHeader(),
                 new GridFieldAddNewButton('toolbar-header-right'),
     			new GridFieldSortableHeader(),
     			new GridFieldDataColumns(),
     			new GridFieldPaginator(15),
     			new GridFieldEditButton(),
     			new GridFieldDeleteAction(),
     			new GridFieldDetailForm()
     		);
     		$gridfield = new GridField("Tasks", "Tasks", $this->Tasks(), $gridFieldConfig);
     		$fields->addFieldToTab('Root.Tasks', $gridfield);*/
     $fields->addFieldToTab("Root.Main", $dateField = new DateField("DueDate", "Date Due"));
     $dateField->setConfig('showcalendar', true);
     $dateField->setConfig('dateformat', 'dd/MM/YYYY');
     return $fields;
 }
    public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $cssFiles = new UploadField('CustomCSSFiles', _t('UserTemplatesExtension.CustomCSSFiles', "Custom CSS Files"));
        $jsFiles = new UploadField('CustomJSFiles', _t('UserTemplatesExtension.CustomJSFiles', "Custom JS Files"));
        $cssFiles->setFolderName(self::$css_folder);
        $jsFiles->setFolderName(self::$js_folder);
        $fields->removeByName('CustomCSSFiles');
        $fields->removeByName('CustomJSFiles');
        $templates = $this->fileBasedTemplates();
        if (count($templates)) {
            $fields->addFieldToTab('Root.Main', $dd = new DropdownField('ContentFile', _t('UserTemplatesExtension.CONTENT_FILE', 'File containing template'), $templates));
            $dd->setRightTitle('If selected, any Content set above will be ignored');
        } else {
            $fields->removeByName('ContentFile');
        }
        $fields->push($strict = CheckboxField::create('StrictActions', _t('UserTemplates.STRICT_ACTIONS', 'Require actions to be explicitly overridden')));
        $text = <<<DOC
   When applied to a page type that has sub-actions, an action template will be used ONLY if the action is listed below, and this main
\t   template will only be used for the 'index' action. If this is not checked, then this template will be used for ALL actions
\t   in the page it is applied to.
DOC;
        $strict->setRightTitle(_t('UserTemplates.STRICT_HELP', $text));
        $templates = DataList::create('UserTemplate')->filter(array('ID:not' => $this->ID));
        if ($templates->count()) {
            $templates = $templates->map();
            $fields->addFieldToTab('Root.Main', $kv = new KeyValueField('ActionTemplates', _t('UserTemplates.ACTION_TEMPLATES', 'Action specific templates'), array(), $templates));
            $kv->setRightTitle(_t('UserTemplates.ACTION_TEMPLATES_HELP', 'Specify an action name and select another user defined template to handle a specific action. Only used for Layout templates'));
        }
        $fields->addFieldToTab('Root.Main', $cssFiles);
        $fields->addFieldToTab('Root.Main', $jsFiles);
        return $fields;
    }
Example #3
0
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // the date field is added in a bit more complex manner so it can have the dropdown date picker
     $EventStartDate = new DateField('EventStartDate', 'First Day of Event');
     $EventStartDate->setConfig('showcalendar', true);
     $EventStartDate->setConfig('showdropdown', true);
     $fields->addFieldToTab('Root.Main', $EventStartDate, 'Content');
     // same things for the event end date
     $EventEndDate = new DateField('EventEndDate', 'Last Day of Event');
     $EventEndDate->setConfig('showcalendar', true);
     $EventEndDate->setConfig('showdropdown', true);
     $fields->addFieldToTab('Root.Main', $EventEndDate, 'Content');
     $fields->addFieldToTab('Root.Main', new TextField('EventLink', 'Event Button Link (URL)'), 'Content');
     $fields->addFieldToTab('Root.Main', new TextField('EventLinkLabel', 'Event Button Label'), 'Content');
     $fields->addFieldToTab('Root.Main', new TextField('EventLocation', 'Event Location'), 'Content');
     $fields->addFieldToTab('Root.Main', new TextField('EventSponsor', 'Event Sponsor'), 'Content');
     $fields->addFieldToTab('Root.Main', new TextField('EventSponsorLogoUrl', 'URL of the Event Sponsor Logo'), 'Content');
     $fields->addFieldToTab('Root.Main', new CheckboxField('IsSummit', 'Official OpenStack Summit Event'), 'Content');
     // remove unneeded fields
     $fields->removeFieldFromTab("Root.Main", "MenuTitle");
     // rename fields
     $fields->renameField("Content", "Event Page Content");
     $fields->renameField("Title", "Event Title");
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
     Requirements::javascript('eventmanagement/javascript/event-ticket-cms.js');
     $fields->removeByName('EventID');
     $fields->removeByName('StartType');
     $fields->removeByName('StartDate');
     $fields->removeByName('StartDays');
     $fields->removeByName('StartHours');
     $fields->removeByName('StartMins');
     $fields->removeByName('EndType');
     $fields->removeByName('EndDate');
     $fields->removeByName('EndDays');
     $fields->removeByName('EndHours');
     $fields->removeByName('EndMins');
     if (class_exists('Payment')) {
         $fields->insertBefore(new OptionSetField('Type', 'Ticket type', array('Free' => 'Free ticket', 'Price' => 'Fixed price ticket')), 'Price');
     } else {
         $fields->removeByName('Type');
         $fields->removeByName('Price');
     }
     foreach (array('Start', 'End') as $type) {
         $fields->addFieldsToTab('Root.Main', array(new OptionSetField("{$type}Type", "{$type} sales at", array('Date' => 'A specific date and time', 'TimeBefore' => 'A time before the event starts')), $dateTime = new DatetimeField("{$type}Date", ''), $before = new FieldGroup("{$type}Offset", new NumericField("{$type}Days", 'Days'), new NumericField("{$type}Hours", 'Hours'), new NumericField("{$type}Mins", 'Minutes'))));
         $before->setName("{$type}Offset");
         $before->setTitle(' ');
         $dateTime->getDateField()->setConfig('showcalendar', true);
         $dateTime->getTimeField()->setConfig('showdropdown', true);
     }
     $fields->addFieldsToTab('Root.Advanced', array(new TextareaField('Description', 'Description'), new NumericField('MinTickets', 'Minimum tickets per order'), new NumericField('MaxTickets', 'Maximum tickets per order')));
     return $fields;
 }
Example #5
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeFieldsFromTab('Root.Main', array('ServicesPageID', 'SortOrder'));
     $fields->dataFieldByName('Content')->setRows(20);
     return $fields;
 }
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // create a dedicated tab for open layers
     $fields->addFieldsToTab("Root.Main", array(new LiteralField("StyleMapHelp", "<h2>Style Map Help</h2>"), new LiteralField("MapLabel1", "Please click <a href='map-style-help?stage=Stage' target='_help'>here<a/> for more help.")));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName("AddressID");
     $fields->addFieldToTab("Root.Main", HasOneButtonField::create("Address", "Address", $this));
     return $fields;
 }
    function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->removeByName("Title");
        $fields->addFieldToTab("Root.Main", new HeaderField($name = "TitleHeader", "search for: '" . $this->Title . "'", 1), "RedirectTo");
        $fields->removeByName("Recommendations");
        if (!$this->RedirectTo) {
            $source = SiteTree::get()->filter(array("ShowInSearch" => 1))->exclude(array("ClassName" => "SearchPlusPage"));
            $sourceArray = $sourc->map()->toArray();
            //$fields->addFieldToTab("Root.Main", new MultiSelectField($name = "Recommendations", $title = "Recommendations", $sourceArray));
            $fields->addFieldToTab("Root.Main", new TreeMultiselectField($name = "Recommendations", $title = "Recommendations", "SiteTree"));
        } else {
            $fields->addFieldToTab("Root.Main", new LiteralField($name = "Recommendations", '<p>This search phrase cannot have recommendations, because it redirects to <i>' . $this->RedirectTo . '</i></p>'));
        }
        $page = SearchPlusPage::get()->first();
        if (!$page) {
            user_error("Make sure to create a SearchPlusPage to make proper use of this module", E_USER_NOTICE);
        } else {
            $fields->addFieldToTab("Root.Main", new LiteralField($name = "BackLinks", $content = '<p>
						Review a graph of all <a href="' . $page->Link() . 'popularsearchwords/100/10/">Popular Search Phrases</a> OR
						<a href="' . $page->Link() . 'results/?Search=' . urlencode($this->Title) . '&amp;action_results=Search&amp;redirect=1">try this search</a>.
					</p>'));
        }
        return $fields;
    }
 /**
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->push(new TextField('OPColor', 'OP Color'));
     $fields->push(new TextField('CSSColor', 'CSS Color'));
     return $fields;
 }
 /**
  * Add the Meta tag CMS fields
  *
  * @since version 1.0.0
  *
  * @return object Return the current page fields
  **/
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('Main');
     $fields->addFieldsToTab('Root.SEO', [HeaderField::create('Meta Tag'), DropdownField::create('Type', 'Tag type', $this->tagTypes()), TextField::create('Name'), TextField::create('Value'), HiddenField::create('PageID')]);
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName(['CaseStudyHolderID']);
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->replaceField("From", $from = new DateField("From", "Valid From - add any date and time"));
     $fields->replaceField("Until", $until = new DateField("Until", "Valid Until - add any date and time"));
     $fields->replaceField("NewPrice", new CurrencyField("NewPrice", "PRICE (OPTION 1 / 3) - only enter if there is a set new price independent of the 'standard' price."));
     $fields->replaceField("Percentage", new NumericField("Percentage", "PERCENTAGE (OPTIONAL 2/ 3) discount from 0 (0% discount) to 100 (100% discount)."));
     $fields->replaceField("Reduction", new CurrencyField("Reduction", "REDUCTION (OPTION 3 /3 ) - e.g. if you enter 2.00 then the new price will be the standard product price minus 2."));
     if (!$this->ID) {
         $fields->addFieldToTab("Root.Main", new LiteralField("SaveFirst", "<p>Please save first - and then select security groups / countries</p>"));
         $fields->removeByName("NoLongerValid");
     }
     if ($groups = Group::get()->count()) {
         $groups = Group::get();
         $fields->replaceField("Groups", new CheckboxSetField("Groups", "Who", $groups->map()->toArray()));
     } else {
         $fields->removeByName("Groups");
     }
     if ($ecommerceCountries = EcommerceCountry::get()) {
         $fields->replaceField("EcommerceCountries", new CheckboxSetField("EcommerceCountries", "Where", $ecommerceCountries->map()->toArray()));
     } else {
         $fields->removeByName("EcommerceCountries");
     }
     if (DiscountCouponOption::get()->count()) {
         $fields->replaceField("DiscountCouponOptions", new CheckboxSetField("DiscountCouponOptions", "Discount Coupons", DiscountCouponOption::get()->map()->toArray()));
     } else {
         $fields->removeByName("DiscountCouponOptions");
     }
     $from->setConfig('showcalendar', true);
     $until->setConfig('showcalendar', true);
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->dataFieldByName('Link')->setRightTitle('Fully qualified (http://www.google.com) or internal (section/page)');
     $fields->dataFieldByName('isLinkExternal')->setTitle('Open link in new window?');
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.Main', new HeaderField('ProfileSectionTitle', _t('MemberProfiles.PROFILESECTION', 'Profile Section')), 'CustomTitle');
     $fields->addFieldToTab('Root.Main', new ReadonlyField('DefaultTitle', _t('MemberProfiles.SECTIONTYPE', 'Section type')), 'CustomTitle');
     return $fields;
 }
Example #15
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab("Root.Main", $this->getCountryField(), 'State');
     $fields->removeByName("MemberID");
     return $fields;
 }
Example #16
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.Main', DropdownField::create('VideoID', 'Select video', EmbeddedObject::get()->map("ID", "Title")));
     $fields->addFieldToTab('Root.Main', EmbeddedObjectField::create('AddVideo', 'Video from oEmbed URL'));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('ProviderClass');
     $fields->removeByName('ProviderSettings');
     $fields->removeByName('Sent');
     $fields->removeByName('SentAt');
     $fields->removeByName('RecipientMembers');
     $fields->removeByName('RecipientGroups');
     $fields->removeByName('SendJobID');
     if ($this->Sent) {
         $fields->insertBefore(new LiteralField('SentAsMessage', sprintf('<p class="message">%s</p>', _t('Push.SENTAT', 'This notification was sent at {at}', array('at' => $this->obj('SentAt')->Nice())))), 'Title');
     }
     if ($this->Sent || !interface_exists('QueuedJob')) {
         $fields->removeByName('ScheduledAt');
     } else {
         $fields->dataFieldByName('ScheduledAt')->getDateField()->setConfig('showcalendar', true);
     }
     $fields->dataFieldByName('Content')->setDescription(_t('Push.USEDMAINBODY', '(Used as the main body of the notification)'));
     if ($this->ID) {
         $fields->addFieldsToTab('Root.Main', array(new CheckboxSetField('RecipientMembers', _t('Push.RECIPIENTMEMBERS', 'Recipient Members'), Member::get()->map()), new TreeMultiselectField('RecipientGroups', _t('Push.RECIPIENTGROUPS', 'Recipient Groups'), 'Group')));
     }
     $fields->addFieldsToTab('Root.Main', array(PushProviderField::create('Provider', _t('Push.PROVIDER', 'Provider'))));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('Sort');
     $fields->removeByName('ListID');
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // Remove fields
     $fields->removeByName(array('Unique', 'Permanent', 'CanClose', 'CloseColor', 'LinkID'));
     // Add fields
     // Main tab
     $fields->addFieldToTab("Root.Main", $test = TextField::create("ButtonText")->setTitle(_t("SiteMessage.LABELBUTTONTEXT", "Button Text")));
     $fields->addFieldToTab("Root.Main", TreeDropdownField::create("PageID")->setTitle(_t("SiteMessage.LABELLINKTO", "Link to"))->setSourceObject("SiteTree"));
     $fields->addFieldToTab("Root.Main", HTMLEditorField::create("Content")->setTitle(_t("SiteMessage.LABELCONTENT", "Message content"))->setRows(15));
     // Design tab
     $fields->addFieldToTab("Root.Design", HeaderField::create("ColorSettings")->setTitle(_t("SiteMessage.HEADERCOLORSETTINGS", "Color settings")));
     $fields->addFieldToTab("Root.Design", ColorField::create("BackgroundColor")->setTitle(_t("SiteMessage.LABELBACKGROUNDCOLOR", "Background Color")));
     $fields->addFieldToTab("Root.Design", ColorField::create("TextColor")->setTitle(_t("SiteMessage.LABELTEXTCOLOR", "Text Color")));
     $fields->addFieldToTab("Root.Design", ColorField::create("ButtonColor")->setTitle(_t("SiteMessage.LABELBUTTONCOLOR", "Button Color")));
     $fields->addFieldToTab("Root.Design", ColorField::create("ButtonTextColor")->setTitle(_t("SiteMessage.LABELBUTTONTEXTCOLOR", "Button Text Color")));
     $fields->addFieldToTab("Root.Design", HeaderField::create("CloseSettings")->setTitle(_t("SiteMessage.HEADERCLOSESETTINGS", "Close button settings")));
     $fields->addFieldToTab("Root.Design", FieldGroup::create(_t("SiteMessage.LABELCANCLOSE", "Show close button?"), Checkboxfield::create("CanClose", "")));
     $fields->addFieldToTab("Root.Design", ColorField::create("CloseColor")->setTitle(_t("SiteMessage.LABELCLOSECOLOR", "Close button color")));
     // Schedule tab
     $fields->addFieldToTab("Root.Schedule", FieldGroup::create(_t("SiteMessage.LABELPERMANENT", "Is this message permanent?"), CheckboxField::create("Permanent", "")));
     $fields->addFieldToTab("Root.Schedule", $Start = new DatetimeField("Start"));
     $fields->addFieldToTab("Root.Schedule", $End = new DatetimeField("End"));
     $Start->setConfig('datavalueformat', 'YYYY-MM-dd HH:mm')->setTitle(_t("SiteMessage.LABELSTART", "Start Date"))->getDateField('Start')->setConfig('showcalendar', TRUE);
     $End->setConfig('datavalueformat', 'YYYY-MM-dd HH:mm')->setTitle(_t("SiteMessage.LABELSTART", "End Date"))->getDateField('End')->setConfig('showcalendar', TRUE);
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('ParentID');
     $fields->dataFieldByName('Link')->setAttribute('placeholder', 'http://')->setDescription(_t('CarouselImage.LINKDESCRIPTION', 'If empty, clicking the image does nothing. You can use absolute or canonical URLs here.'));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     //Events shouldn't be editable from here by default
     $fields->removeByName('Events');
     return $fields;
 }
Example #22
0
 public function getCMSFields()
 {
     $f = parent::getCMSFields();
     $f->addFieldToTab('Root.Main', UploadField::create('ExampleImage', 'Example Image')->setFolderName('homes'));
     $f->addFieldToTab('Root.Main', UploadField::create('Floorplan', 'Floorplan')->setFolderName('homes'));
     return $f;
 }
Example #23
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeFieldsFromTab('Root.Main', array('SortOrder', 'MenuID', 'Title'));
     $fields->replaceField('PageID', TreeDropdownField::create("PageID", "Choose a page:", "SiteTree"));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->push(self::dropdown("Identifier", "Network"));
     $fields->removeByName("ParentID");
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('ConfiguredScheduleID');
     $interval = $fields->dataFieldByName('Interval')->setDescription('Number of seconds between each run. e.g 3600 is 1 hour');
     $fields->replaceField('Interval', $interval);
     $dt = new DateTime();
     $fields->replaceField('StartDate', DateField::create('StartDate')->setConfig('dateformat', 'dd/MM/yyyy')->setConfig('showcalendar', true)->setDescription('DD/MM/YYYY e.g. ' . $dt->format('d/m/y')));
     $fields->replaceField('EndDate', DateField::create('EndDate')->setConfig('dateformat', 'dd/MM/yyyy')->setConfig('showcalendar', true)->setDescription('DD/MM/YYYY e.g. ' . $dt->format('d/m/y')));
     if ($this->ID == null) {
         foreach ($fields->dataFields() as $field) {
             //delete all included fields
             $fields->removeByName($field->Name);
         }
         $rangeTypes = ClassInfo::subclassesFor('ScheduleRange');
         $fields->addFieldToTab('Root.Main', TextField::create('Title', 'Title'));
         $fields->addFieldToTab('Root.Main', DropdownField::create('ClassName', 'Range Type', $rangeTypes));
     } else {
         $fields->addFieldToTab('Root.Main', ReadonlyField::create('ClassName', 'Type'));
     }
     if ($this->ClassName == __CLASS__) {
         $fields->removeByName('ApplicableDays');
     }
     return $fields;
 }
 /**
  * Overwrites SiteTree.getCMSFields.
  *
  * This method creates a customised CMS form for back-end user.
  *
  * @return fieldset
  */
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $csv_file = $fields->fieldByName("Root.Main.CSVFile");
     $pdf_file = $fields->fieldByName("Root.Main.PDFFile");
     $html_file = $fields->fieldByName("Root.Main.HTMLFile");
     //Remove all fields - then add nicely...
     $fields->removeFieldsFromTab("Root.Main", array("ReportFields", "ReportHeaders", "ConditionFields", "ConditionOps", "ConditionValues", "PaginateBy", "PageHeader", "SortBy", "SortDir", "ClearColumns", "AddInRows", "AddCols", "CSVFile", "PDFFile", "HTMLFile", "ReportID"));
     $reportFields = $this->getReportableFields();
     $fieldsGroup = new FieldGroup('Fields', new MultiValueDropdownField('ReportFields', _t('AdvancedReport.REPORT_FIELDS', 'Report Fields'), $reportFields), new MultiValueTextField('ReportHeaders', _t('AdvancedReport.REPORT_HEADERS', 'Headers')));
     $fieldsGroup->addExtraClass('reportMultiField');
     $conditions = new FieldGroup('Conditions', new MultiValueDropdownField('ConditionFields', _t('AdvancedReport.CONDITION_FIELDS', 'Condition Fields'), $reportFields), new MultiValueDropdownField('ConditionOps', _t('AdvancedReport.CONDITION_OPERATIONS', 'Op'), self::$allowed_conditions), new MultiValueTextField('ConditionValues', _t('AdvancedReport.CONDITION_VALUES', 'Value')));
     $conditions->addExtraClass('reportMultiField');
     $combofield = new FieldGroup('Sorting', new MultiValueDropdownField('SortBy', _t('AdvancedReport.SORTED_BY', 'Sorted By'), $reportFields), new MultiValueDropdownField('SortDir', _t('AdvancedReport.SORT_DIRECTION', 'Sort Direction'), array('ASC' => _t('AdvancedReport.ASC', 'Ascending'), 'DESC' => _t('AdvancedReport.DESC', 'Descending'))));
     $combofield->addExtraClass('reportMultiField');
     $paginateFields = $reportFields;
     array_unshift($paginateFields, '');
     $fields->addFieldsToTab("Root.Main", array($fieldsGroup, $conditions, $combofield, new FieldGroup('Formatting', new DropdownField('PaginateBy', _t('AdvancedReport.PAGINATE_BY', 'Paginate By'), $paginateFields), new TextField('PageHeader', _t('AdvancedReport.PAGED_HEADER', 'Header text (use $name for the page name)'), '$name'), new MultiValueDropdownField('AddInRows', _t('AdvancedReport.ADD_IN_ROWS', 'Add these columns for each row'), $reportFields), new MultiValueDropdownField('AddCols', _t('AdvancedReport.ADD_IN_ROWS', 'Provide totals for these columns'), $reportFields), new MultiValueDropdownField('ClearColumns', _t('AdvancedReport.CLEARED_COLS', '"Cleared" columns'), $reportFields))));
     /* create a dedicated tab for report download files
      * @todo convert to InlineFormAction or the like to allow user to download report files
      * @todo provide a Generate Link Action on this page
      */
     $fields->addFieldsToTab("Root.Reports", array(new FieldGroup("Files", $csv_file, $pdf_file, $html_file)));
     return $fields;
 }
 public function getCMSFields()
 {
     //Fetch curret fields and store in Fields
     $fields = parent::getCMSFields();
     //Remove Fields
     $fields->removeFieldFromTab("Root.Main", array("SortOrder", "CalendarID", "Title", "Content", "StartDate", "StartTime", "EndDate", "EndTime", "Location"));
     //Event Title
     $Title = new TextField("Title", "Event Title");
     $Title->setRightTitle("Enter the event title. i.e. sports day.");
     //Start Date & Time
     $StartDate = new DateField("StartDate", "Start Date");
     $StartDate->setConfig('showcalendar', 1);
     $StartDate->setConfig('dateformat', 'dd/MM/YYYY');
     $StartTime = new TimeField("StartTime", "Start Time (Optional)");
     $StartTime->setConfig('use_strtotime', 1);
     //End Date & Time
     $EndDate = new DateField("EndDate", "End Date (Optional)");
     $EndDate->setConfig('showcalendar', 1);
     $EndDate->setConfig('dateformat', 'dd/MM/YYYY');
     $EndTime = new TimeField("EndTime", "End Time (Optional)");
     $StartTime->setConfig('use_strtotime', 1);
     //Location
     $Location = new AddressTextField("Location", "Event Location", "AIzaSyA-folYpPWGiFcpBZURJpf610nO6FJtqqQ");
     $Location->SetRightTitle("Optional. Begin typing and you will see address suggestions (Beta). Powered by Google.");
     $Location->addExtraClass("text");
     //Event Description
     $Description = new HTMLEditorField("Content", "Event Description");
     //Group Start and End Date & Time Fields
     $Times = FieldGroup::create($StartDate, $StartTime, $EndDate, $EndTime)->setTitle('Timings');
     //Add Fields to the CMS
     $fields->addFieldsToTab("Root.Main", array($Title, $Times, $Location, $Description));
     //Return Fields to the CMS
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // Remove MCListSegment GridField Tab And Manually Manage
     $fields->removeByName("MCListSegments");
     // Manually Manage Creation of MCListSegments Based on Selected MCLists
     if (empty($this->owner->ID)) {
         $lists = new DataList("MCList");
         if ($lists->count() > 1) {
             $fields->addFieldToTab('Root.Main', new LiteralField('_AffectedMCListsTitle', '<h2>Affected MailChimp Lists</h2>'));
             $map = $lists->map("ID", "Name");
             $listIDs = new CheckboxSetField('_AffectedMCListIDs', 'Which MailChimp List(s) Does This Event Relate To', $map);
             $listIDs->setDefaultItems(array_keys($map->toArray()));
         } else {
             if ($lists->count() == 1) {
                 $listIDs = new HiddenField('_AffectedMCListIDs', 'Which MailChimp List(s) Does This Event Relate To', $lists->first()->ID);
             } else {
                 $listIDs = new HiddenField('_AffectedMCListIDs', 'Which MailChimp List(s) Does This Event Relate To', 0);
             }
         }
         $fields->addFieldToTab('Root.Main', $listIDs);
     }
     // Configure Attendees Gridfield
     $gf = $fields->fieldByName('Root.Attendees.Attendees');
     if (is_object($gf) && $gf->exists()) {
         $gf->setList($this->getMyManyManyComponents('Attendees'));
         $config = $gf->getConfig();
         $config->removeComponentsByType('GridfieldAddNewButton');
     }
     return $fields;
 }
Example #29
0
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->insertAfter(new LiteralField(_t("Shop.Invoice.PDFLink", "PDF Link"), '<h5><a href="' . Director::absoluteURL($this->pdfLink()) . '" target="_blank">' . _t("Shop.Invoice.PDFLink", "PDF Link") . '</a></h5>'), "OrderID");
     $fields->insertAfter(new LiteralField(_t("Shop.Invoice.InvoiceLink", "InvoiceLink"), '<h5><a href="' . Director::absoluteURL($this->link()) . '" target="_blank">' . _t("Shop.Invoice.InvoiceLink", "Invoice Link") . '</a></h5>'), "OrderID");
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->replaceField('LinkCheckSiteID', $field = new ReadonlyField('Site', 'Site', $this->LinkCheckSite()->SiteName));
     $fields->replaceField('LinkCheckFile', $field = new LiteralField('File', "<a href=" . $this->LinkCheckFile()->Filename . ">Download File</a>"));
     return $fields;
 }