From 54d6b657991d54c2aaa0ef512f4437d6a3e9b5bf Mon Sep 17 00:00:00 2001 From: dingyongliang Date: Wed, 6 Nov 2024 14:54:57 +0800 Subject: [PATCH] * [bug#56706] select lib after moving. --- module/doc/control.php | 4 ++-- module/doc/zen.php | 18 ++++++------------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index c5da286f8c..9eef090671 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -1238,7 +1238,7 @@ class doc extends control $this->doc->moveLib($libID, $data); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - return $this->docZen->responseAfterMove($this->post->space, $spaceType, $libID); + return $this->docZen->responseAfterMove($this->post->space, $libID); } $this->docZen->setAclForCreateLib($spaceType); @@ -1294,7 +1294,7 @@ class doc extends control $this->action->logHistory($actionID, $changes); } - return $this->docZen->responseAfterMove($this->post->space, $spaceType, $data->lib, $locate, $docID); + return $this->docZen->responseAfterMove($this->post->space, $data->lib, $docID); } $projects = $this->loadModel('project')->getPairsByProgram(0, 'all', false, 'order_asc'); diff --git a/module/doc/zen.php b/module/doc/zen.php index 86d6ecdaa6..ebf3f1355f 100644 --- a/module/doc/zen.php +++ b/module/doc/zen.php @@ -392,24 +392,18 @@ class docZen extends doc * Return after move lib or doc. * * @param string $space - * @param string $spaceType * @param int $libID - * @param string $locateLink * @param int $docID * * @access protected - * @return bool|int + * @return void */ - protected function responseAfterMove(string $space, string $spaceType = 'mine', int $libID = 0, string $locateLink = '', int $docID = 0): bool|int + protected function responseAfterMove(string $space, int $libID = 0, int $docID = 0) { - if(empty($locateLink)) - { - if($spaceType == 'mine') $locateLink = $this->createLink('doc', 'mySpace', "type=mine&libID={$libID}"); - elseif($spaceType == 'custom') $locateLink = $this->createLink('doc', 'teamSpace', "objectID={$space}&libID={$libID}"); - else $locateLink = true; - } - if($locateLink === 'true') $locateLink = true; - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'docApp' => $docID ? array('executeCommand', 'handleMovedDoc', array($docID, $space, $libID)) : array('load', null, null, null, array('noLoading' => true, 'picks' => 'lib')))); + $spaceID = (int)(explode('.', $space)[1]); + if($docID) $docAppAction = array('executeCommand', 'handleMovedDoc', array($docID, $space, $libID)); + else $docAppAction = array('selectSpace', $spaceID, $libID); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'docApp' => $docAppAction)); } /**