From f8ff73708673af544d94ce8b4355fe87340a7cc1 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 13 Apr 2016 10:42:19 +0800 Subject: [PATCH] * finish task #2532. --- lib/base/front/front.class.php | 4 +- module/story/config.php | 2 + module/story/control.php | 5 +++ module/story/model.php | 3 ++ module/story/view/batchedit.html.php | 66 +++++++++++++++------------- 5 files changed, 47 insertions(+), 33 deletions(-) diff --git a/lib/base/front/front.class.php b/lib/base/front/front.class.php index 937679a8d9..a2bd0f7a55 100644 --- a/lib/base/front/front.class.php +++ b/lib/base/front/front.class.php @@ -990,9 +990,7 @@ EOT; static public function reload($window = 'self') { $js = self::start(); - $js .= "var href = $window.location.href;\n"; - $js .= "$window.location.href = href.indexOf('#') < 0 ? href : href.substring(0, href.indexOf('#'));"; - + $js .= "$window.location.reload();\n"; $js .= self::end(); return $js; } diff --git a/module/story/config.php b/module/story/config.php index 8b4192b0f4..3dff16432e 100644 --- a/module/story/config.php +++ b/module/story/config.php @@ -41,10 +41,12 @@ $config->story->list->exportFields = ' childStories, linkStories, duplicateStory, files'; $config->story->list->customCreateFields = 'source,verify,pri,estimate,mailto,keywords'; $config->story->list->batchCreateFields = 'module,plan,source,spec,verify,pri,estimate,review,keywords'; +$config->story->list->batchEditFields = 'module,plan,estimate,pri,assignedTo,source,stage,closedBy,closedReason,keywords'; $config->story->custom = new stdclass(); $config->story->custom->create = $config->story->list->customCreateFields; $config->story->custom->batchcreate = 'module,plan,spec,pri,estimate,review'; +$config->story->custom->batchedit = 'module,plan,estimate,pri,source,stage,closedBy,closedReason'; $config->story->datatable = new stdclass(); $config->story->datatable->defaultField = array('id', 'pri', 'title', 'plan', 'source', 'openedBy', 'assignedTo', 'estimate', 'status', 'stage', 'actions'); diff --git a/module/story/control.php b/module/story/control.php index 0163ba7686..5d3cadb439 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -430,6 +430,11 @@ class story extends control $this->lang->story->stageList['ditto'] = $this->lang->story->ditto; $this->lang->story->reasonList['ditto'] = $this->lang->story->ditto; + /* Set Custom*/ + foreach(explode(',', $this->config->story->list->batchEditFields) as $field) $customFields[$field] = $this->lang->story->$field; + $this->view->customFields = $customFields; + $this->view->showFields = $this->config->story->custom->batchedit; + /* Judge whether the editedStories is too large and set session. */ $showSuhosinInfo = false; $showSuhosinInfo = $this->loadModel('common')->judgeSuhosinSetting(count($stories), $this->config->story->batchEdit->columns); diff --git a/module/story/model.php b/module/story/model.php index 8622667cae..5dc52f0caf 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -522,9 +522,12 @@ class storyModel extends model $story->title = $data->titles[$storyID]; $story->estimate = $data->estimates[$storyID]; $story->pri = $data->pris[$storyID]; + $story->assignedTo = $data->assignedTo[$storyID]; + $story->assignedDate = $oldStory == $data->assignedTo[$storyID] ? $oldStory->assignedDate : $now; $story->module = $data->modules[$storyID]; $story->plan = $data->plans[$storyID]; $story->source = $data->sources[$storyID]; + $story->keywords = $data->keywords[$storyID]; $story->stage = isset($data->stages[$storyID]) ? $data->stages[$storyID] : $oldStory->stage; $story->closedBy = isset($data->closedBys[$storyID]) ? $data->closedBys[$storyID] : $oldStory->closedBy; $story->closedReason = isset($data->closedReasons[$storyID]) ? $data->closedReasons[$storyID] : $oldStory->closedReason; diff --git a/module/story/view/batchedit.html.php b/module/story/view/batchedit.html.php index 5809889e6b..fa2d1cf61a 100644 --- a/module/story/view/batchedit.html.php +++ b/module/story/view/batchedit.html.php @@ -19,23 +19,35 @@ icons['product']) . ' ' . $lang->story->product . $lang->colon . ' ' . $productName;?> +
+ +
+
"> - - - + + + - - - + + + + - - - + + + >story->closedReason;?> + @@ -54,28 +66,19 @@ ?> - - + + - - - + + + + - - status != 'draft'):?> - - - - + + status == 'closed'):?> - - - - - - status == 'closed'):?> - - + + - + - +
idAB;?>story->module;?>story->planAB;?> idAB;?>'>story->module;?>'>story->planAB;?> story->title;?> story->estimateAB;?> priAB;?> story->source;?>'> story->estimateAB;?>'> priAB;?>'> story->assignedTo;?>'> story->source;?> story->status;?> story->stageAB;?>story->closedBy;?>story->closedReason;?>'> story->stageAB;?>'>story->closedBy;?>'>story->keywords;?>
module, "class='form-control chosen'");?> plan, "class='form-control chosen'");?>' style='overflow:visible'> module, "class='form-control chosen'");?>' style='overflow:visible'> plan, "class='form-control chosen'");?> title, 'class=form-control'); ?>estimate, "class='form-control' autocomplete='off'"); ?>pri, 'class=form-control');?>source, 'class=form-control');?>>estimate, "class='form-control' autocomplete='off'"); ?>>pri, 'class=form-control');?>' style='overflow:visible'>assignedTo, "class='form-control chosen'");?>>source, 'class=form-control');?> story->statusList[$stories[$storyID]->status];?>stage, 'class=form-control');?>stage, 'class="form-control" disabled="disabled"');?>>stage, 'class="form-control"' . ($stories[$storyID]->status == 'draft' ? ' disabled="disabled"' : ''));?>' style='overflow:visible'>closedBy, "class='form-control" . ($stories[$storyID]->status == 'closed' ? " chosen'" : "' disabled='disabled'"));?> closedBy, "class='form-control chosen'");?>closedBy, 'class="form-control" disabled="disabled"');?> + >
@@ -91,17 +94,20 @@
closedReason, 'class="form-control" disabled="disabled"');?>>closedReason, 'class="form-control" disabled="disabled"');?> >keywords, 'class="form-control"');?>
+createLink('custom', 'ajaxSaveCustom', 'module=story§ion=custom&key=batchedit')?> +