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

Override New Insertion

"; 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->object[$module] . $lang->arrow . $lang->custom->$module->fields[$field]?>
- + @@ -72,7 +72,7 @@ EOT; - + @@ -109,10 +109,10 @@ EOT;
custom->storyReview;?>
custom->forceReview;?> custom->notice->forceReview;?>custom->notice->forceReview, $lang->$module->common);?>
custom->notice->longlife;?>
- + - + diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index f984f4a756..85a633da7a 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -106,16 +106,16 @@ $storyTasks[$story->id] > 0 ? print(html::a($tasksLink, $storyTasks[$story->id], '', 'class="iframe"')) : print(0); ?> - + diff --git a/module/story/model.php b/module/story/model.php index 28880152d5..496549dabb 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1585,7 +1585,7 @@ class storyModel extends model } } - $allProduct = "`product` = 'all'"; + $allProduct = "`product` = 'all'"; $storyQuery = $this->session->projectStoryQuery; if(strpos($this->session->projectStoryQuery, $allProduct) !== false) { diff --git a/module/testcase/js/edit.js b/module/testcase/js/edit.js index 602030e67c..2b5d8ceb21 100644 --- a/module/testcase/js/edit.js +++ b/module/testcase/js/edit.js @@ -51,6 +51,13 @@ function loadLinkCases(caseID) $('#linkCaseBox').load(caseLink); } +/** + * Load lib modules. + * + * @param int $libID + * @access public + * @return void + */ function loadLibModules(libID) { link = createLink('tree', 'ajaxGetOptionMenu', 'libID=' + libID + '&viewtype=caselib&branch=0&rootModuleID=0&returnType=html&needManage=true'); diff --git a/module/testcase/model.php b/module/testcase/model.php index c7d9fb47ce..7e0b1b6cac 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -45,7 +45,7 @@ class testcaseModel extends model $case = fixer::input('post') ->add('openedBy', $this->app->user->account) ->add('openedDate', $now) - ->add('status', $this->isForceReview() ? 'wait' : 'normal') + ->add('status', $this->forceReview() ? 'wait' : 'normal') ->add('version', 1) ->add('fromBug', $bugID) ->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion((int)$this->post->story)) @@ -127,7 +127,7 @@ class testcaseModel extends model $this->loadModel('story'); $storyVersions = array(); - $isForceReview = $this->isForceReview(); + $forceReview = $this->forceReview(); for($i = 0; $i < $batchNum; $i++) { if($cases->type[$i] != '' and $cases->title[$i] != '') @@ -146,7 +146,7 @@ class testcaseModel extends model $data[$i]->keywords = $cases->keywords[$i]; $data[$i]->openedBy = $this->app->user->account; $data[$i]->openedDate = $now; - $data[$i]->status = $isForceReview ? 'wait' : 'normal'; + $data[$i]->status = $forceReview ? 'wait' : 'normal'; $data[$i]->version = 1; $caseStory = $data[$i]->story; @@ -518,7 +518,7 @@ class testcaseModel extends model ->join('stage', ',') ->remove('comment,steps,expects,files,labels,stepType') ->get(); - if($this->isForceReview() and $stepChanged) $case->status = 'wait'; + if($this->forceReview() and $stepChanged) $case->status = 'wait'; $this->dao->update(TABLE_CASE)->data($case)->autoCheck()->batchCheck($this->config->testcase->edit->requiredFields, 'notempty')->where('id')->eq((int)$caseID)->exec(); if(!$this->dao->isError()) { @@ -721,7 +721,7 @@ class testcaseModel extends model if($data->pris[$caseID] == 'ditto') $data->pris[$caseID] = isset($prev['pri']) ? $prev['pri'] : 3; if($data->modules[$caseID] == 'ditto') $data->modules[$caseID] = isset($prev['module']) ? $prev['module'] : 0; if($data->types[$caseID] == 'ditto') $data->types[$caseID] = isset($prev['type']) ? $prev['type'] : ''; - if($data->stories[$caseID] == '') $data->stories[$caseID] = 0; + if($data->stories[$caseID] == '') $data->stories[$caseID] = 0; $prev['pri'] = $data->pris[$caseID]; $prev['module'] = $data->modules[$caseID]; @@ -929,7 +929,7 @@ class testcaseModel extends model $cases[$key] =$caseData; } - $isForceReview = $this->isForceReview(); + $forceReview = $this->forceReview(); foreach($cases as $key => $caseData) { if(!empty($_POST['id'][$key]) and empty($_POST['insert'])) @@ -984,7 +984,7 @@ class testcaseModel extends model { $caseData->lastEditedBy = $this->app->user->account; $caseData->lastEditedDate = $now; - if($stepChanged and $isForceReview) $caseData->status = 'wait'; + if($stepChanged and $forceReview) $caseData->status = 'wait'; $this->dao->update(TABLE_CASE)->data($caseData)->where('id')->eq($caseID)->autoCheck()->exec(); if($stepChanged) { @@ -1018,7 +1018,7 @@ class testcaseModel extends model $caseData->openedBy = $this->app->user->account; $caseData->openedDate = $now; $caseData->branch = isset($data->branch[$key]) ? $data->branch[$key] : $branch; - if($isForceReview) $caseData->status = 'wait'; + if($forceReview) $caseData->status = 'wait'; $this->dao->insert(TABLE_CASE)->data($caseData)->autoCheck()->exec(); if(!dao::isError()) @@ -1383,7 +1383,7 @@ class testcaseModel extends model * @access public * @return void */ - public function isForceReview() + public function forceReview() { if(!$this->config->testcase->needReview) return false; if(empty($this->config->testcase->forceReview)) return true;
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;?>