function getCMSFields() { $fields = parent::getCMSFields(); $user_stories = UserStory::get(); if ($user_stories) { $user_stories = $user_stories->map('ID', 'Title', '(Select one)', true); } $fields->addFieldstoTab('Root.Main', array(new DropdownField('UserStoryID', 'User Story', $user_stories), new TextField('LinkName', 'Link Name'), new TextField('LinkURL', 'Full URL'), new TextField('Description', 'Description'), new HiddenField('SortOrder'))); return $fields; }
function UnPublishFromUserStories() { if (isset($_GET['ID']) && is_numeric($_GET['ID'])) { $user_story_id = $_GET['ID']; $story = UserStory::get()->byID($user_story_id); $story->doUnpublish(); $this->owner->setMessage('Success', '<b>' . $story->Title . '</b> unpublished.'); $this->owner->redirectBack(); } }
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() { $fields = parent::getCMSFields(); $user_stories = UserStory::get(); if ($user_stories) { $user_stories = $user_stories->map('ID', 'Title', '(Select one)', true); } $topics = UserStoriesTopics::get(); if ($topics) { $topics = $topics->map('ID', 'Topic', '(Select one)', true); } $types = array('video' => 'Video', 'case_study' => 'Case Study'); $fields->addFieldstoTab('Root.Main', array(new TextField('Title', 'Title'), new DropdownField('UserStoryID', 'User Story', $user_stories), new DropdownField('UserStoriesTopicsID', 'Topic', $topics), new DropdownField('Type', 'Type', $types), new TextField('VideoURL', 'YouTube Video ID', 'If this is empty and type is Video, it will be used the User Story video'), new CustomUploadField('Thumbnail', 'Thumbnail'), new HiddenField('SortOrder'))); return $fields; }
public function stageChildren($showAll = false) { if (Controller::curr()->getRequest()->param("Action") == "getfilteredsubtree" && (!empty($_REQUEST['SiteTreeSearchTerm']) || !empty($_REQUEST['SiteTreeFilterDate']))) { $staged = UserStory::get()->filter(array('ShowInAdmin' => true, 'ParentID' => $this->owner->ID)); if (!$staged) { $staged = new DataList('UserStory'); } $this->owner->extend("augmentStageChildren", $staged, $showAll); return $staged; } else { $set = UserStory::get()->filter(array('ShowInAdmin' => true, 'ParentID' => $this->owner->ID)); if (!$set) { return array(); } return $set; } }
function Stories() { return UserStory::get()->filter('UserStoriesIndustryID', $this->ID); }
public function hasUserStory() { $userStory = UserStory::get()->filter('DeploymentID', $this->ID)->first(); return $userStory ? true : false; }