From 1e22ef4ea7674e4f2c99d7827f7da319e37b35df Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Fri, 11 Mar 2016 06:55:17 +0800 Subject: [PATCH] * adjust code for linkStory method and change the style for edit method. --- module/story/control.php | 45 ++++++++++------------------ module/story/css/edit.css | 1 + module/story/view/linkstory.html.php | 31 +++++++++---------- 3 files changed, 30 insertions(+), 47 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index e63db52af9..b691876c31 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -916,52 +916,37 @@ class story extends control */ public function linkStory($storyID, $type = '', $stories = '', $browseType = '', $param = 0) { - /* Get story, product, and products. */ - $story = $this->story->getById($storyID); - $product = $this->product->getById($story->product); - $products = $this->product->getPairs(); - - /* Set menu. */ - $this->product->setMenu($products, $product->id, $story->branch); - - $queryID = ($browseType == 'bySearch') ? (int)$param : 0; - $browseLink = $this->createLink('story', 'edit', "storyID=$storyID"); - $branches = $product->type != 'normal' ? $this->loadModel('branch')->getPairs($story->product) : array(); + $this->commonAction($storyID); /* Link stories. */ if(!empty($_POST)) { $stories = $this->story->linkStories($storyID, $type, $stories); if(isonlybody()) die(js::closeModal('parent.parent', '', "function(){parent.parent.loadLinkedStories('$storyID', '$type', '$stories')}")); - die(js::locate($browseLink, 'parent')); + die(js::locate($this->createLink('story', 'edit', "storyID=$storyID"), 'parent')); } + /* Get story, product, products, and queryID. */ + $story = $this->story->getById($storyID); + $products = $this->product->getPairs(); + $queryID = ($browseType == 'bySearch') ? (int)$param : 0; + /* Build search form. */ $actionURL = $this->createLink('story', 'linkStory', "storyID=$storyID&type=$type&stories=$stories&browseType=bySearch&queryID=myQueryID", '', true); $this->loadModel('product')->buildSearchForm($story->product, $products, $queryID, $actionURL); $this->loadModel('search')->setSearchParams($this->config->product->search); /* Get stories to link. */ - if($browseType == 'bySearch') - { - $allStories = $this->story->getBySearch($story->product, $queryID, 'id', null); - } - else - { - $allStories = $this->story->getProductStories($story->product); - } + $allStories = array(); + if($browseType == 'bySearch') $allStories = $this->story->getBySearch($story->product, $queryID, 'id', null); /* Assign. */ - $this->view->title = $this->lang->story->linkStory; - $this->view->position[] = html::a($browseLink, $story->title); - $this->view->position[] = $this->lang->story->linkStory; - $this->view->product = $product; - $this->view->products = $products; - $this->view->branches = $branches; - $this->view->type = $type; - $this->view->story = $story; - $this->view->allStories = $allStories; - $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->title = $this->lang->story->linkStory . "STORY" . $this->lang->colon .$this->lang->story->linkStory; + $this->view->position[] = $this->lang->story->linkStory; + $this->view->type = $type; + $this->view->allStories = $allStories; + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->display(); } diff --git a/module/story/css/edit.css b/module/story/css/edit.css index 0ec48066f5..51a2162f96 100644 --- a/module/story/css/edit.css +++ b/module/story/css/edit.css @@ -1,2 +1,3 @@ .col-side .chosen-container .chosen-drop {width: 216px!important} .col-side .chosen-container {width: 218px!important} +#linkStoriesBox > .list-unstyled > li ,#childStoriesBox > .list-unstyled > li {margin-left:-56px} diff --git a/module/story/view/linkstory.html.php b/module/story/view/linkstory.html.php index 7e2c22e88a..08626708fb 100644 --- a/module/story/view/linkstory.html.php +++ b/module/story/view/linkstory.html.php @@ -14,13 +14,15 @@
- icons['story']);?> - icons['link']);?> story->linkStory;?> + icons['story']);?> id;?> + createLink('story', 'view', "storyID=$story->id"), $story->title);?> + story->linkStory;?>
- +
+ @@ -28,9 +30,6 @@ - type != 'normal'):?> - - @@ -39,20 +38,17 @@ id, explode(',', $story->$type))) continue;?> + id == $story->id) continue;?> createLink('story', 'view', "storyID=$storyDetail->id");?> - type != 'normal'):?> - - @@ -60,14 +56,15 @@ - - - + + + +
idAB;?>story->product;?> story->title;?> story->plan;?>product->branchName[$product->type];?> openedByAB;?> story->estimateAB;?>
- id));?> story->priList, $storyDetail->pri, $storyDetail->pri)?>'>story->priList, $storyDetail->pri, $storyDetail->pri);?> createLink('product', 'browse', "productID=$storyDetail->product&branch=$storyDetail->branch"), $products[$storyDetail->product], '_blank');?> title, '_blank');?> planTitle;?>branch])) echo $branches[$storyDetail->branch];?> openedBy];?> estimate;?>
' class='text-left'> -
- -
-
+
+ +
+