From da39880a1c4c551c2d7cba8f98331622ae65aa07 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 8 Aug 2017 08:21:58 +0800 Subject: [PATCH] * adjust code for zentaobiz and fix bug. --- module/common/view/header.html.php | 7 +++++++ module/doc/css/alllibs.css | 1 + module/doc/js/common.js | 2 +- module/doc/model.php | 6 +++++- module/doc/view/alllibs.html.php | 4 +++- module/doc/view/objectlibs.html.php | 4 ++-- module/testsuite/control.php | 11 ----------- 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/module/common/view/header.html.php b/module/common/view/header.html.php index 8c363207c5..3f4b45231b 100755 --- a/module/common/view/header.html.php +++ b/module/common/view/header.html.php @@ -4,6 +4,13 @@ include 'header.lite.html.php'; include 'chosen.html.php'; //include 'validation.html.php'; ?> +app->getModuleRoot() . '/common/ext/view/'; +$extHookRule = $extPath . 'header.*.hook.php'; +$extHookFiles = glob($extHookRule); +if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile; +?> app->loadConfig('sso');?> getLibById($libID); $lib = fixer::input('post')->join('groups', ',')->join('users', ',')->get(); - if($lib->acl == 'private') $lib->users = $this->app->user->account; + if($lib->acl == 'private') + { + $libCreatedBy = $this->dao->select('*')->from(TABLE_ACTION)->where('objectType')->eq('doclib')->andWhere('objectID')->eq($libID)->andWhere('action')->eq('created')->fetch('actor'); + $lib->users = $libCreatedBy ? $libCreatedBy : $this->app->user->account; + } $this->dao->update(TABLE_DOCLIB)->data($lib)->autoCheck() ->batchCheck('name', 'notempty') ->where('id')->eq($libID) diff --git a/module/doc/view/alllibs.html.php b/module/doc/view/alllibs.html.php index 1e6bdc9911..d493b3fde3 100644 --- a/module/doc/view/alllibs.html.php +++ b/module/doc/view/alllibs.html.php @@ -52,10 +52,12 @@ -
+
'> id") ?>' data-id='id;?>'> + + ' class='file-icon' />
name?>
diff --git a/module/doc/view/objectlibs.html.php b/module/doc/view/objectlibs.html.php index 30e73189f4..65cb27b3fa 100644 --- a/module/doc/view/objectlibs.html.php +++ b/module/doc/view/objectlibs.html.php @@ -16,7 +16,7 @@
-
+
'> $libName):?> id"); ?> ' title='' href='' data-id=''> - + ' class='file-icon' />
diff --git a/module/testsuite/control.php b/module/testsuite/control.php index efd85aaaf5..5b8a787fde 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -174,8 +174,6 @@ class testsuite extends control if($suite->type == 'library') { - $this->lang->menugroup->testsuite = 'caselib'; - /* Set lib menu. */ $libraries = $this->testsuite->getLibraries(); $suiteID = $this->testsuite->saveLibState($suiteID, $libraries); @@ -379,8 +377,6 @@ class testsuite extends control */ public function library($libID = 0, $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { - $this->lang->menugroup->testsuite = 'caselib'; - /* Set browse type. */ $browseType = strtolower($browseType); @@ -456,8 +452,6 @@ class testsuite extends control */ public function createLib() { - $this->lang->menugroup->testsuite = 'caselib'; - if(!empty($_POST)) { $libID = $this->testsuite->createLib(); @@ -487,8 +481,6 @@ class testsuite extends control */ public function createCase($libID, $moduleID = 0, $param = 0) { - $this->lang->menugroup->testsuite = 'caselib'; - if(!empty($_POST)) { $caseResult = $this->loadModel('testcase')->create($bugID = 0); @@ -573,7 +565,6 @@ class testsuite extends control */ public function batchCreateCase($libID, $moduleID = 0) { - $this->lang->menugroup->testsuite = 'caselib'; $this->loadModel('testcase'); if(!empty($_POST)) { @@ -614,8 +605,6 @@ class testsuite extends control */ public function libView($libID) { - $this->lang->menugroup->testsuite = 'caselib'; - $lib = $this->testsuite->getById($libID); /* Set lib menu. */