From ec476a96d7c57bc197569bbd81bf85ea347bf858 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 18 Jun 2014 18:29:52 +0000 Subject: [PATCH] Fix column selection not saved if columnselection pref setting had 'nextmatch-' prefix already. Fixes infolog columns not being saved --- etemplate/js/et2_extension_nextmatch.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/etemplate/js/et2_extension_nextmatch.js b/etemplate/js/et2_extension_nextmatch.js index 9b735c191e..6062c89a0c 100644 --- a/etemplate/js/et2_extension_nextmatch.js +++ b/etemplate/js/et2_extension_nextmatch.js @@ -857,17 +857,27 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], } var list = et2_csvSplit(this.options.settings.columnselection_pref, 2, "."); - var app = list[0]; + var pref = this.options.settings.columnselection_pref; + if(pref.indexOf('nextmatch') == 0) + { + app = list[0].substring('nextmatch'.length+1); + } + else + { + app = list[0]; + // 'nextmatch-' prefix is there in preference name, but not in setting, so add it in + pref = "nextmatch-"+this.options.settings.columnselection_pref; + } // Server side wants each cf listed as a seperate column jQuery.merge(colDisplay, custom_fields); // Save visible columns // 'nextmatch-' prefix is there in preference name, but not in setting, so add it in - egw.set_preference(app, "nextmatch-"+this.options.settings.columnselection_pref, colDisplay.join(",")); + egw.set_preference(app, pref, colDisplay.join(",")); // Save adjusted column sizes - egw.set_preference(app, "nextmatch-"+this.options.settings.columnselection_pref+"-size", colSize); + egw.set_preference(app, pref+"-size", colSize); // Update query value, so data source can use visible columns to exclude expensive sub-queries var oldCols = this.activeFilters.selectcols ? this.activeFilters.selectcols : [];