Merge branch feature/workflowgroup of zentao/zentaopms (#12583)
This commit is contained in:
@@ -908,7 +908,7 @@ const actionsMap =
|
||||
hasPriv('addChapter') && doc.parent != 0 ? {icon: 'plus', text: lang.addSameChapter, command: `addChapter/${doc.parent}`} : null,
|
||||
!isTemplate && hasPriv('create') ? {icon: 'plus', text: lang.addSubDoc, command: `startCreateDoc/${doc.id}`} : null,
|
||||
!isChapter && canMoveDoc(doc) ? {icon: 'folder-move', text: lang.moveDoc, command: `moveDoc/${doc.id}`} : null,
|
||||
!isChapter && hasPriv('delete') ? {icon: 'trash', text: lang.delete, command: `deleteDoc/${doc.id}`} : null,
|
||||
!doc.frozen && !isChapter && hasPriv('delete') ? {icon: 'trash', text: lang.delete, command: `deleteDoc/${doc.id}`} : null,
|
||||
isChapter && hasPriv('editChapter') ? {icon: 'pencil', text: lang.editChapter, command: `editChapter/${doc.id}`} : null,
|
||||
isChapter && hasPriv('deleteChapter') ? {icon: 'trash', text: lang.deleteChapter, command: `deleteDoc/${doc.id}`} : null,
|
||||
];
|
||||
@@ -920,7 +920,7 @@ const actionsMap =
|
||||
|
||||
const moreItems = [];
|
||||
if(canModify && canMoveDoc(doc)) moreItems.push({icon: 'folder-move', text: lang.moveDoc, command: `moveDoc/${doc.id}`});
|
||||
if(canModify && hasPriv('delete')) moreItems.push({icon: 'trash', text: lang.delete, command: `deleteDoc/${doc.id}`});
|
||||
if(!doc.frozen && canModify && hasPriv('delete')) moreItems.push({icon: 'trash', text: lang.delete, command: `deleteDoc/${doc.id}`});
|
||||
if(!isApi && canModify && hasPriv('effort')) moreItems.push({icon: 'time', text: lang.effort, command: `effortDoc/${doc.id}`});
|
||||
if(!isApi && !isTemplate)
|
||||
{
|
||||
@@ -1310,6 +1310,8 @@ const commands =
|
||||
if (typeof doc !== 'object') {
|
||||
doc = docApp._treeMap.value.docs.get(doc)?.data;
|
||||
}
|
||||
if(doc.frozen) return zui.Modal.alert(getLang('frozenTips').replace('%s', getLang('edit')));
|
||||
|
||||
/** 如果是附件类型并且没有内容的文档,则跳转到上传文档页面进行编辑。 */
|
||||
if(doc.type === 'attachment' && !doc.hasContent) {
|
||||
const type = docApp.lib ? docApp.lib.data.type : docApp.spaceType;
|
||||
@@ -2061,6 +2063,15 @@ function getTableOptions(options, info)
|
||||
{
|
||||
if(typeof actionHints[key] === 'string') value.hint = actionHints[key];
|
||||
value.disabled = !privMap[key];
|
||||
|
||||
$.each(options.data, (rowKey, rowData) =>
|
||||
{
|
||||
if(rowData.frozen && (key == 'edit' || key == 'delete'))
|
||||
{
|
||||
value.hint = lang.frozenTips.replace('%s', actionHints[key]);
|
||||
value.disabled = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -329,6 +329,7 @@ $lang->doc->moveTo = 'Move to';
|
||||
$lang->doc->notSupportExport = 'This document does not support export';
|
||||
$lang->doc->downloadTemplate = 'Download Template';
|
||||
$lang->doc->addFile = 'Add File';
|
||||
$lang->doc->frozenTips = 'After the doc are baselined, %s is not allowed.';
|
||||
|
||||
$lang->doc->preview = 'Preview';
|
||||
$lang->doc->insertTitle = 'Insert %s list';
|
||||
@@ -792,6 +793,7 @@ $lang->doc->docLang->editing = 'Editing';
|
||||
$lang->doc->docLang->restoreVersionHint = 'Restore to version';
|
||||
$lang->doc->docLang->restoreVersion = 'Restore';
|
||||
$lang->doc->docLang->restoreVersionConfirm = 'This will create a new version using the content of version {version}. Are you sure you want to continue?';
|
||||
$lang->doc->docLang->frozenTips = $lang->doc->frozenTips;
|
||||
|
||||
$lang->docTemplate->types = array();
|
||||
$lang->docTemplate->types['plan'] = 'Plan';
|
||||
|
||||
@@ -329,6 +329,7 @@ $lang->doc->moveTo = 'Move to';
|
||||
$lang->doc->notSupportExport = 'This document does not support export';
|
||||
$lang->doc->downloadTemplate = 'Download Template';
|
||||
$lang->doc->addFile = 'Add File';
|
||||
$lang->doc->frozenTips = 'After the doc are baselined, %s is not allowed.';
|
||||
|
||||
$lang->doc->preview = 'Preview';
|
||||
$lang->doc->insertTitle = 'Insert %s list';
|
||||
@@ -792,6 +793,7 @@ $lang->doc->docLang->editing = 'Editing';
|
||||
$lang->doc->docLang->restoreVersionHint = 'Restore to version';
|
||||
$lang->doc->docLang->restoreVersion = 'Restore';
|
||||
$lang->doc->docLang->restoreVersionConfirm = 'This will create a new version using the content of version {version}. Are you sure you want to continue?';
|
||||
$lang->doc->docLang->frozenTips = $lang->doc->frozenTips;
|
||||
|
||||
$lang->docTemplate->types = array();
|
||||
$lang->docTemplate->types['plan'] = 'Plan';
|
||||
|
||||
@@ -329,6 +329,7 @@ $lang->doc->moveTo = 'Move to';
|
||||
$lang->doc->notSupportExport = 'This document does not support export';
|
||||
$lang->doc->downloadTemplate = 'Download Template';
|
||||
$lang->doc->addFile = 'Add File';
|
||||
$lang->doc->frozenTips = 'After the doc are baselined, %s is not allowed.';
|
||||
|
||||
$lang->doc->preview = 'Preview';
|
||||
$lang->doc->insertTitle = 'Insert %s list';
|
||||
@@ -792,6 +793,7 @@ $lang->doc->docLang->editing = 'Editing';
|
||||
$lang->doc->docLang->restoreVersionHint = 'Restore to version';
|
||||
$lang->doc->docLang->restoreVersion = 'Restore';
|
||||
$lang->doc->docLang->restoreVersionConfirm = 'This will create a new version using the content of version {version}. Are you sure you want to continue?';
|
||||
$lang->doc->docLang->frozenTips = $lang->doc->frozenTips;
|
||||
|
||||
$lang->docTemplate->types = array();
|
||||
$lang->docTemplate->types['plan'] = 'Plan';
|
||||
|
||||
@@ -329,6 +329,7 @@ $lang->doc->moveTo = '移动至';
|
||||
$lang->doc->notSupportExport = '(此文档暂不支持导出)';
|
||||
$lang->doc->downloadTemplate = '下载模板';
|
||||
$lang->doc->addFile = '提交文件';
|
||||
$lang->doc->frozenTips = '文档打基线后不允许%s';
|
||||
|
||||
$lang->doc->preview = '预览';
|
||||
$lang->doc->insertTitle = '插入%s列表';
|
||||
@@ -792,6 +793,7 @@ $lang->doc->docLang->editing = '正在编辑';
|
||||
$lang->doc->docLang->restoreVersionHint = '恢复到版本';
|
||||
$lang->doc->docLang->restoreVersion = '恢复';
|
||||
$lang->doc->docLang->restoreVersionConfirm = '这将使用文档版本 {version} 的内容创建一个新的版本,确定要继续吗?';
|
||||
$lang->doc->docLang->frozenTips = $lang->doc->frozenTips;
|
||||
|
||||
$lang->docTemplate->types = array();
|
||||
$lang->docTemplate->types['plan'] = '计划';
|
||||
|
||||
@@ -36,6 +36,7 @@ class docModel extends model
|
||||
global $app;
|
||||
$action = strtolower($action);
|
||||
|
||||
if(!empty($doc->frozen) && in_array($action, array('edit', 'delete'))) return false;
|
||||
if($action == 'movedoc') return $doc->addedBy == $app->user->account;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,17 @@ if($type == 'editedbyme') unset($config->my->doc->dtable->fieldList['editedBy'])
|
||||
$docs = initTableData($docs, $config->my->doc->dtable->fieldList, $this->doc);
|
||||
$cols = array_values($config->my->doc->dtable->fieldList);
|
||||
$data = array_values($docs);
|
||||
|
||||
foreach($data as $doc)
|
||||
{
|
||||
if(!isset($doc->actions)) continue;
|
||||
foreach($doc->actions as &$action)
|
||||
{
|
||||
$actionName = $action['name'];
|
||||
if(!empty($doc->frozen) && in_array($actionName, array('edit', 'delete'))) $action['hint'] = sprintf($this->lang->doc->frozenTips, $this->lang->doc->{$actionName});
|
||||
}
|
||||
}
|
||||
|
||||
dtable
|
||||
(
|
||||
set::cols($cols),
|
||||
|
||||
Reference in New Issue
Block a user