Merge branch 'tanghucheng_zentaopms_256' into 'zentaopms_256'

* Finish task #74143.

See merge request easycorp/zentaopms!5963
This commit is contained in:
孙广明
2022-11-01 05:32:44 +00:00
13 changed files with 164 additions and 28 deletions
+1
View File
@@ -224,6 +224,7 @@ $lang->action->desc->reopen = '$date, reopened by <strong>$actor</
$lang->action->desc->merged = '$date, merged by <strong>$actor</strong> .' . "\n";
$lang->action->desc->submitreview = '$date, submitted for review by <strong>$actor</strong>.' . "\n";
$lang->action->desc->ganttmove = '$date, sort by <strong>$actor</strong> .' . "\n";
$lang->action->desc->relieved = '$date, relieved by <strong>$actor</strong> .' . "\n";
/* Used to describe the history of operations related to parent-child tasks. */
$lang->action->desc->createchildren = '$date, <strong>$actor</strong> created a child task <strong>$extra</strong>。' . "\n";
+1
View File
@@ -224,6 +224,7 @@ $lang->action->desc->reopen = '$date, reopened by <strong>$actor</
$lang->action->desc->merged = '$date, merged by <strong>$actor</strong> .' . "\n";
$lang->action->desc->submitreview = '$date, submitted for review by <strong>$actor</strong>.' . "\n";
$lang->action->desc->ganttmove = '$date, sort by <strong>$actor</strong> .' . "\n";
$lang->action->desc->relieved = '$date, relieved by <strong>$actor</strong> .' . "\n";
/* Used to describe the history of operations related to parent-child tasks. */
$lang->action->desc->createchildren = '$date, <strong>$actor</strong> created a child task <strong>$extra</strong>。' . "\n";
+1
View File
@@ -224,6 +224,7 @@ $lang->action->desc->reopen = '$date, reopened by <strong>$actor</
$lang->action->desc->merged = '$date, merged by <strong>$actor</strong> .' . "\n";
$lang->action->desc->submitreview = '$date, submitted for review by <strong>$actor</strong>.' . "\n";
$lang->action->desc->ganttmove = '$date, sort by <strong>$actor</strong> .' . "\n";
$lang->action->desc->relieved = '$date, relieved by <strong>$actor</strong> .' . "\n";
/* Used to describe the history of operations related to parent-child tasks. */
$lang->action->desc->createchildren = '$date, <strong>$actor</strong> a créé un sous-tâche <strong>$extra</strong>。' . "\n";
+1
View File
@@ -224,6 +224,7 @@ $lang->action->desc->reopen = '$date, 由 <strong>$actor</strong>
$lang->action->desc->merged = '$date, 由 <strong>$actor</strong> 合并。' . "\n";
$lang->action->desc->submitreview = '$date, 由 <strong>$actor</strong> 提交评审。' . "\n";
$lang->action->desc->ganttmove = '$date, 由 <strong>$actor</strong> 排序。' . "\n";
$lang->action->desc->relieved = '$date, 由 <strong>$actor</strong> 解除孪生需求关系。' . "\n";
/* 用来描述和父子任务相关的操作历史记录。*/
$lang->action->desc->createchildren = '$date, 由 <strong>$actor</strong> 创建子任务 <strong>$extra</strong>。' . "\n";
+52 -26
View File
@@ -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));
}
}
+10
View File
@@ -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;}
+44
View File
@@ -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: '<div class="popover-icon"><i class="icon-info"></i></div><div class="content">' + relievedTip + '</div><div class="popover-custom text-right"><a href="javascript:relieve(' + $index + ')" class="text-active btn-info">' + relieved + '</a> <a href="javascript:popoverCancel(' + $index + ');" class="text-cancel">' + cancel + '</a></div>'
});
})
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');
}
+4
View File
@@ -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';
+4
View File
@@ -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';
+4
View File
@@ -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';
+4
View File
@@ -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 = '父需求';
+27
View File
@@ -0,0 +1,27 @@
<?php
js::set('relieveURL', inlink('ajaxRelieveSibling'));
js::set('storyID', $story->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 "<li title='$title' class='sibling'>";
echo "<span class='label label-outline label-badge'>{$branch}</span> ";
echo ($canViewLinkStory ? html::a($this->createLink('story', 'view', "id=$id", '', true), "$title", '', "class='iframe' data-width='80%'") : "$id $title");
echo "<a class='unlink hide' data-id='$id' data-toggle='popover'><i class='icon icon-unlink btn-info'></i></a>";
echo "</li>";
}
?>
+11 -2
View File
@@ -401,6 +401,9 @@
<div class="cell">
<div class='tabs'>
<ul class='nav nav-tabs'>
<?php if($product->type != 'normal' and $story->siblings):?>
<li><a href='#legendSiblings' data-toggle='tab'><?php echo $lang->story->sibling;?></a></li>
<?php endif;?>
<?php if($this->config->URAndSR):?>
<li class='active'><a href='#legendStories' data-toggle='tab'><?php echo $story->type == 'story' ? $lang->story->requirement : $lang->story->story;?></a></li>
<?php endif;?>
@@ -410,6 +413,13 @@
<li><a href='#legendRelated' data-toggle='tab'><?php echo $lang->story->legendRelated;?></a></li>
</ul>
<div class='tab-content'>
<?php if($product->type != 'normal'):?>
<div class='tab-pane' id='legendSiblings'>
<ul class="list-unstyled">
<?php include './blocksibling.html.php';?>
</ul>
</div>
<?php endif;?>
<?php if($this->config->URAndSR):?>
<div class='tab-pane active' id='legendStories'>
<ul class="list-unstyled">
@@ -639,7 +649,6 @@ js::set('unlink', $lang->story->unlink);
js::set('cancel', $lang->cancel);
js::set('rawModule', $this->app->rawModule);
?>
<script>
</script>
<?php include '../../common/view/syntaxhighlighter.html.php';?>
<?php include '../../common/view/footer.html.php';?>