diff --git a/module/block/model.php b/module/block/model.php index 6e9ca9d619..43682a746a 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -397,6 +397,39 @@ class blockModel extends model return $this->getListParams($module); } + /** + * Get closed block pairs. + * + * @param string $closedBlock + * @access public + * @return array + */ + public function getClosedBlockPairs($closedBlock) + { + $blockPairs = array(); + if(empty($closedBlock)) return $blockPairs; + + foreach(explode(',', $closedBlock) as $block) + { + $block = trim($block); + if(empty($block)) continue; + + list($moduleName, $blockKey) = explode('|', $block); + if(empty($moduleName)) + { + if($blockKey == 'html') $blockPairs[$block] = 'HTML'; + if($blockKey == 'flowchart') $blockPairs[$block] = $this->lang->block->lblFlowchart; + if($blockKey == 'dynamic') $blockPairs[$block] = $this->lang->block->dynamic; + } + else + { + $blockPairs[$block] = "{$this->lang->block->moduleList[$moduleName]}|{$this->lang->block->modules[$moduleName]->availableBlocks->$blockKey}"; + } + } + + return $blockPairs; + } + /** * Build number params. * diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 256a4e1856..428b3a6dfa 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -429,8 +429,8 @@ $lang->pager->locate = "GO!"; $lang->proVersion = "ZenTao Pro "; $lang->downNotify = "Download Desktop Notification"; -$lang->suhosinInfo = "Warning! Data is reaching the limit. Please change sohusin.post.max_vars and sohusin.request.max_vars (set larger value) in php.ini, then save and restart Apache, or some data will not be saved."; -$lang->maxVarsInfo = "Warning! Data is reaching the limit. Please change max_input_vars (set larger value) in php.ini, then save and restart Apache, or some data will not be saved."; +$lang->suhosinInfo = "Warning! Data is reaching the limit. Please change sohusin.post.max_vars and sohusin.request.max_vars (set larger value) in php.ini, then save and restart Apache or php-fpm, or some data will not be saved."; +$lang->maxVarsInfo = "Warning! Data is reaching the limit. Please change max_input_vars (set larger value) in php.ini, then save and restart Apache or php-fpm, or some data will not be saved."; $lang->pasteTextInfo = "Paste text into text field. Each line will be a header of each data record. "; $lang->noticeImport = "
Imported data contains data that has already existed in system. Please confirm you actions on the date
"; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 7de6ba8f0c..3eecf10939 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -430,8 +430,8 @@ $lang->pager->locate = "GO!"; $lang->proVersion = "专业版 "; $lang->downNotify = "下载桌面提醒"; -$lang->suhosinInfo = "警告:数据太多,请在php.ini中修改sohusin.post.max_vars和sohusin.request.max_vars(设置更大的数)。 保存并重新启动apache,否则会造成部分数据无法保存。"; -$lang->maxVarsInfo = "警告:数据太多,请在php.ini中修改max_input_vars(设置更大的数)。 保存并重新启动apache,否则会造成部分数据无法保存。"; +$lang->suhosinInfo = "警告:数据太多,请在php.ini中修改sohusin.post.max_vars和sohusin.request.max_vars(设置更大的数)。 保存并重新启动apache或php-fpm,否则会造成部分数据无法保存。"; +$lang->maxVarsInfo = "警告:数据太多,请在php.ini中修改max_input_vars(设置更大的数)。 保存并重新启动apache或php-fpm,否则会造成部分数据无法保存。"; $lang->pasteTextInfo = "粘贴文本到文本域中,每行文字作为一条数据的标题。"; $lang->noticeImport = "导入数据中,含有已经存在系统的数据,请确认这些数据要覆盖或者全新插入
"; diff --git a/module/custom/config.php b/module/custom/config.php index 4ccd030c93..1b04fa8303 100644 --- a/module/custom/config.php +++ b/module/custom/config.php @@ -7,3 +7,4 @@ $config->custom->canAdd['testcase'] = 'priList,typeList,stageList,resultList,sta $config->custom->canAdd['testtask'] = 'priList'; $config->custom->canAdd['todo'] = 'priList,typeList'; $config->custom->canAdd['user'] = 'roleList'; +$config->custom->canAdd['block'] = ''; diff --git a/module/custom/control.php b/module/custom/control.php index c5d3990985..439d593371 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -34,6 +34,7 @@ class custom extends control public function set($module = 'story', $field = 'priList', $lang = 'zh_cn') { if($module == 'user' and $field == 'priList') $field = 'roleList'; + if($module == 'block' and $field == 'priList')$field = 'closed'; $currentLang = $this->app->getClientLang(); $this->app->loadLang($module); @@ -45,65 +46,49 @@ class custom extends control unset($fieldList['newfeature']); unset($fieldList['trackthings']); } - if(($module == 'story' || $module == 'testcase') && $field == 'review') + if(($module == 'story' or $module == 'testcase') and $field == 'review') { $this->app->loadConfig($module); $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noclosed'); $this->view->needReview = zget($this->config->$module, 'needReview', 1); $this->view->forceReview = zget($this->config->$module, 'forceReview', ''); } - if($module == 'task' && $field == 'hours') + if($module == 'task' and $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') + if($module == 'bug' and $field == 'longlife') { $this->app->loadConfig('bug'); $this->view->longlife = $this->config->bug->longlife; } - if($module == 'user' && $field == 'closedBlock') + if($module == 'block' and $field == 'closed') { $this->loadModel('block'); $closedBlock = isset($this->config->block->closed) ? $this->config->block->closed : ''; - $blockPairs = array(); - foreach(explode(',', $closedBlock) as $block) - { - $block = trim($block); - if(empty($block)) continue; - list($moduleName, $blockKey) = explode('|', $block); - if(empty($moduleName)) - { - if($blockKey == 'html') $blockPairs[$block] = 'HTML'; - if($blockKey == 'flowchart') $blockPairs[$block] = $this->lang->block->lblFlowchart; - if($blockKey == 'dynamic') $blockPairs[$block] = $this->lang->block->dynamic; - } - else - { - $blockPairs[$block] = "{$this->lang->block->moduleList[$moduleName]}|{$this->lang->block->modules[$moduleName]->availableBlocks->$blockKey}"; - } - } + + $this->view->blockPairs = $this->block->getClosedBlockPairs($closedBlock); $this->view->closedBlock = $closedBlock; - $this->view->blockPairs = $blockPairs; } if(!empty($_POST)) { - if(($module == 'story' || $module == 'testcase') && $field == 'review') + if(($module == 'story' or $module == 'testcase') and $field == 'review') { $data = fixer::input('post')->join('forceReview', ',')->get(); $this->loadModel('setting')->setItems("system.$module", $data); } - elseif($module == 'task' && $field == 'hours') + elseif($module == 'task' and $field == 'hours') { $this->loadModel('setting')->setItems('system.project', fixer::input('post')->get()); } - elseif($module == 'bug' && $field == 'longlife') + elseif($module == 'bug' and $field == 'longlife') { $this->loadModel('setting')->setItems('system.bug', fixer::input('post')->get()); } - elseif($module == 'user' && $field == 'closedBlock') + elseif($module == 'block' and $field == 'closed') { $this->loadModel('setting')->setItems('system.block', fixer::input('post')->join('closed', ',')->get()); } diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index d1a8a2ed26..6540d1eada 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -73,7 +73,7 @@ $lang->custom->confirmRestore = 'Do you want to reset to Default?'; $lang->custom->notice = new stdclass(); $lang->custom->notice->userRole = 'Key must be no more than 20 characters!'; $lang->custom->notice->canNotAdd = 'This item will be processed, so customized feature is not enabled.'; -$lang->custom->notice->forceReview = 'Review is required for stories submitted by certain assignee.'; +$lang->custom->notice->forceReview = 'Review is required for %s submitted by certain assignee.'; $lang->custom->notice->longlife = 'List "Undone" bugs that are older than hold days from "Longlife" bugs.'; $lang->custom->notice->priListKey = 'Priority list key should be numbers!'; $lang->custom->notice->severityListKey = 'Bug severity list key should be numbers.'; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index bc5b9c8eee..5f0652e2be 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -16,6 +16,7 @@ $lang->custom->object['testcase'] = '用例'; $lang->custom->object['testtask'] = '版本'; $lang->custom->object['todo'] = '待办'; $lang->custom->object['user'] = '用户'; +$lang->custom->object['block'] = '区块'; $lang->custom->story = new stdClass(); $lang->custom->story->fields['priList'] = '优先级'; @@ -61,9 +62,10 @@ $lang->custom->todo->fields['typeList'] = '类型'; $lang->custom->todo->fields['statusList'] = '状态'; $lang->custom->user = new stdClass(); -$lang->custom->user->fields['roleList'] = '职位'; -$lang->custom->user->fields['statusList'] = '状态'; -$lang->custom->user->fields['closedBlock'] = '关闭的区块'; +$lang->custom->user->fields['roleList'] = '职位'; +$lang->custom->user->fields['statusList'] = '状态'; + +$lang->custom->block->fields['closed'] = '关闭的区块'; $lang->custom->currentLang = '适用当前语言'; $lang->custom->allLang = '适用所有语言'; @@ -73,7 +75,7 @@ $lang->custom->confirmRestore = '是否要恢复默认配置?'; $lang->custom->notice = new stdclass(); $lang->custom->notice->userRole = '键的长度必须小于20个字符!'; $lang->custom->notice->canNotAdd = '该项参与运算,不提供自定义添加功能'; -$lang->custom->notice->forceReview = '指定人提交的需求必须评审。'; +$lang->custom->notice->forceReview = "指定人提交的%s必须评审。"; $lang->custom->notice->longlife = 'Bug列表页面的久未处理标签中,列出设置天数之前未处理的Bug。'; $lang->custom->notice->priListKey = '优先级的键应当为数字!'; $lang->custom->notice->severityListKey = 'Bug严重程度的键应当为数字!'; diff --git a/module/custom/view/set.html.php b/module/custom/view/set.html.php index 81df1aa09e..24de73e42d 100644 --- a/module/custom/view/set.html.php +++ b/module/custom/view/set.html.php @@ -62,7 +62,7 @@ EOT;| custom->storyReview;?> | @@ -72,7 +72,7 @@ EOT;|||
|---|---|---|---|
| custom->forceReview;?> | - | custom->notice->forceReview;?> | +custom->notice->forceReview, $lang->$module->common);?> |
| @@ -109,10 +109,10 @@ EOT; |
| custom->user->fields['closedBlock'];?> | +custom->block->fields['closed'];?> | |||||
|---|---|---|---|---|---|---|
| - createLink('story', 'bugs', "storyID=$story->id&projectID=$project->id"); - $storyBugs[$story->id] > 0 ? print(html::a($bugsLink, $storyBugs[$story->id], '', 'class="iframe"')) : print(0); - ?> + createLink('story', 'bugs', "storyID=$story->id&projectID=$project->id"); + $storyBugs[$story->id] > 0 ? print(html::a($bugsLink, $storyBugs[$story->id], '', 'class="iframe"')) : print(0); + ?> | - createLink('story', 'cases', "storyID=$story->id&projectID=$project->id"); - $storyCases[$story->id] > 0 ? print(html::a($casesLink, $storyCases[$story->id], '', 'class="iframe"')) : print(0); - ?> + createLink('story', 'cases', "storyID=$story->id&projectID=$project->id"); + $storyCases[$story->id] > 0 ? print(html::a($casesLink, $storyCases[$story->id], '', 'class="iframe"')) : print(0); + ?> | testtask->begin;?> | testtask->end;?> | statusAB;?> | -actions;?> | +actions;?> |