diff --git a/module/report/model.php b/module/report/model.php index 4e2f16bb0f..d8eead8a16 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -726,6 +726,7 @@ class reportModel extends model ->orWhere('RD')->in($accounts) ->markRight(1) ->fi() + ->andWhere('shadow')->eq(0) ->fetchAll('id'); /* Get created plans in this year. */ @@ -733,6 +734,7 @@ class reportModel extends model ->leftJoin(TABLE_ACTION)->alias('t2')->on("t1.id=t2.objectID and t2.objectType='productplan'") ->where('LEFT(t2.date, 4)')->eq($year) ->andWhere('t1.deleted')->eq(0) + ->andWhere('t1.product')->in(array_keys($products)) ->beginIF($accounts) ->andWhere('t2.actor')->in($accounts) ->fi() @@ -750,11 +752,13 @@ class reportModel extends model $createStoryProducts = $this->dao->select('DISTINCT product')->from(TABLE_STORY) ->where('LEFT(openedDate, 4)')->eq($year) ->andWhere('deleted')->eq(0) + ->andWhere('product')->in(array_keys($products)) ->beginIF($accounts)->andWhere('openedBy')->in($accounts)->fi() ->fetchPairs('product', 'product'); $closeStoryProducts = $this->dao->select('DISTINCT product')->from(TABLE_STORY) ->where('LEFT(closedDate, 4)')->eq($year) ->andWhere('deleted')->eq(0) + ->andWhere('product')->in(array_keys($products)) ->beginIF($accounts)->andWhere('closedBy')->in($accounts)->fi() ->fetchPairs('product', 'product'); if($createStoryProducts or $closeStoryProducts) @@ -819,6 +823,7 @@ class reportModel extends model /* Get changed executions in this year. */ $executions = $this->dao->select('id,name')->from(TABLE_EXECUTION)->where('deleted')->eq(0) ->andwhere('type')->eq('sprint') + ->andwhere('multiple')->eq('1') ->andWhere('LEFT(begin, 4)', true)->eq($year) ->orWhere('LEFT(end, 4)')->eq($year) ->markRight(1) diff --git a/module/story/control.php b/module/story/control.php index de24546360..1be08db103 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -1053,19 +1053,10 @@ class story extends control $branchTagOption = array(); $products = array(); - if($executionID) - { - /* The stories of project or execution. */ - $execution = $this->execution->getByID($executionID); - $products = $this->loadModel('product')->getProducts($executionID); - } - else - { - /* The stories of my. */ - $productIdList = array(); - foreach($stories as $story) $productIdList[$story->product] = $story->product; - $products = $this->product->getByIdList($productIdList); - } + /* Get product id list by the stories. */ + $productIdList = array(); + foreach($stories as $story) $productIdList[$story->product] = $story->product; + $products = $this->product->getByIdList($productIdList); foreach($products as $storyProduct) { @@ -1133,8 +1124,6 @@ class story extends control } } - $this->view->position[] = $this->lang->story->common; - $this->view->position[] = $this->lang->story->batchEdit; $this->view->title = $this->lang->story->batchEdit; $this->view->users = $users; $this->view->priList = array('0' => '', 'ditto' => $this->lang->story->ditto) + $this->lang->story->priList; @@ -2028,7 +2017,7 @@ class story extends control */ public function batchToTask($executionID = 0, $projectID = 0) { - if($this->app->tab == 'execution' and $executionID) $this->loadModel('execution')->setMenu($executionID); + if($executionID) $this->loadModel('execution')->setMenu($executionID); if(!empty($_POST['name'])) { @@ -2716,7 +2705,7 @@ class story extends control $this->story->replaceURLang($storyType); $this->products = $this->product->getPairs('', 0, '', 'all'); - if($this->app->tab == 'project') + if(strpos('project,execution', $this->app->tab) !== false) { $project = $this->dao->findByID($projectID)->from(TABLE_PROJECT)->fetch(); if($project->type == 'project') @@ -2729,10 +2718,11 @@ class story extends control $this->loadModel('execution')->setMenu($projectID); } - if(!$project->hasProduct and !$project->multiple) + if(!$project->hasProduct) { unset($this->lang->story->report->charts['storysPerProduct']); - unset($this->lang->story->report->charts['storysPerPlan']); + + if(!$project->multiple) unset($this->lang->story->report->charts['storysPerPlan']); } } else diff --git a/module/story/css/batchclose.css b/module/story/css/batchclose.css index 680e3638d9..576dfc65bd 100644 --- a/module/story/css/batchclose.css +++ b/module/story/css/batchclose.css @@ -1,5 +1,5 @@ .c-id {width: 50px;} -.c-reason {width: 150px;} +.c-reason {width: 210px;} td[id^="duplicateStoryBox"].required:after {top: 6px; right: 2px;} td[id^="duplicateStoryBox"] {overflow: visible;} td.reasons-td {overflow: visible;} diff --git a/module/story/js/batchclose.js b/module/story/js/batchclose.js index bd33321844..7c15a5c040 100755 --- a/module/story/js/batchclose.js +++ b/module/story/js/batchclose.js @@ -12,22 +12,16 @@ function setDuplicateAndChild(resolution, storyID) { $('#childStoryBox' + storyID).hide(); $('#duplicateStoryBox' + storyID).show(); - $('#duplicateStoryTitle').show(); - $('.form-actions').attr('colspan', 6); } else if(resolution == 'subdivided') { $('#duplicateStoryBox' + storyID).hide(); $('#childStoryBox' + storyID).show(); - $('#duplicateStoryTitle').hide(); - $('.form-actions').attr('colspan', 5); } else { $('#duplicateStoryBox' + storyID).hide(); $('#childStoryBox' + storyID).hide(); - $('#duplicateStoryTitle').hide(); - $('.form-actions').attr('colspan', 5); } } diff --git a/module/story/model.php b/module/story/model.php index 1034178962..72d84a177d 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2724,6 +2724,7 @@ class storyModel extends model ->beginIF(!empty($moduleIdList))->andWhere('module')->in($moduleIdList)->fi() ->beginIF(!empty($excludeStories))->andWhere('id')->notIN($excludeStories)->fi() ->beginIF($status and $status != 'all')->andWhere('status')->in($status)->fi() + ->andWhere('vision')->eq($this->config->vision) ->andWhere('type')->eq($type) ->andWhere('deleted')->eq(0) ->orderBy($orderBy) @@ -2936,6 +2937,7 @@ class storyModel extends model $stories = $sql->where('t1.product')->in($productID) ->andWhere('t1.deleted')->eq(0) + ->andWhere('t1.vision')->eq($this->config->vision) ->andWhere('t1.type')->eq($type) ->beginIF($branch != 'all')->andWhere("t1.branch")->eq($branch)->fi() ->beginIF($modules)->andWhere("t1.module")->in($modules)->fi() @@ -2973,6 +2975,7 @@ class storyModel extends model ->beginIF($branch)->andWhere("branch")->eq($branch)->fi() ->beginIF($modules)->andWhere("module")->in($modules)->fi() ->andWhere('deleted')->eq(0) + ->andWhere('vision')->eq($this->config->vision) ->andWhere('stage')->in('developed,released') ->andWhere('status')->ne('closed') ->orderBy($orderBy) @@ -3150,6 +3153,7 @@ class storyModel extends model ->where($sql) ->beginIF($productID != 'all' and $productID != '')->andWhere('t1.`product`')->eq((int)$productID)->fi() ->andWhere('t1.deleted')->eq(0) + ->andWhere('t1.vision')->eq($this->config->vision) ->andWhere('t1.type')->eq($type) ->orderBy($orderBy) ->page($pager, 't1.id') @@ -4944,6 +4948,9 @@ class storyModel extends model case 'assignedDate': echo helper::isZeroDate($story->assignedDate) ? '' : substr($story->assignedDate, 5, 11); break; + case 'activatedDate': + echo helper::isZeroDate($story->activatedDate) ? '' : substr($story->activatedDate, 5, 11); + break; case 'reviewedBy': echo $story->reviewedBy; break; diff --git a/module/story/view/batchclose.html.php b/module/story/view/batchclose.html.php index be938128d6..21cf183703 100755 --- a/module/story/view/batchclose.html.php +++ b/module/story/view/batchclose.html.php @@ -28,7 +28,6 @@