From 1c7e1a6ece094c4f0889c8c82ef59e99a0d5636a Mon Sep 17 00:00:00 2001 From: Yagami Date: Tue, 13 Nov 2018 15:32:15 +0800 Subject: [PATCH 1/6] * Finish task #5112. --- module/doc/control.php | 22 ++++++++++++++++++++-- module/doc/js/edit.js | 11 +++++++++++ module/doc/model.php | 2 +- module/doc/view/edit.html.php | 5 ++++- module/group/lang/resource.php | 2 +- module/project/lang/zh-cn.php | 16 ++++++++-------- module/todo/lang/zh-cn.php | 2 +- module/tree/control.php | 18 +++++++++++++++++- module/tree/view/edit.html.php | 2 +- 9 files changed, 64 insertions(+), 16 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 8084e96f9b..22ae79100f 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -387,6 +387,22 @@ class doc extends control $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('doc', 'view', "docID=$docID"))); } + $libs = $this->doc->getLibs(); + foreach($libs as $id => $libName) + { + $lib = $this->doc->getLibById($id); + if($lib->project != 0) + { + $project = $this->loadModel('project')->getByID($lib->project); + $libs[$id] = $project->name . '/' . $libName; + } + if($lib->product != 0) + { + $product = $this->loadModel('product')->getByID($lib->product); + $libs[$id] = $product->name . '/' . $libName; + } + } + /* Get doc and set menu. */ $doc = $this->doc->getById($docID); $libID = $doc->lib; @@ -404,6 +420,7 @@ class doc extends control $this->view->doc = $doc; $this->view->moduleOptionMenu = $this->tree->getOptionMenu($libID, 'doc', $startModuleID = 0); $this->view->type = $type; + $this->view->libs = $libs; $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->users = $this->user->getPairs('noletter', $doc->users); $this->display(); @@ -617,10 +634,11 @@ class doc extends control * @access public * @return void */ - public function ajaxGetChild($libID) + public function ajaxGetChild($libID, $type = 'module') { $childModules = $this->loadModel('tree')->getOptionMenu($libID, 'doc'); - die(html::select('parent', $childModules, '', "class='form-control'")); + $select = ($type == 'module') ? html::select('module', $childModules, '', "class='form-control chosen'") : html::select('parent', $childModules, '', "class='form-control chosen'"); + die($select); } /** diff --git a/module/doc/js/edit.js b/module/doc/js/edit.js index 66dae955b9..ee768cb4e7 100644 --- a/module/doc/js/edit.js +++ b/module/doc/js/edit.js @@ -16,3 +16,14 @@ $(function() } }) }) + +function loadDocModule(libID) +{ + link = createLink('doc', 'ajaxGetChild', 'libID=' + libID); + $.post(link, function(data) + { + $('#module').replaceWith(data); + $('#module_chosen').remove(); + $('#module').chosen(); + }) +} diff --git a/module/doc/model.php b/module/doc/model.php index 5b8308bcf3..1410756a24 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -658,7 +658,7 @@ class docModel extends model $doc = $this->loadModel('file')->processImgURL($doc, $this->config->doc->editor->edit['id'], $this->post->uid); $doc->product = $lib->product; $doc->project = $lib->project; - if($doc->type == 'url') $doc->content = $doc->url; + if(isset($doc->type) and $doc->type == 'url') $doc->content = $doc->url; unset($doc->url); $files = $this->file->saveUpload('doc', $docID); diff --git a/module/doc/view/edit.html.php b/module/doc/view/edit.html.php index 60eda1a97e..279b8bc963 100644 --- a/module/doc/view/edit.html.php +++ b/module/doc/view/edit.html.php @@ -24,10 +24,13 @@
+ + + + diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index bfe6b705bd..b604898d87 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -337,7 +337,7 @@ $lang->resource->project->printKanban = 'printKanban'; $lang->resource->project->tree = 'tree'; $lang->resource->project->treeTask = 'treeTask'; $lang->resource->project->treeStory = 'treeStory'; -$lang->resource->project->all = 'all'; +$lang->resource->project->all = 'allProjects'; $lang->resource->project->kanbanHideCols = 'kanbanHideCols'; $lang->resource->project->kanbanColsColor = 'kanbanColsColor'; $lang->resource->project->export = 'export'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 8ef86415d5..9456fa7908 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -60,12 +60,12 @@ $lang->project->readjustTask = '顺延任务的起止时间'; $lang->project->effort = '日志'; $lang->project->relatedMember = '相关成员'; -$lang->project->start = '开始'; -$lang->project->activate = '激活'; -$lang->project->putoff = '延期'; -$lang->project->suspend = '挂起'; -$lang->project->close = '关闭'; -$lang->project->export = '导出'; +$lang->project->start = "开始$lang->projectCommon"; +$lang->project->activate = "激活$lang->projectCommon"; +$lang->project->putoff = "延期$lang->projectCommon"; +$lang->project->suspend = "挂起$lang->projectCommon"; +$lang->project->close = "关闭$lang->projectCommon"; +$lang->project->export = "导出$lang->projectCommon"; $lang->project->typeList['sprint'] = "短期$lang->projectCommon"; $lang->project->typeList['waterfall'] = "长期$lang->projectCommon"; @@ -115,7 +115,7 @@ $lang->project->latestDynamic = '最新动态'; $lang->project->build = '所有版本'; $lang->project->testtask = '测试任务'; $lang->project->burn = '燃尽图'; -$lang->project->computeBurn = '更新'; +$lang->project->computeBurn = '更新燃尽图'; $lang->project->burnData = '燃尽图数据'; $lang->project->fixFirst = '修改首天工时'; $lang->project->team = '团队成员'; @@ -142,7 +142,7 @@ $lang->project->batchUnlinkStory = '批量移除需求'; $lang->project->importTask = '转入任务'; $lang->project->importPlanStories = '按计划关联需求'; $lang->project->importBug = '导入Bug'; -$lang->project->updateOrder = '排序'; +$lang->project->updateOrder = "{$lang->projectCommon}排序"; $lang->project->tree = '树状图'; $lang->project->treeTask = '只看任务'; $lang->project->treeStory = '只看需求'; diff --git a/module/todo/lang/zh-cn.php b/module/todo/lang/zh-cn.php index d2232b52eb..d1bb273c4f 100644 --- a/module/todo/lang/zh-cn.php +++ b/module/todo/lang/zh-cn.php @@ -21,7 +21,7 @@ $lang->todo->close = "关闭"; $lang->todo->batchClose = "批量关闭"; $lang->todo->batchEdit = "批量编辑"; $lang->todo->view = "待办详情"; -$lang->todo->finish = "完成"; +$lang->todo->finish = "完成待办"; $lang->todo->batchFinish = "批量完成"; $lang->todo->export = "导出"; $lang->todo->delete = "删除"; diff --git a/module/tree/control.php b/module/tree/control.php index ce93e42434..accb265a91 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -238,9 +238,25 @@ class tree extends control $this->view->optionMenu = $this->tree->getOptionMenu($module->root, $module->type, 0, $branch); } + $libs = $this->loadModel('doc')->getLibs(); + foreach($libs as $id => $libName) + { + $lib = $this->doc->getLibById($id); + if($lib->project != 0) + { + $project = $this->loadModel('project')->getByID($lib->project); + $libs[$id] = $project->name . '/' . $libName; + } + if($lib->product != 0) + { + $product = $this->loadModel('product')->getByID($lib->product); + $libs[$id] = $product->name . '/' . $libName; + } + } + $this->view->module = $module; $this->view->type = $type; - $this->view->libs = array('' => '') + $this->loadModel('doc')->getLibs(); + $this->view->libs = $libs; $this->view->branch = $branch; $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted', $module->owner); diff --git a/module/tree/view/edit.html.php b/module/tree/view/edit.html.php index 0530802a86..eb4f9d6e18 100644 --- a/module/tree/view/edit.html.php +++ b/module/tree/view/edit.html.php @@ -96,7 +96,7 @@ $(function() }) function loadDocModule(libID) { - link = createLink('doc', 'ajaxGetChild', 'libID=' + libID); + link = createLink('doc', 'ajaxGetChild', 'libID=' + libID + '&type=parent'); $.post(link, function(data) { $('#parent').replaceWith(data); From 95d6bf9c6b5ec9d8cb6cf8f11436dfe98388a8cf Mon Sep 17 00:00:00 2001 From: Yagami Date: Tue, 13 Nov 2018 15:36:15 +0800 Subject: [PATCH 2/6] * Add custom filed to testtask. --- module/custom/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/custom/config.php b/module/custom/config.php index f5e4b2ef6a..b064c74147 100644 --- a/module/custom/config.php +++ b/module/custom/config.php @@ -52,7 +52,7 @@ $config->custom->fieldList['testcase']['edit'] = 'stage,story,pri,precondi $config->custom->fieldList['testsuite'] = 'desc'; $config->custom->fieldList['testcase']['createcase'] = 'lib,stage,pri,precondition,keywords'; $config->custom->fieldList['testreport'] = 'begin,end,members,report'; -$config->custom->fieldList['testtask'] = 'owner,pri,status,desc'; +$config->custom->fieldList['testtask'] = 'owner,pri,status,desc,comment'; $config->custom->fieldList['doc'] = 'keywords,content'; $config->custom->fieldList['user']['create'] = 'dept,role,email,commiter'; $config->custom->fieldList['user']['edit'] = 'dept,role,email,commiter,skype,qq,mobile,phone,address,zipcode,wangwang,gtalk'; From 5d1e76c14d7e8150f8117640394de94fe6d0fd38 Mon Sep 17 00:00:00 2001 From: Yagami Date: Tue, 13 Nov 2018 16:41:08 +0800 Subject: [PATCH 3/6] * Fix edit parent task bug. --- module/task/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/model.php b/module/task/model.php index d1ae040a23..86472fbd09 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -578,7 +578,7 @@ class taskModel extends model ->setDefault('story, estimate, left, consumed', 0) ->setDefault('estStarted', '0000-00-00') ->setDefault('deadline', '0000-00-00') - ->setDefault('parent', 0) + ->setIF(!$this->post->parent, 'parent', 0) ->setIF(strpos($this->config->task->edit->requiredFields, 'estStarted') !== false, 'estStarted', $this->post->estStarted) ->setIF(strpos($this->config->task->edit->requiredFields, 'deadline') !== false, 'deadline', $this->post->deadline) ->setIF($this->post->story != false and $this->post->story != $oldTask->story, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) From 54b8536e8b31613be0f41ba863974b8535d6b3dd Mon Sep 17 00:00:00 2001 From: Yagami Date: Tue, 13 Nov 2018 17:00:17 +0800 Subject: [PATCH 4/6] * Fix parent task bug. --- module/task/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/model.php b/module/task/model.php index 86472fbd09..c458c4d8b0 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -578,7 +578,7 @@ class taskModel extends model ->setDefault('story, estimate, left, consumed', 0) ->setDefault('estStarted', '0000-00-00') ->setDefault('deadline', '0000-00-00') - ->setIF(!$this->post->parent, 'parent', 0) + ->setIF($oldTask->parent == 0 && $this->post->parent == '', 'parent', 0) ->setIF(strpos($this->config->task->edit->requiredFields, 'estStarted') !== false, 'estStarted', $this->post->estStarted) ->setIF(strpos($this->config->task->edit->requiredFields, 'deadline') !== false, 'deadline', $this->post->deadline) ->setIF($this->post->story != false and $this->post->story != $oldTask->story, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) From cae5cb78c52773f889994416b9c021f0adcb8535 Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Tue, 13 Nov 2018 17:23:51 +0800 Subject: [PATCH 5/6] * Finish task #5118, #5122, #5125. --- module/admin/lang/zh-cn.php | 2 +- module/product/view/view.html.php | 2 +- module/user/control.php | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/module/admin/lang/zh-cn.php b/module/admin/lang/zh-cn.php index 101ad988df..8f1bb46a58 100644 --- a/module/admin/lang/zh-cn.php +++ b/module/admin/lang/zh-cn.php @@ -59,7 +59,7 @@ $lang->admin->safe->weak = '常用弱口令'; $lang->admin->safe->reason = '类型'; $lang->admin->safe->checkWeak = '弱口令扫描'; $lang->admin->safe->changeWeak = '修改弱口令密码'; -$lang->admin->safe->modifyPasswordFirstLogin = '首次登陆修改密码'; +$lang->admin->safe->modifyPasswordFirstLogin = '首次登录修改密码'; $lang->admin->safe->modeList[0] = '不检查'; $lang->admin->safe->modeList[1] = '中'; diff --git a/module/product/view/view.html.php b/module/product/view/view.html.php index 64767b2589..583f28b729 100644 --- a/module/product/view/view.html.php +++ b/module/product/view/view.html.php @@ -27,7 +27,7 @@ begin)):?>
  • begin) echo "class='active'";?>> - id}");?>"> + id}");?>"> title;?> begin;?> diff --git a/module/user/control.php b/module/user/control.php index 9b0373f090..a698005d75 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -25,6 +25,7 @@ class user extends control $this->loadModel('company')->setMenu(); $this->loadModel('dept'); $this->loadModel('todo'); + $this->app->loadModuleConfig($this->moduleName);//Finish task #5118.(Fix bug #2271) } /** From ca70a83395ce3e52ac13628176faf0416f75540a Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Tue, 13 Nov 2018 17:28:12 +0800 Subject: [PATCH 6/6] * Adjust for task #5111, #5106. --- module/bug/view/view.html.php | 3 +++ module/story/view/view.html.php | 3 +++ module/task/view/view.html.php | 3 +++ module/testcase/control.php | 4 +++- module/testcase/view/view.html.php | 3 +++ 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index 0c845cc9eb..f85b0606be 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -27,9 +27,12 @@ + +
    product}&branch={$bug->branch}&extra=moduleID={$bug->module}", "" . $lang->bug->create, '', "class='btn btn-primary'"); ?>
    +
    diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 940d4c1200..3f34ee4689 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -41,9 +41,12 @@
    + +
    product}&branch={$story->branch}&moduleID={$story->module}", "" . $lang->story->create, '', "class='btn btn-primary'"); ?>
    +
    diff --git a/module/task/view/view.html.php b/module/task/view/view.html.php index 98368ec0bf..3797587d19 100644 --- a/module/task/view/view.html.php +++ b/module/task/view/view.html.php @@ -34,6 +34,8 @@
    + +
    {$lang->task->create}", '', "class='btn btn-primary'"); ?>
    +
    diff --git a/module/testcase/control.php b/module/testcase/control.php index cf871bb1ae..56b327edac 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -1197,7 +1197,9 @@ class testcase extends control $productName = $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch('name'); $browseType = isset($this->lang->testcase->featureBar['browse'][$browseType]) ? $this->lang->testcase->featureBar['browse'][$browseType] : ''; - $this->view->fileName = $productName . $this->lang->dash . $browseType . $fileName; + if($taskID) $taskName = $this->dao->findById($taskID)->from(TABLE_TESTTASK)->fetch('name'); + + $this->view->fileName = $productName . $this->lang->dash . ($taskID ? $taskName . $this->lang->dash : '') . $browseType . $fileName; $this->view->allExportFields = $this->config->testcase->exportFields; $this->view->customExport = true; $this->display(); diff --git a/module/testcase/view/view.html.php b/module/testcase/view/view.html.php index 2d5933b584..d1587ca1b9 100644 --- a/module/testcase/view/view.html.php +++ b/module/testcase/view/view.html.php @@ -44,9 +44,12 @@
    + +
    product}&branch={$case->branch}&moduleID={$case->module}", "" . $lang->testcase->create, '', "class='btn btn-primary'"); ?>
    +
  • doc->lib;?> lib, "class='form-control chosen' onchange=loadDocModule(this.value)");?>
    doc->module;?> - lib)?> module, "class='form-control chosen'");?>