* Code for task#74151,#74155.

This commit is contained in:
xieqiyu
2022-11-03 02:02:38 +00:00
parent affde0c45f
commit d5f1e2a741
9 changed files with 120 additions and 32 deletions
+2 -1
View File
@@ -109,7 +109,8 @@ $('[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')
+9 -6
View File
@@ -99,12 +99,14 @@ $lang->story->successToTask = "Converted to task.";
$lang->story->storyRound = '%s time estimation';
$lang->story->float = "『%s』should be positive number, decimals included.";
$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->assignSyncTip = "Both twin stories modify the assignor synchronously";
$lang->story->closeSyncTip = "Twin stories are closed synchronously";
$lang->story->activateSyncTip = "Twin stories are activated synchronously";
$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->assignSyncTip = "Both twin stories modify the assignor synchronously";
$lang->story->closeSyncTip = "Twin stories are closed synchronously";
$lang->story->activateSyncTip = "Twin stories are activated synchronously";
$lang->story->relievedSiblingsTip = "After product adjustment, the twin relationship of this story will be automatically removed, and the story will no longer be synchronized. Do you want to save?";
$lang->story->id = 'ID';
$lang->story->parent = 'Parent';
@@ -483,6 +485,7 @@ $lang->story->operateList['closed'] = 'closed';
$lang->story->operateList['activated'] = 'activated';
$lang->story->operateList['changed'] = 'changed';
$lang->story->operateList['reviewed'] = 'reviewed';
$lang->story->operateList['edited'] = 'edited';
$lang->requirement->common = $lang->URCommon;
$lang->requirement->create = 'Create Requirement';
+9 -6
View File
@@ -99,12 +99,14 @@ $lang->story->successToTask = "Converted to task.";
$lang->story->storyRound = '%s time estimation';
$lang->story->float = "『%s』should have positive number, or decimals.";
$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->assignSyncTip = "Both twin stories modify the assignor synchronously";
$lang->story->closeSyncTip = "Twin stories are closed synchronously";
$lang->story->activateSyncTip = "Twin stories are activated synchronously";
$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->assignSyncTip = "Both twin stories modify the assignor synchronously";
$lang->story->closeSyncTip = "Twin stories are closed synchronously";
$lang->story->activateSyncTip = "Twin stories are activated synchronously";
$lang->story->relievedSiblingsTip = "After product adjustment, the twin relationship of this story will be automatically removed, and the story will no longer be synchronized. Do you want to save?";
$lang->story->id = 'ID';
$lang->story->parent = 'Parent';
@@ -483,6 +485,7 @@ $lang->story->operateList['closed'] = 'closed';
$lang->story->operateList['activated'] = 'activated';
$lang->story->operateList['changed'] = 'changed';
$lang->story->operateList['reviewed'] = 'reviewed';
$lang->story->operateList['edited'] = 'edited';
$lang->requirement->common = $lang->URCommon;
$lang->requirement->create = 'Create Requirement';
+9 -6
View File
@@ -99,12 +99,14 @@ $lang->story->successToTask = "Converted to task.";
$lang->story->storyRound = '%s time estimation';
$lang->story->float = "『 %s 』doit avoir des nombres positifs ou décimaux.";
$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->assignSyncTip = "Both twin stories modify the assignor synchronously";
$lang->story->closeSyncTip = "Twin stories are closed synchronously";
$lang->story->activateSyncTip = "Twin stories are activated synchronously";
$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->assignSyncTip = "Both twin stories modify the assignor synchronously";
$lang->story->closeSyncTip = "Twin stories are closed synchronously";
$lang->story->activateSyncTip = "Twin stories are activated synchronously";
$lang->story->relievedSiblingsTip = "After product adjustment, the twin relationship of this story will be automatically removed, and the story will no longer be synchronized. Do you want to save?";
$lang->story->id = 'ID';
$lang->story->parent = 'Parent';
@@ -483,6 +485,7 @@ $lang->story->operateList['closed'] = 'closed';
$lang->story->operateList['activated'] = 'activated';
$lang->story->operateList['changed'] = 'changed';
$lang->story->operateList['reviewed'] = 'reviewed';
$lang->story->operateList['edited'] = 'edited';
$lang->requirement->common = $lang->URCommon;
$lang->requirement->create = 'Create Requirement';
+8 -5
View File
@@ -93,11 +93,13 @@ $lang->story->successToTask = "Converted to task.";
$lang->story->storyRound = '%s time estimation';
$lang->story->float = "『%s』should be positive number, decimals included.";
$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->assignSyncTip = "Both twin stories modify the assignor synchronously";
$lang->story->closeSyncTip = "Twin stories are closed synchronously";
$lang->story->activateSyncTip = "Twin stories are activated synchronously";
$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->assignSyncTip = "Both twin stories modify the assignor synchronously";
$lang->story->closeSyncTip = "Twin stories are closed synchronously";
$lang->story->activateSyncTip = "Twin stories are activated synchronously";
$lang->story->relievedSiblingsTip = "After product adjustment, the twin relationship of this story will be automatically removed, and the story will no longer be synchronized. Do you want to save?";
$lang->story->id = 'ID';
$lang->story->parent = 'Mẹ';
@@ -470,3 +472,4 @@ $lang->story->operateList['closed'] = 'closed';
$lang->story->operateList['activated'] = 'activated';
$lang->story->operateList['changed'] = 'changed';
$lang->story->operateList['reviewed'] = 'reviewed';
$lang->story->operateList['edited'] = 'edited';
+9 -6
View File
@@ -99,12 +99,14 @@ $lang->story->successToTask = '批量转任务成功';
$lang->story->storyRound = '第 %s 轮估算';
$lang->story->float = "『%s』应当是正数,可以是小数。";
$lang->story->saveDraftSuccess = '存为草稿成功';
$lang->story->changeSyncTip = "该需求的修改会同步到如下的孪生需求";
$lang->story->syncTip = "孪生需求间除产品、分支 、模块、计划、阶段外均同步,孪生关系解除后不再同步";
$lang->story->relievedTip = "孪生关系解除后无法恢复,需求的内容不再同步,是否解除?";
$lang->story->assignSyncTip = "孪生需求均同步修改指派人";
$lang->story->closeSyncTip = "孪生需求均同步关闭";
$lang->story->activateSyncTip = "孪生需求均同步激活";
$lang->story->changeSyncTip = "该需求的修改会同步到如下的孪生需求";
$lang->story->syncTip = "孪生需求间除产品、分支 、模块、计划、阶段外均同步,孪生关系解除后不再同步";
$lang->story->relievedTip = "孪生关系解除后无法恢复,需求的内容不再同步,是否解除?";
$lang->story->assignSyncTip = "孪生需求均同步修改指派人";
$lang->story->closeSyncTip = "孪生需求均同步关闭";
$lang->story->activateSyncTip = "孪生需求均同步激活";
$lang->story->relievedSiblingsTip = '产品调整后,本需求自动解除孪生关系,需求不再同步,是否保存?';
$lang->story->id = '编号';
$lang->story->parent = '父需求';
@@ -483,6 +485,7 @@ $lang->story->operateList['closed'] = '关闭';
$lang->story->operateList['activated'] = '激活';
$lang->story->operateList['changed'] = '变更';
$lang->story->operateList['reviewed'] = '评审';
$lang->story->operateList['edited'] = '编辑';
$lang->requirement->common = $lang->URCommon;
$lang->requirement->create = "提{$lang->URCommon}";
+61 -2
View File
@@ -910,6 +910,14 @@ class storyModel extends model
->remove('files,labels,comment,contactListMenu,stages,reviewer,needNotReview')
->get();
/* Relieve siblings when change product. */
if(!empty($oldStory->siblings) and $story->product != $oldStory->product)
{
$this->dbh->exec("UPDATE " . TABLE_STORY . " SET siblings = REPLACE(siblings, ',$storyID,', ',') WHERE `product` = $oldStory->product");
$this->dao->update(TABLE_STORY)->set('siblings')->eq('')->where('id')->eq($storyID)->orWhere('siblings')->eq(',')->exec();
$oldStory->siblings = '';
}
if($oldStory->type == 'story' and !isset($story->linkStories)) $story->linkStories = '';
if($oldStory->type == 'requirement' and !isset($story->linkRequirements)) $story->linkRequirements = '';
if($oldStory->status == 'changing' and $story->status == 'draft') $story->status = 'changing';
@@ -961,6 +969,19 @@ class storyModel extends model
->beginIF($oldStory->status == 'reviewing')->andWhere('reviewer')->notin(implode(',', $_POST['reviewer']))
->exec();
/* Sync siblings. */
if(!empty($oldStory->siblings))
{
foreach(explode(',', trim($oldStory->siblings, ',')) as $siblingID)
{
$this->dao->delete()->from(TABLE_STORYREVIEW)
->where('story')->eq($siblingID)
->andWhere('version')->eq($oldStory->version)
->beginIF($oldStory->status == 'reviewing')->andWhere('reviewer')->notin(implode(',', $_POST['reviewer']))
->exec();
}
}
foreach($_POST['reviewer'] as $reviewer)
{
if($oldStory->status == 'reviewing' and in_array($reviewer, array_keys($oldReviewer))) continue;
@@ -970,6 +991,16 @@ class storyModel extends model
$reviewData->version = $oldStory->version;
$reviewData->reviewer = $reviewer;
$this->dao->insert(TABLE_STORYREVIEW)->data($reviewData)->exec();
/* Sync siblings. */
if(!empty($oldStory->siblings))
{
foreach(explode(',', trim($oldStory->siblings, ',')) as $siblingID)
{
$reviewData->story = $siblingID;
$this->dao->insert(TABLE_STORYREVIEW)->data($reviewData)->exec();
}
}
}
if($oldStory->status == 'reviewing') $story = $this->updateStoryByReview($storyID, $oldStory, $story);
@@ -1007,6 +1038,18 @@ class storyModel extends model
$data->verify = $story->verify;
$data->files = $story->files = $addedFiles . trim($storyFiles, ',');
$this->dao->update(TABLE_STORYSPEC)->data($data)->where('story')->eq((int)$storyID)->andWhere('version')->eq($oldStory->version)->exec();
/* Sync siblings. */
if(!empty($oldStory->siblings))
{
foreach(explode(',', trim($oldStory->siblings, ',')) as $siblingID)
{
$this->dao->update(TABLE_STORYSPEC)->data($data)
->where('story')->eq((int)$siblingID)
->andWhere('version')->eq($oldStory->version)
->exec();
}
}
}
if($story->product != $oldStory->product)
@@ -1136,6 +1179,8 @@ class storyModel extends model
if(isset($story->finalResult)) $this->recordReviewAction($story);
}
if(!empty($oldStory->siblings)) $this->syncSiblings($oldStory->id, $oldStory->siblings, $changes, 'Edited');
return true;
}
}
@@ -1549,14 +1594,26 @@ class storyModel extends model
/* Fix bug #671. */
$this->lang->story->closedReason = $this->lang->story->rejectedReason;
$this->dao->update(TABLE_STORYREVIEW)->set('result')->eq($this->post->result)->set('reviewDate')->eq($now)->where('story')->eq($storyID)->andWhere('version')->eq($oldStory->version)->andWhere('reviewer')->eq($this->app->user->account)->exec();
$this->dao->update(TABLE_STORYREVIEW)
->set('result')->eq($this->post->result)
->set('reviewDate')->eq($now)
->where('story')->eq($storyID)
->andWhere('version')->eq($oldStory->version)
->andWhere('reviewer')->eq($this->app->user->account)
->exec();
/* Sync siblings. */
if(!empty($oldStory->siblings))
{
foreach(explode(',', trim($oldStory->siblings, ',')) as $siblingID)
{
$this->dao->update(TABLE_STORYREVIEW)->set('result')->eq($this->post->result)->set('reviewDate')->eq($now)->where('story')->eq($siblingID)->andWhere('version')->eq($oldStory->version)->andWhere('reviewer')->eq($this->app->user->account)->exec();
$this->dao->update(TABLE_STORYREVIEW)
->set('result')->eq($this->post->result)
->set('reviewDate')->eq($now)
->where('story')->eq($siblingID)
->andWhere('version')->eq($oldStory->version)
->andWhere('reviewer')->eq($this->app->user->account)
->exec();
}
}
@@ -6211,6 +6268,8 @@ class storyModel extends model
$syncFieldList[$fieldName] = $fieldValue;
}
if(empty($syncFieldList)) return;
/* Synchronize and record dynamics. */
$this->loadModel('action');
$siblings = explode(',', trim($siblings, ','));
+2
View File
@@ -24,6 +24,8 @@
<?php js::set('feedbackSource', $config->story->feedbackSource); ?>
<?php js::set('storyStatus', $story->status);?>
<?php js::set('lastReviewer', explode(',', $lastReviewer))?>
<?php js::set('siblings', $story->siblings)?>
<?php js::Set('relievedSiblingsTip', $lang->story->relievedSiblingsTip)?>
<div class='main-content' id='mainContent'>
<form method='post' enctype='multipart/form-data' target='hiddenwin' id='dataform'>
<div class='main-header'>
+11
View File
@@ -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);