diff --git a/module/doc/css/objectlibs.css b/module/doc/css/objectlibs.css
index 1cadc6f3f0..e78f8ac770 100644
--- a/module/doc/css/objectlibs.css
+++ b/module/doc/css/objectlibs.css
@@ -16,6 +16,7 @@
.main-col .doc-title .actions a + a {margin-left: 8px;}
.main-col .doc-title .actions i {font-size: 15px; color: #8c8c8c;}
#content .title {max-width: 54%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
+#content .detail-content {padding-left: 10px;}
#mainContent .scrollbar-hover {max-height: 2000px; overflow: scroll;}
#sidebar {width: 275px;}
#sidebar>.cell {width: 100%;}
diff --git a/module/execution/css/common.css b/module/execution/css/common.css
index b944d263d0..b3f5061a7b 100644
--- a/module/execution/css/common.css
+++ b/module/execution/css/common.css
@@ -27,4 +27,3 @@
#whitelistBox .checkbox-inline, #whitelistBox .radio-inline {margin-left: 10px; display: inline-block; padding-left: 0px; padding-right: 10px;}
.main-table > .table-responsive {padding: 0 1px; background: #fff;}
-#teams_chosen ul li:first-child {max-width:256px; display: inline-block; vertical-align: middle;}
diff --git a/module/execution/css/create.css b/module/execution/css/create.css
index dd61b6bbba..d482356317 100644
--- a/module/execution/css/create.css
+++ b/module/execution/css/create.css
@@ -14,5 +14,4 @@
.checkbox input[type=checkbox], .checkbox-inline input[type=checkbox], .radio input[type=radio], .radio-inline input[type=radio] {margin-top: 1px;}
#lifeTimeTips {display: none;}
-#teams_chosen ul > li:first-child {max-width: 425px;}
#teams_chosen ul .label {margin-top: 3px;}
diff --git a/module/execution/js/batchedit.js b/module/execution/js/batchedit.js
new file mode 100644
index 0000000000..9017c3682f
--- /dev/null
+++ b/module/execution/js/batchedit.js
@@ -0,0 +1,13 @@
+$(function()
+{
+ $('[id^="projects"]').change(function()
+ {
+ executionID = $(this).attr('id').replace('projects', '');
+ $td = $(this).closest('td');
+ if($td.find('[id^="syncStories"]').length == 0)
+ {
+ $td.append("");
+ }
+ $("#syncStories" + executionID).val(confirm(confirmSyncStories) ? 'yes' : 'no');
+ })
+});
diff --git a/module/execution/js/create.js b/module/execution/js/create.js
index fd90c0791f..8f82a97143 100644
--- a/module/execution/js/create.js
+++ b/module/execution/js/create.js
@@ -48,8 +48,11 @@ $(function()
{
if(systemMode == 'new')
{
+ var maxWidth = $('.chosen-container .chosen-drop.chosen-auto-max-width.in').width() - 70;
+
$('#teams_chosen ul .label').remove();
$('#teams_chosen ul li:first').after(' ');
+ $('#teams_chosen ul > li:first').attr('style', 'display: inline-block; vertical-align: middle; max-width: ' + maxWidth + 'px');
}
})
diff --git a/module/execution/js/edit.js b/module/execution/js/edit.js
index e17d014f62..6149182c46 100644
--- a/module/execution/js/edit.js
+++ b/module/execution/js/edit.js
@@ -19,10 +19,14 @@ $(function()
$(this).siblings('div').find('span').attr('title', tip);
}
});
-
+
oldProject = $("#project").val();
$('#project').change(function()
{
- if(!confirm('修改所属项目后,执行关联的原项目需求如果要更改所属项目,需手动修改到新项目,是否继续修改?')) $("#project").val(oldProject).trigger("chosen:updated");
+ if($('#submit').closest('td').find('#syncStories').length == 0)
+ {
+ $('#submit').after("");
+ }
+ $("#syncStories").val(confirm(confirmSyncStories) ? 'yes' : 'no');
});
})
diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php
index d3b5f6dea1..b0b406b2b5 100644
--- a/module/execution/lang/zh-cn.php
+++ b/module/execution/lang/zh-cn.php
@@ -315,6 +315,7 @@ $lang->execution->linkAllStoryTip = "(项目下还未关联{$lang->SRCommon}
$lang->execution->confirmDelete = "您确定删除{$lang->executionCommon}[%s]吗?";
$lang->execution->confirmUnlinkMember = "您确定从该{$lang->executionCommon}中移除该用户吗?";
$lang->execution->confirmUnlinkStory = "您确定从该{$lang->executionCommon}中移除该{$lang->SRCommon}吗?";
+$lang->execution->confirmSyncStories = "修改所属项目后,执行关联的{$lang->SRCommon}是否同步到新项目中?";
$lang->execution->confirmUnlinkExecutionStory = "您确定从该项目中移除该{$lang->SRCommon}吗?";
$lang->execution->notAllowedUnlinkStory = "该{$lang->SRCommon}已经与项目下{$lang->executionCommon}相关联,请从{$lang->executionCommon}中移除后再操作。";
$lang->execution->notAllowRemoveProducts = "该{$lang->productCommon}中的{$lang->SRCommon}已与该{$lang->executionCommon}进行了关联,请取消关联后再操作。";
diff --git a/module/execution/model.php b/module/execution/model.php
index 35a0472e04..3ed0a6c0ed 100644
--- a/module/execution/model.php
+++ b/module/execution/model.php
@@ -473,7 +473,7 @@ class executionModel extends model
->setDefault('team', $this->post->name)
->join('whitelist', ',')
->stripTags($this->config->execution->editor->edit['id'], $this->config->allowedTags)
- ->remove('products, branch, uid, plans')
+ ->remove('products, branch, uid, plans, syncStories')
->get();
if($this->config->systemMode == 'new' and (empty($execution->project) or $execution->project == $oldExecution->project)) $this->checkBeginAndEndDate($oldExecution->project, $execution->begin, $execution->end);
@@ -544,7 +544,7 @@ class executionModel extends model
{
$execution->parent = $execution->project;
$execution->path = ",{$execution->project},{$executionID},";
- $this->changeProject($execution->project, $oldExecution->project, $executionID);
+ $this->changeProject($execution->project, $oldExecution->project, $executionID, $this->post->syncStories);
}
$this->file->updateObjectID($this->post->uid, $executionID, 'execution');
@@ -649,7 +649,7 @@ class executionModel extends model
{
$execution->parent = $execution->project;
$execution->path = ",{$execution->project},{$executionID},";
- $this->changeProject($execution->project, $oldExecution->project, $executionID);
+ $this->changeProject($execution->project, $oldExecution->project, $executionID, isset($_POST['syncStories'][$executionID]) ? $_POST['syncStories'][$executionID] : 'no');
}
$changedAccounts = array();
@@ -2104,10 +2104,11 @@ class executionModel extends model
* @param int $newProject
* @param int $oldProject
* @param int $executionID
+ * @param string $syncStories yes|no
* @access public
* @return void
*/
- public function changeProject($newProject, $oldProject, $executionID)
+ public function changeProject($newProject, $oldProject, $executionID, $syncStories = 'no')
{
if($newProject == $oldProject) return;
@@ -2157,6 +2158,22 @@ class executionModel extends model
$addedAccounts[$account] = $account;
}
+ /* Sync stories to new project. */
+ if($syncStories == 'yes')
+ {
+ $this->loadModel('action');
+ $projectLinkedStories = $this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($newProject)->fetchPairs('story', 'story');
+ $executionLinkedStories = $this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($executionID)->fetchAll();
+ foreach($executionLinkedStories as $linkedStory)
+ {
+ if(isset($projectLinkedStories[$linkedStory->story])) continue;
+
+ $linkedStory->project = $newProject;
+ $this->dao->insert(TABLE_PROJECTSTORY)->data($linkedStory)->exec();
+ $this->action->create('story', $linkedStory->story, 'linked2project', '', $newProject);
+ }
+ }
+
if($addedAccounts) $this->loadModel('user')->updateUserView($newProject, 'project', $addedAccounts);
}
@@ -2448,7 +2465,7 @@ class executionModel extends model
*/
public function getTeamPairsByProject($projectID = 0)
{
- if(empty($projectID)) return array();
+ if(empty($projectID) and $this->config->systemMode == 'new') return array();
$teams = $this->dao->select('id,name,type')->from(TABLE_PROJECT)
->where('deleted')->eq(0)
diff --git a/module/execution/view/batchedit.html.php b/module/execution/view/batchedit.html.php
index 8d9d0ed0de..027eddac5e 100755
--- a/module/execution/view/batchedit.html.php
+++ b/module/execution/view/batchedit.html.php
@@ -132,4 +132,5 @@
execution->weekend);?>
+execution->confirmSyncStories);?>
diff --git a/module/execution/view/edit.html.php b/module/execution/view/edit.html.php
index 3014a6f578..3e614444a5 100644
--- a/module/execution/view/edit.html.php
+++ b/module/execution/view/edit.html.php
@@ -173,4 +173,5 @@
execution->errorSameProducts);?>
execution->notAllowRemoveProducts);?>
+execution->confirmSyncStories);?>
diff --git a/module/upgrade/model.php b/module/upgrade/model.php
index 58c203aea7..dd28676d03 100644
--- a/module/upgrade/model.php
+++ b/module/upgrade/model.php
@@ -705,6 +705,7 @@ class upgradeModel extends model
$this->appendExec('15_3');
case '15_4':
$this->saveLogs('Execute 15_4');
+ $this->execSQL($this->getUpgradeFile('15.4'));
if(empty($this->config->isINT))
{
if(!$executeXuanxuan)
@@ -908,6 +909,7 @@ class upgradeModel extends model
case '15_2': $confirmContent .= file_get_contents($this->getUpgradeFile('15.2'));
case '15_3': $confirmContent .= file_get_contents($this->getUpgradeFile('15.3'));
case '15_4':
+ $confirmContent .= file_get_contents($this->getUpgradeFile('15.4'));
if(empty($this->config->isINT))
{
$xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan4.2.sql';