function getCMSFields() { $fields = parent::getCMSFields(); $user_stories = UserStory::get(); if ($user_stories) { $user_stories = $user_stories->map('ID', 'Title', '(Select one)', true); } $industries = UserStoriesIndustry::get(); if ($industries) { $industries = $industries->map('ID', 'IndustryName', '(Select one)', true); } $fields->addFieldstoTab('Root.Main', array(new DropdownField('UserStoryID', 'User Story', $user_stories), new DropdownField('UserStoriesIndustryID', 'Industry', $industries))); return $fields; }
function getCMSFields() { // Get arrays to related dropdowns $deployments = Deployment::get()->filter('IsPublic', 1); if ($deployments) { $deployments = $deployments->map('ID', 'OrgAndLabel', '(Select one)', true); } $industries = UserStoriesIndustry::get()->filter('Active', 1); if ($industries) { $industries = $industries->map('ID', 'IndustryName', '(Select one)', true); } $fields = parent::getCMSFields(); $CountryCodes = CountryCodes::$iso_3166_countryCodes; $fields->addFieldsToTab('Root.Main', array(new CustomUploadField('SummaryImg', 'Summary Image'), new DropdownField('DeploymentID', 'Deployment', $deployments), new DropdownField('UserStoriesIndustryID', 'Industry', $industries), new DropdownField('DeploymentType', 'Deployment Type', DeploymentOptions::$deployment_type_options), $ddl_country = new DropdownField('PrimaryCountry', 'Country', $CountryCodes))); $ddl_country->setEmptyString('-- Select One --'); $fields->addFieldsToTab('Root.CaseStudy', array(new CheckboxField('ShowCaseStudy', 'Show Case Study?'), new TextField('CaseStudyTitle', 'Case Study Title'), new TextField('CompanyName', 'Company Name'), new TextField('CompanyURL', 'Company URL'), new TextField('ThirdPartyURL', '3rd Party Site URL'), new HtmlEditorField('CaseStudyBody', 'Case Study Body'), new CustomUploadField('CaseStudyImg', 'Case Study Image'), new TextField('ObjectivesTitle', 'Objectives Title'), new HtmlEditorField('ObjectivesBody', 'Objectives Body'), new TextField('CompanyHeadquarters', 'Company Headquarters'), new TextField('CompanySize', 'Company Size'), new TextField('CompanyIndustry', 'Company Industry'), new CheckboxSetField('ProjectsUsed', 'ProjectsUsed', array('Openstack Compute (Nova)' => 'Openstack Compute (Nova)', 'Openstack Block Storage (Cinder)' => 'Openstack Block Storage (Cinder)', 'Openstack Object Storage (Swift)' => 'Openstack Object Storage (Swift)', 'Openstack Network' => 'Openstack Network (Neutron)', 'Openstack Dashboard (Horizon)' => 'Openstack Dashboard (Horizon)', 'Openstack Identity Service (Keystone)' => 'Openstack Identity Service (Keystone)', 'Openstack Image Service (Glance)' => 'Openstack Image Service (Glance)', 'Heat' => 'OpenStack Orchestration (Heat)', 'Ceilometer' => 'OpenStack Metering (Ceilometer)', 'OpenStack Bare Metal (Ironic)' => 'OpenStack Bare Metal (Ironic)', 'OpenStack Database as a Service (Trove)' => 'OpenStack Database as a Service (Trove)')))); $fields->addFieldsToTab('Root.Video', array(new CheckboxField('ShowVideo', 'Show Video?'), new TextField('Video', 'YouTube URL'))); // Reuse fields from Page Model, and change their label to match Specs $fields->renameField('Title', 'Deployment Display Name'); $fields->renameField('Content', 'Summary'); return $fields; }
function UserStoriesIndustries() { return UserStoriesIndustry::get()->filter('Active', 1); }