diff --git a/module/project/js/story.js b/module/project/js/story.js index dae22c74ba..3eee9acf9b 100644 --- a/module/project/js/story.js +++ b/module/project/js/story.js @@ -16,33 +16,3 @@ function changeAction(formName, actionName, actionLink) { $('#' + formName).attr('action', actionLink).submit(); } - -/** - * unlink story. - * - * @param int $projectID - * @param int $storyID - * @access public - * @return void - */ -function unlink(projectID, storyID) -{ - if(confirm(confirmUnlinkStory)) - { - url = createLink('project', 'unlinkStory','projectID=' + projectID + '&storyID=' + storyID + '&confrim=yes'); - $.ajax( - { - type: 'GET', - url: url, - dataType: 'json', - success: function(data) - { - if(data.result == 'success') - { - url = createLink('project', 'story', 'projectID=' + projectID); - $('#projectStoryForm').load(url + ' #storyList', function(){sortTable();}); - } - } - }); - } -} diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index d251cd3d4f..01d8ba966f 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -87,8 +87,8 @@ $lang->testcase->batchCreate = $lang->testcase->create; if($productID) common::printIcon('testcase', 'batchCreate', "productID=$story->product&moduleID=$story->module&storyID=$story->id", '', 'list'); - $lang->project->unlinkStory = $lang->unlink; - echo html::a("javascript:unlink($project->id,$story->id)", ' ', '', "class='icon-green-project-unlinkStory' title='$lang->unlink'"); + $unlinkURL = $this->createLink('project', 'unlinkStory', "projectID=$project->id&storyID=$story->id&confirm=yes"); + echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"storyList\",confirmUnlinkStory)", ' ', '', "class='icon-green-productplan-unlinkStory' title='{$lang->project->unlinkStory}'"); ?>