From a1eb251907e9f3f7e8d592af07acef042cb1cbbc Mon Sep 17 00:00:00 2001 From: tianshujie Date: Sat, 2 Apr 2022 10:13:13 +0800 Subject: [PATCH 1/4] * Fix bug #15460,17587. --- module/design/control.php | 7 ++++--- module/design/css/viewcommit.css | 2 ++ module/design/js/viewcommit.js | 20 ++++++++++++++++++++ module/design/view/browse.html.php | 4 ++-- module/design/view/viewcommit.html.php | 8 +++----- 5 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 module/design/css/viewcommit.css create mode 100644 module/design/js/viewcommit.js diff --git a/module/design/control.php b/module/design/control.php index 1beea92865..601a926bca 100644 --- a/module/design/control.php +++ b/module/design/control.php @@ -308,8 +308,6 @@ class design extends control $repos = $this->loadModel('repo')->getRepoPairs('project', $design->project); $repoID = $repoID ? $repoID : key($repos); - if(empty($repoID)) return print(js::locate(helper::createLink('repo', 'create', "objectID=$design->project"))); - $repo = $this->loadModel('repo')->getRepoByID($repoID); $revisions = $this->repo->getCommits($repo, '', 'HEAD', '', '', $begin, $end); @@ -399,12 +397,15 @@ class design extends control $this->app->loadClass('pager', $static = true); $pager = pager::init(0, $recPerPage, $pageID); + $design = $this->design->getCommit($designID, $pager); + $this->view->title = $this->lang->design->common . $this->lang->colon . $this->lang->design->submission; $this->view->position[] = $this->lang->design->submission; - $this->view->design = $this->design->getCommit($designID, $pager); + $this->view->design = $design; $this->view->pager = $pager; $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->repos = $this->loadModel('repo')->getRepoPairs('project', $design->project); $this->display(); } diff --git a/module/design/css/viewcommit.css b/module/design/css/viewcommit.css new file mode 100644 index 0000000000..f14cfda20e --- /dev/null +++ b/module/design/css/viewcommit.css @@ -0,0 +1,2 @@ +#mainContent .pull-right{margin-bottom: 10px} +.table{border: 1px solid #ddd;} diff --git a/module/design/js/viewcommit.js b/module/design/js/viewcommit.js new file mode 100644 index 0000000000..56db3f864e --- /dev/null +++ b/module/design/js/viewcommit.js @@ -0,0 +1,20 @@ +$(function() +{ + $('#linkCommit').click(function() + { + if(repos.length == 0) + { + var onlybody = config.onlybody; + config.onlybody = 'no'; + + var link = createLink('repo', 'create', 'objectID=' + projectID); + + config.onlybody = onlybody; + window.parent.$.apps.open(link, 'devops'); + + parent.$('#triggerModal').modal('hide'); + + return false; + } + }); +}); diff --git a/module/design/view/browse.html.php b/module/design/view/browse.html.php index d080b42d5c..7ebc91caec 100644 --- a/module/design/view/browse.html.php +++ b/module/design/view/browse.html.php @@ -51,9 +51,9 @@ id}"; - common::printIcon('design', 'edit', $vars, $design, 'list', 'alter', '', '', '', '', '', $design->project); + common::printIcon('design', 'edit', $vars, $design, 'list', 'alter'); common::printIcon('design', 'viewCommit', $vars, $design, 'list', 'list-alt', '', 'iframe showinonlybody', true); - common::printIcon('design', 'delete', $vars, $design, 'list', 'trash', 'hiddenwin', '', '', '', '', $design->project); + common::printIcon('design', 'delete', $vars, $design, 'list', 'trash', 'hiddenwin'); ?> diff --git a/module/design/view/viewcommit.html.php b/module/design/view/viewcommit.html.php index 883dcd88b5..052201b658 100644 --- a/module/design/view/viewcommit.html.php +++ b/module/design/view/viewcommit.html.php @@ -11,10 +11,8 @@ */ ?> - + +project);?>

@@ -24,7 +22,7 @@

