From 0db7f60ed2df3fcdaaa019b08ebc7293a21fdad8 Mon Sep 17 00:00:00 2001 From: dingguodong Date: Thu, 22 Jul 2021 15:25:32 +0800 Subject: [PATCH 1/3] * Change ajaxGetProductByRepo function. --- module/job/control.php | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/module/job/control.php b/module/job/control.php index ee9791f323..0854d711a1 100644 --- a/module/job/control.php +++ b/module/job/control.php @@ -254,12 +254,30 @@ class job extends control * * @param int $repoID * @access public - * @return void + * @return string */ public function ajaxGetProductByRepo($repoID) { $repo = $this->loadModel('repo')->getRepoByID($repoID); - if($repo) return $repo->product; - die(js::error("Access Violation. 非法访问。")); + if(empty($repo)) die(json_encode(array(""=>""))); + + $product = $repo->product; + if(strpos($product, ',')) + { + $productList = explode(',', $product); + $matchedProducts = array(); + $productPair = $this->loadModel('product')->getPairs(); + foreach($productList as $productLeft) + { + foreach($productPair as $productRight => $productName) + { + if($productLeft == $productRight) $matchedProducts[$productName] = $productRight; + } + } + die(json_encode($matchedProduct)); + } + + $productName = $this->loadModel('product')->getByID($repo->product)->name; + die(json_encode(array($productName => $repo->product))); } } From a10a069fd69d77f7091e0703ff19ebecf98a9e20 Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Thu, 22 Jul 2021 16:00:07 +0800 Subject: [PATCH 2/3] * Finish task#40514. --- module/program/view/browsebylist.html.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/module/program/view/browsebylist.html.php b/module/program/view/browsebylist.html.php index 89a93144a0..51d1d81276 100644 --- a/module/program/view/browsebylist.html.php +++ b/module/program/view/browsebylist.html.php @@ -46,8 +46,13 @@ > ' title='name?>'> - type == 'program' ? ' table-nest-toggle' : '';?> - + type == 'program') $icon = ' icon-program'; + if($program->type == 'project') $icon = ' icon-common icon-' . (isset($this->config->maxVersion) ? $program->model : $program->type); + $class = $program->type == 'program' ? ' table-nest-toggle' : ''; + ?> + type == 'program'):?> createLink('program', 'product', "programID=$program->id"), $program->name);?> @@ -132,7 +137,10 @@ #programList > thead > tr > th .table-nest-toggle-global {top: 6px} #programList > thead > tr > th .table-nest-toggle-global:before {color: #a6aab8;} #programTableList > tr:last-child .c-actions .dropdown-menu {top: auto; bottom: 100%; margin-bottom: -5px;} -#programTableList .icon-project:before {content: '\e99c'; width: 22px; height: 22px; background: none; color: #16a8f8; top: 0; line-height: 22px; margin-right: 2px; font-size: 14px} +#programTableList .icon-common:before {width: 22px; height: 22px; background: none; color: rgb(166, 170, 184); top: 0; line-height: 22px; margin-right: 2px; font-size: 14px} +#programTableList .icon-project:before {content: '\e99c';} +#programTableList .icon-scrum:before {content: '\e9a2';} +#programTableList .icon-waterfall:before {content: '\e9a4';}