From a862bd46bb39f3bef7c3cf86fb5bc83a449124d0 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 2 Sep 2014 21:14:33 +0000 Subject: [PATCH] Store infolog list details/no details choice as implicit preference --- infolog/inc/class.infolog_ui.inc.php | 3 ++- infolog/js/app.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/infolog/inc/class.infolog_ui.inc.php b/infolog/inc/class.infolog_ui.inc.php index 423aed54fb..40e39e0815 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -893,7 +893,6 @@ class infolog_ui 'no_describtion' => 'no details', 'all' => 'details', ); - if(!isset($values['nm']['filter2'])) $values['nm']['filter2'] = $this->prefs['show_links']; //apply infolog_filter_change javascript method (hide/show of date filter form) over onchange filter $values['nm']['filter_onchange'] = "app.infolog.filter_change();"; @@ -915,6 +914,8 @@ class infolog_ui // Allow add actions even when there's no rows $values['nm']['placeholder_actions'] = array('new'); + if(!isset($values['nm']['filter2'])) $values['nm']['filter2'] = $this->prefs['nextmatch-'.($action ? 'infolog.'.$action : 'infolog.index.rows').'-details-pref']; + // disable columns for main entry as set in the pref for details or no details $values['nm']['columnselection_pref'] = 'nextmatch-'.($action ? 'infolog.'.$action : 'infolog.index.rows') .($values['nm']['filter2']=='all' ? '-details' : ''); diff --git a/infolog/js/app.js b/infolog/js/app.js index ce8ead3bee..717b2593f5 100644 --- a/infolog/js/app.js +++ b/infolog/js/app.js @@ -163,6 +163,9 @@ app.classes.infolog = AppJS.extend( // Show / hide descriptions this.show_details(filter2.value == 'all', nm.getDOMNode(nm)); + // Store selection as implicit preference + egw.set_preference('infolog', nm.options.settings.columnselection_pref.replace('-details','')+'-details-pref', filter2.value); + // Change preference location - widget is nextmatch nm.options.settings.columnselection_pref = nm.options.settings.columnselection_pref.replace('-details','') + (filter2.value == 'all' ? '-details' :'');