From f10dced1e83d6ea961c77c8dd7505aca9938e05d Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Thu, 18 Mar 2021 14:14:52 +0800 Subject: [PATCH 01/10] * Repair program set drop-down menu. --- config/filter.php | 16 ++++++++-------- module/program/view/ajaxgetdropmenu.html.php | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/filter.php b/config/filter.php index dca7d428d4..6b26ad992d 100644 --- a/config/filter.php +++ b/config/filter.php @@ -85,7 +85,7 @@ $filter->program->browse = new stdclass(); $filter->program->export = new stdclass(); $filter->program->pgmbrowse = new stdclass(); $filter->program->export = new stdclass(); -$filter->program->ajaxgetpgmdropmenu = new stdclass(); +$filter->program->ajaxgetdropmenu = new stdclass(); $filter->project->default = new stdclass(); $filter->project->browse = new stdclass(); $filter->project->story = new stdclass(); @@ -165,13 +165,13 @@ $filter->product->index->cookie['preBranch'] = 'int'; $filter->product->export->cookie['checkedItem'] = 'reg::checked'; $filter->product->project->cookie['involved'] = 'code'; -$filter->program->default->cookie['lastPGM'] = 'int'; -$filter->program->default->cookie['lastPRJ'] = 'int'; -$filter->program->prjbrowse->cookie['programType'] = 'code'; -$filter->program->project->cookie['involved'] = 'code'; -$filter->program->browse->cookie['showClosed'] = 'code'; -$filter->program->export->cookie['checkedItem'] = 'reg::checked'; -$filter->program->ajaxgetpgmdropmenu->cookie['showClosed'] = 'code'; +$filter->program->default->cookie['lastPGM'] = 'int'; +$filter->program->default->cookie['lastPRJ'] = 'int'; +$filter->program->prjbrowse->cookie['programType'] = 'code'; +$filter->program->project->cookie['involved'] = 'code'; +$filter->program->browse->cookie['showClosed'] = 'code'; +$filter->program->export->cookie['checkedItem'] = 'reg::checked'; +$filter->program->ajaxgetdropmenu->cookie['showClosed'] = 'code'; $filter->project->default->cookie['lastProject'] = 'int'; $filter->project->default->cookie['lastPRJ'] = 'int'; diff --git a/module/program/view/ajaxgetdropmenu.html.php b/module/program/view/ajaxgetdropmenu.html.php index c369546b4e..0388838842 100644 --- a/module/program/view/ajaxgetdropmenu.html.php +++ b/module/program/view/ajaxgetdropmenu.html.php @@ -58,11 +58,11 @@ $programsPinYin = common::convert2Pinyin($programNames); $('#programTree').tree(); $(function() { - $('input[name^="showClosed"]').click(function() + $(document).on('change', 'input[name^="showClosed"]', function() { var showClosed = $(this).is(':checked') ? 1 : 0; $.cookie('showClosed', showClosed, {expires:config.cookieLife, path:config.webRoot}); - window.location.reload(); + $("#dropMenu > .list-group").load(createLink('program', 'ajaxgetdropmenu', 'programID=' + programID + '&module=' + module + '&method=' + method)); }); }); From a8608c697345ede8ce1a3f240639dbe6dc2f6981 Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Thu, 18 Mar 2021 14:27:34 +0800 Subject: [PATCH 02/10] * Fix execution bug. --- module/build/control.php | 4 ++-- module/execution/control.php | 6 +++--- module/product/model.php | 1 - module/task/control.php | 16 ++++++++-------- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 0c49f66a62..56a2e98ac2 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -205,8 +205,8 @@ class build extends control foreach($stages as $storyID => $stage)$stories[$storyID]->stage = $stage; /* Set menu. */ - $this->loadModel('execution')->setMenu($this->execution->getPairs($this->session->PRJ), $build->execution, $buildID); - $executions = $this->execution->getPairs($this->session->PRJ, 'all', 'empty'); + commonModel::setAppObjectID('execution', $build->execution); + $executions = $this->loadModel('execution')->getPairs($this->session->PRJ, 'all', 'empty'); $this->view->title = "BUILD #$build->id $build->name - " . $executions[$build->execution]; $this->view->position[] = html::a($this->createLink('execution', 'task', "executionID=$build->execution"), $executions[$build->execution]); diff --git a/module/execution/control.php b/module/execution/control.php index 0be9080db5..8b8519cf77 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -540,7 +540,7 @@ class execution extends control $this->app->session->set('executionList', $uri); $this->loadModel('bug'); - $executions = $this->execution->getPairs($this->session->PRJ, 'all', 'nocode'); + $executions = $this->execution->getPairs(0, 'all', 'nocode'); $this->execution->setMenu($executions, $executionID); /* Load pager. */ @@ -1052,7 +1052,7 @@ class execution extends control $this->view->orderBy = $orderBy; $this->view->tasks = $productTasks; $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); - $this->view->products = $this->loadModel('product')->getPairs('', $this->session->PRJ); + $this->view->products = $this->loadModel('product')->getPairs('', 0); $this->view->canBeChanged = common::canModify('execution', $execution); // Determines whether an object is editable. $this->display(); @@ -2963,7 +2963,7 @@ class execution extends control $this->view->cases = $cases; $this->view->story = $story; $this->view->users = $users; - $this->view->executions = $this->loadModel('execution')->getPairs($this->session->PRJ, 'all', 'nocode'); + $this->view->executions = $this->loadModel('execution')->getPairs(0, 'all', 'nocode'); $this->view->actions = $this->loadModel('action')->getList('story', $storyID); $this->view->modulePath = $modulePath; $this->view->version = $version == 0 ? $story->version : $version; diff --git a/module/product/model.php b/module/product/model.php index 33f6921931..febb71a391 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -763,7 +763,6 @@ class productModel extends model if($browseType == 'changedstory') $stories = $this->story->getByStatus($productID, $branch, $modules, 'changed', $type, $sort, $pager); if($browseType == 'willclose') $stories = $this->story->get2BeClosed($productID, $branch, $modules, $type, $sort, $pager); if($browseType == 'closedstory') $stories = $this->story->getByStatus($productID, $branch, $modules, 'closed', $type, $sort, $pager); - if($browseType == 'emptysr') $stories = $this->story->getEmptySR($productID, $branch, $modules, '', $type, $sort, $pager); return $stories; } diff --git a/module/task/control.php b/module/task/control.php index 8c2da8f404..716aa93ec3 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -41,7 +41,7 @@ class task extends control { commonModel::setAppObjectID('execution', $executionID); - $executions = $this->execution->getPairs($this->session->PRJ); + $executions = $this->execution->getPairs(); $executionID = $this->execution->saveState($executionID, $executions); $this->execution->getLimitedExecution(); @@ -208,7 +208,7 @@ class task extends control $this->view->title = $title; $this->view->position = $position; $this->view->execution = $execution; - $this->view->executions = $this->config->systemMode == 'classic' ? $executions : $this->execution->getByProject($this->session->PRJ, 'all', 0, true); + $this->view->executions = $this->config->systemMode == 'classic' ? $executions : $this->execution->getByProject(0, 'all', 0, true); $this->view->task = $task; $this->view->users = $users; $this->view->stories = $stories; @@ -250,7 +250,7 @@ class task extends control $storyLink = $this->session->storyList ? $this->session->storyList : $this->createLink('execution', 'story', "executionID=$executionID"); /* Set menu. */ - $this->execution->setMenu($this->execution->getPairs($this->session->PRJ), $execution->id); + $this->execution->setMenu($this->execution->getPairs(), $execution->id); /* When common task are child tasks, query whether common task are consumed. */ $taskConsumed = 0; @@ -319,7 +319,7 @@ class task extends control $this->view->actions = $this->loadModel('action')->getList('task', $taskID); /* Set menu. */ - $this->execution->setMenu($this->execution->getPairs($this->session->PRJ), $this->view->execution->id); + $this->execution->setMenu($this->execution->getPairs(), $this->view->execution->id); $this->view->position[] = html::a($this->createLink('execution', 'browse', "execution={$this->view->task->execution}"), $this->view->execution->name); } @@ -394,7 +394,7 @@ class task extends control $this->view->users = $this->loadModel('user')->getPairs('nodeleted', "{$this->view->task->openedBy},{$this->view->task->canceledBy},{$this->view->task->closedBy}"); $this->view->showAllModule = isset($this->config->execution->task->allModule) ? $this->config->execution->task->allModule : ''; $this->view->modules = $this->tree->getTaskOptionMenu($this->view->task->execution, 0, 0, $this->view->showAllModule ? 'allModule' : ''); - $this->view->executions = $this->config->systemMode == 'classic' ? $this->execution->getPairs() : $this->execution->getByProject($this->session->PRJ, 'all', 0, true); + $this->view->executions = $this->config->systemMode == 'classic' ? $this->execution->getPairs() : $this->execution->getByProject(0, 'all', 0, true); $this->display(); } @@ -447,7 +447,7 @@ class task extends control if($executionID) { $execution = $this->execution->getById($executionID); - $this->execution->setMenu($this->execution->getPairs($this->session->PRJ), $execution->id); + $this->execution->setMenu($this->execution->getPairs(), $execution->id); /* Set modules and members. */ $showAllModule = isset($this->config->task->allModule) ? $this->config->task->allModule : ''; @@ -656,7 +656,7 @@ class task extends control /* Set menu. */ $execution = $this->execution->getById($task->execution); - $this->execution->setMenu($this->execution->getPairs($this->session->PRJ), $execution->id); + $this->execution->setMenu($this->execution->getPairs(), $execution->id); $this->executeHooks($taskID); @@ -1324,7 +1324,7 @@ class task extends control } } - $executions = $this->execution->getPairs($this->session->PRJ); + $executions = $this->execution->getPairs(); $this->execution->setMenu($executions, $executionID); $this->executions = $executions; From 1d09fea4a48753d4484b5d4c0d3d02c77ffb915e Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Thu, 18 Mar 2021 14:48:05 +0800 Subject: [PATCH 03/10] * Fix bugs. --- module/execution/control.php | 2 +- module/execution/model.php | 11 ++++++----- module/task/model.php | 33 +++++++++------------------------ 3 files changed, 16 insertions(+), 30 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 8b8519cf77..aa6d2836ef 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -475,7 +475,7 @@ class execution extends control $toExecution = $execution->id; $branches = $this->execution->getBranches($toExecution); $tasks = $this->execution->getTasks2Imported($toExecution, $branches); - $executions = $this->execution->getsToImport(array_keys($tasks), $execution->type); + $executions = $this->execution->getToImport(array_keys($tasks), $execution->type); unset($executions[$toExecution]); unset($tasks[$toExecution]); diff --git a/module/execution/model.php b/module/execution/model.php index 6822f93ff5..67423429e2 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -212,7 +212,7 @@ class executionModel extends model */ public function tree() { - $products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ); + $products = $this->loadModel('product')->getPairs('nocode', 0); $productGroup = $this->getProductGroupList(); $executionTree = "