diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 1d3935a7a3..e8d06c435b 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -292,6 +292,7 @@ if($config->systemMode == 'new') $lang->resource->projectstory->view = 'view'; $lang->resource->projectstory->linkStory = 'linkStory'; $lang->resource->projectstory->unlinkStory = 'unlinkStory'; + $lang->resource->projectstory->batchUnlinkStory = 'batchUnlinkStory'; $lang->resource->projectstory->importplanstories = 'importplanstories'; $lang->projectstory->methodOrder[5] = 'story'; diff --git a/module/product/css/browse.css b/module/product/css/browse.css index 76e4e5f962..85ba324ec2 100644 --- a/module/product/css/browse.css +++ b/module/product/css/browse.css @@ -28,3 +28,10 @@ a.removeModule:hover {color: red;} .table td.c-estimate {padding-right: 12px;} .main-table tbody > tr.table-children > td:first-child::before {width: 3px;} @-moz-document url-prefix() {.main-table tbody > tr.table-children > td:first-child::before {width: 4px;};} + +#batchUnlinkStoryTip .modal-body {padding-top: 10px; max-height: 400px; overflow: auto;} +#batchUnlinkStoryTip .table thead {position: fixed;} +#batchUnlinkStoryTip .table tbody {position: relative; top: 33px; display:block; overflow-y: scroll; max-height: 260px;} +#batchUnlinkStoryTip .table tfoot {position: relative; bottom: -30px;} +#batchUnlinkStoryTip .table td {border-bottom: 0px;} +#batchUnlinkStoryTip .table th:first-child {width: 460px;} diff --git a/module/product/js/browse.js b/module/product/js/browse.js index da8b236200..b0beab26e1 100644 --- a/module/product/js/browse.js +++ b/module/product/js/browse.js @@ -77,6 +77,33 @@ $(function() $('#storyIdList').val(storyIdList); }); }); + + $('#batchUnlinkStory').click(function() + { + var storyIdList = ''; + $("input[name^='storyIdList']:checked").each(function() + { + storyIdList += $(this).val() + ','; + }); + + $.get(createLink('projectstory', 'batchUnlinkStory', 'projectID=' + projectID + '&storyIdList=' + storyIdList), function(data) + { + if(data) + { + $('#batchUnlinkStoryTip tbody').html(data); + $('#batchUnlinkStoryTip').modal({show: true}); + } + else + { + window.location.reload(); + } + }); + }); + + $('#batchUnlinkStoryTip .close, #confirmBtn').click(function() + { + window.location.reload(); + }) }); /** diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index c63d1c7cf5..d0c3d258a8 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -281,9 +281,10 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : ''; $canBatchChangeModule = ($canBeChanged and common::hasPriv('story', 'batchChangeModule')); $canBatchChangePlan = ($canBeChanged and common::hasPriv('story', 'batchChangePlan')); $canBatchAssignTo = ($canBeChanged and common::hasPriv('story', 'batchAssignTo')); + $canBatchUnlink = ($canBeChanged and $this->app->openApp == 'project' and common::hasPriv('projectstory', 'batchUnlinkStory')); $canBatchImportToLib = ($canBeChanged and $this->app->openApp == 'project' and isset($this->config->maxVersion) and common::hasPriv('story', 'batchImportToLib')); - $canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchReview or $canBatchChangeStage or $canBatchChangeModule or $canBatchChangePlan or $canBatchAssignTo or $canBatchImportToLib); + $canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchReview or $canBatchChangeStage or $canBatchChangeModule or $canBatchChangePlan or $canBatchAssignTo or $canBatchUnlink or $canBatchImportToLib); ?> ';?>