From 0beaa1a96881cc38da7d6c288c4d6f2f22005888 Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Fri, 2 Apr 2021 09:45:09 +0800 Subject: [PATCH 1/8] + Sdd a sidebar in doc module. --- module/doc/control.php | 3 +- module/doc/css/objectlibs.css | 3 +- module/doc/lang/en.php | 3 +- module/doc/lang/zh-cn.php | 11 +- module/doc/model.php | 107 +++++++++++++++--- module/doc/view/side.html.php | 199 +++------------------------------- 6 files changed, 117 insertions(+), 209 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 636148f606..e3813db046 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -913,7 +913,7 @@ class doc extends control $this->doc->buildSearchForm(0, array(), 0, $actionURL, 'objectLibs'); $this->lang->TRActions = common::hasPriv('doc', 'createLib') ? html::a(helper::createLink('doc', 'createLib', "type=$type&objectID=$objectID"), " " . $this->lang->doc->createlib, '', "class='btn btn-secondary iframe' data-width='70%'") : ''; - $this->lang->TRActions .= common::hasPriv('doc', 'create') ? $this->doc->buildCreateButton4Doc($type, $objectID) : ''; + $this->lang->TRActions .= common::hasPriv('doc', 'create') ? $this->doc->buildCreateButton4Doc($type, $objectID, $libID) : ''; $this->view->customObjectLibs = $customObjectLibs; $this->view->showLibs = $this->config->doc->custom->objectLibs; @@ -924,6 +924,7 @@ class doc extends control $this->view->type = $type; $this->view->object = $object; $this->view->libs = $this->doc->getLibsByObject($type, $objectID); + $this->view->moduleTree = $this->doc->getTreeMenu($type, $objectID, 0); $this->view->canBeChanged = common::canModify($type, $object); // Determines whether an object is editable. $this->display(); } diff --git a/module/doc/css/objectlibs.css b/module/doc/css/objectlibs.css index 33aec7c1f9..5c92ebe539 100644 --- a/module/doc/css/objectlibs.css +++ b/module/doc/css/objectlibs.css @@ -3,6 +3,7 @@ .addbtn .icon-plus {font-size: 18px; display: block; opacity: 0.5; transition: opacity .2s; text-shadow: 1px 1px 3px rgba(0,0,0,.2);} .addbtn:hover .icon-plus {opacity: .9; animation: flash-icon 1s linear alternate infinite;} #dropMenu {min-width: 250px; box-sizing: inhert;} +#dropMenu .table-col .list-group {padding-top: 10px;} .main-col .block-files .panel-heading {padding-right: 20px;} .main-col .block-files .panel-heading .panel-title {height: 35px; line-height: 30px;} -#dropMenu .table-col .list-group {padding-top: 10px;} +.side-col .action a {margin-bottom: 3px;} diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 748ad2e933..8351758fad 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -49,6 +49,7 @@ $lang->doc->item = ' Items'; $lang->doc->num = 'Documents'; $lang->doc->searchResult = 'Search Result'; $lang->doc->mailto = 'Mailto'; +$lang->doc->noModule = 'No document in this lib, please create it'; $lang->doc->moduleDoc = 'By Module'; $lang->doc->searchDoc = 'Search'; @@ -93,7 +94,7 @@ $lang->doc->createlib = 'Create Document Library'; $lang->doc->allLibs = 'Library List'; $lang->doc->objectLibs = "{$lang->productCommon}/{$lang->executionCommon} Libraries"; $lang->doc->showFiles = 'Attachments'; -$lang->doc->editlib = 'Edit Document Library'; +$lang->doc->editLib = 'Edit Document Library'; $lang->doc->deleteLib = 'Delete Document Library'; $lang->doc->fixedMenu = 'Fix to Menu'; $lang->doc->removeMenu = 'Remove from Menu'; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index 137f36db1f..4214833e83 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -49,6 +49,7 @@ $lang->doc->item = '项'; $lang->doc->num = '文档数量'; $lang->doc->searchResult = '搜索结果'; $lang->doc->mailto = '抄送给'; +$lang->doc->noModule = '文档库下没有目录和文档,请维护目录或者创建文档'; $lang->doc->moduleDoc = '按模块浏览'; $lang->doc->searchDoc = '搜索'; @@ -74,10 +75,10 @@ $lang->doc->view = '文档详情'; $lang->doc->diff = '对比'; $lang->doc->diffAction = '对比文档'; $lang->doc->sort = '文档排序'; -$lang->doc->manageType = '维护分类'; -$lang->doc->editType = '编辑分类'; -$lang->doc->deleteType = '删除分类'; -$lang->doc->addType = '增加分类'; +$lang->doc->manageType = '维护目录'; +$lang->doc->editType = '编辑目录'; +$lang->doc->deleteType = '删除目录'; +$lang->doc->addType = '增加目录'; $lang->doc->childType = '子分类'; $lang->doc->collect = '收藏'; $lang->doc->cancelCollection = '取消收藏'; @@ -93,7 +94,7 @@ $lang->doc->createlib = '创建文档库'; $lang->doc->allLibs = '文档库列表'; $lang->doc->objectLibs = "{$lang->productCommon}/{$lang->executionCommon}库列表"; $lang->doc->showFiles = '附件库'; -$lang->doc->editlib = '编辑文档库'; +$lang->doc->editLib = '编辑文档库'; $lang->doc->deleteLib = '删除文档库'; $lang->doc->fixedMenu = '固定到菜单栏'; $lang->doc->removeMenu = '从菜单栏移除'; diff --git a/module/doc/model.php b/module/doc/model.php index 80661d7dff..abfa561900 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1598,28 +1598,24 @@ class docModel extends model * * @param string $type * @param int $objectID + * @param int $libID * @access public * @return string */ - public function buildCreateButton4Doc($type, $objectID) + public function buildCreateButton4Doc($type, $objectID, $libID) { - $libs = $this->getLibs('all', strpos($this->config->doc->custom->showLibs, 'unclosed') !== false ? 'unclosedProject' : ''); - $html = ""; - if($libs) + $html = ""; + return $html; } @@ -1814,4 +1810,83 @@ EOF; return $output; } + + /** + * Get doc tree menu. + * + * @param string $rootID + * @param int $rootID + * @param int $startModule + * @access public + * @return string + */ + public function getTreeMenu($type, $rootID, $startModule = 0) + { + return ''; + + $extra['projectID'] = $rootID; + $menu = "'; + return $menu; + } } diff --git a/module/doc/view/side.html.php b/module/doc/view/side.html.php index 4d9f54a3c5..816751b59d 100644 --- a/module/doc/view/side.html.php +++ b/module/doc/view/side.html.php @@ -15,193 +15,22 @@ if(empty($type)) $type = 'product'; $sideWidth = common::checkNotCN() ? '270' : '238'; ?>
-
-
- -
- doclib->tabList as $tabValue => $tabName):?> - -
"> -
    - - -
  • - navGroup->doc == 'doc' and $tabValue == 'execution') - { - echo $lang->noData; - } - else - { - $text = zget($lang->doclib->create, $tabValue, ''); - if($text and common::hasPriv($tabValue, 'create')) echo html::a($this->createLink($tabValue, 'create', ''), $text, '', "class='text-ellipsis'"); - } - ?> -
  • - - $tabMenuName):?> - $subLibName) - { - if(is_numeric($subLibID) and !empty($mainLibID)) $customLibCount += 1; - if(is_numeric($subLibID) and empty($mainLibID)) $mainLibID = $subLibID; - } - } - - $icon = $tabValue == 'product' ? " " : " "; - $activeClass = ($this->methodName == 'objectlibs' && $type == $tabValue && $object->id == $tabMenuID) ? 'active' : ''; - $activeClass = ($this->methodName == 'browse' && isset($currentLib->id) && $currentLib->id == $mainLibID) ? 'active' : $activeClass; - ?> -
  • > - 0):?> - createLink('doc', 'objectLibs', "type=$tabValue&objectID=$tabMenuID"), $icon . $tabMenuName, '', "class='text-ellipsis' title='{$tabMenuName}'");?> - - createLink('doc', 'browse', "libID=$mainLibID"), $icon . $tabMenuName, '', "class='text-ellipsis' title='{$tabMenuName}'");?> - - -
      - $subLibName):?> - methodName == 'alllibs' && $type == 'execution' && $$tabValue == $tabMenuID) ? "class='active'" : ''; - $icon = 'icon-stack'; - } - elseif($subLibID == 'files') - { - $subLibLink = inlink('showFiles', "type=$tabValue&objectID=$tabMenuID"); - $activeClass = ($this->methodName == 'showfiles' && $type == $tabValue && $object->id == $tabMenuID) ? "class='active'" : ''; - $icon = 'icon-paper-clip'; - } - else - { - $subLibLink = inlink('browse', "libID=$subLibID"); - $activeClass = ($this->methodName == 'browse' && $browseType != 'bymodule' && $subLibID == $libID) ? "class='active'" : ''; - $icon = 'icon-folder-outline'; - } - ?> - 0):?> -
    • > - " . $subLibName, '', "class='text-ellipsis' title='{$subLibName}'");?> - - - 0):?> -
        - - - parent != 0) continue;?> -
      • methodName == 'browse' && $browseType == 'bymodule' && $moduleID == $module->id) echo "class='active'";?>> - createLink('doc', 'browse', "libID=$subLibID&browseType=byModule¶m={$module->id}"), " " . $module->name, '', "class='text-ellipsis' title='{$module->name}'");?> - doc->printChildModule($module, $subLibID, $this->methodName, $browseType, $moduleID);?> -
      • - - 0):?> -
      - - - 0):?> -
    • - - -
    • > - " . $subLibName, '', "class='text-ellipsis' title='{$subLibName}'");?> -
    • - - -
    - -
  • - - - - - -
  • - doclib->create, $tabValue, ''); - if($text and common::hasPriv('doc', 'createLib')) echo html::a($this->createLink('doc', 'createLib', "type={$tabValue}"), $text, '', "class='iframe' data-width='70%'"); - ?> -
  • - - $sideLibName):?> - - - - methodName == 'objectlibs' && $type == $tabValue && $object->id == $sideLibID) ? 'active' : ''; - $activeClass = ($this->methodName == 'browse' && isset($currentLib->id) && $currentLib->id == $sideLibID) ? 'active' : $activeClass; - ?> -
  • > - createLink('doc', 'browse', "libID=$sideLibID"), " " . $sideLibName, '', "class='text-ellipsis' title='{$sideLibName}'");?> - -
      - - parent != 0) continue;?> -
    • methodName == 'browse' && $browseType == 'bymodule' && $moduleID == $module->id) echo "class='active'";?>> - createLink('doc', 'browse', "libID=$sideLibID&browseType=byModule¶m={$module->id}"), " " . $module->name, '', "class='text-ellipsis' title='{$module->name}'");?> - doc->printChildModule($module, $sideLibID, $this->methodName, $browseType, $moduleID);?> -
    • - -
    - -
  • - - - - - -
-
- +
+ +
+
+ doc->noModule;?> +
+
+ + +
+ doc->manageType, '', "class='btn btn-info btn-wide'");?> + doc->editLib, '', "class='btn btn-info btn-wide'");?> + doc->deleteLib, '', "class='btn btn-info btn-wide'");?> +
- -
-