From f41736f24728a72820d3035a85b8ef155fa36d6d Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Thu, 17 Dec 2020 15:42:32 +0800 Subject: [PATCH 1/3] * Fix bug. --- module/issue/view/storyform.html.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/issue/view/storyform.html.php b/module/issue/view/storyform.html.php index ecf3a226fc..4718ee93f2 100644 --- a/module/issue/view/storyform.html.php +++ b/module/issue/view/storyform.html.php @@ -155,6 +155,7 @@ function loadProduct(productID) { loadProductBranches(productID) loadProductModules(productID); + loadProductPlans(productID); } /** From b8873da77fa21b8825b91c9cd189e01eb9ce45f1 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Thu, 17 Dec 2020 16:04:14 +0800 Subject: [PATCH 2/3] * Finish task#8671,task#8670. --- module/task/control.php | 8 ++++++++ module/task/model.php | 3 --- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index 61dfacf410..589f64f30e 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -23,6 +23,14 @@ class task extends control $this->loadModel('project'); $this->loadModel('story'); $this->loadModel('tree'); + + /* Add required fields to waterfall project. */ + $project = $this->project->getByID($this->session->PRJ); + if(!empty($project) && $project->model == 'waterfall') + { + $this->config->task->create->requiredFields .= ',estStarted,deadline'; + $this->config->task->edit->requiredFields .= ',estStarted,deadline'; + } } /** diff --git a/module/task/model.php b/module/task/model.php index 1e34f3a49f..e0e3de90d8 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -28,9 +28,6 @@ class taskModel extends model return false; } - $program = $this->loadModel('project')->getByID($this->session->PRJ); - if($program->model == 'waterfall') $this->config->task->create->requiredFields .= ',estStarted,deadline'; - $projectID = (int)$projectID; $taskIdList = array(); $taskFiles = array(); From 10f1cee5b914dd48f94e9a3fd21ca72b828e0688 Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Thu, 17 Dec 2020 16:13:00 +0800 Subject: [PATCH 3/3] * Adjust code. --- module/custom/control.php | 19 ++++++++- module/projectstory/control.php | 2 +- module/story/control.php | 70 +++++---------------------------- module/story/lang/zh-cn.php | 2 +- module/story/model.php | 54 +++++++++++++++++++++++++ 5 files changed, 83 insertions(+), 64 deletions(-) diff --git a/module/custom/control.php b/module/custom/control.php index d5f6eb6ef9..51b82e2ae7 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -451,7 +451,7 @@ class custom extends control { $this->loadModel('setting')->setItem('system.custom.URSR', $key); - die(js::reload('parent.parent')); + die(js::reload('parent')); } /** @@ -476,7 +476,22 @@ class custom extends control ->andWhere('`key`')->eq($key) ->exec(); - die(js::reload('parent.parent')); + $defaultConcept = $this->dao->select('`value`')->from(TABLE_CONFIG) + ->where('module')->eq('custom') + ->andWhere('`key`')->eq('URSR') + ->fetch('value'); + + /* Stay default concept. */ + if($defaultConcept == $key) + { + $this->dao->update(TABLE_CONFIG) + ->set('`value`')->eq(1) + ->where('module')->eq('custom') + ->andWhere('`key`')->eq('URSR') + ->exec(); + } + + die(js::reload('parent')); } } diff --git a/module/projectstory/control.php b/module/projectstory/control.php index d4bdc470a4..80270b1922 100644 --- a/module/projectstory/control.php +++ b/module/projectstory/control.php @@ -50,7 +50,7 @@ class projectStory extends control $this->lang->projectstory->menu->requirement['subModule'] = 'product'; $this->projectstory->setMenu($this->products, $productID, $branch); - $this->fetch('story', 'replaceURLang', 'type=requirement'); + $this->loadModel('story')->replaceURLang('requirement'); $this->lang->story->title = str_replace($this->lang->productURCommon, $this->lang->projectURCommon, $this->lang->story->title); $this->lang->story->createRequirement = str_replace($this->lang->productURCommon, $this->lang->projectURCommon, $this->lang->story->createRequirement); $this->lang->story->createStory = str_replace($this->lang->productURCommon, $this->lang->projectURCommon, $this->lang->story->createStory); diff --git a/module/story/control.php b/module/story/control.php index e1d4a77c87..81d31e363d 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -45,7 +45,7 @@ class story extends control */ public function create($productID = 0, $branch = 0, $moduleID = 0, $storyID = 0, $projectID = 0, $bugID = 0, $planID = 0, $todoID = 0, $extra = '', $type = 'story') { - $this->replaceURLang($type); + $this->story->replaceURLang($type); $this->lang->product->menu = $this->lang->product->viewMenu; $this->lang->product->switcherMenu = $this->product->getSwitcher($productID); @@ -307,7 +307,7 @@ class story extends control if($productID != $this->cookie->preProductID) unset($_SESSION['storyImagesFile']); setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true); - $this->replaceURLang($type); + $this->story->replaceURLang($type); /* Check can subdivide or not. */ if($storyID) @@ -450,7 +450,7 @@ class story extends control $this->lang->product->switcherMenu = $this->product->getSwitcher($product->id); $this->product->setMenu($products, $product->id, $story->branch); - $this->replaceURLang($story->type); + $this->story->replaceURLang($story->type); /* Assign. */ $this->view->position[] = html::a($this->createLink('product', 'browse', "product=$product->id&branch=$story->branch"), $product->name); @@ -463,58 +463,6 @@ class story extends control $this->view->actions = $this->action->getList('story', $storyID); } - /** - * Replace requirement story lang. - * - * @param string $type - * @access public - * @return void - */ - public function replaceURLang($type) - { - if($type == 'requirement') - { - $storyLang = $this->lang->story; - $SRCommon = $this->lang->productSRCommon; - $URCommon = $this->lang->productURCommon; - - $storyLang->create = str_replace($SRCommon, $URCommon, $storyLang->create); - $storyLang->changeAction = str_replace($SRCommon, $URCommon, $storyLang->changeAction); - $storyLang->changed = str_replace($SRCommon, $URCommon, $storyLang->changed); - $storyLang->assignAction = str_replace($SRCommon, $URCommon, $storyLang->assignAction); - $storyLang->reviewAction = str_replace($SRCommon, $URCommon, $storyLang->reviewAction); - $storyLang->subdivideAction = str_replace($SRCommon, $URCommon, $storyLang->subdivideAction); - $storyLang->closeAction = str_replace($SRCommon, $URCommon, $storyLang->closeAction); - $storyLang->activateAction = str_replace($SRCommon, $URCommon, $storyLang->activateAction); - $storyLang->deleteAction = str_replace($SRCommon, $URCommon, $storyLang->deleteAction); - $storyLang->view = str_replace($SRCommon, $URCommon, $storyLang->view); - $storyLang->linkStory = str_replace($SRCommon, $URCommon, $storyLang->linkStory); - $storyLang->unlinkStory = str_replace($SRCommon, $URCommon, $storyLang->unlinkStory); - $storyLang->exportAction = str_replace($SRCommon, $URCommon, $storyLang->exportAction); - $storyLang->zeroCase = str_replace($SRCommon, $URCommon, $storyLang->zeroCase); - $storyLang->zeroTask = str_replace($SRCommon, $URCommon, $storyLang->zeroTask); - $storyLang->copyTitle = str_replace($SRCommon, $URCommon, $storyLang->copyTitle); - $storyLang->common = str_replace($SRCommon, $URCommon, $storyLang->common); - $storyLang->source = str_replace($SRCommon, $URCommon, $storyLang->source); - $storyLang->title = str_replace($SRCommon, $URCommon, $storyLang->title); - $storyLang->type = str_replace($SRCommon, $URCommon, $storyLang->type); - $storyLang->spec = str_replace($SRCommon, $URCommon, $storyLang->spec); - $storyLang->children = str_replace($SRCommon, $URCommon, $storyLang->children); - $storyLang->linkStories = str_replace($SRCommon, $URCommon, $storyLang->linkStories); - $storyLang->childStories = str_replace($SRCommon, $URCommon, $storyLang->childStories); - $storyLang->duplicateStory = str_replace($SRCommon, $URCommon, $storyLang->duplicateStory); - $storyLang->newStory = str_replace($SRCommon, $URCommon, $storyLang->newStory); - $storyLang->copy = str_replace($SRCommon, $URCommon, $storyLang->copy); - $storyLang->total = str_replace($SRCommon, $URCommon, $storyLang->total); - $storyLang->allStories = str_replace($SRCommon, $URCommon, $storyLang->allStories); - $storyLang->released = str_replace($SRCommon, $URCommon, $storyLang->released); - $storyLang->legendLifeTime = str_replace($SRCommon, $URCommon, $storyLang->legendLifeTime); - $storyLang->legendLinkStories = str_replace($SRCommon, $URCommon, $storyLang->legendLinkStories); - $storyLang->legendChildStories = str_replace($SRCommon, $URCommon, $storyLang->legendChildStories); - $storyLang->legendSpec = str_replace($SRCommon, $URCommon, $storyLang->legendSpec); - } - } - /** * Edit a story. * @@ -555,7 +503,7 @@ class story extends control $stories = $this->story->getParentStoryPairs($story->product, $story->parent); if(isset($stories[$storyID])) unset($stories[$storyID]); - $this->replaceURLang($story->type); + $this->story->replaceURLang($story->type); $this->view->title = $this->lang->story->edit . "STORY" . $this->lang->colon . $this->view->story->title; $this->view->position[] = $this->lang->story->edit; @@ -579,7 +527,7 @@ class story extends control { $this->lang->product->menu = $this->lang->product->viewMenu; $this->lang->product->switcherMenu = $this->product->getSwitcher($productID); - $this->replaceURLang($storyType); + $this->story->replaceURLang($storyType); /* Load model. */ $this->loadModel('productplan'); @@ -806,7 +754,7 @@ class story extends control $story = $this->story->getById($storyID, $version, true); if(!$story) die(js::error($this->lang->notFound) . js::locate('back')); - $this->replaceURLang($story->type); + $this->story->replaceURLang($story->type); $story->files = $this->loadModel('file')->getByObject('story', $storyID); $product = $this->dao->findById($story->product)->from(TABLE_PRODUCT)->fields('name, id, type, status')->fetch(); @@ -928,7 +876,7 @@ class story extends control $story = $this->story->getById($storyID); $product = $this->dao->findById($story->product)->from(TABLE_PRODUCT)->fields('name, id')->fetch(); - $this->replaceURLang($story->type); + $this->story->replaceURLang($story->type); /* Set menu. */ $this->product->setMenu($this->product->getPairs(), $product->id, $story->branch); @@ -1013,7 +961,7 @@ class story extends control $story = $this->story->getById($storyID); $product = $this->dao->findById($story->product)->from(TABLE_PRODUCT)->fields('name, id')->fetch(); - $this->replaceURLang($story->type); + $this->story->replaceURLang($story->type); /* Set menu. */ $this->product->setMenu($this->product->getPairs(), $product->id, $story->branch); @@ -1703,6 +1651,8 @@ class story extends control $this->view->datas[$chart] = $this->report->computePercent($chartData); } } + + $this->story->replaceURLang($storyType); $this->products = $this->product->getPairs(); $this->lang->product->switcherMenu = $this->product->getSwitcher($productID, $storyType, $branchID); $this->product->setMenu($this->products, $productID, $branchID); diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 2fe209a28f..40c40abfed 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -93,7 +93,7 @@ $lang->story->source = "来源"; $lang->story->sourceNote = '来源备注'; $lang->story->fromBug = '来源Bug'; $lang->story->title = "{$lang->productSRCommon}名称"; -$lang->story->type = "{$lang->productSRCommon}类型"; +$lang->story->type = "类型"; $lang->story->color = '标题颜色'; $lang->story->toBug = '转Bug'; $lang->story->spec = "{$lang->productSRCommon}描述"; diff --git a/module/story/model.php b/module/story/model.php index 876f3662f1..13bafbc205 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3856,4 +3856,58 @@ class storyModel extends model $order++; } } + + /** + * Replace requirement story lang. + * + * @param string $type + * @access public + * @return void + */ + public function replaceURLang($type) + { + if($type == 'requirement') + { + $storyLang = $this->lang->story; + $SRCommon = $this->lang->productSRCommon; + $URCommon = $this->lang->productURCommon; + + $storyLang->create = str_replace($SRCommon, $URCommon, $storyLang->create); + $storyLang->changeAction = str_replace($SRCommon, $URCommon, $storyLang->changeAction); + $storyLang->changed = str_replace($SRCommon, $URCommon, $storyLang->changed); + $storyLang->assignAction = str_replace($SRCommon, $URCommon, $storyLang->assignAction); + $storyLang->reviewAction = str_replace($SRCommon, $URCommon, $storyLang->reviewAction); + $storyLang->subdivideAction = str_replace($SRCommon, $URCommon, $storyLang->subdivideAction); + $storyLang->closeAction = str_replace($SRCommon, $URCommon, $storyLang->closeAction); + $storyLang->activateAction = str_replace($SRCommon, $URCommon, $storyLang->activateAction); + $storyLang->deleteAction = str_replace($SRCommon, $URCommon, $storyLang->deleteAction); + $storyLang->view = str_replace($SRCommon, $URCommon, $storyLang->view); + $storyLang->linkStory = str_replace($SRCommon, $URCommon, $storyLang->linkStory); + $storyLang->unlinkStory = str_replace($SRCommon, $URCommon, $storyLang->unlinkStory); + $storyLang->exportAction = str_replace($SRCommon, $URCommon, $storyLang->exportAction); + $storyLang->zeroCase = str_replace($SRCommon, $URCommon, $storyLang->zeroCase); + $storyLang->zeroTask = str_replace($SRCommon, $URCommon, $storyLang->zeroTask); + $storyLang->copyTitle = str_replace($SRCommon, $URCommon, $storyLang->copyTitle); + $storyLang->common = str_replace($SRCommon, $URCommon, $storyLang->common); + $storyLang->title = str_replace($SRCommon, $URCommon, $storyLang->title); + $storyLang->type = str_replace($SRCommon, $URCommon, $storyLang->type); + $storyLang->spec = str_replace($SRCommon, $URCommon, $storyLang->spec); + $storyLang->children = str_replace($SRCommon, $URCommon, $storyLang->children); + $storyLang->linkStories = str_replace($SRCommon, $URCommon, $storyLang->linkStories); + $storyLang->childStories = str_replace($SRCommon, $URCommon, $storyLang->childStories); + $storyLang->duplicateStory = str_replace($SRCommon, $URCommon, $storyLang->duplicateStory); + $storyLang->newStory = str_replace($SRCommon, $URCommon, $storyLang->newStory); + $storyLang->copy = str_replace($SRCommon, $URCommon, $storyLang->copy); + $storyLang->total = str_replace($SRCommon, $URCommon, $storyLang->total); + $storyLang->allStories = str_replace($SRCommon, $URCommon, $storyLang->allStories); + $storyLang->released = str_replace($SRCommon, $URCommon, $storyLang->released); + $storyLang->legendLifeTime = str_replace($SRCommon, $URCommon, $storyLang->legendLifeTime); + $storyLang->legendLinkStories = str_replace($SRCommon, $URCommon, $storyLang->legendLinkStories); + $storyLang->legendChildStories = str_replace($SRCommon, $URCommon, $storyLang->legendChildStories); + $storyLang->legendSpec = str_replace($SRCommon, $URCommon, $storyLang->legendSpec); + $storyLang->report->charts['storysPerProduct'] = str_replace($SRCommon, $URCommon, $storyLang->report->charts['storysPerProduct']); + $storyLang->report->charts['storysPerModule'] = str_replace($SRCommon, $URCommon, $storyLang->report->charts['storysPerModule']); + $storyLang->report->charts['storysPerSource'] = str_replace($SRCommon, $URCommon, $storyLang->report->charts['storysPerSource']); + } + } }