Merge branch dev/task-144985 of zentao/zentaopms (#9519)
This commit is contained in:
@@ -590,9 +590,14 @@ $.extend(window.docAppCommands,
|
||||
const doc = docInfo.data;
|
||||
const isChapter = doc?.type === 'chapter';
|
||||
|
||||
const reviewObjects = ['PP', 'SRS', 'HLDS', 'DDS', 'DBDS', 'ADS', 'ITTC', 'STTC'];
|
||||
const templateType = doc.templateType;
|
||||
const reviewTemplates = docApp.props.projectReviewTemplates;
|
||||
const confirmTip = reviewObjects.includes(templateType) && reviewTemplates?.[templateType]?.[docID] ? 'confirmDeleteReviewTemplate' : 'confirmDelete';
|
||||
|
||||
$.ajaxSubmit(
|
||||
{
|
||||
confirm: getLang(isChapter ? (docInfo.docs.length > 0 ? 'confirmDeleteChapterWithSub' : 'confirmDeleteChapter') : (docInfo.docs.length > 0 ? 'confirmDeleteWithSub' : 'confirmDelete')),
|
||||
confirm: getLang(isChapter ? (docInfo.docs.length > 0 ? 'confirmDeleteChapterWithSub' : 'confirmDeleteChapter') : (docInfo.docs.length > 0 ? 'confirmDeleteWithSub' : confirmTip)),
|
||||
url: $.createLink('doc', 'deleteTemplate', `docID=${docID}`),
|
||||
load: false,
|
||||
onSuccess: function()
|
||||
|
||||
@@ -94,7 +94,6 @@ $lang->docTemplate->addTemplateType = 'Add template category';
|
||||
$lang->docTemplate->editTemplateType = 'Edit template category';
|
||||
$lang->docTemplate->docTitlePlaceholder = 'Enter the document template title';
|
||||
$lang->docTemplate->docTitleRequired = 'Please enter the doc template title.';
|
||||
$lang->docTemplate->noticeAddTemplateType = 'Support two-level categories. Built-in template category cannot move.';
|
||||
$lang->docTemplate->errorDeleteType = 'There is document template exists in the current category, it cannot be deleted.';
|
||||
$lang->docTemplate->convertToNewDocConfirm = 'Are you ready to convert this document template to the new format using a modern block-level editor? After saving as a draft or publishing, you can no longer switch back to the old editor.';
|
||||
$lang->docTemplate->oldDocEditingTip = 'This document template is being created in the old editor, the new editor is now enabled for editing. If you want to switch to the new editor, please save the document template first.';
|
||||
@@ -114,6 +113,7 @@ $lang->docTemplate->confirmDeleteChapterWithSub = "After deleting a chapter, th
|
||||
$lang->docTemplate->confirmDeleteTemplateWithSub = "After deleting the template, the lower level content of the template will be hidden. Are you sure you want to delete this template?";
|
||||
$lang->docTemplate->scopeHasTemplateTips = 'There are templates within this scope. Please remove them before deleting the scope.';
|
||||
$lang->docTemplate->scopeHasModuleTips = 'There are template category data within this scope. Please remove them before deleting the scope.';
|
||||
$lang->docTemplate->confirmDeleteReviewTemplate = "After deletion, when using the category to which this template belongs for project review, the system template cannot automatically generate data for review. Are you sure you want to delete it?";
|
||||
|
||||
$lang->docTemplate->create = 'Create Template';
|
||||
$lang->docTemplate->edit = 'Edit Template';
|
||||
|
||||
@@ -94,7 +94,6 @@ $lang->docTemplate->addTemplateType = 'Add template category';
|
||||
$lang->docTemplate->editTemplateType = 'Edit template category';
|
||||
$lang->docTemplate->docTitlePlaceholder = 'Enter the document template title';
|
||||
$lang->docTemplate->docTitleRequired = 'Please enter the doc template title.';
|
||||
$lang->docTemplate->noticeAddTemplateType = 'Support two-level categories. Built-in template category cannot move.';
|
||||
$lang->docTemplate->errorDeleteType = 'There is document template exists in the current category, it cannot be deleted.';
|
||||
$lang->docTemplate->convertToNewDocConfirm = 'Are you ready to convert this document template to the new format using a modern block-level editor? After saving as a draft or publishing, you can no longer switch back to the old editor.';
|
||||
$lang->docTemplate->oldDocEditingTip = 'This document template is being created in the old editor, the new editor is now enabled for editing. If you want to switch to the new editor, please save the document template first.';
|
||||
@@ -114,6 +113,7 @@ $lang->docTemplate->confirmDeleteChapterWithSub = "After deleting a chapter, th
|
||||
$lang->docTemplate->confirmDeleteTemplateWithSub = "After deleting the template, the lower level content of the template will be hidden. Are you sure you want to delete this template?";
|
||||
$lang->docTemplate->scopeHasTemplateTips = 'There are templates within this scope. Please remove them before deleting the scope.';
|
||||
$lang->docTemplate->scopeHasModuleTips = 'There are template category data within this scope. Please remove them before deleting the scope.';
|
||||
$lang->docTemplate->confirmDeleteReviewTemplate = "After deletion, when using the category to which this template belongs for project review, the system template cannot automatically generate data for review. Are you sure you want to delete it?";
|
||||
|
||||
$lang->docTemplate->create = 'Create Template';
|
||||
$lang->docTemplate->edit = 'Edit Template';
|
||||
|
||||
@@ -94,7 +94,6 @@ $lang->docTemplate->addTemplateType = 'Add template category';
|
||||
$lang->docTemplate->editTemplateType = 'Edit template category';
|
||||
$lang->docTemplate->docTitlePlaceholder = 'Enter the document template title';
|
||||
$lang->docTemplate->docTitleRequired = 'Please enter the doc template title.';
|
||||
$lang->docTemplate->noticeAddTemplateType = 'Support two-level categorys. Built-in template category cannot move.';
|
||||
$lang->docTemplate->errorDeleteType = 'There is document template exists in the current category, it cannot be deleted.';
|
||||
$lang->docTemplate->convertToNewDocConfirm = 'Are you ready to convert this document template to the new format using a modern block-level editor? After saving as a draft or publishing, you can no longer switch back to the old editor.';
|
||||
$lang->docTemplate->oldDocEditingTip = 'This document template is being created in the old editor, the new editor is now enabled for editing. If you want to switch to the new editor, please save the document template first.';
|
||||
@@ -114,6 +113,7 @@ $lang->docTemplate->confirmDeleteChapterWithSub = "After deleting a chapter, th
|
||||
$lang->docTemplate->confirmDeleteTemplateWithSub = "After deleting the template, the lower level content of the template will be hidden. Are you sure you want to delete this template?";
|
||||
$lang->docTemplate->scopeHasTemplateTips = 'There are templates within this scope. Please remove them before deleting the scope.';
|
||||
$lang->docTemplate->scopeHasModuleTips = 'There are template category data within this scope. Please remove them before deleting the scope.';
|
||||
$lang->docTemplate->confirmDeleteReviewTemplate = "After deletion, when using the category to which this template belongs for project review, the system template cannot automatically generate data for review. Are you sure you want to delete it?";
|
||||
|
||||
$lang->docTemplate->create = 'Create Template';
|
||||
$lang->docTemplate->edit = 'Edit Template';
|
||||
|
||||
@@ -94,7 +94,6 @@ $lang->docTemplate->addTemplateType = '添加模板分类';
|
||||
$lang->docTemplate->editTemplateType = '编辑模板分类';
|
||||
$lang->docTemplate->docTitlePlaceholder = '请输入文档模板标题';
|
||||
$lang->docTemplate->docTitleRequired = '文档模板标题不能为空。';
|
||||
$lang->docTemplate->noticeAddTemplateType = '支持两级分类,内置模板分类参与逻辑运算,不可修改所在位置';
|
||||
$lang->docTemplate->errorDeleteType = '当前分类存在文档模板,不可删除';
|
||||
$lang->docTemplate->convertToNewDocConfirm = '全新文档格式使用现代化块级编辑器,带来全新的文档功能体验。确定要将此文档模板转换为新文档格式吗?存为草稿或者发布后,不能再切换回旧编辑器。';
|
||||
$lang->docTemplate->oldDocEditingTip = '此文档模板为旧版本编辑器创建,已启用新版编辑器编辑,保存后将转换为新版文档模板';
|
||||
@@ -114,6 +113,7 @@ $lang->docTemplate->confirmDeleteChapterWithSub = "删除章节后,章节下
|
||||
$lang->docTemplate->confirmDeleteTemplateWithSub = "删除文档模板后,文档模板下层级内容将一并隐藏,确定要删除该文档模板吗?";
|
||||
$lang->docTemplate->scopeHasTemplateTips = '该范围下有文档模板,请移除后再删除范围。';
|
||||
$lang->docTemplate->scopeHasModuleTips = '该范围下有模板分类数据,请移除后再删除范围。';
|
||||
$lang->docTemplate->confirmDeleteReviewTemplate = "删除后,使用该模板所属分类进行项目评审时不能由系统模板自动生成数据进行评审,确认要删除吗?";
|
||||
|
||||
$lang->docTemplate->more = '更多';
|
||||
$lang->docTemplate->scopeLabel = '范围';
|
||||
|
||||
@@ -4707,5 +4707,9 @@ class docModel extends model
|
||||
|
||||
$this->action->create('docTemplate', $templateID, 'Created');
|
||||
}
|
||||
|
||||
/* 记录文档模板的更新时间。*/
|
||||
/* Record the time of upgrade doc template. */
|
||||
$this->setting->setItem("system.doc.upgradeTime", helper::now());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,22 +21,6 @@ formPanel
|
||||
setClass('text-xl font-black'),
|
||||
set::level(1),
|
||||
set::text($lang->docTemplate->addTemplateType)
|
||||
),
|
||||
div
|
||||
(
|
||||
label
|
||||
(
|
||||
to::before
|
||||
(
|
||||
icon
|
||||
(
|
||||
setClass('warning-ghost margin-left8'),
|
||||
'help'
|
||||
)
|
||||
),
|
||||
set::text($lang->docTemplate->noticeAddTemplateType),
|
||||
setClass('gray-200-pale')
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
@@ -75,6 +75,7 @@ $langData['createTypeFirst'] = $lang->docTemplate->createTypeFirst;
|
||||
$langData['addSubDocTemplate'] = $lang->docTemplate->addSubDocTemplate;
|
||||
$langData['confirmDeleteChapterWithSub'] = $lang->docTemplate->confirmDeleteChapterWithSub;
|
||||
$langData['confirmDeleteWithSub'] = $lang->docTemplate->confirmDeleteTemplateWithSub;
|
||||
$langData['confirmDeleteReviewTemplate'] = $lang->docTemplate->confirmDeleteReviewTemplate;
|
||||
|
||||
$langData['actions']['addModule'] = $lang->docTemplate->addTemplateType;
|
||||
$langData['actions']['addSameModule'] = $lang->docTemplate->addSameModule;
|
||||
|
||||
@@ -35,22 +35,6 @@ formPanel
|
||||
setClass('text-xl font-black'),
|
||||
set::level(1),
|
||||
set::text($lang->docTemplate->editTemplateType)
|
||||
),
|
||||
div
|
||||
(
|
||||
label
|
||||
(
|
||||
to::before
|
||||
(
|
||||
icon
|
||||
(
|
||||
setClass('warning-ghost margin-left8'),
|
||||
'help'
|
||||
)
|
||||
),
|
||||
set::text($lang->docTemplate->noticeAddTemplateType),
|
||||
setClass('gray-200-pale')
|
||||
)
|
||||
)
|
||||
)
|
||||
) : null,
|
||||
|
||||
@@ -978,6 +978,10 @@ class upgrade extends control
|
||||
{
|
||||
$this->session->set('upgradeDocTemplates', true);
|
||||
$this->doc->upgradeTemplateLibAndModule($upgradeDocTemplates['all']);
|
||||
|
||||
/* 记录文档模板的更新时间。*/
|
||||
/* Record the time of upgrade doc template. */
|
||||
$this->loadModel('setting')->setItem("system.doc.upgradeTime", helper::now());
|
||||
}
|
||||
return $this->locate(inlink('afterExec', "fromVersion={$fromVersion}&processed=no&skipMoveFile=yes&skipUpdateDocs=yes&skipUpdateDocTemplates=yes"));
|
||||
}
|
||||
|
||||
@@ -11212,13 +11212,9 @@ class upgradeModel extends model
|
||||
{
|
||||
/* 为八种类型添加内置模板,若已存在则返回。*/
|
||||
/* Return when has bulit-in doc template. */
|
||||
$builtInTemplateTypes = array('PP', 'SRS', 'HLDS', 'DDS', 'ADS', 'DBDS', 'ITTC', 'STTC');
|
||||
$builtInDocTemplates = $this->dao->select('*')->from(TABLE_DOC)
|
||||
->where('templateType')->in($builtInTemplateTypes)
|
||||
->andWhere('lib')->gt(0)
|
||||
->andWhere('module')->gt(0)
|
||||
->fetchAll();
|
||||
if(!empty($builtInDocTemplates)) return;
|
||||
$this->loadModel('setting');
|
||||
$projectReviewDocTemplate = $this->setting->getItem('vision=rnd&owner=system&module=doc&key=projectReviewDocTemplate');
|
||||
if(!empty($projectReviewDocTemplate)) return;
|
||||
|
||||
/* 获取有系统数据的wiki模板的类型。*/
|
||||
/* Get the type of wiki template with system data. */
|
||||
@@ -11232,6 +11228,7 @@ class upgradeModel extends model
|
||||
/* 获取没有系统数据的wiki模板的类型。*/
|
||||
/* Get the type of wiki template without system data. */
|
||||
$noSystemDataTemplateTypes = array();
|
||||
$builtInTemplateTypes = array('PP', 'SRS', 'HLDS', 'DDS', 'ADS', 'DBDS', 'ITTC', 'STTC');
|
||||
foreach($builtInTemplateTypes as $type)
|
||||
{
|
||||
if(!isset($hasSystemDataTemplateTypes[$type])) $noSystemDataTemplateTypes[] = $type;
|
||||
|
||||
Reference in New Issue
Block a user