diff --git a/module/build/control.php b/module/build/control.php index 54081658a1..6c279e0e26 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -132,6 +132,9 @@ class build extends control $build = $this->build->getById((int)$buildID, true); if(!$build) die(js::error($this->lang->notFound) . js::locate('back')); + $product = $this->loadModel('product')->getById($build->product); + if($product->type != 'normal') $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); + $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($build->stories)->andWhere('deleted')->eq(0)->fetchAll('id'); $stages = $this->dao->select('*')->from(TABLE_STORYSTAGE)->where('story')->in($build->stories)->andWhere('branch')->eq($build->branch)->fetchPairs('story', 'stage'); foreach($stages as $storyID => $stage)$stories[$storyID]->stage = $stage; diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index 24d6c9f814..715e68cdf6 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -24,8 +24,8 @@
| build->product;?> | -- + + |
id, "onchange='loadBranches(this.value);' class='form-control chosen'");?>
-
|
+
build->noProduct, $this->createLink('project', 'manageproducts', "projectID=$projectID"));?> | |||||
|---|---|---|---|---|---|---|---|---|
| build->name;?> | -+ |
diff --git a/module/file/lang/en.php b/module/file/lang/en.php
index 1e8c2c477d..6b027f4d61 100644
--- a/module/file/lang/en.php
+++ b/module/file/lang/en.php
@@ -31,4 +31,5 @@ $lang->file->errorExtract = 'Decompression failure! The file may have been d
$lang->file->uploadImagesExplain = << 2. The file name at the beginning contains 'digital+underline', generation of title will they ignore. +3、Image format : jpg|jpeg|gif|png. EOD; diff --git a/module/file/lang/zh-cn.php b/module/file/lang/zh-cn.php index bd81b1a8ee..087ddf0c54 100644 --- a/module/file/lang/zh-cn.php +++ b/module/file/lang/zh-cn.php @@ -31,4 +31,5 @@ $lang->file->errorExtract = '解压缩失败!可能文件已经损坏, $lang->file->uploadImagesExplain = <<2、如果文件名可以开头含有 数字+下划线,以方便排序,程序会将他们忽略。 +3、图片格式:jpg|jpeg|gif|png。 EOD; diff --git a/module/file/model.php b/module/file/model.php index cca958f6d0..a2aaf1a16f 100644 --- a/module/file/model.php +++ b/module/file/model.php @@ -408,8 +408,8 @@ class fileModel extends model $files = $zip->listContent(); foreach($files as $uploadFile) { - $extension = substr(strrchr($uploadFile['filename'], '.'), 1); - if(empty($extension) or strpos($this->config->file->dangers, $extension) !== false) return false; + $extension = strtolower(substr(strrchr($uploadFile['filename'], '.'), 1)); + if(empty($extension) or !in_array($extension, $this->config->file->imageExtensions)) return false; } if($zip->extract(PCLZIP_OPT_PATH, $filePath) == 0) return false; diff --git a/module/story/control.php b/module/story/control.php index 38d261b471..64ef813aca 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -522,7 +522,7 @@ class story extends control $users = $this->user->getPairs('noletter'); /* Set the menu. */ - $this->product->setMenu($this->product->getPairs(), $product->id); + $this->product->setMenu($this->product->getPairs(), $product->id, $story->branch); if($from == 'project') { diff --git a/module/story/model.php b/module/story/model.php index 2675770db6..3ffd308432 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -46,7 +46,15 @@ class storyModel extends model //$story->bugCount = $this->dao->select('COUNT(*)')->alias('count')->from(TABLE_BUG)->where('story')->eq($storyID)->fetch('count'); //$story->caseCount = $this->dao->select('COUNT(*)')->alias('count')->from(TABLE_CASE)->where('story')->eq($storyID)->fetch('count'); if($story->toBug) $story->toBugTitle = $this->dao->findById($story->toBug)->from(TABLE_BUG)->fetch('title'); - if($story->plan) $story->planTitle = join(' ', $this->dao->select('*')->from(TABLE_PRODUCTPLAN)->where('id')->in($story->plan)->fetchPairs('id', 'title')); + if($story->plan) + { + $plans = $this->dao->select('id,title,branch')->from(TABLE_PRODUCTPLAN)->where('id')->in($story->plan)->fetchAll('id'); + foreach($plans as $planID => $plan) + { + $story->planTitle[$planID] = $plan->title; + if($plan->branch and !isset($story->stages[$plan->branch])) $story->stages[$plan->branch] = 'planned'; + } + } $extraStories = array(); if($story->duplicateStory) $extraStories = array($story->duplicateStory); if($story->linkStories) $extraStories = explode(',', $story->linkStories); @@ -390,12 +398,11 @@ class storyModel extends model $oldStory = $this->getById($storyID); $story = fixer::input('post') - ->cleanInt('product,module,pri,plan') + ->cleanInt('product,module,pri') ->add('assignedDate', $oldStory->assignedDate) ->add('lastEditedBy', $this->app->user->account) ->add('lastEditedDate', $now) ->setDefault('status', $oldStory->status) - ->setIF($this->post->plan !== false and $this->post->plan == '', 'plan', 0) ->setIF($this->post->assignedTo != $oldStory->assignedTo, 'assignedDate', $now) ->setIF($this->post->closedBy != false and $oldStory->closedDate == '', 'closedDate', $now) ->setIF($this->post->closedReason != false and $oldStory->closedDate == '', 'closedDate', $now) @@ -405,6 +412,7 @@ class storyModel extends model ->join('mailto', ',') ->remove('files,labels,comment') ->get(); + if(is_array($story->plan)) $story->plan = trim(join(',', $story->plan), ','); $this->dao->update(TABLE_STORY) ->data($story) @@ -1271,6 +1279,7 @@ class storyModel extends model ->page($pager) ->fetchAll('id'); + $query = $this->dao->get(); $branches = array(); foreach($stories as $story) { @@ -1281,6 +1290,8 @@ class storyModel extends model $stages = $this->dao->select('*')->from(TABLE_STORYSTAGE)->where('story')->in($storyIDList)->andWhere('branch')->eq($branchID)->fetchPairs('story', 'stage'); foreach($stages as $storyID => $stage) $stories[$storyID]->stage = $stage; } + + $this->dao->sqlobj->sql = $query; return $stories; } @@ -1364,8 +1375,7 @@ class storyModel extends model */ public function getUserStories($account, $type = 'assignedTo', $orderBy = 'id_desc', $pager = null) { - $stories = $this->dao->select('t1.*, t2.name as productTitle') - ->from(TABLE_STORY)->alias('t1') + $stories = $this->dao->select('t1.*, t2.name as productTitle')->from(TABLE_STORY)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') ->where('t1.deleted')->eq(0) ->beginIF($type != 'all') @@ -1828,6 +1838,7 @@ class storyModel extends model foreach($storyPlans as $planID) $story->planTitle .= zget($plans, $planID) . ' '; } + $this->dao->sqlobj->sql = $query; return $stories; } } diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index 9f7f074a5a..32cbc1a686 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -83,7 +83,8 @@story->plan;?> |
|
- plan, "class='form-control chosen'");
+ session->currentProductType != 'normal' and empty($story->branch)) ? true : false;?>
+ plan, "class='form-control chosen'" . ($multiple ? ' multiple' : ''));
if(count($plans) == 1)
{
echo "";
diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php
index 43d2b3b4fd..fb7f649163 100644
--- a/module/story/view/view.html.php
+++ b/module/story/view/view.html.php
@@ -147,7 +147,18 @@
| ||||
| story->plan;?> | -planTitle)) if(!common::printLink('productplan', 'view', "planID=$story->plan", $story->planTitle)) echo $story->planTitle;?> | +
+ planTitle))
+ {
+ foreach($story->planTitle as $planID => $planTitle)
+ {
+ if(!common::printLink('productplan', 'view', "planID=$planID", $planTitle)) echo $lanTitle;
+ echo ' '; + } + } + ?> + |
||||||
| story->source;?> | diff --git a/module/testtask/control.php b/module/testtask/control.php index 21905cdcd8..cd6309e5b4 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -286,6 +286,7 @@ class testtask extends control ->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id') ->where($caseQuery) ->andWhere('t1.task')->eq($taskID) + ->beginIF($task->branch)->andWhere('t2.branch')->in("0,{$task->branch}")->fi() ->orderBy(strpos($sort, 'assignedTo') !== false ? ('t1.' . $sort) : ('t2.' . $sort)) ->page($pager) ->fetchAll(); @@ -302,16 +303,8 @@ class testtask extends control $this->config->testcase->search['params']['product']['values']= array($productID => $this->products[$productID], 'all' => $this->lang->testcase->allProduct); $this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case'); $this->config->testcase->search['actionURL'] = inlink('cases', "taskID=$taskID&browseType=bySearch&queryID=myQueryID"); - if($this->session->currentProductType == 'normal') - { - unset($this->config->testcase->search['fields']['branch']); - unset($this->config->testcase->search['params']['branch']); - } - else - { - $this->config->testcase->search['fields']['branch'] = $this->lang->product->branch; - $this->config->testcase->search['params']['branch']['values'] = array('' => '') + $this->loadModel('branch')->getPairs($productID, 'noempty'); - } + unset($this->config->testcase->search['fields']['branch']); + unset($this->config->testcase->search['params']['branch']); $this->loadModel('search')->setSearchParams($this->config->testcase->search); $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->cases; @@ -335,6 +328,14 @@ class testtask extends control $this->display(); } + /** + * Group case. + * + * @param int $taskID + * @param string $groupBy + * @access public + * @return void + */ public function groupCase($taskID, $groupBy = 'story') { /* Save the session. */ diff --git a/module/user/view/story.html.php b/module/user/view/story.html.php index 7cf0a40109..f5f0db7d74 100644 --- a/module/user/view/story.html.php +++ b/module/user/view/story.html.php @@ -45,7 +45,7 @@story->priList, $story->pri, $story->pri);?>'>story->priList, $story->pri, $story->pri);?> | productTitle;?> | title);?> | -planTitle;?> | +planTitle;?> | openedBy];?> | estimate;?> | story->statusList[$story->status];?> |