diff --git a/module/action/lang/de.php b/module/action/lang/de.php index f11ff708dd..273f1eb867 100644 --- a/module/action/lang/de.php +++ b/module/action/lang/de.php @@ -224,6 +224,7 @@ $lang->action->desc->reopen = '$date, reopened by $actoraction->desc->merged = '$date, merged by $actor .' . "\n"; $lang->action->desc->submitreview = '$date, submitted for review by $actor.' . "\n"; $lang->action->desc->ganttmove = '$date, sort by $actor .' . "\n"; +$lang->action->desc->relieved = '$date, relieved by $actor .' . "\n"; /* Used to describe the history of operations related to parent-child tasks. */ $lang->action->desc->createchildren = '$date, $actor created a child task $extra。' . "\n"; diff --git a/module/action/lang/en.php b/module/action/lang/en.php index fbdaf2970f..b6202e131d 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -224,6 +224,7 @@ $lang->action->desc->reopen = '$date, reopened by $actoraction->desc->merged = '$date, merged by $actor .' . "\n"; $lang->action->desc->submitreview = '$date, submitted for review by $actor.' . "\n"; $lang->action->desc->ganttmove = '$date, sort by $actor .' . "\n"; +$lang->action->desc->relieved = '$date, relieved by $actor .' . "\n"; /* Used to describe the history of operations related to parent-child tasks. */ $lang->action->desc->createchildren = '$date, $actor created a child task $extra。' . "\n"; diff --git a/module/action/lang/fr.php b/module/action/lang/fr.php index 1e033620da..e8dd3c9eee 100644 --- a/module/action/lang/fr.php +++ b/module/action/lang/fr.php @@ -224,6 +224,7 @@ $lang->action->desc->reopen = '$date, reopened by $actoraction->desc->merged = '$date, merged by $actor .' . "\n"; $lang->action->desc->submitreview = '$date, submitted for review by $actor.' . "\n"; $lang->action->desc->ganttmove = '$date, sort by $actor .' . "\n"; +$lang->action->desc->relieved = '$date, relieved by $actor .' . "\n"; /* Used to describe the history of operations related to parent-child tasks. */ $lang->action->desc->createchildren = '$date, $actor a créé un sous-tâche $extra。' . "\n"; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 9da2fc3667..406172d195 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -224,6 +224,7 @@ $lang->action->desc->reopen = '$date, 由 $actor $lang->action->desc->merged = '$date, 由 $actor 合并。' . "\n"; $lang->action->desc->submitreview = '$date, 由 $actor 提交评审。' . "\n"; $lang->action->desc->ganttmove = '$date, 由 $actor 排序。' . "\n"; +$lang->action->desc->relieved = '$date, 由 $actor 解除孪生需求关系。' . "\n"; /* 用来描述和父子任务相关的操作历史记录。*/ $lang->action->desc->createchildren = '$date, 由 $actor 创建子任务 $extra。' . "\n"; diff --git a/module/story/control.php b/module/story/control.php index c7717c80e0..4e5fecc46e 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1296,32 +1296,33 @@ class story extends control $position[] = $this->lang->story->common; $position[] = $this->lang->story->view; - $this->view->title = $title; - $this->view->position = $position; - $this->view->product = $product; - $this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id); - $this->view->plan = $plan; - $this->view->bugs = $bugs; - $this->view->fromBug = $fromBug; - $this->view->cases = $cases; - $this->view->story = $story; - $this->view->linkedMRs = $linkedMRs; - $this->view->track = $this->story->getTrackByID($story->id); - $this->view->users = $this->user->getPairs('noletter'); - $this->view->reviewers = $reviewers; - $this->view->relations = $this->story->getStoryRelation($story->id, $story->type); - $this->view->executions = $this->execution->getPairs(0, 'all', 'nocode'); - $this->view->execution = empty($story->execution) ? array() : $this->dao->findById($story->execution)->from(TABLE_EXECUTION)->fetch(); - $this->view->actions = $this->action->getList('story', $storyID); - $this->view->storyModule = $storyModule; - $this->view->modulePath = $modulePath; - $this->view->storyProducts = $storyProducts; - $this->view->version = $version; - $this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('story', $storyID); - $this->view->from = $from; - $this->view->param = $param; - $this->view->builds = $this->loadModel('build')->getStoryBuilds($storyID); - $this->view->releases = $this->loadModel('release')->getStoryReleases($storyID); + $this->view->title = $title; + $this->view->position = $position; + $this->view->product = $product; + $this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id); + $this->view->siblings = !empty($story->siblings) ? $this->story->getByList($story->siblings) : array(); + $this->view->plan = $plan; + $this->view->bugs = $bugs; + $this->view->fromBug = $fromBug; + $this->view->cases = $cases; + $this->view->story = $story; + $this->view->linkedMRs = $linkedMRs; + $this->view->track = $this->story->getTrackByID($story->id); + $this->view->users = $this->user->getPairs('noletter'); + $this->view->reviewers = $reviewers; + $this->view->relations = $this->story->getStoryRelation($story->id, $story->type); + $this->view->executions = $this->execution->getPairs(0, 'all', 'nocode'); + $this->view->execution = empty($story->execution) ? array() : $this->dao->findById($story->execution)->from(TABLE_EXECUTION)->fetch(); + $this->view->actions = $this->action->getList('story', $storyID); + $this->view->storyModule = $storyModule; + $this->view->modulePath = $modulePath; + $this->view->storyProducts = $storyProducts; + $this->view->version = $version; + $this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('story', $storyID); + $this->view->from = $from; + $this->view->param = $param; + $this->view->builds = $this->loadModel('build')->getStoryBuilds($storyID); + $this->view->releases = $this->loadModel('release')->getStoryReleases($storyID); $this->display(); } @@ -2741,4 +2742,29 @@ class story extends control return print(html::select('URS[]', $URS, $requirementList, "class='form-control chosen' multiple")); } + + /** + * AJAX: Deleted story sibling. + * + * @access public + * @return void + */ + public function ajaxRelieveSibling() + { + $siblingID = !empty($_POST['siblingID']) ? $_POST['siblingID'] : 0; + $story = $this->story->getByID($siblingID); + + if(empty($story->siblings)) return $this->send(array('result' => 'fail')); + + $siblings = str_replace(",$siblingID", '', $story->siblings); + + /* If siblings == ,$siblingID, update siblings empty.*/ + if(count(explode(',', $siblings)) == 3) $siblings = ''; + + $this->dao->update(TABLE_STORY)->set('siblings')->eq('')->where('id')->eq($siblingID)->exec(); + $this->dao->update(TABLE_STORY)->set('siblings')->eq($siblings)->where('siblings')->like("%,{$_POST['siblingID']},%")->exec(); + + if(!dao::isError()) $this->loadModel('action')->create('story', $siblingID, 'relieved'); + return $this->send(array('result' => 'success', 'data' => $siblings)); + } } diff --git a/module/story/css/common.css b/module/story/css/common.css index 3baf85cc15..1eb34136d8 100644 --- a/module/story/css/common.css +++ b/module/story/css/common.css @@ -17,3 +17,13 @@ .c-source {width: 130px} .c-note {width: 100px} .c-category {width: 90px} + +.icon-info {color: #ff9800; border-color: #ff9800;} +.text-active {text-decoration: underline;} +.text-cancel {text-decoration: underline;color:#838a9d;margin-left:10px;} +.popover {border:unset;} +.popover.bottom .arrow{border-bottom-color:#ffffff;} +.popover-icon {float:left;} +.popover .content {margin-left:20px;overflow: overlay;} +.hide {display:none !important;} +.sibling {padding:6px;} diff --git a/module/story/js/common.js b/module/story/js/common.js index 5e6525c4eb..79bd8d2224 100644 --- a/module/story/js/common.js +++ b/module/story/js/common.js @@ -86,3 +86,47 @@ function loadURS() $('#URS').chosen(); }); } + +$('.sibling').mouseover(function() { + $(this).parent('ul').find('a.unlink').addClass('hide'); + $(this).find('.unlink').removeClass('hide'); +}); +$('.sibling').mouseenter(function() { + $('[data-toggle="popover"]').popover('hide'); +}); +$('.sibling').mouseout(function() { + $(this).find('.unlink').addClass('hide'); +}); + +$('[data-toggle="popover"]').each(function(item) { + $index = $(this).attr('data-id'); + $(this).popover({ + placement: 'bottom', + html: true, + content: '
' + relievedTip + '
' + }); +}) + +function relieve(index) +{ + $.post(relieveURL, {storyID:storyID, 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) + { + $('[href="#legendSiblings"]').parent('li').next('li').addClass('active');; + $('[href="#legendSiblings"]').parent('li').remove(); + $('#legendSiblings').next('div').addClass('active'); + $('#legendSiblings').remove(); + } + } + }, 'json'); +} + +function popoverCancel(index) +{ + $('[data-id="' + index + '"]').popover('hide').addClass('hide'); +} diff --git a/module/story/lang/de.php b/module/story/lang/de.php index 5a28ddb553..3fd7cebe11 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -76,6 +76,9 @@ $lang->story->undetermined = 'undetermined'; $lang->story->order = 'Order'; $lang->story->saveDraft = 'Save as draft'; $lang->story->doNotSubmit = 'Do Not Submit'; +$lang->story->currentBranch = 'Current Branch'; +$lang->story->sibling = 'Sibling story'; +$lang->story->relieved = 'Relieved'; $lang->story->editAction = "Edit {$lang->SRCommon}"; $lang->story->changeAction = "Change Story"; @@ -97,6 +100,7 @@ $lang->story->float = "『%s』should be positive number, decimals in $lang->story->saveDraftSuccess = 'Save as draft succeeded.'; $lang->story->changeSyncTip = "The modification of this story will be synchronized to the following twin requirements"; $lang->story->syncTip = "The twin story are synchronized except for product, branch, module, plan, and stage. After the twin relationship is dissolved, they are no longer synchronized."; +$lang->story->relievedTip = "The twin relationship cannot be restored after dissolving, the content of the demand is no longer synchronized, whether to dissolving?"; $lang->story->id = 'ID'; $lang->story->parent = 'Parent'; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index f65cb2f83b..2b5b16b79e 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -76,6 +76,9 @@ $lang->story->undetermined = 'undetermined'; $lang->story->order = 'Order'; $lang->story->saveDraft = 'Save as draft'; $lang->story->doNotSubmit = 'Do Not Submit'; +$lang->story->currentBranch = 'Current Branch'; +$lang->story->sibling = 'Sibling story'; +$lang->story->relieved = 'Relieved'; $lang->story->editAction = "Edit {$lang->SRCommon}"; $lang->story->changeAction = "Change {$lang->SRCommon}"; @@ -97,6 +100,7 @@ $lang->story->float = "『%s』should have positive number, or decima $lang->story->saveDraftSuccess = 'Save as draft succeeded.'; $lang->story->changeSyncTip = "The modification of this story will be synchronized to the following twin requirements"; $lang->story->syncTip = "The twin story are synchronized except for product, branch, module, plan, and stage. After the twin relationship is dissolved, they are no longer synchronized."; +$lang->story->relievedTip = "The twin relationship cannot be restored after dissolving, the content of the demand is no longer synchronized, whether to dissolving?"; $lang->story->id = 'ID'; $lang->story->parent = 'Parent'; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index 7981c32ea0..d044e700a7 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -76,6 +76,9 @@ $lang->story->undetermined = 'undetermined'; $lang->story->order = 'Order'; $lang->story->saveDraft = 'Save as draft'; $lang->story->doNotSubmit = 'Do Not Submit'; +$lang->story->currentBranch = 'Current Branch'; +$lang->story->sibling = 'Sibling story'; +$lang->story->relieved = 'Relieved'; $lang->story->editAction = "Edit {$lang->SRCommon}"; $lang->story->changeAction = "Changer Story"; @@ -97,6 +100,7 @@ $lang->story->float = "『 %s 』doit avoir des nombres positifs ou d $lang->story->saveDraftSuccess = 'Save as draft succeeded.'; $lang->story->changeSyncTip = "The modification of this story will be synchronized to the following twin requirements"; $lang->story->syncTip = "The twin story are synchronized except for product, branch, module, plan, and stage. After the twin relationship is dissolved, they are no longer synchronized."; +$lang->story->relievedTip = "The twin relationship cannot be restored after dissolving, the content of the demand is no longer synchronized, whether to dissolving?"; $lang->story->id = 'ID'; $lang->story->parent = 'Parent'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 952c89de11..44cf6d20c6 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -76,6 +76,9 @@ $lang->story->undetermined = '待定'; $lang->story->order = '排序'; $lang->story->saveDraft = '存为草稿'; $lang->story->doNotSubmit = '保存暂不提交'; +$lang->story->currentBranch = '当前分支'; +$lang->story->sibling = '孪生需求'; +$lang->story->relieved = '解除'; $lang->story->editAction = "编辑{$lang->SRCommon}"; $lang->story->changeAction = "变更{$lang->SRCommon}"; @@ -97,6 +100,7 @@ $lang->story->float = "『%s』应当是正数,可以是小数。"; $lang->story->saveDraftSuccess = '存为草稿成功'; $lang->story->changeSyncTip = "该需求的修改会同步到如下的孪生需求"; $lang->story->syncTip = "孪生需求间除产品、分支 、模块、计划、阶段外均同步,孪生关系解除后不再同步"; +$lang->story->relievedTip = "孪生关系解除后无法恢复,需求的内容不再同步,是否解除?"; $lang->story->id = '编号'; $lang->story->parent = '父需求'; diff --git a/module/story/view/blocksibling.html.php b/module/story/view/blocksibling.html.php new file mode 100644 index 0000000000..def4a3e836 --- /dev/null +++ b/module/story/view/blocksibling.html.php @@ -0,0 +1,27 @@ +id); +js::set('relieved', $lang->story->relieved); +js::set('relievedTip', $lang->story->relievedTip); +js::set('cancel', $lang->cancel); +$canViewLinkStory = common::hasPriv('story', 'view'); + +foreach($siblings as $id => $sibling) +{ + if($story->branch == $sibling->branch) continue; + unset($siblings[$id]); + $siblings[] = $sibling; +} + +foreach($siblings as $sibling) +{ + $id = $sibling->id; + $title = $id . ' '. $sibling->title; + $branch = $story->branch == $sibling->branch ? $lang->story->currentBranch : $branches[$sibling->branch]; + echo "
  • "; + echo "{$branch} "; + echo ($canViewLinkStory ? html::a($this->createLink('story', 'view', "id=$id", '', true), "$title", '', "class='iframe' data-width='80%'") : "$id $title"); + echo ""; + echo "
  • "; +} +?> diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index a4d3d9b26f..db46505375 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -401,6 +401,9 @@
    + type != 'normal'):?> +
    +
      + +
    +
    + config->URAndSR):?>
      @@ -639,7 +649,6 @@ js::set('unlink', $lang->story->unlink); js::set('cancel', $lang->cancel); js::set('rawModule', $this->app->rawModule); ?> - +