From b68d7f7274b5cf508d0dfc1d069de2ed6672336f Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 17 Mar 2015 18:24:50 +0000 Subject: [PATCH] Include lettersearch when forcing preferences --- etemplate/inc/class.etemplate_widget_nextmatch.inc.php | 9 ++++++++- etemplate/js/et2_extension_nextmatch.js | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/etemplate/inc/class.etemplate_widget_nextmatch.inc.php b/etemplate/inc/class.etemplate_widget_nextmatch.inc.php index 3daa81b5f9..a7b59c90b2 100644 --- a/etemplate/inc/class.etemplate_widget_nextmatch.inc.php +++ b/etemplate/inc/class.etemplate_widget_nextmatch.inc.php @@ -1056,19 +1056,25 @@ class etemplate_widget_nextmatch extends etemplate_widget { $GLOBALS['egw']->preferences->delete($app,$pref_name,'forced'); $GLOBALS['egw']->preferences->delete($app,$refresh_pref_name,'forced'); + $GLOBALS['egw']->preferences->delete($app,$pref_name.'-size','forced'); + $GLOBALS['egw']->preferences->delete($app,$pref_name.'-lettersearch','forced'); $GLOBALS['egw']->preferences->save_repository(true,'forced'); } // Set columns + refresh as default for all users // Columns included in submit, preference might not be updated yet $cols = $value['selectcols']; - $GLOBALS['egw']->preferences->read(); + $GLOBALS['egw']->preferences->read_repository(true); $GLOBALS['egw']->preferences->add($app,$pref_name,is_array($cols) ? implode(',',$cols) : $cols, $pref_level); // Autorefresh $refresh = $value['nm_autorefresh']; $GLOBALS['egw']->preferences->add($app,$refresh_pref_name,(int)$refresh,$pref_level); + // Lettersearch + $lettersearch = is_array($cols) && in_array('lettersearch', $cols); + $GLOBALS['egw']->preferences->add($app,$pref_name.'-lettersearch',(int)$lettersearch,$pref_level); + $GLOBALS['egw']->preferences->save_repository(true,$pref_level); $GLOBALS['egw']->preferences->read(true); @@ -1077,6 +1083,7 @@ class etemplate_widget_nextmatch extends etemplate_widget // Clear column + refresh preference so users go back to default $GLOBALS['egw']->preferences->delete_preference($app,$pref_name); $GLOBALS['egw']->preferences->delete_preference($app,$pref_name.'-size'); + $GLOBALS['egw']->preferences->delete_preference($app,$pref_name.'-lettersearch'); $GLOBALS['egw']->preferences->delete_preference($app,$refresh_pref_name); } } diff --git a/etemplate/js/et2_extension_nextmatch.js b/etemplate/js/et2_extension_nextmatch.js index afb34c64bb..c10480dff2 100644 --- a/etemplate/js/et2_extension_nextmatch.js +++ b/etemplate/js/et2_extension_nextmatch.js @@ -1379,6 +1379,10 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput, et2_IPrin // Set default or clear forced? if(defaultCheck.get_value()) { + if(show_letters) + { + self.activeFilters.selectcols.push('lettersearch'); + } self.getInstanceManager().submit(); } self.selectPopup = null;