From f5b740ec61e17c70aa0814d40b48add04ccbb90c Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 4 Aug 2025 14:39:43 +0800 Subject: [PATCH 1/3] * [task#147107,doing,0.5h] adjust page for report. --- module/doc/control.php | 5 +++-- module/doc/ui/zentaolist.html.php | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 6a445e9470..b38a13ca49 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -166,7 +166,8 @@ 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'; if($this->view->isTemplate) { @@ -181,7 +182,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]); diff --git a/module/doc/ui/zentaolist.html.php b/module/doc/ui/zentaolist.html.php index 56caf69ffa..a3ce10f2fb 100644 --- a/module/doc/ui/zentaolist.html.php +++ b/module/doc/ui/zentaolist.html.php @@ -35,8 +35,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($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 +47,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 +66,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,7 +86,7 @@ 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 && !$fromReport ? sprintf($lang->docTemplate->configTip, $type == 'gantt' ? $lang->docTemplate->zentaoList['gantt'] : $lang->doc->list) : $emptyTip ) ):null, !$isTemplate && $type != 'gantt' ? dtable From 4d8b455e344a941999b6c25a1e0ec3f25a98c205 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 4 Aug 2025 15:31:43 +0800 Subject: [PATCH 2/3] * [task#147107,doing,0.5h] add doesn't support list tip. --- module/doc/control.php | 8 ++++++++ module/doc/lang/de.php | 1 + module/doc/lang/en.php | 1 + module/doc/lang/fr.php | 1 + module/doc/lang/zh-cn.php | 1 + module/doc/ui/zentaolist.html.php | 15 +++++++++++++-- 6 files changed, 25 insertions(+), 2 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index b38a13ca49..d2e28a1ed7 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -169,6 +169,14 @@ class doc extends control $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) { $this->view->title = sprintf($this->lang->doc->insertTitle, $this->lang->docTemplate->zentaoList[$type]); diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php index b33b197aae..a49576740e 100644 --- a/module/doc/lang/de.php +++ b/module/doc/lang/de.php @@ -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."; diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 454b1c8d7d..0c1e9c68ee 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -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."; diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php index d4f4d35d30..6c41af605e 100644 --- a/module/doc/lang/fr.php +++ b/module/doc/lang/fr.php @@ -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."; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index 5987251d0c..9ad5f35b40 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -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}访问权限或白名单里的用户可以访问。"; diff --git a/module/doc/ui/zentaolist.html.php b/module/doc/ui/zentaolist.html.php index a3ce10f2fb..41f32efad2 100644 --- a/module/doc/ui/zentaolist.html.php +++ b/module/doc/ui/zentaolist.html.php @@ -10,6 +10,8 @@ declare(strict_types=1); */ namespace zin; +$noticeTip = $noSupport ? sprintf($lang->doc->noSupportList, $lang->doc->zentaoList[$type] . $lang->doc->list) : ''; + if($type == 'gantt' && !empty($ganttData)) { $userList = array(); @@ -36,7 +38,7 @@ if($type == 'productCase') $actions = array(); $setText = (!$isTemplate && $fromTemplate && !$fromReport) ? $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 || $fromReport ? 'sm' : 'lg'); +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) @@ -89,7 +91,7 @@ div $isTemplate && !$fromReport ? sprintf($lang->docTemplate->configTip, $type == 'gantt' ? $lang->docTemplate->zentaoList['gantt'] : $lang->doc->list) : $emptyTip ) ):null, - !$isTemplate && $type != 'gantt' ? dtable + !$isTemplate && $type != 'gantt' && !$noSupport ? dtable ( set::cols(array_values($cols)), set::data(array_values($data)), @@ -105,6 +107,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')), From 2ecdbd64141e0a597c10c2bfcf08539c29a1cd22 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 4 Aug 2025 15:40:40 +0800 Subject: [PATCH 3/3] * [task#147107,done,0.1h] optimize code. --- module/doc/ui/zentaolist.html.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/doc/ui/zentaolist.html.php b/module/doc/ui/zentaolist.html.php index 41f32efad2..a440f6da6d 100644 --- a/module/doc/ui/zentaolist.html.php +++ b/module/doc/ui/zentaolist.html.php @@ -11,6 +11,7 @@ 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)) { @@ -88,7 +89,7 @@ div div ( setClass('config-tip text-center px-3 py-2'), - $isTemplate && !$fromReport ? 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' && !$noSupport ? dtable