diff --git a/config/zentaopms.php b/config/zentaopms.php index 8ae47750ff..42c169bf6a 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -174,6 +174,7 @@ define('TABLE_JOB', '`' . $config->db->prefix . 'job`'); define('TABLE_COMPILE', '`' . $config->db->prefix . 'compile`'); define('TABLE_REPO', '`' . $config->db->prefix . 'repo`'); +define('TABLE_RELATION', '`' . $config->db->prefix . 'relation`'); define('TABLE_REPOHISTORY', '`' . $config->db->prefix . 'repohistory`'); define('TABLE_REPOFILES', '`' . $config->db->prefix . 'repofiles`'); define('TABLE_REPOBRANCH', '`' . $config->db->prefix . 'repobranch`'); diff --git a/db/zentao.sql b/db/zentao.sql index 0da0e83e8b..788f33a110 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -1119,6 +1119,23 @@ CREATE TABLE IF NOT EXISTS `zt_repo` ( PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +-- DROP TABLE IF EXISTS `zt_relation`; +CREATE TABLE `zt_relation` ( + `id` int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY, + `program` mediumint(8) NOT NULL, + `product` mediumint(8) NOT NULL, + `project` mediumint(8) NOT NULL, + `AType` char(30) NOT NULL, + `AID` mediumint(8) NOT NULL, + `AVersion` char(30) NOT NULL, + `relation` char(30) NOT NULL, + `BType` char(30) NOT NULL, + `BID` mediumint(8) NOT NULL, + `BVersion` char(30) NOT NULL, + `extra` char(30) NOT NULL, + UNIQUE KEY `relation` (`relation`,`AType`,`BType`, `AID`, `BID`) +) ENGINE='MyISAM' DEFAULT CHARSET=utf8; + -- DROP TABLE IF EXISTS `zt_repobranch`; CREATE TABLE IF NOT EXISTS `zt_repobranch` ( `repo` mediumint(8) unsigned NOT NULL, diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 1fdf3d4af3..ba6d054ad2 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -24,6 +24,7 @@ $lang->story->edit = "Edit Story"; $lang->story->batchEdit = "Batch Edit"; $lang->story->subdivide = 'Decompose'; $lang->story->subdivideAction = 'Decompose Story'; +$lang->story->splitRequirent = 'Decompose'; $lang->story->close = 'Close'; $lang->story->closeAction = 'Close Story'; $lang->story->batchClose = 'Batch Close'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 9a213896a2..b4286f9271 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -24,6 +24,7 @@ $lang->story->edit = "编辑"; $lang->story->batchEdit = "批量编辑"; $lang->story->subdivide = '细分'; $lang->story->subdivideAction = "细分{$lang->storyCommon}"; +$lang->story->splitRequirent = '拆分'; $lang->story->close = '关闭'; $lang->story->closeAction = "关闭{$lang->storyCommon}"; $lang->story->batchClose = '批量关闭'; diff --git a/module/story/model.php b/module/story/model.php index 4f621c4953..135d0b17fb 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -840,7 +840,7 @@ class storyModel extends model ->batchCheck($this->config->story->close->requiredFields, 'notempty') ->where('id')->eq($storyID)->exec(); $changes = common::createChanges($oldStory, $newStory); - $actionID = $this->action->create('story', $storyID, 'Closed', '', 'Subdivided'); + $actionID = $this->loadModel('action')->create('story', $storyID, 'Closed', '', 'Subdivided'); $this->action->logHistory($actionID, $changes); return $actionID; diff --git a/module/story/view/batchcreate.html.php b/module/story/view/batchcreate.html.php index 8875232d60..f3955135f8 100644 --- a/module/story/view/batchcreate.html.php +++ b/module/story/view/batchcreate.html.php @@ -134,5 +134,6 @@ $(function() }); }); + diff --git a/module/story/view/change.html.php b/module/story/view/change.html.php index 43c0000a9b..23a02d6a2a 100644 --- a/module/story/view/change.html.php +++ b/module/story/view/change.html.php @@ -88,4 +88,5 @@ spec);?> verify);?> +type);?> diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 80c54e50cd..5746476a64 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -216,4 +216,5 @@ story->module);?> + diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index 28ab2624f5..9812e04ba4 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -278,4 +278,5 @@ +type);?> diff --git a/module/story/view/review.html.php b/module/story/view/review.html.php index d0e5ae6a87..6aae25cbe4 100644 --- a/module/story/view/review.html.php +++ b/module/story/view/review.html.php @@ -94,4 +94,5 @@ var assignedTo = 'lastEditedBy ? print($story->lastEditedBy) : pri id);?> +type);?> diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 0e26604693..9bec07fc79 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -74,9 +74,10 @@ common::printIcon('story', 'review', "storyID=$story->id", $story, 'button', '', '', 'showinonlybody'); if($story->status != 'closed' and !isonlybody()) { - $misc = "class='btn' data-toggle='modal' data-type='iframe' data-width='95%'"; - $link = $this->createLink('story', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', true); - if(common::hasPriv('story', 'batchCreate')) echo html::a($link, " " . $lang->story->subdivide, '', $misc); + $divideLang = ($story->type == 'story' || !$story->type) ? $lang->story->subdivide : $lang->story->splitRequirent; + $misc = "class='btn divideStory' data-toggle='modal' data-type='iframe' data-width='95%'"; + $link = $this->createLink('story', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', true); + if(common::hasPriv('story', 'batchCreate')) echo html::a($link, " " . $divideLang, '', $misc); } common::printIcon('story', 'assignTo', "storyID=$story->id", $story, 'button', '', '', 'iframe showinonlybody', true); @@ -108,7 +109,7 @@ echo "
"; common::printIcon('story', 'edit', "storyID=$story->id", $story); - common::printIcon('story', 'create', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", $story, 'button', 'copy', '', '', true, "data-width='1050'"); + common::printIcon('story', 'create', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id&projectID=0&bugID=0&planID=0&todoID=0&extra=&type=$story->type", $story, 'button', 'copy', '', '', true, "data-width='1050'"); common::printIcon('story', 'delete', "storyID=$story->id", $story, 'button', 'trash', 'hiddenwin'); ?> @@ -400,6 +401,7 @@ js::set('createStory', $lang->story->create); js::set('productID', $story->product); js::set('branch', $story->branch); js::set('moduleID', $story->module); +js::set('storyType', $story->type); ?>