From 0725d8e372e1a8a13a2d5f1f642c42c715febac0 Mon Sep 17 00:00:00 2001 From: dingguodong Date: Mon, 19 Jun 2023 14:02:46 +0800 Subject: [PATCH] * Finish task#95327. Show customized icon for project view. --- module/datatable/config.php | 1 - module/datatable/control.php | 7 +++++++ module/datatable/model.php | 8 ++++++++ module/program/ui/browse.html.php | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/module/datatable/config.php b/module/datatable/config.php index 088fc925f4..b03c9c7a03 100644 --- a/module/datatable/config.php +++ b/module/datatable/config.php @@ -3,7 +3,6 @@ $config->datatable->moduleAlias['product-browse'] = 'story'; $config->datatable->moduleAlias['execution-story'] = 'story'; $config->datatable->moduleAlias['execution-task'] = 'task'; $config->datatable->moduleAlias['program-project'] = 'project'; -$config->datatable->moduleAlias['program-browse'] = 'project'; $config->datatable->moduleAlias['project-bug'] = 'bug'; $config->datatable->moduleAlias['execution-bug'] = 'bug'; $config->datatable->moduleAlias['my-bug'] = 'bug'; diff --git a/module/datatable/control.php b/module/datatable/control.php index eada0c21fa..30da5bfd67 100644 --- a/module/datatable/control.php +++ b/module/datatable/control.php @@ -144,6 +144,13 @@ class datatable extends control $module = zget($this->config->datatable->moduleAlias, "$module-$method", $module); $setting = ''; if(isset($this->config->datatable->$target->cols)) $setting = $this->config->datatable->$target->cols; + + if($module == 'program' and $method == 'browse') + { + $method = 'projectView'; /* Use projectView datatable setting in program module . */ + $setting = $this->config->datatable->programProjectView->cols; /* Use the customized table data from database. */ + } + if(empty($setting)) { $cols = $this->datatable->getFieldList($module, $method); diff --git a/module/datatable/model.php b/module/datatable/model.php index 190efe3275..a62909d0ad 100644 --- a/module/datatable/model.php +++ b/module/datatable/model.php @@ -92,9 +92,17 @@ class datatableModel extends model $datatableId = $module . ucfirst($method); $module = zget($this->config->datatable->moduleAlias, "$module-$method", $module); + + if(!isset($this->config->$module)) $this->loadModel($module); if(isset($this->config->datatable->$datatableId->cols)) $setting = json_decode($this->config->datatable->$datatableId->cols, true); + if($module == 'program' and $method == 'browse') + { + $method = 'projectView'; /* Use projectView datatable setting in program module . */ + $setting = json_decode($this->config->datatable->programProjectView->cols, true); /* Fetch the customized table data from database. */ + } + $fieldList = $this->getFieldList($module, $method); if(empty($setting)) { diff --git a/module/program/ui/browse.html.php b/module/program/ui/browse.html.php index f7c006cbb4..9d8d7eb881 100644 --- a/module/program/ui/browse.html.php +++ b/module/program/ui/browse.html.php @@ -1,7 +1,7 @@ program->projectView->dtable->fieldList); +$cols = $this->loadModel('datatable')->getSetting('program'); $data = array(); foreach($programs as $program) {