From 984bbf4d44440da32bcda5ca2190fb6959b7f85d Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 16 Mar 2015 22:28:18 +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 f92102d4a2..5dde80c4bd 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 a7a2b2a6a3..7c214ceeb9 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;