diff --git a/module/action/model.php b/module/action/model.php index dd894bec84..df0af1c69d 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -373,11 +373,17 @@ class actionModel extends model } elseif($actionName == 'linked2execution' or $actionName == 'linked2kanban') { - $execution = $this->dao->select('name,type')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch(); + $execution = $this->dao->select('name,type,multiple')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch(); if(!empty($execution)) { - $name = $execution->name; - $method = $execution->type == 'kanban' ? 'kanban' : 'view'; + if($execution->type != 'project' and empty($execution->multiple)) + { + unset($actions[$actionID]); + continue; + } + + $name = $execution->name; + $method = $execution->type == 'kanban' ? 'kanban' : 'view'; $action->extra = (!common::hasPriv('execution', $method) or ($method == 'kanban' and isonlybody())) ? $name : html::a(helper::createLink('execution', $method, "executionID=$action->execution"), $name); } } diff --git a/module/story/control.php b/module/story/control.php index aa04a6c7f8..fa63c10d58 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -178,7 +178,7 @@ class story extends control $this->action->create('story', $storyID, 'linked2project', '', $object->project); $actionType = $object->type == 'kanban' ? 'linked2kanban' : 'linked2execution'; - $this->action->create('story', $storyID, $actionType, '', $objectID); + if($object->multiple) $this->action->create('story', $storyID, $actionType, '', $objectID); } else { diff --git a/module/testcase/model.php b/module/testcase/model.php index aaa8b63f46..69c6e457ba 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -2259,9 +2259,10 @@ class testcaseModel extends model $data->order = ++ $lastOrder; $this->dao->insert(TABLE_PROJECTCASE)->data($data)->exec(); - $objectType = $objectInfo[$projectID]->type; + $object = $objectInfo[$projectID]; + $objectType = $object->type; if($objectType == 'project') $this->action->create('case', $caseID, 'linked2project', '', $projectID); - if(in_array($objectType, array('sprint', 'stage'))) $this->action->create('case', $caseID, 'linked2execution', '', $projectID); + if(in_array($objectType, array('sprint', 'stage')) and $object->multiple) $this->action->create('case', $caseID, 'linked2execution', '', $projectID); } }