From 2513fcb7d79fb5c9b9df86182789cc45603b689d Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 25 Apr 2016 14:49:59 +0000 Subject: [PATCH] - For print column dialog don't check individual customfields if no customfields are selected - Fix afterPrint failing if columnselection preference had no nextmatch prefix --- api/js/etemplate/et2_extension_nextmatch.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/et2_extension_nextmatch.js b/api/js/etemplate/et2_extension_nextmatch.js index 71a8e4edc2..c74abf05a8 100644 --- a/api/js/etemplate/et2_extension_nextmatch.js +++ b/api/js/etemplate/et2_extension_nextmatch.js @@ -2061,7 +2061,10 @@ var et2_nextmatch = (function(){ "use strict"; return et2_DOMWidget.extend([et2_ for(var field_name in widget.customfields) { columns[widget.prefix+field_name] = " - "+widget.customfields[field_name].label; - if(widget.options.fields[field_name]) columns_selected.push(et2_customfields_list.prototype.prefix+field_name); + if(widget.options.fields[field_name] && columns_selected.indexOf(colName) >= 0) + { + columns_selected.push(et2_customfields_list.prototype.prefix+field_name); + } } } } @@ -2228,7 +2231,21 @@ var et2_nextmatch = (function(){ "use strict"; return et2_DOMWidget.extend([et2_ } // Restore columns - this.set_columns(this.egw().preference(this.options.settings.columnselection_pref,this.getInstanceManager().app)); + var pref = []; + var app = this.getInstanceManager().app; + if(this.options.settings.columnselection_pref.indexOf('nextmatch') == 0) + { + pref = egw.preference(this.options.settings.columnselection_pref, app); + } + else + { + // 'nextmatch-' prefix is there in preference name, but not in setting, so add it in + pref = egw.preference("nextmatch-"+this.options.settings.columnselection_pref, app); + } + if(pref) + { + this.set_columns(pref,app); + } this.dynheight.outerNode.css('max-width','inherit'); this.resize(); }