Merge branch dev/task-147107 of zentao/zentaopms (#10752)

This commit is contained in:
刘刚
2025-08-04 16:01:03 +08:00
committed by Gitfox
6 changed files with 33 additions and 8 deletions
+11 -2
View File
@@ -166,7 +166,16 @@ class doc extends control
}
$doc = $this->doc->getByID($blockData->doc);
$this->view->isTemplate = !empty($doc->templateType) && !in_array($blockData->extra, array('fromReview', 'fromProjectReport'));
$this->view->isTemplate = !empty($doc->templateType) && !in_array($blockData->extra, array('fromReview', 'fromReport'));
$this->view->fromReport = $blockData->extra == 'fromReport';
$noSupport = false;
if($this->view->fromReport)
{
$project = $this->loadModel('project')->fetchByID($this->session->project);
$noSupport = in_array($type, array('HLDS', 'DDS', 'DBDS', 'ADS')) && in_array($project->model, array('scrum', 'scrumplus', 'kanban'));
}
$this->view->noSupport = $noSupport;
if($this->view->isTemplate)
{
@@ -181,7 +190,7 @@ class doc extends control
return $this->display();
}
$fromTemplate = $blockData->extra == 'fromTemplate' || $blockData->extra == 'fromReview';
$fromTemplate = in_array($blockData->extra, array('fromTemplate', 'fromReview', 'fromReport'));
if($fromTemplate)
{
$this->view->title = sprintf($this->lang->doc->insertTitle, $this->lang->docTemplate->zentaoList[$type]);
+1
View File
@@ -538,6 +538,7 @@ $lang->doc->previewNotAvailable = 'Preview function is not available. Pl
$lang->doc->hocuspocusConnect = 'The collaborative editing service is connected.';
$lang->doc->hocuspocusDisconnect = 'The collaborative editing service is disconnected. Edits will be synchronized after reconnection.';
$lang->doc->docTemplateConvertComment = 'The template has been converted to the new editor format. Switch to version %s to view the template before conversion.';
$lang->doc->noSupportList = "This {$lang->projectCommon} does not support %s.";
$lang->doc->noticeAcl['lib']['product']['default'] = "Users who can access the selected {$lang->productCommon} can access it.";
$lang->doc->noticeAcl['lib']['product']['custom'] = "Users who can access the selected {$lang->productCommon} or users in the whiltelist can access it.";
+1
View File
@@ -538,6 +538,7 @@ $lang->doc->previewNotAvailable = 'Preview function is not available. Pl
$lang->doc->hocuspocusConnect = 'The collaborative editing service is connected.';
$lang->doc->hocuspocusDisconnect = 'The collaborative editing service is disconnected. Edits will be synchronized after reconnection.';
$lang->doc->docTemplateConvertComment = 'The template has been converted to the new editor format. Switch to version %s to view the template before conversion.';
$lang->doc->noSupportList = "This {$lang->projectCommon} does not support %s.";
$lang->doc->noticeAcl['lib']['product']['default'] = "Users who can access the selected {$lang->productCommon} can access it.";
$lang->doc->noticeAcl['lib']['product']['custom'] = "Users who can access the selected {$lang->productCommon} or users in the whiltelist can access it.";
+1
View File
@@ -538,6 +538,7 @@ $lang->doc->previewNotAvailable = 'Preview function is not available. Pl
$lang->doc->hocuspocusConnect = 'The collaborative editing service is connected.';
$lang->doc->hocuspocusDisconnect = 'The collaborative editing service is disconnected. Edits will be synchronized after reconnection.';
$lang->doc->docTemplateConvertComment = 'The template has been converted to the new editor format. Switch to version %s to view the template before conversion.';
$lang->doc->noSupportList = "This {$lang->projectCommon} does not support %s.";
$lang->doc->noticeAcl['lib']['product']['default'] = "Users who can access the selected {$lang->productCommon} can access it.";
$lang->doc->noticeAcl['lib']['product']['custom'] = "Users who can access the selected {$lang->productCommon} or users in the whiltelist can access it.";
+1
View File
@@ -538,6 +538,7 @@ $lang->doc->previewNotAvailable = '预览功能暂不可用,请访问
$lang->doc->hocuspocusConnect = '协作编辑服务已连接。';
$lang->doc->hocuspocusDisconnect = '协作编辑服务已断开,编辑内容将在重新连接后同步。';
$lang->doc->docTemplateConvertComment = "文档模板已经转换为新编辑器格式,切换版本 %s 来查看转换前的文档模板。";
$lang->doc->noSupportList = "当前{$lang->projectCommon}暂不支持“ %s”";
$lang->doc->noticeAcl['lib']['product']['default'] = "有所选{$lang->productCommon}访问权限的用户可以访问。";
$lang->doc->noticeAcl['lib']['product']['custom'] = "有所选{$lang->productCommon}访问权限或白名单里的用户可以访问。";
+18 -6
View File
@@ -10,6 +10,9 @@ declare(strict_types=1);
*/
namespace zin;
$noticeTip = $noSupport ? sprintf($lang->doc->noSupportList, $lang->doc->zentaoList[$type] . $lang->doc->list) : '';
$listText = $type == 'gantt' ? $lang->docTemplate->zentaoList['gantt'] : $lang->doc->list;
if($type == 'gantt' && !empty($ganttData))
{
$userList = array();
@@ -35,8 +38,8 @@ if($type == 'productCase')
}
$actions = array();
$setText = (!$isTemplate && $fromTemplate) ? $lang->doc->zentaoAction['setParams'] : $lang->doc->zentaoAction['set'];
if($type != 'gantt' || !$isTemplate) $actions[] = array('icon' => 'menu-backend', 'text' => $setText, 'data-toggle' => 'modal', 'url' => str_replace('{blockID}', "$blockID", $settings), 'data-size' => $isTemplate ? 'sm' : 'lg');
$setText = (!$isTemplate && $fromTemplate && !$fromReport) ? $lang->doc->zentaoAction['setParams'] : $lang->doc->zentaoAction['set'];
if(!$noSupport && ($type != 'gantt' || !$isTemplate)) $actions[] = array('icon' => 'menu-backend', 'text' => $setText, 'data-toggle' => 'modal', 'url' => str_replace('{blockID}', "$blockID", $settings), 'data-size' => $isTemplate || $fromReport ? 'sm' : 'lg');
$actions[] = array('icon' => 'trash', 'text' => $lang->doc->zentaoAction['delete'], 'zui-on-click' => "deleteZentaoList($blockID)");
if($isTemplate || $fromTemplate)
@@ -47,7 +50,7 @@ if($isTemplate || $fromTemplate)
if(($type == 'productCase' || $type == 'projectCase') && !empty($caseStage)) $blockTitle = $blockTitle . $lang->testcase->stageList[$caseStage];
}
$emptyTip = $lang->doc->previewTip;
$emptyTip = $fromReport ? $lang->docTemplate->emptyTip : $lang->doc->previewTip;
if(!$isTemplate && $fromTemplate) $emptyTip = $isSetted ? $lang->docTemplate->emptyTip : $lang->docTemplate->previewTip;
$pagerSetting = usePager();
@@ -66,7 +69,7 @@ div
h2
(
setClass('font-bold text-xl'),
($isTemplate || $fromTemplate ? $blockTitle . $lang->docTemplate->zentaoList[$type] : $lang->doc->zentaoList[$type]) . ($type == 'gantt' ? '' : $lang->doc->list)
(($isTemplate || $fromTemplate || $fromReport) ? $blockTitle . $lang->docTemplate->zentaoList[$type] : $lang->doc->zentaoList[$type]) . ($type == 'gantt' ? '' : $lang->doc->list)
),
div
(
@@ -86,10 +89,10 @@ div
div
(
setClass('config-tip text-center px-3 py-2'),
$isTemplate ? sprintf($lang->docTemplate->configTip, $type == 'gantt' ? $lang->docTemplate->zentaoList['gantt'] : $lang->doc->list) : $emptyTip
$isTemplate ? sprintf($lang->docTemplate->configTip, $listText) : $emptyTip
)
):null,
!$isTemplate && $type != 'gantt' ? dtable
!$isTemplate && $type != 'gantt' && !$noSupport ? dtable
(
set::cols(array_values($cols)),
set::data(array_values($data)),
@@ -105,6 +108,15 @@ div
$type == 'productRelease' ? set::plugins(array('cellspan')) : null,
$type == 'productRelease' ? set::getCellSpan(jsRaw('window.getCellSpan')) : null
) : null,
$noSupport ? div
(
setClass('canvas border rounded py-3 px-3'),
div
(
setClass('config-tip text-center px-3 py-2 text-gray-400'),
div($noticeTip)
)
) : null,
$type == 'gantt' && !empty($ganttData) ? zui::gantt
(
set::onInit(jsRaw('window.onInitGantt')),