From cc046270aaf21144dcd0dc84e1679767edf6a600 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Mon, 21 Sep 2020 14:56:13 +0800 Subject: [PATCH 1/2] * Project add type selection. --- framework/base/router.class.php | 2 +- module/program/control.php | 16 +++++++++++++--- module/program/view/createguide.html.php | 3 ++- module/program/view/pgmbrowse.html.php | 2 +- module/program/view/prjbrowse.html.php | 2 +- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 3cda125117..18b1897354 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -1801,7 +1801,7 @@ class baseRouter global $filter; /* Remove these three params. */ - unset($passedParams['pgm']); + unset($passedParams['PRJ']); unset($passedParams['onlybody']); unset($passedParams['HTTP_X_REQUESTED_WITH']); diff --git a/module/program/control.php b/module/program/control.php index d6ad09a77d..65c744da16 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -97,8 +97,9 @@ class program extends control * @access public * @return void */ - public function createGuide($programID = 0) + public function createGuide($programID = 0, $from = 'PRJ') { + $this->view->from = $from; $this->view->programID = $programID; $this->display(); } @@ -976,9 +977,18 @@ class program extends control * @access public * @return void */ - public function PRJCreate($template = 'waterfall', $programID = 0, $parentProgramID = 0, $copyProgramID = '') + public function PRJCreate($template = 'waterfall', $programID = 0, $from = 'PRJ', $parentProgramID = 0, $copyProgramID = '') { - $this->lang->navGroup->program = 'project'; + if($from == 'PRJ') + { + $this->lang->navGroup->program = 'project'; + } + else + { + $this->lang->navGroup->program = 'program'; + $this->lang->program->switcherMenu = $this->program->getPGMCommonAction(); + } + if($_POST) { $projectID = $this->program->PRJCreate(); diff --git a/module/program/view/createguide.html.php b/module/program/view/createguide.html.php index 2ff0b81577..3adc459ae2 100644 --- a/module/program/view/createguide.html.php +++ b/module/program/view/createguide.html.php @@ -36,13 +36,14 @@ + diff --git a/module/program/view/pgmbrowse.html.php b/module/program/view/pgmbrowse.html.php index 91cd716af2..5dd1e01319 100644 --- a/module/program/view/pgmbrowse.html.php +++ b/module/program/view/pgmbrowse.html.php @@ -28,7 +28,7 @@
pageActions)) echo $lang->pageActions;?> - createLink('program', 'createguide'), " " . $this->lang->program->PRJCreate, '', "class='btn btn-primary' data-toggle='modal'");?> + createLink('program', 'createguide', 'program=0&from=PGM'), " " . $this->lang->program->PRJCreate, '', "class='btn btn-primary' data-toggle='modal'");?>
diff --git a/module/program/view/prjbrowse.html.php b/module/program/view/prjbrowse.html.php index 4d6aa87fd2..578cba74b5 100644 --- a/module/program/view/prjbrowse.html.php +++ b/module/program/view/prjbrowse.html.php @@ -32,7 +32,7 @@ js::set('browseType', $browseType); $lang->program->mine), '', $this->cookie->PRJMine ? 'checked=checked' : '');?>
- ' . $lang->program->PRJCreate, '', 'class="btn btn-primary" data-toggle="modal" data-target="#guideDialog"');?> + ' . $lang->program->PRJCreate, '', 'class="btn btn-primary" data-toggle="modal" data-target="#guideDialog"');?>
From 9d6cefd375fb671bc7c144e414ea3f0b66cac5c5 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Mon, 21 Sep 2020 14:59:04 +0800 Subject: [PATCH 2/2] * Create guide method to add comments. --- module/program/control.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/module/program/control.php b/module/program/control.php index 65c744da16..02a953da89 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -94,6 +94,8 @@ class program extends control /** * Program create guide. * + * @param int $programID + * @param string $from * @access public * @return void */ @@ -998,12 +1000,12 @@ class program extends control $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('PRJBrowse', array('programID' => $programID, 'browseType' => 'doing')))); } - $name = ''; - $code = ''; - $team = ''; - $whitelist = ''; - $acl = 'open'; - $privway = 'extend'; + $name = ''; + $code = ''; + $team = ''; + $whitelist = ''; + $acl = 'open'; + $privway = 'extend'; if($parentProgramID) {