Merge branch dev/story-70500 of zentao/zentaopms (#10515)
This commit is contained in:
@@ -375,7 +375,7 @@ function handleSwitchView(mode, location, info)
|
||||
{
|
||||
url = formatUrl.call(this, formatOptions);
|
||||
}
|
||||
else if(mode === 'view')
|
||||
else if(mode === 'view' || mode === 'diff')
|
||||
{
|
||||
url = $.createLink('doc', 'view', `docID=${location.docID}` + (info.data && location.docVersion && location.docVersion !== info.data.version ? `&version=${location.docVersion}` : ''));
|
||||
}
|
||||
@@ -1789,6 +1789,18 @@ const customRenders =
|
||||
{
|
||||
const docInfo = this.doc;
|
||||
const doc = docInfo ? docInfo.data : null;
|
||||
if (mode === 'diff') {
|
||||
const {
|
||||
diffVersions,
|
||||
spaceType,
|
||||
} = this.signals;
|
||||
const versions = diffVersions ? diffVersions.value : [];
|
||||
if (versions.length === 2) {
|
||||
return {
|
||||
fetcher: $.createLink('doc', 'diff', `&objectType=${spaceType.value}&docID=${doc.id}&newVersion=${versions[0]}&oldVersion=${versions[1]}`),
|
||||
};
|
||||
}
|
||||
}
|
||||
if(mode === 'view' && !hasPriv('view')) return {html: `<h1>${doc ? doc.title : ''}</h1><p>${getDocAppLang('accessDenied')}</p>`};
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -223,6 +223,10 @@ class docApp extends wg
|
||||
$langData->libTypeList = $lang->api->libTypeList;
|
||||
$langData->latestVersion = $lang->api->latestVersion;
|
||||
$langData->template = $lang->doc->template;
|
||||
$langData->labelAllVersions = $lang->doc->allVersion;
|
||||
$langData->labelDiff = $lang->doc->diff;
|
||||
$langData->labelConfirm = $lang->doc->confirm;
|
||||
$langData->labelCancelDiff = $lang->doc->cancelDiff;
|
||||
|
||||
/**
|
||||
* 通过语言项定义文档表格列显示名称。
|
||||
@@ -265,10 +269,11 @@ class docApp extends wg
|
||||
*/
|
||||
$viewModeUrl = $this->prop('viewModeUrl');
|
||||
$spaceType = $this->hasProp('spaceType') ? $this->prop('spaceType') : data('spaceType');
|
||||
|
||||
$rawModule = $app->rawModule;
|
||||
$rawMethod = $app->rawMethod;
|
||||
if(!$this->hasProp('viewModeUrl'))
|
||||
{
|
||||
$rawModule = $app->rawModule;
|
||||
$rawMethod = $app->rawMethod;
|
||||
if ($rawModule == 'doc' && $rawMethod == 'app')
|
||||
{
|
||||
$viewModeUrl = createLink('doc', 'app', 'type={spaceType}&spaceID={spaceID}&libID={libID}&moduleID={moduleID}&docID={docID}&mode={mode}&orderBy={orderBy}&recTotal={recTotal}&recPerPage={recPerPage}&pageID={page}&filterType={filterType}&search={search}&noSpace={noSpace}');
|
||||
@@ -314,6 +319,11 @@ class docApp extends wg
|
||||
$historyPanelProps = array('fileListProps' => $fileListProps);
|
||||
$canPreviewOffice = $canDownload && isset($config->file->libreOfficeTurnon) and $config->file->libreOfficeTurnon == 1;
|
||||
|
||||
// 不可用场景:文档模板、API 文档、开源版
|
||||
$diffEnabled = ($config->edition != 'open')
|
||||
&& !($rawModule == 'doc' && $rawMethod == 'view')
|
||||
&& $rawModule != 'api';
|
||||
|
||||
$zentaoListMenu = $hasZentaoSlashMenu ? $this->getZentaoListMenu() : array();
|
||||
|
||||
$moreMenus = $zentaoListMenu
|
||||
@@ -342,6 +352,7 @@ class docApp extends wg
|
||||
set::moduleID(data('moduleID')),
|
||||
set::docID(data('docID')),
|
||||
set::docVersion(data('docVersion')),
|
||||
set::diffEnabled($diffEnabled),
|
||||
set::mode('list'),
|
||||
set::filterType(data('filterType')),
|
||||
set::search(data('search')),
|
||||
|
||||
@@ -267,6 +267,7 @@ $lang->doc->createBook = 'Create Book';
|
||||
$lang->doc->browse = 'Liste';
|
||||
$lang->doc->view = 'Details';
|
||||
$lang->doc->diff = 'Diff';
|
||||
$lang->doc->confirm = 'Confirm';
|
||||
$lang->doc->cancelDiff = 'Cancel diff';
|
||||
$lang->doc->diffAction = 'Diff Document';
|
||||
$lang->doc->sort = 'Sortierung';
|
||||
|
||||
@@ -267,6 +267,7 @@ $lang->doc->createBook = 'Create Book';
|
||||
$lang->doc->browse = 'Document List';
|
||||
$lang->doc->view = 'Document Detail';
|
||||
$lang->doc->diff = 'Diff';
|
||||
$lang->doc->confirm = 'Confirm';
|
||||
$lang->doc->cancelDiff = 'Cancel diff';
|
||||
$lang->doc->diffAction = 'Diff Document';
|
||||
$lang->doc->sort = 'Rank Document';
|
||||
|
||||
@@ -267,6 +267,7 @@ $lang->doc->createBook = 'Create Book';
|
||||
$lang->doc->browse = 'Liste Documents';
|
||||
$lang->doc->view = 'Détail Document';
|
||||
$lang->doc->diff = 'Diff';
|
||||
$lang->doc->confirm = 'Confirm';
|
||||
$lang->doc->cancelDiff = 'Cancel diff';
|
||||
$lang->doc->diffAction = 'Document Diff';
|
||||
$lang->doc->sort = 'Rang Document';
|
||||
|
||||
@@ -267,6 +267,7 @@ $lang->doc->createBook = '创建手册';
|
||||
$lang->doc->browse = '文档列表';
|
||||
$lang->doc->view = '文档详情';
|
||||
$lang->doc->diff = '对比';
|
||||
$lang->doc->confirm = '确定';
|
||||
$lang->doc->cancelDiff = '取消对比';
|
||||
$lang->doc->diffAction = '对比文档';
|
||||
$lang->doc->sort = '文档排序';
|
||||
|
||||
@@ -117,6 +117,7 @@ $lang->doc->createBook = '創建手冊';
|
||||
$lang->doc->browse = '文檔列表';
|
||||
$lang->doc->view = '文檔詳情';
|
||||
$lang->doc->diff = '對比';
|
||||
$lang->doc->confirm = '確定';
|
||||
$lang->doc->diffAction = '對比文檔';
|
||||
$lang->doc->sort = '文檔排序';
|
||||
$lang->doc->manageType = '維護目錄';
|
||||
|
||||
Reference in New Issue
Block a user