From 76016e1b7834f1c64f13bd107eeeefd614878209 Mon Sep 17 00:00:00 2001 From: wangxuepeng Date: Tue, 7 Mar 2023 07:43:26 +0000 Subject: [PATCH 1/3] * Fixed #bug86288. --- module/action/model.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index 6a346ac118..b148865057 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -482,9 +482,18 @@ class actionModel extends model if($name) $action->extra = common::hasPriv('testtask', 'view') ? html::a(helper::createLink('testtask', 'view', "taskID=$action->extra"), $name) : $name; } elseif(strpos('feedback,ticket', $action->objectType) === false and $actionName == 'tostory') - { - $title = $this->dao->select('title')->from(TABLE_STORY)->where('id')->eq($action->extra)->fetch('title'); - if($title) $action->extra = common::hasPriv('story', 'view') ? html::a(helper::createLink('story', 'view', "storyID=$action->extra"), "#$action->extra " . $title) : "#$action->extra " . $title; + { + $projectID = 0; + $productShadow = $this->dao->select('*')->from(TABLE_PRODUCT)->where('id')->in($action->product)->fetch('shadow'); + $title = $this->dao->select('title')->from(TABLE_STORY)->where('id')->eq($action->extra)->fetch('title'); + $defaultExtra = "#$action->extra ".$title; + if($productShadow === "1") + { + $projectID = $this->dao->select('project')->from(TABLE_PROJECTPRODUCT)->where('product')->in($action->product)->fetch('project'); + if($title) $action->extra = common::hasPriv('projectstory','story') && $projectID ? html::a(helper::createLink('projectstory','story',"projectID=$projectID"),"#$action->extra ".$title) : $defaultExtra; + }else{ + if($title) $action->extra = common::hasPriv('story', 'view') ? html::a(helper::createLink('story', 'view', "storyID=$action->extra"), "#$action->extra " . $title) : $defaultExtra; + } } elseif($actionName == 'importedcard') { From 21c915dc366e0966a66d04190b227ef82968c8ed Mon Sep 17 00:00:00 2001 From: wangxuepeng Date: Wed, 8 Mar 2023 02:33:35 +0000 Subject: [PATCH 2/3] * Fixed #bug86288. --- module/action/model.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index b148865057..41432da860 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -483,16 +483,17 @@ class actionModel extends model } elseif(strpos('feedback,ticket', $action->objectType) === false and $actionName == 'tostory') { - $projectID = 0; $productShadow = $this->dao->select('*')->from(TABLE_PRODUCT)->where('id')->in($action->product)->fetch('shadow'); $title = $this->dao->select('title')->from(TABLE_STORY)->where('id')->eq($action->extra)->fetch('title'); $defaultExtra = "#$action->extra ".$title; if($productShadow === "1") { $projectID = $this->dao->select('project')->from(TABLE_PROJECTPRODUCT)->where('product')->in($action->product)->fetch('project'); - if($title) $action->extra = common::hasPriv('projectstory','story') && $projectID ? html::a(helper::createLink('projectstory','story',"projectID=$projectID"),"#$action->extra ".$title) : $defaultExtra; - }else{ - if($title) $action->extra = common::hasPriv('story', 'view') ? html::a(helper::createLink('story', 'view', "storyID=$action->extra"), "#$action->extra " . $title) : $defaultExtra; + if($title) $action->extra = common::hasPriv('projectstory','story') && $projectID ? html::a(helper::createLink('projectstory','story',"projectID=$projectID"),$defaultExtra) : $defaultExtra; + } + else + { + if($title) $action->extra = common::hasPriv('story', 'view') ? html::a(helper::createLink('story', 'view', "storyID=$action->extra"), $defaultExtra) : $defaultExtra; } } elseif($actionName == 'importedcard') From 4db7af7e52d20a531bd30aaea112c6ab51a01572 Mon Sep 17 00:00:00 2001 From: wangxuepeng Date: Wed, 8 Mar 2023 02:37:40 +0000 Subject: [PATCH 3/3] * Fixed #bug86288. --- module/action/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index 41432da860..d0133ef7fd 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -485,11 +485,11 @@ class actionModel extends model { $productShadow = $this->dao->select('*')->from(TABLE_PRODUCT)->where('id')->in($action->product)->fetch('shadow'); $title = $this->dao->select('title')->from(TABLE_STORY)->where('id')->eq($action->extra)->fetch('title'); - $defaultExtra = "#$action->extra ".$title; + $defaultExtra = "#$action->extra ". $title; if($productShadow === "1") { $projectID = $this->dao->select('project')->from(TABLE_PROJECTPRODUCT)->where('product')->in($action->product)->fetch('project'); - if($title) $action->extra = common::hasPriv('projectstory','story') && $projectID ? html::a(helper::createLink('projectstory','story',"projectID=$projectID"),$defaultExtra) : $defaultExtra; + if($title) $action->extra = common::hasPriv('projectstory', 'story') && $projectID ? html::a(helper::createLink('projectstory', 'story', "projectID=$projectID"), $defaultExtra) : $defaultExtra; } else {