diff --git a/module/story/view/header.html.php b/module/story/view/header.html.php index 5e72a353b0..769e6aec09 100644 --- a/module/story/view/header.html.php +++ b/module/story/view/header.html.php @@ -11,6 +11,17 @@ */ function loadProduct(productID) { + if(siblings && productID != oldProductID) + { + confirmRelievedSiblings = confirm(relievedSiblingsTip); + if(!confirmRelievedSiblings) + { + $('#product').val(oldProductID); + $('#product').trigger("chosen:updated"); + return false; + } + } + if(typeof parentStory != 'undefined' && parentStory) { confirmLoadProduct = confirm(moveChildrenTips); From 646b34a04e1adb30e22331e8cae8766ec01865e0 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Thu, 3 Nov 2022 10:09:35 +0800 Subject: [PATCH 037/386] * Fix ajaxRelieved for story. --- module/story/control.php | 5 ++--- module/story/js/common.js | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index eb9b306212..1e9545dee3 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -2753,11 +2753,10 @@ class story extends control { $siblingID = !empty($_POST['siblingID']) ? $_POST['siblingID'] : 0; $story = $this->story->getByID($siblingID); + $siblings = explode(',', trim($story->siblings, ',')); if(empty($story->siblings)) return $this->send(array('result' => 'fail')); - $siblings = str_replace(",$siblingID", '', $story->siblings); - /* batchUnset siblingID from siblings.*/ $replaceSql = "UPDATE " . TABLE_STORY . " SET siblings = REPLACE(siblings,',$siblingID,', ',') WHERE `product` = $story->product"; $this->dbh->exec($replaceSql); @@ -2766,6 +2765,6 @@ class story extends control $this->dao->update(TABLE_STORY)->set('siblings')->eq('')->where('id')->eq($siblingID)->orWhere('siblings')->eq(',')->exec(); if(!dao::isError()) $this->loadModel('action')->create('story', $siblingID, 'relieved'); - return $this->send(array('result' => 'success', 'data' => $siblings)); + return $this->send(array('result' => 'success', 'silbingsCount' => count($siblings)-1)); } } diff --git a/module/story/js/common.js b/module/story/js/common.js index f0481757a9..51c47c3603 100644 --- a/module/story/js/common.js +++ b/module/story/js/common.js @@ -109,13 +109,13 @@ $('[data-toggle="popover"]').each(function(item) { function relieve(index) { - $.post(relieveURL, {storyID:storyID, siblingID:index}, function(data){ + $.post(relieveURL, {siblingID:index}, function(data){ $('[data-id="' + index + '"]').popover('hide'); if(data.result == 'success') { - if(data.data.length !== 0) $('[data-id="' + index + '"]').parent('li').remove(); - if(data.data.length == 0 || index == storyID) + if(data.silbingsCount != 0) $('[data-id="' + index + '"]').parent('li').remove(); + if(data.silbingsCount == 0 || index == storyID) { $('[href="#legendSiblings"]').parent('li').next('li').addClass('active');; $('[href="#legendSiblings"]').parent('li').remove(); From 0b25f8972503539a3f44e11597885fa5603fa909 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 3 Nov 2022 02:29:36 +0000 Subject: [PATCH 038/386] * Add condition of edit page. --- module/story/view/header.html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/story/view/header.html.php b/module/story/view/header.html.php index 769e6aec09..d323bf8bcd 100644 --- a/module/story/view/header.html.php +++ b/module/story/view/header.html.php @@ -11,7 +11,7 @@ */ function loadProduct(productID) { - if(siblings && productID != oldProductID) + if(page == 'edit' && siblings && productID != oldProductID) { confirmRelievedSiblings = confirm(relievedSiblingsTip); if(!confirmRelievedSiblings) @@ -248,4 +248,4 @@ function loadProductReviewers(productID) } }); } - \ No newline at end of file + From 9f93db829ab36cbfcf0b14d2ad6221a1eb336c4d Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 3 Nov 2022 10:41:21 +0800 Subject: [PATCH 039/386] switch product fix --- module/story/view/create.html.php | 1 + module/story/view/header.html.php | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index b04c50041e..6e3f024204 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -383,6 +383,7 @@ foreach(explode(',', $config->story->create->requiredFields) as $field) story->module);?> story->plan);?> +