From da5cd2aa447c205a536c997b6614da33c49ffdf3 Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Wed, 11 May 2022 03:02:28 +0000 Subject: [PATCH] * Finish task #53651. --- module/execution/js/batchedit.js | 25 ++++++++++++------------ module/execution/view/batchedit.html.php | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/module/execution/js/batchedit.js b/module/execution/js/batchedit.js index 8eb547e84f..79b1c266ef 100644 --- a/module/execution/js/batchedit.js +++ b/module/execution/js/batchedit.js @@ -1,14 +1,15 @@ -$(function() +function sync(obj, executionID, projectID) { - $('[id^="projects"]').change(function() + var $td = $(obj).closest('td'); + if($td.find('[id^="syncStories"]').length == 0) { - var executionID = $(this).attr('id').replace('projects', ''); - var $td = $(this).closest('td'); - if($td.find('[id^="sync"]').length == 0) - { - $td.append(""); - } - alert(confirmSync); - $("#sync" + executionID).val('yes'); - }) -}); + console.log($td); + $td.append(""); + } + var confirmVal = confirm(confirmSync); + $("#syncStories" + executionID).val(confirmVal ? 'yes' : 'no'); + if(!confirmVal) + { + $(obj).val(projectID).trigger("chosen:updated"); + } +}; diff --git a/module/execution/view/batchedit.html.php b/module/execution/view/batchedit.html.php index d33fbb88b5..e82cb7b529 100755 --- a/module/execution/view/batchedit.html.php +++ b/module/execution/view/batchedit.html.php @@ -83,7 +83,7 @@ systemMode == 'new' and isset($project) and $project->model == 'scrum'):?> - project, "class='form-control picker-select'");?> + project, "class='form-control picker-select' onchange='sync(this, $executionID, {$executions[$executionID]->project})'");?> name, "class='form-control'");?> code, "class='form-control'");?>