From 6f70fd827c6fd37797d2cf6dbb01ce76f18ba894 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Wed, 4 Aug 2021 08:30:33 +0800 Subject: [PATCH] * Fix bug #13974. --- module/doc/control.php | 3 ++- module/doc/model.php | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index c6def4f134..2b2c02239a 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -293,7 +293,8 @@ class doc extends control if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $docID)); $objectID = zget($lib, $lib->type, ''); - $params = "type={$lib->type}&objectID=$objectID&libID={$lib->id}&docID=" . $docResult['id']; + $libType = ($lib->type == 'execution' and $this->app->openApp != 'execution') ? 'project' : $lib->type; + $params = "type={$libType}&objectID=$objectID&libID={$lib->id}&docID=" . $docResult['id']; $link = $this->createLink('doc', 'objectLibs', $params); return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link)); } diff --git a/module/doc/model.php b/module/doc/model.php index e8082f2664..46243f828c 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1070,7 +1070,7 @@ class docModel extends model } else { - $objectLibs = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere($type)->eq($objectID)->andWhere('type')->eq($type)->orderBy('`order`, id')->fetchAll('id'); + $objectLibs = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere($type)->eq($objectID)->orderBy('`order`, id')->fetchAll('id'); } if($type == 'product') @@ -1784,9 +1784,9 @@ class docModel extends model if($doc->type == 'project') $objectID = $doc->project; if($doc->type == 'execution') $objectID = $doc->execution; - $locateApp = $doc->type == 'execution' ? 'execution' : 'doc'; + $docType = ($doc->type == 'execution' and $this->app->openApp != 'execution') ? 'project' : $doc->type; - $html .= '
  • ' . html::a(inlink('objectLibs', "type={$doc->type}&objectID=$objectID&libID={$doc->lib}&docID={$doc->id}"), " " . $doc->title, '', "data-app='{$locateApp}' title='{$doc->title}'") . '
  • '; + $html .= '
  • ' . html::a(inlink('objectLibs', "type={$docType}&objectID=$objectID&libID={$doc->lib}&docID={$doc->id}"), " " . $doc->title, '', "data-app='doc' title='{$doc->title}'") . '
  • '; } $collectionCount = $this->dao->select('count(id) as count')->from(TABLE_DOC)