From 6e1f7dfbf73adcf6d021886acbb8b3cac06c713a Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Wed, 17 Nov 2021 18:06:48 +0800 Subject: [PATCH] * Finish task #44361. --- module/execution/control.php | 17 +++++++++++++++++ module/upgrade/js/mergeprogram.js | 19 +++++++++++++++++++ module/upgrade/view/mergebyproduct.html.php | 2 +- 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/module/execution/control.php b/module/execution/control.php index 144c94a87c..451b016275 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -40,6 +40,7 @@ class execution extends control $this->loadModel('project'); + if(IN_UPGRADE) return false; $this->executions = $this->execution->getPairs(0, 'all', 'nocode'); $skipCreateStep = array('computeburn', 'ajaxgetdropmenu', 'executionkanban', 'ajaxgetteammembers'); if(!in_array($this->methodName, $skipCreateStep) and $this->app->tab == 'execution') @@ -3317,4 +3318,20 @@ class execution extends control $groups = $this->lang->kanban->group->$type; die(html::select("group", $groups, $group, 'class="form-control chosen" data-max_drop_width="215"')); } + + /** + * AJAX: Update the execution name. + * + * @param int $executionID + * @param string $newExecutionName + * @access public + * @return bool + */ + public function ajaxUpdateExecutionName($executionID, $newExecutionName) + { + $this->dao->update(TABLE_EXECUTION)->set('name')->eq($newExecutionName)->where('id')->eq($executionID)->exec(); + if(dao::isError()) echo false; + + echo true; + } } diff --git a/module/upgrade/js/mergeprogram.js b/module/upgrade/js/mergeprogram.js index 12c0bae379..364bfd9402 100644 --- a/module/upgrade/js/mergeprogram.js +++ b/module/upgrade/js/mergeprogram.js @@ -1167,9 +1167,28 @@ $(function() $(this).parents('.sprintItem').next('.sprintRename').removeClass('hidden'); }) + $('.sprintRename button.name-confirm').click(function() + { + var execution = $(this).parent().siblings('input').attr('name').split('_'); + var newExecutionName = $(this).parent().siblings('input').val(); + var link = createLink('execution', 'ajaxUpdateExecutionName', 'executionID=' + execution[1] + '&newExecutionName=' + newExecutionName); + var $this = $(this); + + $.post(link, function(data) + { + if(data) + { + $this.closest('.sprintRename').addClass('hidden'); + $this.closest('.sprintRename').prev('.sprintItem').removeClass('hidden').find('.checkbox-primary label').text(newExecutionName); + } + }) + }) + $('.sprintRename button.name-cancel').click(function() { + var oldValue = $(this).closest('.sprintRename').prev('.sprintItem').find('.checkbox-primary label').text(); $(this).closest('.sprintRename').addClass('hidden'); $(this).closest('.sprintRename').prev('.sprintItem').removeClass('hidden'); + $(this).parent().siblings('input').val(oldValue); }) }) diff --git a/module/upgrade/view/mergebyproduct.html.php b/module/upgrade/view/mergebyproduct.html.php index f5d22033b7..933d1b04a3 100644 --- a/module/upgrade/view/mergebyproduct.html.php +++ b/module/upgrade/view/mergebyproduct.html.php @@ -35,7 +35,7 @@