From 86da04ad79c35e65f7a2f6a21039a970646f9f4d Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Fri, 2 Apr 2021 09:35:04 +0800 Subject: [PATCH 14/49] * Add upgrade version. --- module/upgrade/lang/version.php | 1 + module/upgrade/model.php | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/module/upgrade/lang/version.php b/module/upgrade/lang/version.php index 9d6b9f23e2..1d3010332f 100644 --- a/module/upgrade/lang/version.php +++ b/module/upgrade/lang/version.php @@ -132,3 +132,4 @@ $lang->upgrade->fromVersions['12_4_4'] = '12.4.4'; $lang->upgrade->fromVersions['12_5'] = '12.5'; $lang->upgrade->fromVersions['12_5_1'] = '12.5.1'; $lang->upgrade->fromVersions['12_5_2'] = '12.5.2'; +$lang->upgrade->fromVersions['12_5_3'] = '12.5.3'; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index afbac96eb6..c2db590b52 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -632,17 +632,15 @@ class upgradeModel extends model case '12_5_2': $this->saveLogs('Execute 12_5_2'); $this->appendExec('12_5_2'); + case '12_5_3': + $this->saveLogs('Execute 12_5_3'); + $this->appendExec('12_5_3'); case '15_0': $this->saveLogs('Execute 15_0'); $this->execSQL($this->getUpgradeFile('15.0')); $this->adjustWhitelistOfProject(); $this->adjustWhitelistOfProduct(); $this->appendExec('15_0'); - case '15_0_beta1': - $this->saveLogs('Execute 15_0_beta1'); - $this->adjustBugOfProject(); - $this->adjustPriv15_0(); - $this->appendExec('15_0_beta1'); } $this->deletePatch(); @@ -826,6 +824,7 @@ class upgradeModel extends model case '12_5': case '12_5_1': case '12_5_2': + case '12_5_3': case '15_0' : $confirmContent .= file_get_contents($this->getUpgradeFile('15.0')); } return str_replace('zt_', $this->config->db->prefix, $confirmContent); From 4c9f9536586a0fd757aab38a44aab6b4e1342acc Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Fri, 2 Apr 2021 09:35:25 +0800 Subject: [PATCH 15/49] * Fix version. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4b99d26192..343f3a761a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -15.0.beta1 +15.0.rc1 From 0beaa1a96881cc38da7d6c288c4d6f2f22005888 Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Fri, 2 Apr 2021 09:45:09 +0800 Subject: [PATCH 16/49] + 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 = "
    "; + $startModulePath = ''; + if($startModule > 0) + { + $startModule = $this->getById($startModule); + if($startModule) $startModulePath = $startModule->path . '%'; + } + + $executionModules = $this->getTaskTreeModules($rootID, true); + $executionBranches = $this->dao->select('DISTINCT t2.branch')->from(TABLE_PROJECTSTORY)->alias('t1') + ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') + ->where('t1.project')->eq($rootID) + ->andWhere('t2.deleted')->eq(0) + ->fetchPairs(); + + /* Get module according to product. */ + $products = $this->loadModel('product')->getProductPairsByProject($rootID); + $branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products)); + $productNum = count($products); + foreach($products as $id => $product) + { + $projectProductLink = helper::createLink('projectstory', 'story', "projectID=$rootID&productID=$id"); + $executionProductLink = helper::createLink('execution', 'story', "executionID=$rootID&ordery=&status=byProduct&praram=$id"); + $link = $this->app->rawModule == 'projectstory' ? $projectProductLink : $executionProductLink; + if($productNum > 1) $menu .= "
  • " . html::a($link, $product, '_self', "id='product$id'"); + + /* tree menu. */ + $tree = ''; + if(empty($branchGroups[$id])) $branchGroups[$id]['0'] = ''; + foreach($branchGroups[$id] as $branch => $branchName) + { + $treeMenu = array(); + $query = $this->dao->select('*')->from(TABLE_MODULE) + ->where('root')->eq((int)$id) + ->andWhere('type')->eq('story') + ->beginIF(count($branchGroups[$id]) > 1)->andWhere('branch')->eq($branch)->fi() + ->beginIF($startModulePath)->andWhere('path')->like($startModulePath)->fi() + ->andWhere('deleted')->eq(0) + ->orderBy('grade desc, branch, `order`, type') + ->get(); + $stmt = $this->dbh->query($query); + while($module = $stmt->fetch()) + { + /* If not manage, ignore unused modules. */ + if(isset($executionModules[$module->id]) and $this->app->rawModule == 'execution') $this->buildTree($treeMenu, $module, 'task', $userFunc, $extra); + if($this->app->rawModule == 'projectstory') $this->buildTree($treeMenu, $module, 'task', $userFunc, $extra); + } + if((isset($treeMenu[0]) and $branch) or isset($executionBranches[$branch])) + { + $childMenu = isset($treeMenu[0]) ? "
      {$treeMenu[0]}
    " : ''; + $projectBranchLink = helper::createLink('projectstory', 'story', "projectID=$rootID&productID=$id&branch=" . (empty($branch) ? 0 : $branch) . "&browseType=byBranch"); + $executionBranchLink = helper::createLink('execution', 'story', "executionID=$rootID&ordery=&status=byBranch&praram=" . (empty($branch) ? "{$id},0" : $branch)); + $link = $this->app->rawModule == 'projectstory' ? $projectBranchLink : $executionBranchLink; + if($branchName) $treeMenu[0] = "
  • " . html::a($link, $branchName, '_self', "id='branch" . (empty($branch) ? "{$id}_0" : $branch) . "'") . "{$childMenu}
  • "; + } + $tree .= isset($treeMenu[0]) ? $treeMenu[0] : ''; + } + if($productNum > 1) $tree = "
      " . $tree . "
    \n"; + $menu .= $tree; + } + + $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'");?> +
- -
-