From 4d10b5f6573caf62836fc4e4b51d17ceedb1bb23 Mon Sep 17 00:00:00 2001 From: daitingting Date: Mon, 19 Feb 2024 05:16:25 +0000 Subject: [PATCH] * Fix bug #45741. --- module/story/control.php | 2 +- module/story/js/view.ui.js | 13 +++++++++++++ module/story/ui/view.html.php | 5 ++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 8018c60fe3..9d5be2be4e 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -1309,7 +1309,7 @@ class story extends control $this->story->linkStories($storyID, $this->post->stories); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - return $this->send(array('result' => 'success', 'callback' => 'loadCurrentPage()', 'closeModal' => true)); + return $this->send(array('result' => 'success', 'callback' => 'refreshViewModal')); } /* Get story, product, products, and queryID. */ diff --git a/module/story/js/view.ui.js b/module/story/js/view.ui.js index 8fbd703c14..d546806097 100644 --- a/module/story/js/view.ui.js +++ b/module/story/js/view.ui.js @@ -26,4 +26,17 @@ window.ajaxDelete = function(storyID) if(res) $.get($.createLink('story', 'delete', 'storyID=' + storyID + '&confirm=yes'), function(data){if(data.result == 'success') loadPage(data.load)}); }); } + $('#mainContent .files').removeClass('px-6'); + +window.refreshViewModal = function() +{ + if(isInModal) + { + loadModal($.createLink('story', 'view', 'storyID=' + storyID), $('.modal').attr('id')); + } + else + { + loadPage($.createLink('story', 'view', 'storyID=' + storyID)); + } +} diff --git a/module/story/ui/view.html.php b/module/story/ui/view.html.php index 6092dcf637..7baca229d2 100644 --- a/module/story/ui/view.html.php +++ b/module/story/ui/view.html.php @@ -17,14 +17,17 @@ if($story->type == 'requirement') $lang->story->unlinkStory = str_replace($lang->URCommon, $lang->SRCommon, $lang->story->unlinkStory); } +$isInModal = isInModal(); + data('branchID', $story->branch); data('activeMenuID', $story->type); jsVar('relievedTip', $lang->story->relievedTip); jsVar('unlinkStoryTip', $story->type == 'story' ? str_replace($lang->SRCommon, $lang->URCommon, $lang->story->unlinkStory) : $lang->story->unlinkStory); jsVar('confirmDeleteTip', $confirmDelete); jsVar('storyType', $story->type); +jsVar('storyID', $story->id); +jsVar('isInModal', $isInModal); -$isInModal = isInModal(); $otherParam = 'storyID=&projectID='; $tab = 'product'; if($this->app->rawModule == 'projectstory' or $this->app->tab == 'project')