diff --git a/module/story/css/change.css b/module/story/css/change.css index 18629745f7..c82effceff 100644 --- a/module/story/css/change.css +++ b/module/story/css/change.css @@ -2,6 +2,9 @@ #affectedProjects .table + h6 {border-top: 1px solid #ddd;} .nav-tabs>li>a {height: 36px;} .table-form>tbody>tr>th {width: 100px !important;} -.colorpicker {right: 7px; top: 7px; opacity: 1;} +.colorpicker {right: -1px; top: 7px; opacity: 1;} #twinsList td, #twinsTitle td {padding-left: 65px;} #twinsTitle td {font-weight: 700;} + +.title-group.required:after {display: none;} +.title-group.required > .required:after {display: block; right: 32px; top: 5px;} diff --git a/module/story/lang/de.php b/module/story/lang/de.php index e32e5046ec..a0932d5131 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -525,4 +525,5 @@ $lang->story->deleteBranch = 'Delete %s'; $lang->story->notice->branch = 'Each branch will establish a requirement. The requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; $lang->story->relievedTwinsRelation = 'Relieved twins relationship'; -$lang->story->relievedTwinsRelationTips = 'After the twins relationship is terminated, it cannot be restored and the shutdown of the requirement is no longer synchronized.'; \ No newline at end of file +$lang->story->relievedTwinsRelationTips = 'After the twins relationship is terminated, it cannot be restored and the shutdown of the requirement is no longer synchronized.'; +$lang->story->changeRelievedTwinsTips = 'After the twins relationship is terminated, the twin stories are no longer synchronized.'; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 5a82887fd9..3142c56cfc 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -525,4 +525,5 @@ $lang->story->deleteBranch = 'Delete %s'; $lang->story->notice->branch = 'Each branch will establish a requirement. The requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; $lang->story->relievedTwinsRelation = 'Relieved twins relationship'; -$lang->story->relievedTwinsRelationTips = 'After the twins relationship is terminated, it cannot be restored and the shutdown of the requirement is no longer synchronized.'; \ No newline at end of file +$lang->story->relievedTwinsRelationTips = 'After the twins relationship is terminated, it cannot be restored and the shutdown of the requirement is no longer synchronized.'; +$lang->story->changeRelievedTwinsTips = 'After the twins relationship is terminated, the twin stories are no longer synchronized.'; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index 3f52120952..5694e1bf3f 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -525,4 +525,5 @@ $lang->story->deleteBranch = 'Delete %s'; $lang->story->notice->branch = 'Each branch will establish a requirement. The requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; $lang->story->relievedTwinsRelation = 'Relieved twins relationship'; -$lang->story->relievedTwinsRelationTips = 'After the twins relationship is terminated, it cannot be restored and the shutdown of the requirement is no longer synchronized.'; \ No newline at end of file +$lang->story->relievedTwinsRelationTips = 'After the twins relationship is terminated, it cannot be restored and the shutdown of the requirement is no longer synchronized.'; +$lang->story->changeRelievedTwinsTips = 'After the twins relationship is terminated, the twin stories are no longer synchronized.'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 81e060b41b..56e74b951c 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -525,4 +525,5 @@ $lang->story->deleteBranch = '删除%s'; $lang->story->notice->branch = '每个分支会建立一个需求,需求间互为孪生关系。孪生需求间除产品、分支、模块、计划、阶段字段外均保持同步,后期您可以手动解除孪生关系。'; $lang->story->relievedTwinsRelation = '解除孪生关系'; -$lang->story->relievedTwinsRelationTips = '孪生关系解除后无法恢复,需求的关闭将不再同步。'; \ No newline at end of file +$lang->story->relievedTwinsRelationTips = '孪生关系解除后无法恢复,需求的关闭将不再同步。'; +$lang->story->changeRelievedTwinsTips = '孪生关系解除后无法恢复,孪生需求间内容不再同步。'; diff --git a/module/story/model.php b/module/story/model.php index f75c833318..d9c21cbc2d 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -778,7 +778,7 @@ class storyModel extends model ->get(); $story = $this->loadModel('file')->processImgURL($story, $this->config->story->editor->change['id'], $this->post->uid); - $this->dao->update(TABLE_STORY)->data($story, 'spec,verify,deleteFiles') + $this->dao->update(TABLE_STORY)->data($story, 'spec,verify,deleteFiles,relievedTwins') ->autoCheck() ->batchCheck($this->config->story->change->requiredFields, 'notempty') ->checkFlow() @@ -804,7 +804,7 @@ class storyModel extends model $this->dao->insert(TABLE_STORYSPEC)->data($data)->exec(); /* Sync twins. */ - if(!empty($oldStory->twins)) + if(!isset($story->relievedTwins) and !empty($oldStory->twins)) { foreach(explode(',', trim($oldStory->twins, ',')) as $twinID) { @@ -843,7 +843,7 @@ class storyModel extends model $this->dao->insert(TABLE_STORYREVIEW)->data($reviewData)->exec(); /* Sync twins. */ - if(!empty($oldStory->twins)) + if(!isset($story->relievedTwins) and !empty($oldStory->twins)) { foreach(explode(',', trim($oldStory->twins, ',')) as $twinID) { @@ -861,7 +861,17 @@ class storyModel extends model } $changes = common::createChanges($oldStory, $story); - if(!empty($oldStory->twins)) $this->syncTwins($oldStory->id, $oldStory->twins, $changes, 'Changed'); + + if(isset($story->relievedTwins)) + { + $this->dbh->exec("UPDATE " . TABLE_STORY . " SET twins = REPLACE(twins, ',$storyID,', ',') WHERE `product` = $oldStory->product"); + $this->dao->update(TABLE_STORY)->set('twins')->eq('')->where('id')->eq($storyID)->orWhere('twins')->eq(',')->exec(); + } + elseif(!empty($oldStory->twins)) + { + $this->syncTwins($oldStory->id, $oldStory->twins, $changes, 'Changed'); + } + return $changes; } } diff --git a/module/story/view/change.html.php b/module/story/view/change.html.php index a54f308795..e90bc1baae 100644 --- a/module/story/view/change.html.php +++ b/module/story/view/change.html.php @@ -44,14 +44,24 @@ story->title;?> -
- - - + twins) ? '' : 'title-group';?> +
+
+ title, 'class="form-control story-title"');?> +
+ + + +
+
+ twins)):?> +
+ story->relievedTwinsRelation, '', "id='relievedTwins' title='{$lang->story->changeRelievedTwinsTips}'");?> +
+
- title, 'class="form-control story-title"');?>