From 4d5bacb8236b420062a979a8745997a35d34b58c Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 11 Jun 2021 16:51:28 +0800 Subject: [PATCH] * adjust for web page. --- module/build/control.php | 6 ++++++ module/common/model.php | 2 +- module/execution/control.php | 13 +++++++++++-- module/personnel/control.php | 3 ++- module/product/control.php | 12 +++++++++++- module/program/lang/zh-cn.php | 1 + module/program/model.php | 25 +++++++++++++++++++++++++ module/project/model.php | 7 +++++++ module/story/model.php | 4 ++-- module/task/model.php | 4 ++-- 10 files changed, 68 insertions(+), 9 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 818f5998e5..bcec1bb185 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -361,6 +361,8 @@ class build extends control $isJsonView = $this->app->getViewType() == 'json'; if($varName == 'openedBuild') { + if(empty($executionID)) $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type); + $params = ($type == 'all') ? 'noempty' : 'noempty, noterminate, nodone'; $builds = $this->build->getExecutionBuildPairs($executionID, $productID, $branch, $params, $build); if($isJsonView) die(json_encode($builds)); @@ -368,12 +370,16 @@ class build extends control } if($varName == 'openedBuilds') { + if(empty($executionID)) $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type); + $builds = $this->build->getExecutionBuildPairs($executionID, $productID, $branch, 'noempty'); if($isJsonView) die(json_encode($builds)); else die(html::select($varName . "[$index][]", $builds , $build, 'size=4 class=form-control multiple')); } if($varName == 'resolvedBuild') { + if(empty($executionID)) $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type); + $params = ($type == 'all') ? '' : 'noterminate, nodone'; $builds = $this->build->getExecutionBuildPairs($executionID, $productID, $branch, $params, $build); if($isJsonView) die(json_encode($builds)); diff --git a/module/common/model.php b/module/common/model.php index 31181f9425..9f5629b734 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -2195,7 +2195,7 @@ EOD; $response->errcode = $this->config->entry->errcode[$code]; $response->errmsg = $this->lang->entry->errmsg[$code]; - die(helper::jsonEncode($response)); + die(urldecode(json_encode($response))); } /** diff --git a/module/execution/control.php b/module/execution/control.php index c0bee38f16..e951e05e09 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2720,8 +2720,17 @@ class execution extends control if($this->app->viewType == 'mhtml') { - $executionID = $this->execution->saveState(0, $this->executions); - $this->execution->setMenu($executionID); + if($this->app->rawModule == 'project' and $this->app->rawMethod == 'execution') + { + $projects = $this->project->getPairsByProgram(); + $projectID = $this->project->saveState($projectID, $projects); + $this->project->setMenu($projectID); + } + else + { + $executionID = $this->execution->saveState(0, $this->executions); + $this->execution->setMenu($executionID); + } } /* Load pager and get tasks. */ diff --git a/module/personnel/control.php b/module/personnel/control.php index 7bd1032f15..77b3bb7c35 100644 --- a/module/personnel/control.php +++ b/module/personnel/control.php @@ -24,7 +24,7 @@ class personnel extends control * @access public * @return void */ - public function accessible($programID = 0, $deptID = 0, $browseType='browse', $param = 0, $recTotal = 0, $recPerPage = 15, $pageID = 1) + public function accessible($programID = 0, $deptID = 0, $browseType = 'browse', $param = 0, $recTotal = 0, $recPerPage = 15, $pageID = 1) { $this->loadModel('program')->setMenu($programID); $this->app->loadLang('user'); @@ -81,6 +81,7 @@ class personnel extends control $this->view->title = $this->lang->personnel->invest; $this->view->position[] = $this->lang->personnel->invest; $this->view->investList = $this->personnel->getInvest($programID); + $this->view->programID = $programID; $this->display(); } diff --git a/module/product/control.php b/module/product/control.php index 7e643b084f..1ab5854591 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -334,7 +334,17 @@ class product extends control } if($this->app->openApp == 'program') $this->loadModel('program')->setMenu($programID); - if($this->app->getViewType() == 'mhtml') $this->product->setMenu(''); + if($this->app->getViewType() == 'mhtml') + { + if($this->app->rawModule == 'projectstory' and $this->app->rawMethod == 'story') + { + $this->loadModel('project')->setMenu(); + } + else + { + $this->product->setMenu(''); + } + } $this->loadModel('user'); $poUsers = $this->user->getPairs('nodeleted|pofirst|noclosed', '', $this->config->maxCount); diff --git a/module/program/lang/zh-cn.php b/module/program/lang/zh-cn.php index ada4d56b10..b27a7048ce 100644 --- a/module/program/lang/zh-cn.php +++ b/module/program/lang/zh-cn.php @@ -56,6 +56,7 @@ $lang->program->closeErrorMessage = '存在子项目集或项目为未关 $lang->program->hasChildren = '该项目集有子项目集或项目存在,不能删除。'; $lang->program->confirmDelete = "您确定要删除吗?"; $lang->program->readjustTime = '重新调整项目集起止时间'; +$lang->program->accessDenied = '你无权访问该项目集'; $lang->program->stakeholderTypeList['inside'] = '内部'; $lang->program->stakeholderTypeList['outside'] = '外部'; diff --git a/module/program/model.php b/module/program/model.php index a0f28f6612..6180c0d997 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -1,6 +1,24 @@ lang->program->accessDenied)); + + if(!$this->server->http_referer) die(js::locate(helper::createLink('my', 'index'))); + + $loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login"; + if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(helper::createLink('my', 'index'))); + + die(js::locate('back')); + } + /** * Save program state. * @@ -395,6 +413,13 @@ class programModel extends model $currentProgramName = $this->lang->program->all; } + if($this->app->viewType == 'mhtml' and $programID) + { + $output = $this->lang->program->common . $this->lang->colon; + $output .= "{$currentProgramName} "; + return $output; + } + $dropMenuLink = helper::createLink('program', 'ajaxGetDropMenu', "objectID=$programID&module=$currentModule&method=$currentMethod"); $output = "
"; diff --git a/module/project/model.php b/module/project/model.php index a0a5db50f2..c960f1aacd 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -146,6 +146,13 @@ class projectModel extends model $currentProjectName = $currentProject->name; } + if($this->app->viewType == 'mhtml' and $projectID) + { + $output = $this->lang->project->common . $this->lang->colon; + $output .= "{$currentProjectName} "; + return $output; + } + $dropMenuLink = helper::createLink('project', 'ajaxGetDropMenu', "objectID=$projectID&module=$currentModule&method=$currentMethod"); $output = "