* code for task #74779.

This commit is contained in:
wangyidong
2022-11-02 14:21:24 +08:00
parent 557d32fbd3
commit f2cd7c12b4
3 changed files with 13 additions and 6 deletions
+9 -3
View File
@@ -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);
}
}
+1 -1
View File
@@ -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
{
+3 -2
View File
@@ -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);
}
}