* Finish task#40496.

This commit is contained in:
hufangzhou
2021-07-26 11:44:56 +08:00
parent fa3da1b7b4
commit 1dcc5b11c3
13 changed files with 360 additions and 87 deletions
+8 -8
View File
@@ -146,7 +146,7 @@ $lang->product->menu->release = array('link' => "{$lang->release->common}|re
$lang->product->menu->roadmap = array('link' => "{$lang->roadmap}|product|roadmap|productID=%s"); $lang->product->menu->roadmap = array('link' => "{$lang->roadmap}|product|roadmap|productID=%s");
$lang->product->menu->project = array('link' => "{$lang->project->common}|product|project|status=all&productID=%s"); $lang->product->menu->project = array('link' => "{$lang->project->common}|product|project|status=all&productID=%s");
$lang->product->menu->track = array('link' => "{$lang->track}|story|track|productID=%s"); $lang->product->menu->track = array('link' => "{$lang->track}|story|track|productID=%s");
$lang->product->menu->doc = array('link' => "{$lang->doc->common}|doc|objectLibs|type=product&objectID=%s", 'subModule' => 'doc'); $lang->product->menu->doc = array('link' => "{$lang->doc->common}|doc|tableContents|type=product&objectID=%s", 'subModule' => 'doc');
$lang->product->menu->dynamic = array('link' => "{$lang->dynamic}|product|dynamic|productID=%s"); $lang->product->menu->dynamic = array('link' => "{$lang->dynamic}|product|dynamic|productID=%s");
$lang->product->menu->settings = array('link' => "{$lang->settings}|product|view|productID=%s", 'subModule' => 'tree,branch', 'alias' => 'edit,whitelist,addwhitelist'); $lang->product->menu->settings = array('link' => "{$lang->settings}|product|view|productID=%s", 'subModule' => 'tree,branch', 'alias' => 'edit,whitelist,addwhitelist');
@@ -184,7 +184,7 @@ $lang->scrum->menu = new stdclass();
$lang->scrum->menu->index = array('link' => "{$lang->dashboard}|project|index|project=%s"); $lang->scrum->menu->index = array('link' => "{$lang->dashboard}|project|index|project=%s");
$lang->scrum->menu->execution = array('link' => "$lang->executionCommon|project|execution|status=all&projectID=%s", 'exclude' => 'execution-testreport'); $lang->scrum->menu->execution = array('link' => "$lang->executionCommon|project|execution|status=all&projectID=%s", 'exclude' => 'execution-testreport');
$lang->scrum->menu->story = array('link' => "$lang->SRCommon|projectstory|story|projectID=%s", 'subModule' => 'projectstory,tree', 'alias' => 'story,track'); $lang->scrum->menu->story = array('link' => "$lang->SRCommon|projectstory|story|projectID=%s", 'subModule' => 'projectstory,tree', 'alias' => 'story,track');
$lang->scrum->menu->doc = array('link' => "{$lang->doc->common}|doc|objectLibs|type=project&objectID=%s", 'subModule' => 'doc'); $lang->scrum->menu->doc = array('link' => "{$lang->doc->common}|doc|tableContents|type=project&objectID=%s", 'subModule' => 'doc');
$lang->scrum->menu->qa = array('link' => "{$lang->qa->common}|project|bug|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport,execution', 'alias' => 'bug,testtask,testcase,testreport', 'exclude' => 'execution-create,execution-batchedit'); $lang->scrum->menu->qa = array('link' => "{$lang->qa->common}|project|bug|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport,execution', 'alias' => 'bug,testtask,testcase,testreport', 'exclude' => 'execution-create,execution-batchedit');
$lang->scrum->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo'); $lang->scrum->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo');
$lang->scrum->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s"); $lang->scrum->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s");
@@ -236,7 +236,7 @@ $lang->execution->menu->view = array('link' => "$lang->view|execution|groupt
$lang->execution->menu->story = array('link' => "$lang->SRCommon|execution|story|executionID=%s", 'subModule' => 'story', 'alias' => 'batchcreate,linkstory,storykanban'); $lang->execution->menu->story = array('link' => "$lang->SRCommon|execution|story|executionID=%s", 'subModule' => 'story', 'alias' => 'batchcreate,linkstory,storykanban');
$lang->execution->menu->qa = array('link' => "{$lang->qa->common}|execution|bug|executionID=%s", 'subModule' => 'bug,testcase,testtask,testreport', 'alias' => 'qa,bug,testcase,testtask,testreport'); $lang->execution->menu->qa = array('link' => "{$lang->qa->common}|execution|bug|executionID=%s", 'subModule' => 'bug,testcase,testtask,testreport', 'alias' => 'qa,bug,testcase,testtask,testreport');
$lang->execution->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo'); $lang->execution->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo');
$lang->execution->menu->doc = array('link' => "{$lang->doc->common}|doc|objectLibs|type=execution&objectID=%s", 'subModule' => 'doc'); $lang->execution->menu->doc = array('link' => "{$lang->doc->common}|doc|tableContents|type=execution&objectID=%s", 'subModule' => 'doc');
$lang->execution->menu->build = array('link' => "{$lang->build->common}|execution|build|executionID=%s", 'subModule' => 'build'); $lang->execution->menu->build = array('link' => "{$lang->build->common}|execution|build|executionID=%s", 'subModule' => 'build');
$lang->execution->menu->action = array('link' => "$lang->dynamic|execution|dynamic|executionID=%s"); $lang->execution->menu->action = array('link' => "$lang->dynamic|execution|dynamic|executionID=%s");
$lang->execution->menu->settings = array('link' => "$lang->settings|execution|view|executionID=%s", 'subModule' => 'personnel', 'alias' => 'edit,manageproducts,team,whitelist,addwhitelist,managemembers', 'class' => 'dropdown dropdown-hover'); $lang->execution->menu->settings = array('link' => "$lang->settings|execution|view|executionID=%s", 'subModule' => 'personnel', 'alias' => 'edit,manageproducts,team,whitelist,addwhitelist,managemembers', 'class' => 'dropdown dropdown-hover');
@@ -329,16 +329,16 @@ $lang->devops->menuOrder[20] = 'jenkins';
$lang->devops->menuOrder[25] = 'maintain'; $lang->devops->menuOrder[25] = 'maintain';
$lang->devops->menuOrder[30] = 'rules'; $lang->devops->menuOrder[30] = 'rules';
/* Doc menu.*/ /* Doc menu. */
$lang->doc->menu = new stdclass(); $lang->doc->menu = new stdclass();
$lang->doc->menu->dashboard = array('link' => "{$lang->dashboard}|doc|index"); $lang->doc->menu->dashboard = array('link' => "{$lang->dashboard}|doc|index");
$lang->doc->menu->recent = array('link' => "{$lang->doc->recent}|doc|browse|browseTyp=byediteddate", 'alias' => 'recent'); $lang->doc->menu->recent = array('link' => "{$lang->doc->recent}|doc|browse|browseTyp=byediteddate", 'alias' => 'recent');
$lang->doc->menu->my = array('link' => "{$lang->doc->my}|doc|browse|browseTyp=openedbyme", 'alias' => 'my'); $lang->doc->menu->my = array('link' => "{$lang->doc->my}|doc|browse|browseTyp=openedbyme", 'alias' => 'my');
$lang->doc->menu->collect = array('link' => "{$lang->doc->favorite}|doc|browse|browseTyp=collectedbyme", 'alias' => 'collect'); $lang->doc->menu->collect = array('link' => "{$lang->doc->favorite}|doc|browse|browseTyp=collectedbyme", 'alias' => 'collect');
$lang->doc->menu->product = array('link' => "{$lang->doc->product}|doc|objectLibs|type=product", 'alias' => 'product'); $lang->doc->menu->product = array('link' => "{$lang->doc->product}|doc|tableContents|type=product", 'alias' => 'product');
if($config->systemMode == 'new') $lang->doc->menu->project = array('link' => "{$lang->doc->project}|doc|objectLibs|type=project", 'alias' => 'project'); if($config->systemMode == 'new') $lang->doc->menu->project = array('link' => "{$lang->doc->project}|doc|tableContents|type=project", 'alias' => 'project');
if($config->systemMode == 'classic') $lang->doc->menu->execution = array('link' => "{$lang->doc->execution}|doc|objectLibs|type=execution", 'alias' => 'execution'); if($config->systemMode == 'classic') $lang->doc->menu->execution = array('link' => "{$lang->doc->execution}|doc|tableContents|type=execution", 'alias' => 'execution');
$lang->doc->menu->custom = array('link' => "{$lang->doc->custom}|doc|objectLibs|type=custom", 'alias' => 'custom'); $lang->doc->menu->custom = array('link' => "{$lang->doc->custom}|doc|tableContents|type=custom", 'alias' => 'custom');
$lang->doc->dividerMenu = ',product,'; $lang->doc->dividerMenu = ',product,';
+105
View File
@@ -957,4 +957,109 @@ class doc extends control
$this->view->users = $this->user->getPairs('noclosed,noletter'); $this->view->users = $this->user->getPairs('noclosed,noletter');
$this->display(); $this->display();
} }
/**
* Show the catalog of the doc library.
*
* @param string $type
* @param int $objectID
* @param int $libID
* @access public
* @return void
*/
public function tableContents($type, $objectID = 0, $libID = 0)
{
if(empty($type))
{
$doclib = $this->doc->getLibById($libID);
$type = $doclib->type == 'execution' ? 'project' : $doclib->type;
$objectID = $type == 'custom' or $type == 'book' ? 0 : $doclib->$type;
}
$this->session->set('docList', $this->app->getURI(true), $this->app->openApp);
$objects = $this->doc->getOrderedObjects($type);
if($type == 'custom')
{
$libs = $this->doc->getLibsByObject('custom', 0);
$this->app->rawMethod = 'custom';
if($libID == 0) $libID = key($libs);
$this->lang->modulePageNav = $this->doc->select($type, $objects, $objectID, $libs, $libID);
$object = new stdclass();
$object->id = 0;
}
elseif($type == 'book')
{
$libs = $this->doc->getLibsByObject('book', 0);
$this->app->rawMethod = 'book';
if($libID == 0 and !empty($libs)) $libID = reset($libs)->id;
$this->lang->modulePageNav = $this->doc->select($type, $objects, $objectID, $libs, $libID);
$object = new stdclass();
$object->id = 0;
}
else
{
if($type == 'product')
{
$objectID = $this->product->saveState($objectID, $objects);
$table = TABLE_PRODUCT;
$libs = $this->doc->getLibsByObject('product', $objectID);
if($libID == 0) $libID = key($libs);
$this->lang->modulePageNav = $this->doc->select($type, $objects, $objectID, $libs, $libID);
$this->app->rawMethod = 'product';
}
else if($type == 'project')
{
$objectID = $this->project->saveState($objectID, $objects);
$table = TABLE_PROJECT;
$libs = $this->doc->getLibsByObject('project', $objectID);
if($libID == 0) $libID = key($libs);
$this->lang->modulePageNav = $this->doc->select($type, $objects, $objectID, $libs, $libID);
$this->app->rawMethod = 'project';
}
else if($type == 'execution')
{
$objectID = $this->execution->saveState($objectID, $objects);
$table = TABLE_EXECUTION;
$libs = $this->doc->getLibsByObject('execution', $objectID);
if($libID == 0) $libID = key($libs);
$this->lang->modulePageNav = $this->doc->select($type, $objects, $objectID, $libs, $libID);
$this->app->rawMethod = 'execution';
}
$object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch();
if(empty($object)) $this->locate($this->createLink($type, 'create', '', '', '', $this->session->project));
}
if(!$libID) $libID = key($libs);
$openApp = strpos('doc,product,project,execution', $this->app->openApp) !== false ? $this->app->openApp : 'doc';
if($openApp != 'doc') $this->loadModel($openApp)->setMenu($objectID);
$this->lang->TRActions = common::hasPriv('doc', 'create') ? $this->doc->buildCreateButton4Doc($type, $objectID, $libID) : '';
$moduleTree = $type == 'book' ? $this->doc->getBookStructure($libID) : $this->doc->getTreeMenu($type, $objectID, $libID);
$title = ($type == 'book' or $type == 'custom') ? $this->lang->doc->tableContents : $object->name . $this->lang->colon . $this->lang->doc->tableContents;
$this->view->title = $title;
$this->view->type = $type;
$this->view->objectID = $objectID;
$this->view->libID = $libID;
$this->view->moduleTree = $moduleTree;
$this->view->users = $this->user->getPairs('noletter');
$this->display();
}
} }
+19
View File
@@ -0,0 +1,19 @@
.main-content {padding-top: 0; padding-bottom: 0;}
.main-content #createDropdown {display: inline-block;}
.main-content #createDropdown ul {position: absolute;}
.no-content {width: 100px; height: 100px; margin: 0 auto;}
.notice {text-align: center; padding-left: 15px; padding-top: 20px;}
.no-content-button {text-align: center; padding-top: 20px;}
.no-content-button a:nth-child(2) {margin-left: 20px;}
.cell .detail .detail-title {padding-left: 5px;}
.catalog>a {color: #838a9d !important;}
.detail ul {position: relative;}
.tail-info {position: absolute; right: 0; padding-left: 10px; padding-top: 1px;}
.tail-info, .doc-title, span.item {background: #fff;}
span.dotted-line+a {display: block;}
#modules li.tree-single-item:before, .chapterNode:before, .independent:before {content: " "; width: 100%; border-bottom: 1px dashed #b5b9c5; position: absolute; top: 50%; right: 0; left: 30px;}
.doc-title {display: inline-block !important; position: relative; padding-right: 10px;}
.tree li.has-list.open:before {content: unset;}
i.icon-file-text {color: #D0D2D6; font-size: 14px;}
+14
View File
@@ -0,0 +1,14 @@
$(function()
{
if(!moduleTree || moduleTree.length == 0)
{
var contentHeight = $('.no-content').parent().innerHeight();
var titleHeight = $('.cell div:nth-child(1)').innerHeight();
var height = $(document).height() - $('#header').height() - parent.$('#appsBar').height() - (2 * parseInt($('#main').css('padding-top')));
$('.main-content .cell').height(height);
$('.no-content').parent().css('padding-top', (height - contentHeight)/2 - titleHeight + 'px');
}
$('#main .main-content li.has-list').addClass('open in');
})
+1
View File
@@ -64,6 +64,7 @@ $lang->doc->todayEdited = 'Heute aktualisiert';
$lang->doc->pastEdited = 'Aktualisiert'; $lang->doc->pastEdited = 'Aktualisiert';
$lang->doc->myDoc = 'Meine Dokumente'; $lang->doc->myDoc = 'Meine Dokumente';
$lang->doc->myCollection = 'Meine Favoriten'; $lang->doc->myCollection = 'Meine Favoriten';
$lang->doc->tableContents = 'Catalog';
/* 方法列表。*/ /* 方法列表。*/
$lang->doc->index = 'Home'; $lang->doc->index = 'Home';
+14 -13
View File
@@ -52,19 +52,20 @@ $lang->doc->mailto = 'Mailto';
$lang->doc->noModule = 'No document in this lib, please create it'; $lang->doc->noModule = 'No document in this lib, please create it';
$lang->doc->noChapter = 'No chapters or articles in this book. Please add chapters and articles.'; $lang->doc->noChapter = 'No chapters or articles in this book. Please add chapters and articles.';
$lang->doc->moduleDoc = 'By Module'; $lang->doc->moduleDoc = 'By Module';
$lang->doc->searchDoc = 'Search'; $lang->doc->searchDoc = 'Search';
$lang->doc->fast = 'Quick Entry'; $lang->doc->fast = 'Quick Entry';
$lang->doc->allDoc = 'All Documents'; $lang->doc->allDoc = 'All Documents';
$lang->doc->openedByMe = 'My'; $lang->doc->openedByMe = 'My';
$lang->doc->editedByMe = 'Edited By Me'; $lang->doc->editedByMe = 'Edited By Me';
$lang->doc->orderByOpen = 'Recent Added'; $lang->doc->orderByOpen = 'Recent Added';
$lang->doc->orderByEdit = 'Recent Updated'; $lang->doc->orderByEdit = 'Recent Updated';
$lang->doc->orderByVisit = 'Last Visited'; $lang->doc->orderByVisit = 'Last Visited';
$lang->doc->todayEdited = 'Updated Today'; $lang->doc->todayEdited = 'Updated Today';
$lang->doc->pastEdited = 'Total Updated'; $lang->doc->pastEdited = 'Total Updated';
$lang->doc->myDoc = 'My Documents'; $lang->doc->myDoc = 'My Documents';
$lang->doc->myCollection = 'My Favorites'; $lang->doc->myCollection = 'My Favorites';
$lang->doc->tableContents = 'Catalog';
/* Methods list */ /* Methods list */
$lang->doc->index = 'Document Home'; $lang->doc->index = 'Document Home';
+1
View File
@@ -64,6 +64,7 @@ $lang->doc->todayEdited = "Mis à Jour Aujourd'hui";
$lang->doc->pastEdited = 'Total Mis à Jour'; $lang->doc->pastEdited = 'Total Mis à Jour';
$lang->doc->myDoc = 'Mes Documents'; $lang->doc->myDoc = 'Mes Documents';
$lang->doc->myCollection = 'Mes Favoris'; $lang->doc->myCollection = 'Mes Favoris';
$lang->doc->tableContents = 'Catalog';
/* 方法列表。*/ /* 方法列表。*/
$lang->doc->index = 'Accueil Documents'; $lang->doc->index = 'Accueil Documents';
+14 -13
View File
@@ -51,19 +51,20 @@ $lang->doc->mailto = 'Mailto';
$lang->doc->noModule = 'No document in this lib, please create it'; $lang->doc->noModule = 'No document in this lib, please create it';
$lang->doc->noChapter = 'No chapters or articles in this book. Please add chapters and articles.'; $lang->doc->noChapter = 'No chapters or articles in this book. Please add chapters and articles.';
$lang->doc->moduleDoc = 'By Module'; $lang->doc->moduleDoc = 'By Module';
$lang->doc->searchDoc = 'Tìm kiếm'; $lang->doc->searchDoc = 'Tìm kiếm';
$lang->doc->fast = 'Quick Entry'; $lang->doc->fast = 'Quick Entry';
$lang->doc->allDoc = 'Tất cả tài liệu'; $lang->doc->allDoc = 'Tất cả tài liệu';
$lang->doc->openedByMe = 'Của bạn'; $lang->doc->openedByMe = 'Của bạn';
$lang->doc->editedByMe = 'Edited By Me'; $lang->doc->editedByMe = 'Edited By Me';
$lang->doc->orderByOpen = 'Recent Added'; $lang->doc->orderByOpen = 'Recent Added';
$lang->doc->orderByEdit = 'Recent Updated'; $lang->doc->orderByEdit = 'Recent Updated';
$lang->doc->orderByVisit = 'Last Visited'; $lang->doc->orderByVisit = 'Last Visited';
$lang->doc->todayEdited = 'Updated Today'; $lang->doc->todayEdited = 'Updated Today';
$lang->doc->pastEdited = 'Tổng Updated'; $lang->doc->pastEdited = 'Tổng Updated';
$lang->doc->myDoc = 'My tài liệu'; $lang->doc->myDoc = 'My tài liệu';
$lang->doc->myCollection = 'My Favorites'; $lang->doc->myCollection = 'My Favorites';
$lang->doc->tableContents = 'Catalog';
/* Methods list */ /* Methods list */
$lang->doc->index = 'Document Home'; $lang->doc->index = 'Document Home';
+14 -13
View File
@@ -52,19 +52,20 @@ $lang->doc->mailto = '抄送给';
$lang->doc->noModule = '文档库下没有目录和文档,请维护目录或者创建文档'; $lang->doc->noModule = '文档库下没有目录和文档,请维护目录或者创建文档';
$lang->doc->noChapter = '手册下没有章节和文章,请维护手册'; $lang->doc->noChapter = '手册下没有章节和文章,请维护手册';
$lang->doc->moduleDoc = '按模块浏览'; $lang->doc->moduleDoc = '按模块浏览';
$lang->doc->searchDoc = '搜索'; $lang->doc->searchDoc = '搜索';
$lang->doc->fast = '快速访问'; $lang->doc->fast = '快速访问';
$lang->doc->allDoc = '所有文档'; $lang->doc->allDoc = '所有文档';
$lang->doc->openedByMe = '由我创建'; $lang->doc->openedByMe = '由我创建';
$lang->doc->editedByMe = '由我编辑'; $lang->doc->editedByMe = '由我编辑';
$lang->doc->orderByOpen = '最近添加'; $lang->doc->orderByOpen = '最近添加';
$lang->doc->orderByEdit = '最近更新'; $lang->doc->orderByEdit = '最近更新';
$lang->doc->orderByVisit = '最近访问'; $lang->doc->orderByVisit = '最近访问';
$lang->doc->todayEdited = '今日更新'; $lang->doc->todayEdited = '今日更新';
$lang->doc->pastEdited = '往日更新'; $lang->doc->pastEdited = '往日更新';
$lang->doc->myDoc = '我的文档'; $lang->doc->myDoc = '我的文档';
$lang->doc->myCollection = '我的收藏'; $lang->doc->myCollection = '我的收藏';
$lang->doc->tableContents = '目录';
/* 方法列表。*/ /* 方法列表。*/
$lang->doc->index = '文档主页'; $lang->doc->index = '文档主页';
+14 -13
View File
@@ -52,19 +52,20 @@ $lang->doc->mailto = '抄送給';
$lang->doc->noModule = '文檔庫下沒有目錄和文檔,請維護目錄或者創建文檔'; $lang->doc->noModule = '文檔庫下沒有目錄和文檔,請維護目錄或者創建文檔';
$lang->doc->noChapter = '手冊下沒有章節和文章,請維護手冊'; $lang->doc->noChapter = '手冊下沒有章節和文章,請維護手冊';
$lang->doc->moduleDoc = '按模組瀏覽'; $lang->doc->moduleDoc = '按模組瀏覽';
$lang->doc->searchDoc = '搜索'; $lang->doc->searchDoc = '搜索';
$lang->doc->fast = '快速訪問'; $lang->doc->fast = '快速訪問';
$lang->doc->allDoc = '所有文檔'; $lang->doc->allDoc = '所有文檔';
$lang->doc->openedByMe = '由我創建'; $lang->doc->openedByMe = '由我創建';
$lang->doc->editedByMe = '由我編輯'; $lang->doc->editedByMe = '由我編輯';
$lang->doc->orderByOpen = '最近添加'; $lang->doc->orderByOpen = '最近添加';
$lang->doc->orderByEdit = '最近更新'; $lang->doc->orderByEdit = '最近更新';
$lang->doc->orderByVisit = '最近訪問'; $lang->doc->orderByVisit = '最近訪問';
$lang->doc->todayEdited = '今日更新'; $lang->doc->todayEdited = '今日更新';
$lang->doc->pastEdited = '往日更新'; $lang->doc->pastEdited = '往日更新';
$lang->doc->myDoc = '我的文檔'; $lang->doc->myDoc = '我的文檔';
$lang->doc->myCollection = '我的收藏'; $lang->doc->myCollection = '我的收藏';
$lang->doc->tableContents = '目錄';
/* 方法列表。*/ /* 方法列表。*/
$lang->doc->index = '文檔主頁'; $lang->doc->index = '文檔主頁';
+41 -14
View File
@@ -1829,6 +1829,9 @@ class docModel extends model
$maxHeight = ($type == 'project' and $this->app->openApp == 'doc') ? '260px' : '290px'; $maxHeight = ($type == 'project' and $this->app->openApp == 'doc') ? '260px' : '290px';
$class = ($type == 'project' and $this->app->openApp == 'doc') ? 'col-left' : ''; $class = ($type == 'project' and $this->app->openApp == 'doc') ? 'col-left' : '';
$currentMethod = $this->app->getMethodName();
$methodName = $currentMethod == 'tablecontents' ? 'tablecontents' : 'objectLibs';
if($this->app->openApp == 'doc' and $type != 'custom' and $type != 'book') 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 load-indicator' data-ride='searchList'>"; $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 load-indicator' data-ride='searchList'>";
@@ -1844,12 +1847,12 @@ class docModel extends model
$selected = $key == $objectID ? 'selected' : ''; $selected = $key == $objectID ? 'selected' : '';
if(isset($clseedProjects[$key])) if(isset($clseedProjects[$key]))
{ {
$closedProjectsHtml .= html::a(inlink('objectLibs', "type=$type&objectID=$key"), $object, '', "class='$selected' data-app='{$this->app->openApp}'"); $closedProjectsHtml .= html::a(inlink($methodName, "type=$type&objectID=$key"), $object, '', "class='$selected' data-app='{$this->app->openApp}'");
if($selected == 'selected') $tabActive = 'closed'; if($selected == 'selected') $tabActive = 'closed';
} }
else else
{ {
$output .= html::a(inlink('objectLibs', "type=$type&objectID=$key"), $object, '', "class='$selected' data-app='{$this->app->openApp}'"); $output .= html::a(inlink($methodName, "type=$type&objectID=$key"), $object, '', "class='$selected' data-app='{$this->app->openApp}'");
} }
} }
if($type == 'project' and $this->app->openApp == 'doc') if($type == 'project' and $this->app->openApp == 'doc')
@@ -1870,7 +1873,7 @@ class docModel extends model
foreach($libs as $key => $lib) foreach($libs as $key => $lib)
{ {
$selected = $key == $libID ? 'selected' : ''; $selected = $key == $libID ? 'selected' : '';
$output .= html::a(inlink('objectLibs', "type=$type&objectID=$objectID&libID=$key"), $lib->name, '', "class='$selected' data-app='{$this->app->openApp}'"); $output .= html::a(inlink($methodName, "type=$type&objectID=$objectID&libID=$key"), $lib->name, '', "class='$selected' data-app='{$this->app->openApp}'");
} }
$output .= "</div></div></div></div></div>"; $output .= "</div></div></div></div></div>";
} }
@@ -1881,16 +1884,19 @@ class docModel extends model
/** /**
* Get doc tree menu. * Get doc tree menu.
* *
* @param string $type * @param string $type
* @param int $objectID * @param int $objectID
* @param int $rootID * @param int $rootID
* @param int $startModule * @param int $startModule
* @param pointer $docID
* @access public * @access public
* @return string * @return string
*/ */
public function getTreeMenu($type, $objectID, $rootID, $startModule = 0, & $docID = 0) public function getTreeMenu($type, $objectID, $rootID, $startModule = 0, & $docID = 0)
{ {
$startModulePath = ''; $startModulePath = '';
$currentMethod = $this->app->getMethodName();
$users = $this->loadModel('user')->getPairs('noletter');
if($startModule > 0) if($startModule > 0)
{ {
$startModule = $this->tree->getById($startModule); $startModule = $this->tree->getById($startModule);
@@ -1925,8 +1931,18 @@ class docModel extends model
foreach($moduleDocs[0] as $doc) foreach($moduleDocs[0] as $doc)
{ {
if(!$docID) $docID = $doc->id; if(!$docID and $currentMethod != 'tablecontents') $docID = $doc->id;
$treeMenu[0] .= '<li' . ($doc->id == $docID ? ' class="active"' : '') . '>' . html::a(inlink('objectLibs', "type=$type&objectID=$objectID&libID=$rootID&docID={$doc->id}"), "<i class='icon icon-file-text text-muted'></i> &nbsp;" . $doc->title, '', "data-app='{$this->app->openApp}'") . '</li>';
$treeMenu[0] .= '<li' . ($doc->id == $docID ? ' class="active"' : ' class="independent"') . '>';
if($currentMethod == 'tablecontents')
{
$treeMenu[0] .= '<span class="tail-info">' . zget($users, $doc->editedBy) . ' &nbsp;' . $doc->editedDate . '</span>';
}
$treeMenu[0] .= html::a(inlink('objectLibs', "type=$type&objectID=$objectID&libID=$rootID&docID={$doc->id}"), "<i class='icon icon-file-text text-muted'></i> &nbsp;" . $doc->title, '', "data-app='{$this->app->openApp}' class='doc-title'");
$treeMenu[0] .= '</li>';
} }
} }
@@ -1945,20 +1961,31 @@ class docModel extends model
* @param int $libID * @param int $libID
* @param object $module * @param object $module
* @param array $moduleDocs * @param array $moduleDocs
* @param int $docID * @param pointer $docID
* @access public * @access private
* @return string * @return string
*/ */
private function buildTree(& $treeMenu, $type, $objectID, $libID, $module, $moduleDocs, & $docID) private function buildTree(& $treeMenu, $type, $objectID, $libID, $module, $moduleDocs, & $docID)
{ {
if(!isset($treeMenu[$module->id])) $treeMenu[$module->id] = ''; if(!isset($treeMenu[$module->id])) $treeMenu[$module->id] = '';
$users = $this->loadModel('user')->getPairs('noletter');
$currentMethod = $this->app->getMethodName();
if(isset($moduleDocs[$module->id])) if(isset($moduleDocs[$module->id]))
{ {
foreach($moduleDocs[$module->id] as $doc) foreach($moduleDocs[$module->id] as $doc)
{ {
if(!$docID) $docID = $doc->id; if(!$docID and $currentMethod != 'tablecontents') $docID = $doc->id;
$treeMenu[$module->id] .= '<li' . ($doc->id == $docID ? ' class="active"' : '') . '>' . html::a(inlink('objectLibs', "type=$type&objectID=$objectID&libID=$libID&docID={$doc->id}"), "<i class='icon icon-file-text text-muted'></i> &nbsp;" . $doc->title, '', "data-app='{$this->app->openApp}'") . '</li>'; $treeMenu[$module->id] = '<li' . ($doc->id == $docID ? ' class="active"' : '') . '>';
if($currentMethod == 'tablecontents')
{
$treeMenu[$module->id] .= '<span class="tail-info">' . zget($users, $doc->editedBy) . ' &nbsp;' . $doc->editedDate . '</span>';
}
$treeMenu[$module->id] .= html::a(inlink('objectLibs', "type=$type&objectID=$objectID&libID=$libID&docID={$doc->id}"), "<i class='icon icon-file-text text-muted'></i> &nbsp;" . $doc->title, '', "data-app='{$this->app->openApp}' class='doc-title'");
$treeMenu[$module->id] .= '</li>';
} }
} }
@@ -1969,6 +1996,6 @@ class docModel extends model
} }
if(!isset($treeMenu[$module->parent])) $treeMenu[$module->parent] = ''; if(!isset($treeMenu[$module->parent])) $treeMenu[$module->parent] = '';
$treeMenu[$module->parent] .= '<li' . ($treeMenu[$module->id] ? ' class="closed"' : '') . '>' . $li . '</li>'; $treeMenu[$module->parent] .= '<li' . ($treeMenu[$module->id] ? ' class="closed catalog"' : ' class="catalog"') . '>' . $li . '</li>';
} }
} }
+101
View File
@@ -0,0 +1,101 @@
<?php
/**
* The table contents view file of doc module of ZenTaoPMS.
*
* @copyright Copyright 2009-2021 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Fangzhou Hu <hufangzhou@easycorp.ltd>
* @package doc
* @version $Id$
* @link https://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('moduleTree', $moduleTree);?>
<?php
$sideLibs = array();
foreach($lang->doclib->tabList as $libType => $typeName) $sideLibs[$libType] = $this->doc->getLimitLibs($libType);
$allModules = $this->loadModel('tree')->getDocStructure();
$sideSubLibs = array();
$sideSubLibs['product'] = $this->doc->getSubLibGroups('product', array_keys($sideLibs['product']));
$sideSubLibs['execution'] = $this->doc->getSubLibGroups('execution', array_keys($sideLibs['execution']));
if($this->methodName != 'browse')
{
$browseType = '';
$moduleID = '';
}
if(empty($type)) $type = 'product';
?>
<div class="main-content" >
<div class="cell" id="<?php echo $type;?>">
<div class="detail">
<div class="detail-title"><?php echo $lang->doc->tableContents;?></div>
</div>
<div class="detail">
<?php if($moduleTree):?>
<?php if($type == 'book'):?>
<?php include './bookside.html.php';?>
<?php else:?>
<?php echo $moduleTree;?>
<?php endif;?>
<?php else:?>
<div class="no-content"><img src="<?php echo $config->webRoot . 'theme/default/images/main/no_content.png'?>"/></div>
<div class="notice text-muted"><?php echo $this->lang->doc->noDoc;?></div>
<div class="no-content-button">
<?php
$html = '';
if($type == 'book')
{
$html = html::a(helper::createLink('doc', 'createLib', "type=$type&objectID=$objectID"), '<i class="icon icon-plus"></i>' . $this->lang->doc->createBook, '', 'class="btn btn-info btn-wide iframe"');
}
elseif($libID)
{
$html = "<div class='dropdown' id='createDropdown'>";
$html .= "<button class='btn btn-info btn-wide' type='button' data-toggle='dropdown'><i class='icon icon-plus'></i>" . $this->lang->doc->createAB . " <span class='caret'></span></button>";
$html .= "<ul class='dropdown-menu' style='left:0px'>";
foreach($this->lang->doc->typeList as $typeKey => $typeName)
{
$class = strpos($this->config->doc->officeTypes, $typeKey) !== false ? 'iframe' : '';
$html .= "<li>";
$html .= html::a(helper::createLink('doc', 'create', "objectType=$type&objectID=$objectID&libID=$libID&moduleID=0&type=$typeKey", '', $class ? true : false), $typeName, '', "class='$class' data-app='{$this->app->openApp}'");
$html .= "</li>";
}
$html .= "</ul></div>";
}
echo $html;
?>
<?php
if($type == 'book')
{
common::printLink('doc', 'manageBook', "bookID=$libID", $lang->doc->manageBook, '', "class='btn btn-info btn-wide'");
}
else
{
common::printLink('tree', 'browse', "rootID=$libID&view=doc", $lang->doc->manageType, '', "class='btn btn-info btn-wide iframe'", '', true);
}
?>
</div>
<?php endif;?>
</div>
<div class="text-center action">
<?php
if($type == 'book')
{
//common::printLink('doc', 'editLib', "rootID=$libID", $lang->doc->editBook, '', "class='btn btn-info btn-wide iframe'", '', true);
//common::printLink('doc', 'manageBook', "bookID=$libID", $lang->doc->manageBook, '', "class='btn btn-info btn-wide'");
}
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>
</div>
<?php include '../../common/view/footer.html.php';?>
+14 -13
View File
@@ -1011,19 +1011,20 @@ $lang->job->methodOrder[25] = 'exec';
/* Doc. */ /* Doc. */
$lang->resource->doc = new stdclass(); $lang->resource->doc = new stdclass();
$lang->resource->doc->index = 'index'; $lang->resource->doc->index = 'index';
$lang->resource->doc->browse = 'browse'; $lang->resource->doc->browse = 'browse';
$lang->resource->doc->createLib = 'createLib'; $lang->resource->doc->createLib = 'createLib';
$lang->resource->doc->editLib = 'editLib'; $lang->resource->doc->editLib = 'editLib';
$lang->resource->doc->deleteLib = 'deleteLib'; $lang->resource->doc->deleteLib = 'deleteLib';
$lang->resource->doc->create = 'create'; $lang->resource->doc->create = 'create';
$lang->resource->doc->view = 'view'; $lang->resource->doc->view = 'view';
$lang->resource->doc->edit = 'edit'; $lang->resource->doc->edit = 'edit';
$lang->resource->doc->delete = 'delete'; $lang->resource->doc->delete = 'delete';
$lang->resource->doc->deleteFile = 'deleteFile'; $lang->resource->doc->deleteFile = 'deleteFile';
$lang->resource->doc->allLibs = 'allLibs'; $lang->resource->doc->allLibs = 'allLibs';
$lang->resource->doc->objectLibs = 'objectLibs'; $lang->resource->doc->objectLibs = 'objectLibs';
$lang->resource->doc->collect = 'collectAction'; $lang->resource->doc->collect = 'collectAction';
$lang->resource->doc->tableContents = 'tableContents';
$lang->doc->methodOrder[0] = 'index'; $lang->doc->methodOrder[0] = 'index';
$lang->doc->methodOrder[5] = 'browse'; $lang->doc->methodOrder[5] = 'browse';