- id", "" . $lang->design->linkCommit, '_blank', "class='btn btn-primary'");?> + id", "" . $lang->design->linkCommit, '', "class='btn btn-primary' id='linkCommit'");?>
commit)):?>
From bb6581b99ac3fabb6cdb6f98ced7bf3675c79aa6 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Sat, 2 Apr 2022 10:14:26 +0800 Subject: [PATCH 2/4] * Fix bug #18273. --- module/doc/css/createlib.css | 2 +- module/doc/css/editlib.css | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/module/doc/css/createlib.css b/module/doc/css/createlib.css index 7ceca80ca3..7a5b6bbfba 100644 --- a/module/doc/css/createlib.css +++ b/module/doc/css/createlib.css @@ -7,4 +7,4 @@ table {width: 90% !important;} #product_chosen {width: 50% !important;} #execution_chosen {width: 50% !important;} -#whiteListBox .input-group:last-child {margin-top: 10px;} +#groups_chosen.chosen-container .chosen-results, #users_chosen.chosen-container .chosen-results {max-height: 160px;} diff --git a/module/doc/css/editlib.css b/module/doc/css/editlib.css index b69d2fa8e3..2acde0e1ba 100644 --- a/module/doc/css/editlib.css +++ b/module/doc/css/editlib.css @@ -4,3 +4,4 @@ form {margin-right: 30px;} #whiteListBox .input-group:last-child {margin-top: 10px;} .center-block {margin-top: 20px;} +#groups_chosen.chosen-container .chosen-results, #users_chosen.chosen-container .chosen-results {max-height: 160px;} From a9b0b2127ac024a4f2be1558f40edb2cc66984bf Mon Sep 17 00:00:00 2001 From: tianshujie Date: Sat, 2 Apr 2022 10:26:41 +0800 Subject: [PATCH 3/4] * Fix bug #21401. --- module/execution/control.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/execution/control.php b/module/execution/control.php index 466fae912d..282a0798ae 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -3279,6 +3279,7 @@ class execution extends control $this->view->project = $project; $this->project->setMenu($projectID); + if(!$projectID) return $this->locate($this->createLink('project', 'browse')); if(!empty($project->model) and $project->model == 'kanban' and !(defined('RUN_MODE') and RUN_MODE == 'api')) return $this->locate($this->createLink('project', 'index', "projectID=$projectID")); } From b2e99c8dd4696e549960a06dba9196722c7877dd Mon Sep 17 00:00:00 2001 From: tianshujie Date: Sat, 2 Apr 2022 10:37:43 +0800 Subject: [PATCH 4/4] * Modify the jump link mode. --- module/execution/control.php | 8 ++++---- module/task/control.php | 2 +- module/upgrade/control.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 282a0798ae..98c1b23534 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1971,7 +1971,7 @@ class execution extends control if($execution->type == 'kanban') { if(defined('RUN_MODE') && RUN_MODE == 'api') return print($this->fetch('execution', 'kanban', "executionID=$executionID")); - return $this->locate(inlink('kanban', "executionID=$executionID")); + return print(js::locate(inlink('kanban', "executionID=$executionID"))); } $this->app->loadLang('program'); @@ -2041,7 +2041,7 @@ class execution extends control $this->lang->execution->menu = new stdclass(); $execution = $this->commonAction($executionID); - if($execution->type != 'kanban') return $this->locate(inlink('view', "executionID=$executionID")); + if($execution->type != 'kanban') return print(js::locate(inlink('view', "executionID=$executionID"))); $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $browseType, $orderBy, 0, $groupBy); $executionActions = array(); @@ -3279,8 +3279,8 @@ class execution extends control $this->view->project = $project; $this->project->setMenu($projectID); - if(!$projectID) return $this->locate($this->createLink('project', 'browse')); - if(!empty($project->model) and $project->model == 'kanban' and !(defined('RUN_MODE') and RUN_MODE == 'api')) return $this->locate($this->createLink('project', 'index', "projectID=$projectID")); + if(!$projectID) return print(js::locate($this->createLink('project', 'browse'))); + if(!empty($project->model) and $project->model == 'kanban' and !(defined('RUN_MODE') and RUN_MODE == 'api')) return print(js::locate($this->createLink('project', 'index', "projectID=$projectID"))); } if($this->app->viewType == 'mhtml') diff --git a/module/task/control.php b/module/task/control.php index 4b9de25297..25ce86ce2a 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -833,7 +833,7 @@ class task extends control } $execution = $this->execution->getById($task->execution); - if(!isonlybody() and $execution->type == 'kanban') return $this->locate($this->createLink('execution', 'kanban', "executionID=$execution->id")); + if(!isonlybody() and $execution->type == 'kanban') return print(js::locate($this->createLink('execution', 'kanban', "executionID=$execution->id"))); $this->session->project = $task->project; diff --git a/module/upgrade/control.php b/module/upgrade/control.php index 960f4aeb1c..335390a852 100644 --- a/module/upgrade/control.php +++ b/module/upgrade/control.php @@ -718,7 +718,7 @@ class upgrade extends control } $extFiles = $this->upgrade->getExtFiles(); - if(!empty($extFiles) and $skipMoveFile == 'no') return $this->locate(inlink('moveExtFiles', "fromVersion=$fromVersion")); + if(!empty($extFiles) and $skipMoveFile == 'no') return print(js::locate(inlink('moveExtFiles', "fromVersion=$fromVersion"))); $response = $this->upgrade->removeEncryptedDir(); if($response['result'] == 'fail')