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);
     }
     $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 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);
 }
 function AddUserStory()
 {
     if (isset($_GET['ID']) && is_numeric($_GET['ID'])) {
         $ID = $_GET['ID'];
     } else {
         die;
     }
     $parent = UserStoryHolder::get()->first();
     if (!$parent) {
         $this->owner->setMessage('Error', 'could not add an user story bc there is not any available parent page(UserStoryHolder).');
         Controller::curr()->redirectBack();
     }
     $userStory = new UserStory();
     $userStory->Title = $_GET['label'];
     $userStory->DeploymentID = $ID;
     $userStory->UserStoriesIndustryID = $_GET['industry'];
     $userStory->CompanyName = $_GET['org'];
     $userStory->CaseStudyTitle = $_GET['org'];
     $userStory->ShowInAdmin = 1;
     $userStory->setParent($parent);
     // Should set the ID once the Holder is created...
     $userStory->write();
     //$userStory->publish("Live", "Stage");
     $userStory->flushCache();
     $this->owner->setMessage('Success', '<b>' . $userStory->Title . '</b> added as User Story.');
     Controller::curr()->redirectBack();
 }
예제 #8
0
 public function hasUserStory()
 {
     $userStory = UserStory::get()->filter('DeploymentID', $this->ID)->first();
     return $userStory ? true : false;
 }