* Finish task #37114.

This commit is contained in:
holan20180123
2021-04-07 11:35:04 +08:00
parent a2f2b2ca69
commit f385acc4b5
9 changed files with 60 additions and 13 deletions
+25 -4
View File
@@ -214,7 +214,7 @@ class doc extends control
if(!dao::isError())
{
$this->action->create('docLib', $libID, 'Created');
die(js::locate($this->createLink('doc', 'objectLibs', "type=$type&objectID=$objectID&libID=$libID"), 'parent.parent'));
die(js::locate($this->createLink('doc', 'objectLibs', "type={$this->post->type}&objectID=$objectID&libID=$libID"), 'parent.parent'));
}
else
{
@@ -297,6 +297,11 @@ class doc extends control
if(!empty($lib->main)) die(js::alert($this->lang->doc->errorMainSysLib));
$this->doc->delete(TABLE_DOCLIB, $libID);
if(isonlybody())
{
unset($_GET['onlybody']);
die(js::locate($this->createLink('doc', 'objectLibs', 'type=book'), 'parent.parent'));
}
die(js::locate($this->createLink('doc', 'index'), 'parent'));
}
}
@@ -924,6 +929,22 @@ class doc extends control
$object = new stdclass();
$object->id = 0;
}
elseif($type == 'book')
{
$libs = $this->doc->getLibsByObject('book', 0);
$this->app->rawMethod = 'book';
if($libID == 0) $libID = key($libs);
$this->lang->modulePageNav = $this->doc->select($type, $objects, $objectID, $libs, $libID);
if(!$docID) $docID = $this->dao->select('id')->from(TABLE_DOC)
->where('lib')->eq($libID)
->andWhere('type')->eq('article')
->andWhere('deleted')->eq(0)
->fetch('id');
$object = new stdclass();
$object->id = 0;
}
else
{
if($type == 'product')
@@ -978,7 +999,7 @@ class doc extends control
$this->lang->TRActions = common::hasPriv('doc', 'create') ? $this->doc->buildCreateButton4Doc($type, $objectID, $libID) : '';
$moduleTree = $this->doc->getTreeMenu($type, $objectID, $libID, 0, $docID);
$moduleTree = $type == 'book' ? $this->doc->getBookStructure($libID) : $this->doc->getTreeMenu($type, $objectID, $libID, 0, $docID);
/* Get doc. */
if($docID)
@@ -997,8 +1018,8 @@ class doc extends control
$this->view->customObjectLibs = $customObjectLibs;
$this->view->showLibs = $this->config->doc->custom->objectLibs;
$this->view->title = $type == 'custom' ? $this->lang->doc->customAB : $object->name;
$this->view->position[] = $type == 'custom' ? $this->lang->doc->customAB : $object->name;
$this->view->title = ($type == 'book' or $type == 'custom') ? $this->lang->doc->customAB : $object->name;
$this->view->position[] = ($type == 'book' or $type == 'custom') ? $this->lang->doc->customAB : $object->name;
$this->view->docID = $docID;
$this->view->doc = $docID ? $doc : '';
+2
View File
@@ -74,6 +74,8 @@ $lang->doc->diff = 'Diff';
$lang->doc->diffAction = 'Diff Document';
$lang->doc->sort = 'Sortierung';
$lang->doc->manageType = 'Kategorie verwalten';
$lang->doc->manageBook = 'Manage Book';
$lang->doc->editBook = 'Edit Book';
$lang->doc->editType = 'Bearbeiten';
$lang->doc->deleteType = 'Löschen';
$lang->doc->addType = 'Hinzufügen';
+2
View File
@@ -76,6 +76,8 @@ $lang->doc->diff = 'Diff';
$lang->doc->diffAction = 'Diff Document';
$lang->doc->sort = 'Rank Document';
$lang->doc->manageType = 'Manage Category';
$lang->doc->manageBook = 'Manage Book';
$lang->doc->editBook = 'Edit Book';
$lang->doc->editType = 'Edit';
$lang->doc->deleteType = 'Delete';
$lang->doc->addType = 'Add';
+2
View File
@@ -74,6 +74,8 @@ $lang->doc->diff = 'Diff';
$lang->doc->diffAction = 'Document Diff';
$lang->doc->sort = 'Rang Document';
$lang->doc->manageType = 'Gérer Catégories';
$lang->doc->manageBook = 'Manage Book';
$lang->doc->editBook = 'Edit Book';
$lang->doc->editType = 'Editer';
$lang->doc->deleteType = 'Supprimer';
$lang->doc->addType = 'Ajouter';
+2
View File
@@ -74,6 +74,8 @@ $lang->doc->diff = 'Diff';
$lang->doc->diffAction = 'Diff tài liệu';
$lang->doc->sort = 'Đánh giá tài liệu';
$lang->doc->manageType = 'Quản lý danh mục';
$lang->doc->manageBook = 'Manage Book';
$lang->doc->editBook = 'Edit Book';
$lang->doc->editType = 'Sửa';
$lang->doc->deleteType = 'Xóa';
$lang->doc->addType = 'Thêm';
+2
View File
@@ -76,6 +76,8 @@ $lang->doc->diff = '对比';
$lang->doc->diffAction = '对比文档';
$lang->doc->sort = '文档排序';
$lang->doc->manageType = '维护目录';
$lang->doc->manageBook = '维护手册';
$lang->doc->editBook = '编辑手册';
$lang->doc->editType = '编辑目录';
$lang->doc->deleteType = '删除目录';
$lang->doc->addType = '增加目录';
+2
View File
@@ -74,6 +74,8 @@ $lang->doc->diff = '對比';
$lang->doc->diffAction = '對比文檔';
$lang->doc->sort = '文檔排序';
$lang->doc->manageType = '維護分類';
$lang->doc->manageBook = '維護手冊';
$lang->doc->editBook = '編輯手冊';
$lang->doc->editType = '編輯分類';
$lang->doc->deleteType = '刪除分類';
$lang->doc->addType = '增加分類';
+5 -5
View File
@@ -653,7 +653,7 @@ class docModel extends model
if(isset($doc->digest)) $docContent->digest = $doc->digest;
if($files) $docContent->files .= ',' . join(',', array_keys($files));
$docContent->files = trim($docContent->files, ',');
$this->dao->insert(TABLE_DOCCONTENT)->data($docContent)->exec();
$this->dao->replace(TABLE_DOCCONTENT)->data($docContent)->exec();
}
unset($doc->contentType);
@@ -1119,9 +1119,9 @@ class docModel extends model
*/
public function getLibsByObject($type, $objectID, $mode = '')
{
if($type == 'custom')
if($type == 'custom' or $type == 'book')
{
$objectLibs = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere('type')->eq('custom')->orderBy('`order`, id')->fetchAll('id');
$objectLibs = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere('type')->eq($type)->orderBy('`order`, id')->fetchAll('id');
}
else if($type != 'product' and $type != 'project' and $type != 'execution')
{
@@ -1896,11 +1896,11 @@ EOF;
*/
public function select($type, $objects, $objectID, $libs, $libID = 0)
{
if($type != 'custom' and empty($objects)) return '';
if($type != 'custom' and $type != 'book' and empty($objects)) return '';
$output = '';
if($this->app->openApp == 'doc' and $type != 'custom')
if($this->app->openApp == 'doc' and $type != 'custom' and $type != 'book')
{
$output = "<div class='btn-group angle-btn'><div class='btn-group'><button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentItem' title='{$objects[$objectID]}'><span class='text'>{$objects[$objectID]}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList'>";
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
+18 -4
View File
@@ -15,7 +15,7 @@ if(empty($type)) $type = 'product';
$sideWidth = common::checkNotCN() ? '270' : '238';
?>
<div class="side-col" style="width:<?php echo $sideWidth;?>px" data-min-width="<?php echo $sideWidth;?>">
<div class="cell">
<div class="cell" id="<?php echo $type;?>">
<?php if(!$moduleTree):?>
<hr class="space">
<div class="text-center text-muted tips">
@@ -23,11 +23,25 @@ $sideWidth = common::checkNotCN() ? '270' : '238';
</div>
<hr class="space">
<?php endif;?>
<?php if($type == 'book'):?>
<?php include './bookside.html.php';?>
<?php else:?>
<?php echo $moduleTree;?>
<?php endif;?>
<div class="text-center action">
<?php common::printLink('tree', 'browse', "rootID=$libID&view=doc", $lang->doc->manageType, '', "class='btn btn-info btn-wide iframe'", '', true);?>
<?php common::printLink('doc', 'editLib', "rootID=$libID", $lang->doc->editLib, '', "class='btn btn-info btn-wide iframe'", '', true);?>
<?php common::printLink('doc', 'deleteLib', "rootID=$libID", $lang->doc->deleteLib, 'hiddenwin', "class='btn btn-info btn-wide'");?>
<?php
if($type == 'book')
{
common::printLink('doc', 'manageBook', "bookID=$libID", $lang->doc->manageBook, '', "class='btn btn-info btn-wide iframe'", '', true);
common::printLink('doc', 'editLib', "rootID=$libID", $lang->doc->editBook, '', "class='btn btn-info btn-wide iframe'", '', true);
}
else
{
common::printLink('tree', 'browse', "rootID=$libID&view=doc", $lang->doc->manageType, '', "class='btn btn-info btn-wide iframe'", '', true);
common::printLink('doc', 'editLib', "rootID=$libID", $lang->doc->editLib, '', "class='btn btn-info btn-wide iframe'", '', true);
common::printLink('doc', 'deleteLib', "rootID=$libID", $lang->doc->deleteLib, 'hiddenwin', "class='btn btn-info btn-wide'");
}
?>
<hr class="space-sm" />
</div>
</div>