From 776dccf2a2cc272ca219afde8be1bf677732e465 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 25 Jun 2013 01:25:26 +0000 Subject: [PATCH] * finish task #1429. --- module/product/js/browse.js | 2 +- module/product/view/browse.html.php | 80 +------------------------- module/product/view/storylist.html.php | 79 +++++++++++++++++++++++++ module/story/control.php | 1 + module/story/model.php | 8 +-- www/js/my.full.js | 7 +-- 6 files changed, 87 insertions(+), 90 deletions(-) create mode 100644 module/product/view/storylist.html.php diff --git a/module/product/js/browse.js b/module/product/js/browse.js index c37552d985..7d9cc6bbe5 100644 --- a/module/product/js/browse.js +++ b/module/product/js/browse.js @@ -25,5 +25,5 @@ function changeAction(formName, actionName, actionLink) $(function() { if(browseType == 'bysearch') ajaxGetSearchForm(); - $(function(){$('.iframe').colorbox({width:900, height:500, iframe:true, transition:'none', onCleanup:function(){parent.location.href=parent.location.href;}});}) + loadColorbox('iframe', 'storyList'); }) diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 3e7bf3295d..31e20b4d9e 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -10,6 +10,7 @@ * @link http://www.zentao.net */ ?> + @@ -53,84 +54,7 @@ var browseType = ''; - - - - recTotal}&recPerPage={$pager->recPerPage}";?> - - - - - - - - - - - - - - - $story):?> - createLink('story', 'view', "storyID=$story->id"); - $canView = common::hasPriv('story', 'view'); - ?> - - - - - - - - - - - - - - - - - - - - -
idAB);?> priAB);?> story->title);?> story->planAB);?> story->source);?> openedByAB);?> assignedToAB);?>story->estimateAB);?> statusAB);?> story->stageAB);?>actions;?>
- - id)); else printf('%03d', $story->id);?> - story->priList[$story->pri];?>'>story->priList[$story->pri]?>title);?>planTitle;?>story->sourceList[$story->source];?>openedBy];?>assignedTo];?>estimate;?>story->statusList[$story->status];?>story->stageList[$story->stage];?> - id}"; - common::printIcon('story', 'change', $vars, $story, 'list'); - common::printIcon('story', 'review', $vars, $story, 'list'); - common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); - common::printIcon('story', 'edit', $vars, $story, 'list'); - common::printIcon('story', 'createCase', "productID=$story->product&module=0&from=¶m=0&$vars", $story, 'list', 'createCase'); - ?> -
-
- createLink('story', 'batchEdit', "from=productBrowse&productID=$productID&projectID=0&orderBy=$orderBy"); - echo html::commonButton($lang->edit, "onclick=\"changeAction('productStoryForm', 'batchEdit', '$actionLink')\""); - } - if(common::hasPriv('story', 'batchClose') and strtolower($browseType) != 'closedbyme' and strtolower($browseType) != 'closedstory') - { - $actionLink = $this->createLink('story', 'batchClose', "from=productBrowse&productID=$productID&projectID=0&orderBy=$orderBy"); - echo html::commonButton($lang->close, "onclick=\"changeAction('productStoryForm', 'batchClose', '$actionLink')\""); - } - } - echo $summary; - ?> -
- show();?> -
+ diff --git a/module/product/view/storylist.html.php b/module/product/view/storylist.html.php new file mode 100644 index 0000000000..2d9906c087 --- /dev/null +++ b/module/product/view/storylist.html.php @@ -0,0 +1,79 @@ + + + + + recTotal}&recPerPage={$pager->recPerPage}";?> + + + + + + + + + + + + + + + $story):?> + createLink('story', 'view', "storyID=$story->id"); + $canView = common::hasPriv('story', 'view'); + ?> + + + + + + + + + + + + + + + + + + + + +
idAB);?> priAB);?> story->title);?> story->planAB);?> story->source);?> openedByAB);?> assignedToAB);?>story->estimateAB);?> statusAB);?> story->stageAB);?>actions;?>
+ + id)); else printf('%03d', $story->id);?> + story->priList[$story->pri];?>'>story->priList[$story->pri]?>title);?>planTitle;?>story->sourceList[$story->source];?>openedBy];?>assignedTo];?>estimate;?>story->statusList[$story->status];?>story->stageList[$story->stage];?> + id}"; + common::printIcon('story', 'change', $vars, $story, 'list'); + common::printIcon('story', 'review', $vars, $story, 'list'); + common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); + common::printIcon('story', 'edit', $vars, $story, 'list'); + common::printIcon('story', 'createCase', "productID=$story->product&module=0&from=¶m=0&$vars", $story, 'list', 'createCase'); + ?> +
+
+ createLink('story', 'batchEdit', "from=productBrowse&productID=$productID&projectID=0&orderBy=$orderBy"); + echo html::commonButton($lang->edit, "onclick=\"changeAction('productStoryForm', 'batchEdit', '$actionLink')\""); + } + if(common::hasPriv('story', 'batchClose') and strtolower($browseType) != 'closedbyme' and strtolower($browseType) != 'closedstory') + { + $actionLink = $this->createLink('story', 'batchClose', "from=productBrowse&productID=$productID&projectID=0&orderBy=$orderBy"); + echo html::commonButton($lang->close, "onclick=\"changeAction('productStoryForm', 'batchClose', '$actionLink')\""); + } + } + echo $summary; + ?> +
+ show();?> +
diff --git a/module/story/control.php b/module/story/control.php index 5dcb7e9105..03fa231d5a 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -587,6 +587,7 @@ class story extends control $actionID = $this->action->create('story', $storyID, 'Closed', $this->post->comment, ucfirst($this->post->closedReason)); $this->action->logHistory($actionID, $changes); $this->sendMail($storyID, $actionID); + if(isonlybody()) die(js::closeColorbox('parent.parent')); die(js::locate(inlink('view', "storyID=$storyID"), 'parent')); } diff --git a/module/story/model.php b/module/story/model.php index b677527d77..a2d92a9db4 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -708,15 +708,13 @@ class storyModel extends model */ public function getProductStories($productID = 0, $moduleIds = 0, $status = 'all', $orderBy = 'id_desc', $pager = null) { - return $this->dao->select('t1.*, t2.title as planTitle, t3.verify, t3.spec') + return $this->dao->select('t1.*, t2.title as planTitle') ->from(TABLE_STORY)->alias('t1') ->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id') - ->leftJoin(TABLE_STORYSPEC)->alias('t3')->on('t1.id = t3.story') ->where('t1.product')->in($productID) ->beginIF(!empty($moduleIds))->andWhere('module')->in($moduleIds)->fi() ->beginIF($status != 'all')->andWhere('status')->in($status)->fi() ->andWhere('t1.deleted')->eq(0) - ->andWhere('t3.version=t1.version') ->orderBy($orderBy)->page($pager)->fetchAll(); } @@ -1027,17 +1025,15 @@ class storyModel extends model */ public function getUserStories($account, $type = 'assignedTo', $orderBy = 'id_desc', $pager = null) { - $stories = $this->dao->select('t1.*, t2.title as planTitle, t3.name as productTitle, t4.spec, t4.verify') + $stories = $this->dao->select('t1.*, t2.title as planTitle, t3.name as productTitle') ->from(TABLE_STORY)->alias('t1') ->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id') ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id') - ->leftJoin(TABLE_STORYSPEC)->alias('t4')->on('t1.id = t4.story') ->where('t1.deleted')->eq(0) ->beginIF($type == 'assignedTo')->andWhere('assignedTo')->eq($account)->fi() ->beginIF($type == 'openedBy')->andWhere('openedBy')->eq($account)->fi() ->beginIF($type == 'reviewedBy')->andWhere('reviewedBy')->like('%' . $account . '%')->fi() ->beginIF($type == 'closedBy')->andWhere('closedBy')->eq($account)->fi() - ->andWhere('t4.version=t1.version') ->orderBy($orderBy) ->page($pager) ->fetchAll(); diff --git a/www/js/my.full.js b/www/js/my.full.js index 0913090f54..478c36f8e9 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -834,11 +834,8 @@ function loadColorbox(colorboxClass, replaceID) onCleanup:function() { saveWindowSize(); - var link = self.location.href; - var onlybody = config.requestType == 'PATH_INFO' ? "?onlybody=yes" : '&onlybody=yes'; - - link = link + onlybody; - $.get(link, function(data) + var link = self.location.href; + $.get(link, {onlybody:"yes"}, function(data) { $('#' + replaceID).replaceWith(data) loadColorbox(colorboxClass, replaceID)