* Move the judgement of action mr to tao.

This commit is contained in:
wangxuepeng
2023-10-09 09:24:47 +00:00
parent df0b1a3382
commit 5aa5215aa1
2 changed files with 4 additions and 8 deletions
+3 -8
View File
@@ -933,8 +933,7 @@ class actionModel extends model
/* Add objectName field to the action. */
$this->actionTao->addObjectNameForAction($action, $objectNames);
$projectID = isset($relatedProjects[$action->objectType][$action->objectID]) ? $relatedProjects[$action->objectType][$action->objectID] : 0;
$projectID = isset($relatedProjects[$action->objectType][$action->objectID]) ? $relatedProjects[$action->objectType][$action->objectID] : 0;
$actionType = strtolower($action->action);
$objectType = strtolower($action->objectType);
@@ -952,14 +951,10 @@ class actionModel extends model
/* Get gitlab, gitea or gogs objectname. */
if(empty($action->objectName) && (substr($objectType, 0, 6) == 'gitlab' || substr($objectType, 0, 5) == 'gitea' || substr($objectType, 0, 4) == 'gogs')) $action->objectName = $action->extra;
/* 其它类型的action,设置action的objectLink属性。 */
/* For other types of actions, set the objectLink attribute of the action. */
/* 设置action的objectLink属性。 */
/* Set the objectLink attribute of the action. */
$this->setObjectLink($action, $deptUsers, $shadowProducts, zget($projectMultiples, $projectID, ''));
/* 设置合并请求的objectLink属性。 */
/* Set merge request objectLink. */
if((empty($action->objectName) || $action->action == 'deleted') && $action->objectType == 'mr') $action->objectLink = '';
$action->major = (isset($this->config->action->majorList[$action->objectType]) && in_array($action->action, $this->config->action->majorList[$action->objectType])) ? 1 : 0;
}
return $actions;
+1
View File
@@ -1064,6 +1064,7 @@ class actionTao extends actionModel
if($todo->private == 1 && $todo->account != $this->app->user->account) return false;
}
if($action->objectType == 'mr' && (empty($action->objectName) || $action->action == 'deleted')) return false;
if($action->objectType == 'stakeholder' && $action->project == 0) return false;
if($action->objectType == 'chartgroup') return false;
if($action->objectType == 'branch' && $action->action == 'mergedbranch') return false;