From 1ce64ff3c996188a819fe36b59f1828cd64a5335 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 11 Apr 2023 08:47:05 +0800 Subject: [PATCH] * Fix bug #33985. --- module/action/model.php | 9 ++++++--- module/doc/config.php | 10 +++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index ea2e44208c..c51bcb6852 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1549,6 +1549,8 @@ class actionModel extends model */ public function setObjectLink($action, $deptUsers, $shadowProducts, $project = null) { + $this->app->loadConfig('doc'); + $action->objectLink = ''; $action->objectLabel = zget($this->lang->action->objectTypes, $action->objectLabel); @@ -1678,9 +1680,10 @@ class actionModel extends model else { $method = 'tablecontents'; - if($docLib->type == 'product') $method = 'productspace'; - if(in_array($docLib->type, array('project', 'execution'))) $method = 'projectspace'; - $params = $method == 'tablecontents' ? sprintf($vars, $docLib->type, $docLib->objectID, $action->objectID, $appendLib) : "objectID={$docLib->objectID}&libID={$action->objectID}"; + if(isset($this->config->doc->spaceMethod[$docLib->type])) $method = $this->config->doc->spaceMethod[$docLib->type]; + if($method == 'myspace') $params = "type=mine&libID={$action->objectID}"; + if($method == 'tablecontents') $params = sprintf($vars, $docLib->type, $docLib->objectID, $action->objectID, $appendLib); + if(!in_array($method, array('myspace', 'tablecontents'))) $params = "objectID={$docLib->objectID}&libID={$action->objectID}"; $action->objectLink = helper::createLink('doc', $method, $params); } } diff --git a/module/doc/config.php b/module/doc/config.php index 2b4fa0e959..2a640cbce6 100644 --- a/module/doc/config.php +++ b/module/doc/config.php @@ -43,11 +43,11 @@ $config->doc->objectIconList['execution'] = 'icon-run'; $config->doc->objectIconList['mine'] = 'icon-contacts'; $config->doc->objectIconList['custom'] = 'icon-groups'; -$config->doc->spaceMethod['mine'] = 'mySpace'; -$config->doc->spaceMethod['product'] = 'productSpace'; -$config->doc->spaceMethod['project'] = 'projectSpace'; -$config->doc->spaceMethod['execution'] = 'projectSpace'; -$config->doc->spaceMethod['custom'] = 'tableContents'; +$config->doc->spaceMethod['mine'] = 'myspace'; +$config->doc->spaceMethod['product'] = 'productspace'; +$config->doc->spaceMethod['project'] = 'projectspace'; +$config->doc->spaceMethod['execution'] = 'projectspace'; +$config->doc->spaceMethod['custom'] = 'tablecontents'; $config->doc->search['module'] = 'doc'; $config->doc->search['fields']['title'] = $lang->doc->title;