diff --git a/framework/base/router.class.php b/framework/base/router.class.php
index 0834e02b19..5818dd8422 100644
--- a/framework/base/router.class.php
+++ b/framework/base/router.class.php
@@ -1801,11 +1801,8 @@ class baseRouter
{
foreach($lang->db->custom[$moduleName] as $section => $fields)
{
- foreach($fields as $key => $value)
- {
- unset($lang->{$moduleName}->{$section}[$key]);
- $lang->{$moduleName}->{$section}[$key] = $value;
- }
+ unset($lang->{$moduleName}->{$section});
+ foreach($fields as $key => $value) $lang->{$moduleName}->{$section}[$key] = $value;
}
}
diff --git a/module/bug/config.php b/module/bug/config.php
index 685f2e2e68..8a25f7663c 100644
--- a/module/bug/config.php
+++ b/module/bug/config.php
@@ -1,6 +1,7 @@
bug = new stdClass();
$config->bug->batchCreate = 10;
+$config->bug->longlife = 7;
$config->bug->create = new stdclass();
$config->bug->edit = new stdclass();
diff --git a/module/bug/model.php b/module/bug/model.php
index 3982769215..ce4b6e0141 100644
--- a/module/bug/model.php
+++ b/module/bug/model.php
@@ -1842,11 +1842,12 @@ class bugModel extends model
*/
public function getByLonglifebugs($productID, $branch, $modules, $projects, $orderBy, $pager)
{
- return $this->dao->findByLastEditedDate("<", date(DT_DATE1, strtotime('-7 days')))->from(TABLE_BUG)->andWhere('product')->eq($productID)
+ $lastEditedDate = date(DT_DATE1, time() - $this->config->bug->longlife * 24 * 3600);
+ return $this->dao->findByLastEditedDate("<", $lastEditedDate)->from(TABLE_BUG)->andWhere('product')->eq($productID)
->andWhere('project')->in(array_keys($projects))
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
->beginIF($modules)->andWhere('module')->in($modules)->fi()
- ->andWhere('openedDate')->lt(date(DT_DATE1,strtotime('-7 days')))
+ ->andWhere('openedDate')->lt($lastEditedDate)
->andWhere('deleted')->eq(0)
->andWhere('status')->ne('closed')->orderBy($orderBy)->page($pager)->fetchAll();
}
@@ -2114,13 +2115,13 @@ class bugModel extends model
echo $bug->activatedCount;
break;
case 'openedBy':
- echo zget($users, $bug->openedBy, $bug->openedBy);
+ echo zget($users, $bug->openedBy);
break;
case 'openedDate':
echo substr($bug->openedDate, 5, 11);
break;
case 'openedBuild':
- foreach(explode(',', $bug->openedBuild) as $build) echo zget($builds, $build, $build) . '
';
+ foreach(explode(',', $bug->openedBuild) as $build) echo zget($builds, $build) . '
';
break;
case 'assignedTo':
echo zget($users, $bug->assignedTo, $bug->assignedTo);
@@ -2132,7 +2133,7 @@ class bugModel extends model
echo zget($users, $bug->resolvedBy, $bug->resolvedBy);
break;
case 'resolution':
- echo $this->lang->bug->resolutionList[$bug->resolution];
+ echo zget($this->lang->bug->resolutionList, $bug->resolution);
break;
case 'resolvedDate':
echo substr($bug->resolvedDate, 5, 11);
@@ -2141,7 +2142,7 @@ class bugModel extends model
echo $bug->resolvedBuild;
break;
case 'closedBy':
- echo zget($users, $bug->closedBy, $bug->closedBy);
+ echo zget($users, $bug->closedBy);
break;
case 'lastEditedDate':
echo substr($bug->lastEditedDate, 5, 11);
diff --git a/module/bug/view/browsedata.html.php b/module/bug/view/browsedata.html.php
index 909ce37559..9b1f63ff34 100644
--- a/module/bug/view/browsedata.html.php
+++ b/module/bug/view/browsedata.html.php
@@ -89,7 +89,7 @@
assignedTo == $this->app->user->account) echo 'class="red"';?>>assignedTo, $bug->assignedTo);?> |
resolvedBy, $bug->resolvedBy)?> |
- bug->resolutionList[$bug->resolution];?> |
+ bug->resolutionList, $bug->resolution);?> |
cookie->windowWidth >= $this->config->wideSize):?>
resolvedDate, 5, 11)?> |
diff --git a/module/common/lang/en.php b/module/common/lang/en.php
index f7612815d5..c9ca750f5f 100644
--- a/module/common/lang/en.php
+++ b/module/common/lang/en.php
@@ -304,7 +304,7 @@ $lang->admin = new stdclass();
$lang->admin->menu = new stdclass();
$lang->admin->menu->index = array('link' => 'Homepage|admin|index');
$lang->admin->menu->extension = array('link' => 'Extension|extension|browse', 'subModule' => 'extension');
-$lang->admin->menu->custom = array('link' => 'Custom|custom|index', 'subModule' => 'custom');
+$lang->admin->menu->custom = array('link' => 'Custom|custom|set', 'subModule' => 'custom');
$lang->admin->menu->mail = array('link' => 'Email|mail|index', 'subModule' => 'mail');
$lang->admin->menu->convert = array('link' => 'Import|convert|index', 'subModule' => 'convert');
$lang->admin->menu->backup = array('link' => 'Backup|backup|index', 'subModule' => 'backup');
diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php
index 7bfbf3d6aa..692c91adc8 100644
--- a/module/common/lang/zh-cn.php
+++ b/module/common/lang/zh-cn.php
@@ -304,7 +304,7 @@ $lang->admin = new stdclass();
$lang->admin->menu = new stdclass();
$lang->admin->menu->index = array('link' => '首页|admin|index');
$lang->admin->menu->extension = array('link' => '插件|extension|browse', 'subModule' => 'extension');
-$lang->admin->menu->custom = array('link' => '自定义|custom|index', 'subModule' => 'custom');
+$lang->admin->menu->custom = array('link' => '自定义|custom|set', 'subModule' => 'custom');
$lang->admin->menu->mail = array('link' => '发信|mail|index', 'subModule' => 'mail');
$lang->admin->menu->convert = array('link' => '导入|convert|index', 'subModule' => 'convert');
$lang->admin->menu->backup = array('link' => '备份|backup|index', 'subModule' => 'backup');
diff --git a/module/custom/config.php b/module/custom/config.php
index 9d068042dd..4ccd030c93 100644
--- a/module/custom/config.php
+++ b/module/custom/config.php
@@ -1,9 +1,9 @@
custom = new stdClass();
$config->custom->canAdd['story'] = 'reasonList,reviewResultList,sourceList,priList';
-$config->custom->canAdd['task'] = 'priList,typeList';
+$config->custom->canAdd['task'] = 'priList,typeList,reasonList';
$config->custom->canAdd['bug'] = 'priList,severityList,osList,browserList,typeList,resolutionList';
-$config->custom->canAdd['testcase'] = 'priList,typeList,stageList';
+$config->custom->canAdd['testcase'] = 'priList,typeList,stageList,resultList,statusList';
$config->custom->canAdd['testtask'] = 'priList';
$config->custom->canAdd['todo'] = 'priList,typeList';
$config->custom->canAdd['user'] = 'roleList';
diff --git a/module/custom/control.php b/module/custom/control.php
index c1c1efedcf..c343386b7a 100644
--- a/module/custom/control.php
+++ b/module/custom/control.php
@@ -37,8 +37,7 @@ class custom extends control
$currentLang = $this->app->getClientLang();
$this->app->loadLang($module);
- $this->app->loadConfig('story');
- $fieldList = $this->lang->$module->$field;
+ $fieldList = zget($this->lang->$module, $field, '');
if($module == 'bug' and $field == 'typeList')
{
@@ -46,12 +45,35 @@ class custom extends control
unset($fieldList['newfeature']);
unset($fieldList['trackthings']);
}
+ if($module == 'story' && $field == 'review')
+ {
+ $this->app->loadConfig('story');
+ $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noclosed');
+ $this->view->needReview = zget($this->config->story, 'needReview', 1);
+ $this->view->forceReview = zget($this->config->story, 'forceReview', '');
+ }
+ if($module == 'task' && $field == 'hours')
+ {
+ $this->app->loadConfig('project');
+ $this->view->weekend = $this->config->project->weekend;
+ $this->view->workhours = $this->config->project->defaultWorkhours;
+ }
+ if($module == 'bug' && $field == 'longlife')
+ {
+ $this->app->loadConfig('bug');
+ $this->view->longlife = $this->config->bug->longlife;
+ }
if(!empty($_POST))
{
if($module == 'story' && $field == 'review')
{
- $this->loadModel('setting')->setItem('system.story.needReview', fixer::input('post')->get()->needReview);
+ $data = fixer::input('post')->join('forceReview', ',')->get();
+ $this->loadModel('setting')->setItems('system.story', $data);
+ }
+ elseif($module == 'task' && $field == 'hours')
+ {
+ $this->loadModel('setting')->setItems('system.project', fixer::input('post')->get());
}
else
{
@@ -60,8 +82,8 @@ class custom extends control
foreach($_POST['keys'] as $index => $key)
{
$value = $_POST['values'][$index];
- if(!$value or !$key) continue;
$system = $_POST['systems'][$index];
+ if(!$system and (!$value or !$key)) continue;
/* the length of role is 20, check it when save. */
if($module == 'user' and $field == 'roleList' and strlen($key) > 20) die(js::alert($this->lang->custom->notice->userRole));
@@ -93,7 +115,6 @@ class custom extends control
$this->view->title = $this->lang->custom->common . $this->lang->colon . $this->lang->$module->common;
$this->view->position[] = $this->lang->custom->common;
$this->view->position[] = $this->lang->$module->common;
- $this->view->needReview = $this->config->story->needReview;
$this->view->fieldList = $fieldList;
$this->view->dbFields = $dbFields;
$this->view->field = $field;
diff --git a/module/custom/css/common.css b/module/custom/css/common.css
index e69de29bb2..21488f0936 100644
--- a/module/custom/css/common.css
+++ b/module/custom/css/common.css
@@ -0,0 +1 @@
+.alert-block{border-top:1px solid #ddd;}
diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php
index f16b397425..4d08f35eb9 100644
--- a/module/custom/lang/zh-cn.php
+++ b/module/custom/lang/zh-cn.php
@@ -31,6 +31,7 @@ $lang->custom->task->fields['priList'] = '优先级';
$lang->custom->task->fields['typeList'] = '类型';
$lang->custom->task->fields['reasonList'] = '关闭原因';
$lang->custom->task->fields['statusList'] = '状态';
+$lang->custom->task->fields['hours'] = '工时';
$lang->custom->bug = new stdClass();
$lang->custom->bug->fields['priList'] = '优先级';
@@ -40,6 +41,7 @@ $lang->custom->bug->fields['browserList'] = '浏览器';
$lang->custom->bug->fields['typeList'] = '类型';
$lang->custom->bug->fields['resolutionList'] = '解决方案';
$lang->custom->bug->fields['statusList'] = '状态';
+$lang->custom->bug->fields['longlife'] = '久未处理天数';
$lang->custom->testcase = new stdClass();
$lang->custom->testcase->fields['priList'] = '优先级';
@@ -67,15 +69,24 @@ $lang->custom->allLang = '适用所有语言';
$lang->custom->confirmRestore = '是否要恢复默认配置?';
$lang->custom->notice = new stdclass();
-$lang->custom->notice->userRole = '键的长度必须小于20个字符!';
+$lang->custom->notice->userRole = '键的长度必须小于20个字符!';
+$lang->custom->notice->canNotAdd = '该项值已经在禅道中固定,不能添加新值';
+$lang->custom->notice->forceReview = '指定人提交的需求必须评审。';
+$lang->custom->notice->longlife = 'Bug列表页面的久未处理标签中,列出设置天数之前未处理的Bug。';
$lang->custom->notice->indexPage['product'] = "从8.2版本起增加了产品主页视图,是否默认进入产品主页?";
$lang->custom->notice->indexPage['project'] = "从8.2版本起增加了项目主页视图,是否默认进入项目主页?";
$lang->custom->notice->indexPage['qa'] = "从8.2版本起增加了测试主页视图,是否默认进入测试主页?";
$lang->custom->storyReview = '评审流程';
+$lang->custom->forceReview = '强制评审';
$lang->custom->reviewList[1] = '开启';
$lang->custom->reviewList[0] = '关闭';
+$lang->custom->workingHours = '每天可用工时';
+$lang->custom->weekend = '周休';
+$lang->custom->weekendList[2] = '双休';
+$lang->custom->weekendList[1] = '单休';
+
$lang->custom->productProject = new stdclass();
$lang->custom->productProject->relation['0_0'] = '产品 - 项目';
$lang->custom->productProject->relation['0_1'] = '产品 - 迭代';
diff --git a/module/custom/model.php b/module/custom/model.php
index a9e253e230..8fd0c7734a 100644
--- a/module/custom/model.php
+++ b/module/custom/model.php
@@ -193,7 +193,8 @@ class customModel extends model
/* Merge fileMenu and customMenu. */
foreach($customMenuMap as $name => $item)
{
- if(!isset($allMenu->$name))$allMenu->$name = $item;
+ if(is_object($allMenu) and !isset($allMenu->$name))$allMenu->$name = $item;
+ if(is_array($allMenu) and !isset($allMenu[$name]))$allMenu[$name] = $item;
}
foreach($allMenu as $name => $item)
diff --git a/module/custom/view/flow.html.php b/module/custom/view/flow.html.php
index 24a3555b73..eca2cab2d4 100644
--- a/module/custom/view/flow.html.php
+++ b/module/custom/view/flow.html.php
@@ -29,19 +29,18 @@