From 4b591de8f948f5f481294ad84332c9e9d3518a45 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 25 Feb 2013 21:39:53 +0000 Subject: [PATCH] Fix column default preferences, include auto refresh in 'As default' --- .../inc/class.etemplate_widget_nextmatch.inc.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/etemplate/inc/class.etemplate_widget_nextmatch.inc.php b/etemplate/inc/class.etemplate_widget_nextmatch.inc.php index 0e8876ce5e..a9d2582886 100644 --- a/etemplate/inc/class.etemplate_widget_nextmatch.inc.php +++ b/etemplate/inc/class.etemplate_widget_nextmatch.inc.php @@ -753,13 +753,18 @@ class etemplate_widget_nextmatch extends etemplate_widget list($app) = explode('.',$this->attrs['template']); if($GLOBALS['egw_info']['user']['apps']['admin'] && $app) { - $pref_name = 'nextmatch-' . (isset($value['columnselection_pref']) ? $value['columnselection_pref'] : $this->attrs['template'].'-details'); + $pref_name = 'nextmatch-' . (isset($value['columnselection_pref']) ? $value['columnselection_pref'] : $this->attrs['template']); // Columns already saved to user's preferences, use from there - $cols = $GLOBALS['egw']->preferences->read(); - $cols = $cols[$app][$pref_name]; + $prefs = $GLOBALS['egw']->preferences->read(); + $cols = $prefs[$app][$pref_name]; $GLOBALS['egw']->preferences->add($app,$pref_name,is_array($cols) ? implode(',',$cols) : $cols,'default'); + // Autorefresh + $refresh = $prefs[$app][$pref_name."-autorefresh"]; + $GLOBALS['egw']->preferences->add($app,$pref_name."-autorefresh",(int)$refresh,'default'); + $GLOBALS['egw']->preferences->save_repository(false,'default'); + $prefs = $GLOBALS['egw']->preferences->read(); } } $validated[$form_name] = $value;