* code for task #74779.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user