Fix admin changing their columns set the default for all users

This commit is contained in:
Nathan Gray 2015-09-21 21:41:54 +00:00
parent 999b9f8724
commit e791caf622
2 changed files with 16 additions and 8 deletions

View File

@ -1043,7 +1043,17 @@ class etemplate_widget_nextmatch extends etemplate_widget
{ {
$pref_name = 'nextmatch-' . (isset($content_value['columnselection_pref']) ? $content_value['columnselection_pref'] : $this->attrs['template']); $pref_name = 'nextmatch-' . (isset($content_value['columnselection_pref']) ? $content_value['columnselection_pref'] : $this->attrs['template']);
$refresh_pref_name = $pref_name.'-autorefresh'; $refresh_pref_name = $pref_name.'-autorefresh';
$pref_level = $value['nm_col_preference'] == 'force' ? 'forced' : 'default'; switch($value['nm_col_preference']) {
case 'force':
$pref_level = 'forced';
break;
case 'reset':
case 'default':
$pref_level = 'default';
break;
default:
$pref_level = 'user';
}
// Clear forced pref before setting default // Clear forced pref before setting default
if($pref_level != 'forced') if($pref_level != 'forced')

View File

@ -1421,15 +1421,13 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput, et2_IPrin
// Auto refresh // Auto refresh
self._set_autorefresh(autoRefresh.get_value()); self._set_autorefresh(autoRefresh.get_value());
// Set default or clear forced? // Set default or clear forced
if(defaultCheck.get_value()) if(show_letters)
{ {
if(show_letters) self.activeFilters.selectcols.push('lettersearch');
{
self.activeFilters.selectcols.push('lettersearch');
}
self.getInstanceManager().submit();
} }
self.getInstanceManager().submit();
self.selectPopup = null; self.selectPopup = null;
}; };