From cb365dbfe7ecf33ef1cb3799a73389950568af15 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Fri, 9 Apr 2021 16:20:17 +0800 Subject: [PATCH 1/2] * Add execution doc lib menu. --- module/common/lang/menu.php | 9 ++++++--- module/common/lang/zh-cn.php | 15 ++++++++------- module/doc/control.php | 3 ++- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index 0b94a30e34..b8d444dc72 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -334,7 +334,8 @@ $lang->doc->menu->recent = array('link' => "{$lang->doc->recent}|doc|browse|l $lang->doc->menu->my = array('link' => "{$lang->doc->my}|doc|browse|libID=0&browseTyp=openedbyme", 'alias' => 'my'); $lang->doc->menu->collect = array('link' => "{$lang->doc->favorite}|doc|browse|libID=0&browseTyp=collectedbyme", 'alias' => 'collect'); $lang->doc->menu->product = array('link' => "{$lang->doc->product}|doc|objectLibs|type=product", 'alias' => 'product'); -$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|objectLibs|type=project", 'alias' => 'project'); +if($config->systemMode == 'classic') $lang->doc->menu->execution = array('link' => "{$lang->doc->execution}|doc|objectLibs|type=execution", 'alias' => 'execution'); $lang->doc->menu->custom = array('link' => "{$lang->doc->custom}|doc|objectLibs|type=custom", 'alias' => 'custom'); $lang->doc->dividerMenu = ',product,'; @@ -345,11 +346,13 @@ $lang->doc->menuOrder[10] = 'recent'; $lang->doc->menuOrder[15] = 'my'; $lang->doc->menuOrder[20] = 'collect'; $lang->doc->menuOrder[25] = 'product'; -$lang->doc->menuOrder[30] = 'project'; +if($config->systemMode == 'new') $lang->doc->menuOrder[30] = 'project'; +if($config->systemMode == 'classic') $lang->doc->menuOrder[30] = 'execution'; $lang->doc->menuOrder[35] = 'custom'; $lang->doc->menu->product['subMenu'] = new stdclass(); -$lang->doc->menu->project['subMenu'] = new stdclass(); +if($config->systemMode == 'new') $lang->doc->menu->project['subMenu'] = new stdclass(); +if($config->systemMode == 'classic') $lang->doc->menu->execution['subMenu'] = new stdclass(); $lang->doc->menu->custom['subMenu'] = new stdclass(); /* Report menu.*/ diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index cefb5ce79d..4840a236c3 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -210,13 +210,14 @@ $lang->project->list = '项目列表'; $lang->execution->list = "{$lang->executionCommon}列表"; -$lang->doc->recent = '最近文档'; -$lang->doc->my = '我的文档'; -$lang->doc->favorite = '我的收藏'; -$lang->doc->product = '产品库'; -$lang->doc->project = '项目库'; -$lang->doc->custom = '自定义库'; -$lang->doc->wiki = 'WIKI'; +$lang->doc->recent = '最近文档'; +$lang->doc->my = '我的文档'; +$lang->doc->favorite = '我的收藏'; +$lang->doc->product = '产品库'; +$lang->doc->project = '项目库'; +$lang->doc->execution = "{$lang->executionCommon}库"; +$lang->doc->custom = '自定义库'; +$lang->doc->wiki = 'WIKI'; $lang->product->list = $lang->productCommon . '列表'; diff --git a/module/doc/control.php b/module/doc/control.php index b17884f505..7144a52608 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -215,7 +215,7 @@ class doc extends control if(!dao::isError()) { $objectType = $this->post->type; - if($objectType == 'execution' and $this->post->execution) + if($objectType == 'execution' and $this->post->execution and $this->config->systemMode == 'new') { $execution = $this->execution->getByID($this->post->execution); $objectType = 'project'; @@ -1037,6 +1037,7 @@ class doc extends control } else if($type == 'execution') { + $objectID = $this->execution->saveState($objectID, $objects); $table = TABLE_EXECUTION; $libs = $this->doc->getLibsByObject('execution', $objectID); From 8db49adccc762a1643f0b022ab0fc4285ad23cbf Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Fri, 9 Apr 2021 16:23:04 +0800 Subject: [PATCH 2/2] * Fix bug. --- module/doc/control.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 9870cc6316..778b899373 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -620,6 +620,8 @@ class doc extends control } else { + $doc = $this->doc->getByID($docID); + $objectType = $this->dao->select('type')->from(TABLE_DOCLIB)->where('id')->eq($doc->lib)->fetch('type'); $this->doc->delete(TABLE_DOC, $docID); /* if ajax request, send result. */ @@ -637,9 +639,7 @@ class doc extends control if($from == 'lib') { - $pos = strpos($this->session->docList, 'docID'); - $link = $pos !== false ? substr($this->session->docList, 0, $pos - 1) : $this->session->docList; - $response['locate'] = $link; + $response['locate'] = $this->createLink('doc', 'objectLibs', "type=$objectType"); } } $this->send($response);