From 2a92cee55ee5f5acb96df2f7122bc03d7c18adb0 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 30 Nov 2022 09:45:37 +0800 Subject: [PATCH] * Code for task#77794. Batch edit productplan. --- module/productplan/js/batchedit.js | 6 +++--- module/productplan/model.php | 4 ++-- module/productplan/view/batchedit.html.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/productplan/js/batchedit.js b/module/productplan/js/batchedit.js index 247b9b1772..2e06088dcb 100644 --- a/module/productplan/js/batchedit.js +++ b/module/productplan/js/batchedit.js @@ -24,13 +24,13 @@ function changeDate(planID) * Get conflict stories. * * @param int $planID - * @param int $branch * @access public * @return void */ -function getConflictStories(planID, branch) +function getConflictStories(planID) { - $.get(createLink('productplan', 'ajaxGetConflictStory', 'planID=' + planID + '&newBranch=' + branch), function(conflictStories) + var newBranch = $('#branch' + planID).val() ? $('#branch' + planID).val().toString() : ''; + $.get(createLink('productplan', 'ajaxGetConflictStory', 'planID=' + planID + '&newBranch=' + newBranch), function(conflictStories) { if(conflictStories != '' && !confirm(conflictStories)) { diff --git a/module/productplan/model.php b/module/productplan/model.php index 78e8ffbe43..dde20b69b7 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -755,7 +755,7 @@ class productplanModel extends model if(isset($data->status[$planID]) and $data->status[$planID] != 'wait') $isFuture = false; $plan = new stdclass(); - $plan->branch = isset($data->branch[$planID]) ? $data->branch[$planID] : $oldPlans[$planID]->branch; + $plan->branch = isset($data->branch[$planID]) ? join(',', $data->branch[$planID]) : $oldPlans[$planID]->branch; $plan->title = $data->title[$planID]; $plan->begin = isset($data->begin[$planID]) ? $data->begin[$planID] : ''; $plan->end = isset($data->end[$planID]) ? $data->end[$planID] : ''; @@ -788,7 +788,7 @@ class productplanModel extends model /* Determine whether the begin and end dates of the parent plan and the child plan are correct. */ if($parentID > 0) { - $parent = isset($plans[$parentID]) ? $plans[$parentID] : $this->getByID($parentID); + $parent = isset($plans[$parentID]) ? $plans[$parentID] : $this->getByID($parentID); if($parent->begin != $this->config->productplan->future and $plan->begin != $this->config->productplan->future and $plan->begin < $parent->begin) { return print(js::alert(sprintf($this->lang->productplan->beginLetterParentTip, $planID, $plan->begin, $parent->begin))); diff --git a/module/productplan/view/batchedit.html.php b/module/productplan/view/batchedit.html.php index 545a57289a..6aab7a43e0 100644 --- a/module/productplan/view/batchedit.html.php +++ b/module/productplan/view/batchedit.html.php @@ -44,7 +44,7 @@ type != 'normal'):?> parent == -1 ? "disabled='disabled'" : '';?> - id]", $plan->parent == '-1' ? '' : $branchTagOption, $plan->branch, "onchange='getConflictStories($plan->id, this.value); 'class='form-control chosen' $disabled");?> + id][]", $plan->parent == '-1' ? '' : $branchTagOption, $plan->branch, "onchange='getConflictStories($plan->id); 'class='form-control chosen' multiple $disabled");?> id]", $plan->title, "class='form-control'")?>