diff --git a/module/bug/model.php b/module/bug/model.php index e15a7fc9b9..dad2de58be 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1855,7 +1855,7 @@ class bugModel extends model ->andWhere('deleted')->eq(0) ->beginIF($excludeBugs)->andWhere('id')->notIN($excludeBugs)->fi() ->beginIF(!empty($productID) and strpos($bugQuery, 'product') === false and strpos($bugQuery, '`product` IN') === false)->andWhere('product')->eq($productID)->fi() - ->beginIF(!empty($productID) and strpos($bugQuery, 'product') === false and strpos($bugQuery, '`product` IN') === false)->andWhere('branch')->eq($branchID)->fi() + ->beginIF(!empty($productID) and strpos($bugQuery, 'product') === false and strpos($bugQuery, '`product` IN') === false and $branchID != 'all')->andWhere('branch')->eq($branchID)->fi() ->orderBy($orderBy) ->page($pager) ->fetchAll('id'); @@ -2319,7 +2319,7 @@ class bugModel extends model $products = $this->session->product; preg_match('/`product` IN \((?P.+)\)/', $this->reportCondition(), $matchs); if(!empty($matchs) and isset($matchs['productIdList'])) $products = str_replace('\'', '', $matchs['productIdList']); - $builds = $this->loadModel('build')->getBuildPairs($products, $branch = 0, $params = 'hasDeleted'); + $builds = $this->loadModel('build')->getBuildPairs($products, $branch = 0, $params = 'hasdeleted'); /* Deal with the situation that a bug maybe associate more than one openedBuild. */ foreach($datas as $buildIDList => $data) diff --git a/module/build/control.php b/module/build/control.php index f701326654..4b8483ebdd 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -283,6 +283,8 @@ class build extends control foreach($stages as $storyID => $stage) $stories[$storyID]->stage = $stage; /* Set menu. */ + $objectType = 'execution'; + $objectID = $build->execution; if($this->app->tab == 'project') { $this->loadModel('project')->setMenu($build->project); @@ -643,7 +645,10 @@ class build extends control if($build->branch) { - foreach(explode(',', $build->branch) as $branchID) $branches += array($branchID => $branchPairs[$branchID]); + foreach(explode(',', $build->branch) as $branchID) + { + if(isset($branchPairs[$branchID])) $branches += array($branchID => $branchPairs[$branchID]); + } } $this->config->product->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); diff --git a/module/build/js/create.js b/module/build/js/create.js index 836a71ed59..0626390b86 100644 --- a/module/build/js/create.js +++ b/module/build/js/create.js @@ -25,6 +25,7 @@ $().ready(function() { var projectID = $('#project').val(); var executionID = $('#execution').val(); + if($(this).val() == 'no') { $('#execution').closest('tr').show(); @@ -35,7 +36,16 @@ $().ready(function() { $('#execution').closest('tr').hide(); $('#buildBox').closest('tr').show(); + + $.ajaxSettings.async = false; loadProducts(projectID); + var productID = $('#product').val(); + $.get(createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=builds&build=&branch=all&index=&needCreate=&type=noempty,notrunk,separate,singled&extra=multiple'), function(data) + { + if(data) $('#buildBox').html(data); + $('#builds').attr('data-placeholder', multipleSelect).chosen(); + }); + $.ajaxSettings.async = true; } }); $('#product').change(); diff --git a/module/build/model.php b/module/build/model.php index b13c40eead..0f7acaea46 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -63,7 +63,7 @@ class buildModel extends model */ public function getProjectBuilds($projectID = 0, $type = 'all', $param = 0, $orderBy = 't1.date_desc,t1.id_desc', $pager = null) { - return $this->dao->select('t1.*, t2.name as executionName, t2.id as executionID, t3.name as productName') + return $this->dao->select('t1.*, t2.name as executionName, t2.id as executionID, t2.deleted as executionDeleted, t3.name as productName') ->from(TABLE_BUILD)->alias('t1') ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id') ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id') @@ -253,7 +253,7 @@ class buildModel extends model ->beginIF($products)->andWhere('product')->in($products)->fi() ->beginIF($objectType === 'execution' and $objectID)->andWhere('execution')->eq($objectID)->fi() ->beginIF($objectType === 'project' and $objectID)->andWhere('project')->eq($objectID)->fi() - ->beginIF(strpos($params, 'hasDeleted') === false)->andWhere('deleted')->eq(0)->fi() + ->beginIF(strpos($params, 'hasdeleted') === false)->andWhere('deleted')->eq(0)->fi() ->fetchPairs(); } @@ -267,7 +267,7 @@ class buildModel extends model ->leftJoin(TABLE_PRODUCT)->alias('t5')->on('t1.product = t5.id') ->where('1=1') ->andWhere('t1.id')->notIN($shadows) - ->beginIF(strpos($params, 'hasDeleted') === false)->andWhere('t1.deleted')->eq(0)->fi() + ->beginIF(strpos($params, 'hasdeleted') === false)->andWhere('t1.deleted')->eq(0)->fi() ->beginIF(strpos($params, 'hasproject') !== false)->andWhere('t1.project')->ne(0)->fi() ->beginIF(strpos($params, 'singled') !== false)->andWhere('t1.execution')->ne(0)->fi() ->beginIF($products)->andWhere('t1.product')->in($products)->fi() @@ -457,7 +457,7 @@ class buildModel extends model ->get(); $product = $this->loadModel('product')->getByID($build->product); - if(!empty($product) and $product->type != 'normal' and !isset($_POST['branch'])) + if(!empty($product) and $product->type != 'normal' and !isset($_POST['branch']) and isset($_POST['product'])) { $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); dao::$errors['branch'] = sprintf($this->lang->error->notempty, $this->lang->product->branch); diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php index 45df680489..82f83870e5 100644 --- a/module/build/view/edit.html.php +++ b/module/build/view/edit.html.php @@ -37,7 +37,7 @@ build->notice->changeProduct;?> - '> + execution)) echo 'hidden'?>'> loadModel('bug')->getStoryBugCounts($storyIdList, $executionID); $storyCases = $this->loadModel('testcase')->getStoryCaseCounts($storyIdList); - $plans = $this->execution->getPlans($products, 'skipParent|withMainPlan', $executionID); + $plans = $this->execution->getPlans($products, 'skipParent|withMainPlan|unexpired|noclosed', $executionID); $allPlans = array('' => ''); if(!empty($plans)) { diff --git a/module/execution/css/create.css b/module/execution/css/create.css index b3ef4c9ba2..a71b046e42 100644 --- a/module/execution/css/create.css +++ b/module/execution/css/create.css @@ -31,7 +31,7 @@ #endLabel {white-space: nowrap;} #copyProjectModal .projectSelect {display: inline-block; margin-left: 10px; width: 20%;} #copyProjectModal .titleBox{position: relative; bottom: 3px; display: inline-block;} -a.chosen-single > div > b {top: -4px !important;} +#copyProjectModal .projectSelect a.chosen-single > div > b {top: -4px !important;} .productsBox a {border-radius: 2px !important;} .productsBox .required:after {right: -9.5px !important;} diff --git a/module/execution/model.php b/module/execution/model.php index 3f1f901f42..f6be50c7f2 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1582,17 +1582,14 @@ class executionModel extends model ->andWhere('type')->eq('execution') ->fetchPairs(); } - $project = $this->loadModel('project')->getByID($projectID); $executions = $this->dao->select('t1.*,t2.name projectName, t2.model as projectModel')->from(TABLE_EXECUTION)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') - ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t3')->on('t1.id=t3.project') - ->beginIF(!empty($project->division))->leftJoin(TABLE_PRODUCT)->alias('t4')->on('t4.id=t3.product')->fi() + ->beginIF($productID)->leftJoin(TABLE_PROJECTPRODUCT)->alias('t3')->on('t1.id=t3.project')->fi() ->where('t1.type')->in('sprint,stage,kanban') ->andWhere('t1.deleted')->eq('0') ->andWhere('t1.vision')->eq($this->config->vision) ->andWhere('t1.multiple')->eq('1') - ->beginIF(!empty($project->division))->andWhere('t4.deleted')->eq('0')->fi() ->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->sprints)->fi() ->beginIF(!empty($executionQuery))->andWhere($executionQuery)->fi() ->beginIF($productID)->andWhere('t3.product')->eq($productID)->fi() @@ -2319,7 +2316,7 @@ class executionModel extends model $planPairs = array('' => ''); foreach($products as $productID => $product) { - $plans = $this->productplan->getBranchPlanPairs($productID, array(BRANCH_MAIN) + $product->branches, true); + $plans = $this->productplan->getBranchPlanPairs($productID, array(BRANCH_MAIN) + $product->branches, 'unexpired', true); foreach($plans as $plan) $planPairs += $plan; } $this->config->product->search['params']['plan']['values'] = $planPairs; @@ -4656,6 +4653,8 @@ class executionModel extends model { $this->loadModel('productplan'); + $date = date('Y-m-d'); + $param = strtolower($param); $branchIdList = strpos($param, 'withmainplan') !== false ? array(BRANCH_MAIN => BRANCH_MAIN) : array(); $branchGroups = $this->getBranchByProduct(array_keys($products), $executionID, 'noclosed'); @@ -4686,6 +4685,8 @@ class executionModel extends model ->where('t1.product')->in(array_keys($products)) ->andWhere('t1.deleted')->eq(0) ->andWhere($branchQuery) + ->beginIF(strpos($param, 'unexpired') !== false)->andWhere('t1.end')->ge($date)->fi() + ->beginIF(strpos($param, 'noclosed') !== false)->andWhere('t1.status')->ne('closed')->fi() ->orderBy('t1.begin desc') ->fetchAll('id'); diff --git a/module/execution/view/story.html.php b/module/execution/view/story.html.php index 15d06fd689..6ca7343939 100644 --- a/module/execution/view/story.html.php +++ b/module/execution/view/story.html.php @@ -408,7 +408,8 @@ diff --git a/module/file/control.php b/module/file/control.php index c19efc9cc2..7bf6ae7588 100755 --- a/module/file/control.php +++ b/module/file/control.php @@ -131,7 +131,7 @@ class file extends control { echo(js::alert($this->lang->file->accessDenied)); if(isonlybody()) return print(js::reload('parent.parent')); - return print(js::locate(helper::createLink('my', 'index'))); + return print(js::locate(helper::createLink('my', 'index'), 'parent.parent')); } /* Judge the mode, down or open. */ diff --git a/module/my/control.php b/module/my/control.php index f4f4a98646..75e03d3233 100755 --- a/module/my/control.php +++ b/module/my/control.php @@ -962,7 +962,10 @@ EOF; } else { - $this->lang->my->auditMenu->audit = $this->my->getReviewingTypeList(); + $typeList = $this->my->getReviewingTypeList(); + if(!isset($typeList->$browseType)) $browseType = 'all'; + + $this->lang->my->auditMenu->audit = $typeList; $reviewList = $this->my->getReviewingList($browseType, $orderBy, $pager); } diff --git a/module/product/control.php b/module/product/control.php index 8f1001d8f1..4045f5c654 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -257,7 +257,7 @@ class product extends control $this->products = $this->product->getProducts($projectID, 'all', '', false); $projectProducts = $this->product->getProducts($projectID); - $productPlans = $this->execution->getPlans($projectProducts, 'skipParent', $projectID); + $productPlans = $this->execution->getPlans($projectProducts, 'skipParent,unexpired,noclosed', $projectID); if($browseType == 'bybranch') $param = $branchID; $stories = $this->story->getExecutionStories($projectID, $productID, $branchID, $sort, $browseType, $param, $storyType, '', $pager); diff --git a/module/productplan/control.php b/module/productplan/control.php index 6f7fa1bdce..8a941102e7 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -1030,6 +1030,7 @@ class productplan extends control $parentPlan = $this->productplan->getByID($parentID); foreach(explode(',', $parentPlan->branch) as $parentBranchID) { + if(!isset($branchPairs[$parentBranchID])) continue; $parentBranches[$parentBranchID] = $branchPairs[$parentBranchID]; if(!empty($currentBranches) and strpos(",$currentBranches,", ",$parentBranchID,") === false) $currentBranches = str_replace(",$parentBranchID,", ',', $currentBranches); } diff --git a/module/productplan/model.php b/module/productplan/model.php index ad8a367e33..dbb8372e66 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -460,11 +460,12 @@ class productplanModel extends model * * @param int $productID * @param array $branches + * @param string $param * @param bool $skipParent * @access public * @return array */ - public function getBranchPlanPairs($productID, $branches = '', $skipParent = false) + public function getBranchPlanPairs($productID, $branches = '', $param = '', $skipParent = false) { $branchQuery = ''; if($branches !== '' and $branches !== 'all') @@ -479,10 +480,14 @@ class productplanModel extends model $branchQuery .= ')'; } + $date = date('Y-m-d'); + $param = strtolower($param); $plans = $this->dao->select('parent,branch,id,title,begin,end')->from(TABLE_PRODUCTPLAN) ->where('product')->eq($productID) ->andWhere('deleted')->eq(0) ->beginIF(!empty($branchQuery))->andWhere($branchQuery)->fi() + ->beginIF($branches != '')->andWhere('branch')->in($branches)->fi() + ->beginIF(strpos($param, 'unexpired') !== false)->andWhere('end')->ge($date)->fi() ->orderBy('begin desc') ->fetchAll('id'); diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index 3f032ac745..c1f1db4e25 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -52,7 +52,7 @@ hasProduct):?> build->product;?> - build->branch;?> + build->branch;?> multiple):?> @@ -84,7 +84,12 @@ multiple):?> execution):?> - executionName;?> + + executionName;?> + executionDeleted):?> + build->deleted;?> + + diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index 3aa33fb6b4..279122c073 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -87,6 +87,16 @@ class projectrelease extends control $releases = $this->projectrelease->getList($projectID, $type, $orderBy, $pager); + $showBranch = false; + foreach($releases as $release) + { + if($release->productType != 'normal') + { + $showBranch = true; + break; + } + } + $this->view->title = $objectName . $this->lang->colon . $this->lang->release->browse; $this->view->execution = $execution; $this->view->project = $project; @@ -97,6 +107,7 @@ class projectrelease extends control $this->view->type = $type; $this->view->from = $this->app->tab; $this->view->pager = $pager; + $this->view->showBranch = $showBranch; $this->display(); } @@ -136,7 +147,7 @@ class projectrelease extends control $builds = $this->build->getBuildPairs($this->view->product->id, 'all', 'notrunk|withbranch|hasproject', $projectID, 'project', '', false); $releasedBuilds = $this->projectrelease->getReleasedBuilds($projectID); foreach($releasedBuilds as $build) unset($builds[$build]); - + $this->view->title = $this->view->project->name . $this->lang->colon . $this->lang->release->create; $this->view->projectID = $projectID; $this->view->builds = $builds; diff --git a/module/projectrelease/model.php b/module/projectrelease/model.php index 259f1ad772..1cb51eee9e 100644 --- a/module/projectrelease/model.php +++ b/module/projectrelease/model.php @@ -59,7 +59,7 @@ class projectreleaseModel extends model */ public function getList($projectID, $type = 'all', $orderBy = 't1.date_desc', $pager = null) { - $releases = $this->dao->select('t1.*, t2.name as productName')->from(TABLE_RELEASE)->alias('t1') + $releases = $this->dao->select('t1.*, t2.name as productName, t2.type as productType')->from(TABLE_RELEASE)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') ->where('t1.deleted')->eq(0) ->andWhere("FIND_IN_SET($projectID, t1.project)") diff --git a/module/projectrelease/view/browse.html.php b/module/projectrelease/view/browse.html.php index 39e62aca76..013ea04061 100644 --- a/module/projectrelease/view/browse.html.php +++ b/module/projectrelease/view/browse.html.php @@ -53,7 +53,9 @@ projectrelease->product;?> release->includedBuild;?> + release->branch;?> + release->status;?> release->date;?> createLink($build->execution ? 'build' : 'projectbuild', 'view', "buildID=$buildID"), $build->name, '', "data-app='project' title='{$build->name}'");?> processStatus('release', $release);?> + class='c-branch text-center'>branchName; ?> + class='c-status text-center' title=''> diff --git a/module/release/control.php b/module/release/control.php index 611f4b1684..ee3070a121 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -50,12 +50,23 @@ class release extends control $uri = $this->app->getURI(true); $this->session->set('releaseList', $uri, 'product'); $this->session->set('buildList', $uri); + $releases = $this->release->getList($productID, $branch, $type, $orderBy, $pager); + $showBranch = false; + foreach($releases as $release) + { + if($release->productType != 'normal') + { + $showBranch = true; + break; + } + } $this->view->title = $this->view->product->name . $this->lang->colon . $this->lang->release->browse; $this->view->position[] = $this->lang->release->browse; - $this->view->releases = $this->release->getList($productID, $branch, $type, $orderBy, $pager); + $this->view->releases = $releases; $this->view->type = $type; $this->view->pager = $pager; + $this->view->showBranch = $showBranch; $this->display(); } diff --git a/module/release/model.php b/module/release/model.php index ea1e215de2..2b089d5860 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -58,7 +58,7 @@ class releaseModel extends model */ public function getList($productID, $branch = 'all', $type = 'all', $orderBy = 't1.date_desc', $pager = null) { - $releases = $this->dao->select('t1.*, t2.name as productName')->from(TABLE_RELEASE)->alias('t1') + $releases = $this->dao->select('t1.*, t2.name as productName, t2.type as productType')->from(TABLE_RELEASE)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') ->where('t1.deleted')->eq(0) ->beginIF($productID)->andWhere('t1.product')->eq((int)$productID)->fi() @@ -84,8 +84,19 @@ class releaseModel extends model $releaseBuilds[] = $builds[$buildID]; } - $release->builds = $releaseBuilds; + + $branchName = ''; + if($release->branch != 'normal') + { + foreach(explode(',', $release->branch) as $releaseBranch) + { + $branchName .= $this->loadModel('branch')->getById($releaseBranch); + $branchName .= ','; + } + $branchName = trim($branchName, ','); + } + $release->branchName = empty($branchName) ? $this->lang->branch->main : $branchName; } return $releases; @@ -224,6 +235,7 @@ class releaseModel extends model $linkedBuilds = array_merge($linkedBuilds, explode(',', $build->builds)); } if($linkedBuilds) $builds += $this->dao->select('id,project,branch,builds,stories,bugs')->from(TABLE_BUILD)->where('id')->in($linkedBuilds)->fetchAll('id'); + $branches = array(); foreach($builds as $build) { foreach(explode(',', $build->branch) as $buildBranch) @@ -328,10 +340,14 @@ class releaseModel extends model /* update release project and branch */ if($release->build) { - $builds = $this->dao->select('project, branch')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll(); + $builds = $this->dao->select('project, branch')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll(); + $branches = array(); foreach($builds as $build) { - $branches[$build->branch] = $build->branch; + foreach(explode(',', $build->branch) as $buildBranch) + { + if(!isset($branches[$buildBranch])) $branches[$buildBranch] = $buildBranch; + } $projects[$build->project] = $build->project; } $release->build = ',' . trim($release->build, ',') . ','; diff --git a/module/release/view/browse.html.php b/module/release/view/browse.html.php index ad9b6aa7c4..2f0fe5bf04 100644 --- a/module/release/view/browse.html.php +++ b/module/release/view/browse.html.php @@ -52,6 +52,9 @@ release->id;?> release->name;?> release->includedBuild;?> + + release->branch;?> + release->relatedProject;?> release->status;?> release->date;?> @@ -98,6 +101,11 @@ ?> + + + class='c-branch text-center'>branchName; ?> + + projectName;?> processStatus('release', $release);?> diff --git a/module/story/control.php b/module/story/control.php index 4e4dc56dcc..25e576180b 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -263,7 +263,9 @@ class story extends control } else { - $response['locate'] = $this->session->storyList; + $sessionStoryList = $this->session->storyList; + if(count($_POST['branches']) > 1) $sessionStoryList = preg_replace('/branch=(\d+|[A-Za-z]+)/', 'branch=all', $this->session->storyList); + $response['locate'] = $sessionStoryList; } } } @@ -1064,7 +1066,7 @@ class story extends control $moduleList = $branchProduct ? $modulePairs : array(0 => $modulePairs); $modules = array($productID => $moduleList); - $plans = array($productID => $this->productplan->getBranchPlanPairs($productID, '', true)); + $plans = array($productID => $this->productplan->getBranchPlanPairs($productID, '', 'unexpired', true)); $products = array($productID => $product); $branchTagOption = array($productID => $branchTagOption); } @@ -1096,7 +1098,7 @@ class story extends control $modulePairs = $this->tree->getOptionMenu($storyProduct->id, 'story', 0, $branches); $modules[$storyProduct->id] = $storyProduct->type != 'normal' ? $modulePairs : array(0 => $modulePairs); - $plans[$storyProduct->id] = $this->productplan->getBranchPlanPairs($storyProduct->id, $branches, true); + $plans[$storyProduct->id] = $this->productplan->getBranchPlanPairs($storyProduct->id, $branches, 'unexpired', true); if(empty($plans[$storyProduct->id])) $plans[$storyProduct->id][0] = $plans[$storyProduct->id]; if($storyProduct->type != 'normal') $branchProduct = true; diff --git a/module/story/lang/de.php b/module/story/lang/de.php index a02500a216..1230c70ab0 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -521,4 +521,4 @@ $lang->requirement->linkStory = 'Link Story'; $lang->story->addBranch = 'Add %s'; $lang->story->deleteBranch = 'Delete %s'; -$lang->story->notice->branch = 'Each branch will establish a requirement, and the requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; +$lang->story->notice->branch = 'Each branch will establish a requirement. The requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index de58d24c61..f161d210e3 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -521,4 +521,4 @@ $lang->requirement->linkStory = 'Link Story'; $lang->story->addBranch = 'Add %s'; $lang->story->deleteBranch = 'Delete %s'; -$lang->story->notice->branch = 'Each branch will establish a requirement, and the requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; +$lang->story->notice->branch = 'Each branch will establish a requirement. The requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index 07c3f8038c..e1c04c3599 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -521,4 +521,4 @@ $lang->requirement->linkStory = 'Lier Story'; $lang->story->addBranch = 'Add %s'; $lang->story->deleteBranch = 'Delete %s'; -$lang->story->notice->branch = 'Each branch will establish a requirement, and the requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; +$lang->story->notice->branch = 'Each branch will establish a requirement. The requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 0d183843f4..c657376873 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -521,4 +521,4 @@ $lang->requirement->linkStory = "关联{$lang->SRCommon}"; $lang->story->addBranch = '添加%s'; $lang->story->deleteBranch = '删除%s'; -$lang->story->notice->branch = '每个分支会建立一个需求,需求间互为孪生关系,孪生需求间除产品、分支、模块、计划、阶段字段外均同步,后期您可以手动解除孪生关系'; +$lang->story->notice->branch = '每个分支会建立一个需求,需求间互为孪生关系。孪生需求间除产品、分支、模块、计划、阶段字段外均保持同步,后期您可以手动解除孪生关系。'; diff --git a/module/story/model.php b/module/story/model.php index 8303cf05e7..cd53755880 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1256,7 +1256,7 @@ class storyModel extends model if(empty($childrenStatus)) return $this->dao->update(TABLE_STORY)->set('parent')->eq('0')->where('id')->eq($parentID)->exec(); $status = $oldParentStory->status; - if(count($childrenStatus) == 1 and $oldParentStory->status != 'changing') + if(count($childrenStatus) == 1 and $oldParentStory->status != 'changing' and $oldParentStory->status != 'reviewing') { $status = current($childrenStatus); if($status == 'draft' or $status == 'changing') $status = 'active'; diff --git a/module/testtask/model.php b/module/testtask/model.php index 4f837c3ba7..8841c5f707 100755 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -91,7 +91,7 @@ class testtaskModel extends model ->beginIF($scopeAndStatus[0] == 'all')->andWhere('t1.product')->in($products)->fi() ->beginIF(strtolower($scopeAndStatus[1]) == 'totalstatus')->andWhere('t1.status')->in('blocked,doing,wait,done')->fi() ->beginIF(!in_array(strtolower($scopeAndStatus[1]), array('totalstatus', 'review'), true))->andWhere('t1.status')->eq($scopeAndStatus[1])->fi() - ->beginIF($branch !== 'all')->andWhere('t4.branch')->eq($branch)->fi() + ->beginIF($branch !== 'all')->andWhere("CONCAT(',', t4.branch, ',')")->like("%,$branch,%")->fi() ->beginIF($beginTime)->andWhere('t1.begin')->ge($beginTime)->fi() ->beginIF($endTime)->andWhere('t1.end')->le($endTime)->fi() ->beginIF($branch == BRANCH_MAIN) diff --git a/module/transfer/model.php b/module/transfer/model.php index 82cf31e94d..f9374a6bb8 100644 --- a/module/transfer/model.php +++ b/module/transfer/model.php @@ -852,7 +852,7 @@ class transferModel extends model $storyDatas = end($stories); $lastBranch = $storyDatas->branch; $lastType = $storyDatas->type; - $stories = $this->story->mergePlanTitle($productID , $stories, $lastBranch, $lastType); + $stories = $this->loadModel('story')->mergePlanTitle($productID , $stories, $lastBranch, $lastType); return $stories; } diff --git a/module/webhook/model.php b/module/webhook/model.php index ce5c32ad80..74a292e885 100644 --- a/module/webhook/model.php +++ b/module/webhook/model.php @@ -422,6 +422,7 @@ class webhookModel extends model $viewLink = $this->getViewLink($objectType == 'kanbancard' ? 'kanban' : $objectType, $objectType == 'kanbancard' ? $object->kanban : $objectID); $objectTypeName = ($objectType == 'story' and $object->type == 'requirement') ? $this->lang->action->objectTypes['requirement'] : $this->lang->action->objectTypes[$objectType]; $title = $this->app->user->realname . $this->lang->action->label->$actionType . $objectTypeName; + $host = (defined('RUN_MODE') and RUN_MODE == 'api') ? '' : $host; $text = $title . ' ' . "[#{$objectID}::{$object->$field}](" . $host . $viewLink . ")"; $mobile = '';