From a2371bf82fa506647529ae0a22309171acdff80e Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Tue, 28 May 2024 14:10:39 +0800 Subject: [PATCH] * Fix bug #50201. --- module/story/config/form.php | 2 +- module/story/control.php | 2 ++ module/story/zen.php | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/module/story/config/form.php b/module/story/config/form.php index 14d96a6a95..124b4840d4 100644 --- a/module/story/config/form.php +++ b/module/story/config/form.php @@ -95,7 +95,7 @@ $config->story->form->batchCreate['keywords'] = array('ditto' => false, 'type' $config->story->form->batchCreate['mailto'] = array('ditto' => false, 'type' => 'array', 'control' => 'select', 'required' => false, 'width' => '200px', 'default' => array(''), 'multiple' => true, 'options' => 'users', 'filter' => 'join'); $config->story->form->batchEdit = array(); -$config->story->form->batchEdit['branch'] = array('type' => 'int', 'width' => '200px', 'control' => 'picker', 'required' => false, 'default' => 0, 'options' => array()); +$config->story->form->batchEdit['branch'] = array('type' => 'string', 'width' => '200px', 'control' => 'picker', 'required' => false, 'default' => '', 'options' => array()); $config->story->form->batchEdit['module'] = array('type' => 'int', 'width' => '200px', 'control' => array('control' => 'picker', 'required' => true), 'required' => false, 'default' => 0, 'options' => array()); $config->story->form->batchEdit['plan'] = array('type' => 'int', 'width' => '200px', 'control' => 'picker', 'required' => false, 'default' => 0, 'options' => array()); $config->story->form->batchEdit['title'] = array('type' => 'string', 'width' => '240px', 'control' => array('control' => 'colorInput', 'inputClass' => 'filter-none'), 'required' => true, 'filter' => 'trim', 'base' => true); diff --git a/module/story/control.php b/module/story/control.php index aa43b074bc..dd79e449c9 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -366,6 +366,8 @@ class story extends control $this->storyZen->setFormOptionsForBatchEdit($productID, $executionID, $stories); + foreach($stories as $story) $story->branch = 'branch' . $story->branch; + $this->view->title = $this->lang->story->batchEdit; $this->view->productID = $productID; $this->view->branch = $branch; diff --git a/module/story/zen.php b/module/story/zen.php index 67446b3c2b..a9a19d588b 100644 --- a/module/story/zen.php +++ b/module/story/zen.php @@ -842,7 +842,7 @@ class storyZen extends story { $options = $this->getFormOptionsForSingleProduct($storyProduct->id, $executionID, $storyProduct); if($options['branchProduct'] && !$branchProduct) $branchProduct = true; - if($options['branchProduct']) $branchTagOption[$storyProduct->id] = array(BRANCH_MAIN => $this->lang->branch->main) + $options['branchTagOption'][$storyProduct->id]; + if($options['branchProduct']) $branchTagOption[$storyProduct->id] = $options['branchTagOption'][$storyProduct->id]; $modules += $options['modules']; $plans += $options['plans']; if(empty($plans[$storyProduct->id])) $plans[$storyProduct->id][0] = $plans[$storyProduct->id]; @@ -908,7 +908,7 @@ class storyZen extends story if($branchProduct) { $branches = $this->branch->getList($productID, $executionID, 'all'); - foreach($branches as $branchInfo) $branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : ''); + foreach($branches as $branchInfo) $branchTagOption['branch' . $branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : ''); $branches = array_keys($branches); } @@ -1505,6 +1505,7 @@ class storyZen extends story $story->lastEditedBy = $this->app->user->account; $story->lastEditedDate = $now; $story->stage = empty($story->stage) ? $oldStory->stage : $story->stage; + $story->branch = !isset($story->branch) ? $oldStory->branch : str_replace('branch', '', $story->branch); if($oldStory->assignedTo != $story->assignedTo) $story->assignedDate = $now; if($oldStory->parent < 0) $story->plan = '';