* [task#152647] Set the button of stage when stage are baselined.

This commit is contained in:
xieqiyu
2025-11-28 02:47:15 +00:00
parent d1550d33b4
commit f516dcad8a
9 changed files with 45 additions and 4 deletions
+12
View File
@@ -1066,6 +1066,13 @@ class execution extends control
$this->loadModel('project')->checkAccess($projectID, $allProjects);
if(empty($projectID)) $projectID = key($allProjects) ? key($allProjects) : 0;
/* 过滤掉阶段已打基线的项目。*/
$executionList = $this->project->getExecutionList(array_keys($allProjects));
foreach($executionList as $executionInfo)
{
if(!empty($executionInfo->frozen)) unset($allProjects[$executionInfo->project]);
}
$project = empty($projectID) ? null : $this->loadModel('project')->fetchByID($projectID);
$project ? $this->executionZen->correctExecutionCommonLang($project, $execution->type) : $project = null;
$products = $this->executionZen->getLinkedProducts($copyExecutionID, $planID, $project);
@@ -1377,6 +1384,11 @@ class execution extends control
$relatedProjects = $this->dao->select('id,project')->from(TABLE_PROJECT)->where('id')->in($executionIDList)->fetchPairs(); /* 获取执行所属的项目列表。*/
$projects = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->in($relatedProjects)->fetchAll('id'); /* 获取执行所属的项目列表中每个项目的项目信息。*/
foreach($executions as $key => $execution)
{
if(!empty($execution->frozen)) unset($executions[$key]);
}
list($pmUsers, $poUsers, $qdUsers, $rdUsers) = $this->executionZen->setUserMoreLink($executions);
/* Set custom fields. */
+3
View File
@@ -163,6 +163,9 @@ $lang->execution->typeTip = "The sub-stages of other types can be cre
$lang->execution->waterfallTip = "In the Waterfall {$lang->projectCommon} or in the Waterfall + {$lang->projectCommon},";
$lang->execution->progressTip = 'All Progress = Consumed / (Consumed + Left)';
$lang->execution->limitedTip = "Limited users can only edit tasks that are relevant to them and cannot create new tasks. Relevant tasks include those assigned to them, completed tasks, canceled tasks, closed tasks, and the last edited tasks, but exclude those copied to them. \nIf a user was not a limited user before but is now classified as one, they will still have permissions for tasks they created in the past.";
$lang->execution->stageFrozenTip = 'After the stage are baselined, %s is not allowed.';
$lang->execution->createChildStage = 'create child stage';
$lang->execution->ganttDrag = 'Drag';
$lang->execution->start = 'Start';
$lang->execution->activate = 'Aktivieren';
+3
View File
@@ -163,6 +163,9 @@ $lang->execution->typeTip = "The sub-stages of other types can be cre
$lang->execution->waterfallTip = "In the Waterfall {$lang->projectCommon} or in the Waterfall + {$lang->projectCommon},";
$lang->execution->progressTip = 'All Progress = Consumed / (Consumed + Left)';
$lang->execution->limitedTip = "Limited users can only edit tasks that are relevant to them and cannot create new tasks. Relevant tasks include those assigned to them, completed tasks, canceled tasks, closed tasks, and the last edited tasks, but exclude those copied to them. \nIf a user was not a limited user before but is now classified as one, they will still have permissions for tasks they created in the past.";
$lang->execution->stageFrozenTip = 'After the stage are baselined, %s is not allowed.';
$lang->execution->createChildStage = 'create child stage';
$lang->execution->ganttDrag = 'Drag';
$lang->execution->start = 'Start';
$lang->execution->activate = 'Activate';
+3
View File
@@ -163,6 +163,9 @@ $lang->execution->typeTip = "The sub-stages of other types can be cre
$lang->execution->waterfallTip = "In the Waterfall {$lang->projectCommon} or in the Waterfall + {$lang->projectCommon},";
$lang->execution->progressTip = 'All Progress = Consumed / (Consumed + Left)';
$lang->execution->limitedTip = "Limited users can only edit tasks that are relevant to them and cannot create new tasks. Relevant tasks include those assigned to them, completed tasks, canceled tasks, closed tasks, and the last edited tasks, but exclude those copied to them. \nIf a user was not a limited user before but is now classified as one, they will still have permissions for tasks they created in the past.";
$lang->execution->stageFrozenTip = 'After the stage are baselined, %s is not allowed.';
$lang->execution->createChildStage = 'create child stage';
$lang->execution->ganttDrag = 'Drag';
$lang->execution->start = 'Démarrer';
$lang->execution->activate = 'Activer';
+3
View File
@@ -163,6 +163,9 @@ $lang->execution->typeTip = '“综合”类型的父阶段可以创
$lang->execution->waterfallTip = "瀑布{$lang->projectCommon}和融合瀑布{$lang->projectCommon}中,";
$lang->execution->progressTip = '总进度 = 已消耗工时 / (已消耗工时 + 剩余工时)';
$lang->execution->limitedTip = "受限用户只能编辑与自己相关的任务,不能新增任务。与自己相关的内容,包含指派给、已完成、已取消、已关闭、最后编辑,不包含抄送给的内容。 \n如果该用户之前不是受限用户,现在是受限用户,那么之前由他创建的任务还有相关的操作权限。";
$lang->execution->stageFrozenTip = '阶段打基线后不允许%s';
$lang->execution->createChildStage = '创建子阶段';
$lang->execution->ganttDrag = '拖拽';
$lang->execution->start = "开始";
$lang->execution->activate = "激活";
+2
View File
@@ -3929,6 +3929,7 @@ class executionModel extends model
*/
public static function isClickable(object $execution, string $action): bool
{
if(!empty($execution->frozen) && in_array($action, array('edit', 'createChildStage', 'delete', 'putoff'))) return false;
if($action == 'createChildStage') return commonModel::hasPriv('programplan', 'create') && $execution->type == 'stage';
if($action == 'createTask') return commonModel::hasPriv('task', 'create') && commonModel::hasPriv('execution', 'create') && empty($execution->isParent);
if(!commonModel::hasPriv('execution', $action)) return false;
@@ -4964,6 +4965,7 @@ class executionModel extends model
if($actionName == 'createChildStage' && $action['disabled'] && $execution->type != 'stage') $action['hint'] = $this->lang->programplan->error->notStage;
if(!$action['disabled']) break;
if($actionName == 'close' && $execution->status != 'closed') break;
if(!empty($execution->frozen) && in_array($actionName, array('edit', 'createChildStage', 'delete', 'putoff'))) $action['hint'] = sprintf($this->lang->execution->stageFrozenTip, $this->lang->execution->$actionName);
}
if(!empty($action))
+4 -2
View File
@@ -26,13 +26,15 @@ formPanel
datePicker
(
set::name('begin'),
set::value($newBegin)
set::value($newBegin),
set::disabled(!empty($execution->frozen))
),
$lang->execution->to,
datePicker
(
set::name('end'),
set::value($newEnd)
set::value($newEnd),
set::disabled(!empty($execution->frozen))
)
)
),