From 39bc8a888c530e6f5586fc3dd52dee00bafbbae0 Mon Sep 17 00:00:00 2001 From: chentao Date: Fri, 16 Jun 2023 14:23:02 +0800 Subject: [PATCH] * Add URL link to the 'name' and 'totalProjects' fileds of the data table on the product view page within program module. --- module/program/config/dtable.php | 4 +++- module/program/js/productview.ui.js | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/module/program/config/dtable.php b/module/program/config/dtable.php index 3cc6aea68a..c6a9580d8e 100644 --- a/module/program/config/dtable.php +++ b/module/program/config/dtable.php @@ -63,6 +63,7 @@ $config->program->productview->dtable->fieldList = array(); $config->program->productview->dtable->fieldList['name']['name'] = 'name'; $config->program->productview->dtable->fieldList['name']['title'] = $lang->nameAB; $config->program->productview->dtable->fieldList['name']['type'] = 'title'; +$config->program->productview->dtable->fieldList['name']['link'] = array('module' => 'product', 'method' => 'browse', 'params' => 'productID={id}'); $config->program->productview->dtable->fieldList['name']['nestedToggle'] = true; $config->program->productview->dtable->fieldList['name']['checkbox'] = true; $config->program->productview->dtable->fieldList['name']['show'] = true; @@ -118,7 +119,8 @@ $config->program->productview->dtable->fieldList['totalPlans']['group'] = 'g5 $config->program->productview->dtable->fieldList['totalProjects']['name'] = 'totalProjects'; $config->program->productview->dtable->fieldList['totalProjects']['title'] = $lang->program->project; -$config->program->productview->dtable->fieldList['totalProjects']['type'] = 'text'; +$config->program->productview->dtable->fieldList['totalProjects']['type'] = 'number'; +$config->program->productview->dtable->fieldList['totalProjects']['link'] = array('module' => 'product', 'method' => 'project', 'params' => 'status=all&&productID={id}'); $config->program->productview->dtable->fieldList['totalProjects']['sortType'] = true; $config->program->productview->dtable->fieldList['totalProjects']['group'] = 'g5'; diff --git a/module/program/js/productview.ui.js b/module/program/js/productview.ui.js index 9101b004da..4bccdd7a83 100644 --- a/module/program/js/productview.ui.js +++ b/module/program/js/productview.ui.js @@ -15,5 +15,18 @@ window.renderReleaseCountCell = function(result, {col, row}) if(row.data.latestReleaseDate === '') return ['']; } + if(col.name == 'name' && row.data.type !== 'product') + { + if(row.data.type == 'productLine') result[3] = row.data.name; + if(row.data.type == 'program') result[2] = row.data.name; + + return result; + } + + if(col.name == 'totalProjects' && row.data.type !== 'product') + { + return [row.data.totalProjects]; + } + return result; }