From 67dbcb0f6b307754ad45de52666cb57de586f803 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Fri, 2 Mar 2012 14:57:31 -0500 Subject: [PATCH] lp945091 save columns independently for hold lists Teaches util.list.init a new parameter, columns_saved_under, which effectively replaces the tree/list id attribute when used to construct a filename for saving and retrieving column settings. Use this technique with holds.js so that each XUL-based hold list interface can save column configurations independently. Specifically, these interfaces: Actions for this Record -> View Holds Patron Display -> Holds Circulation -> Browse Hold Shelf Circulation -> Pull List for Hold Requests Signed-off-by: Jason Etheridge Signed-off-by: Thomas Berezansky --- Open-ILS/xul/staff_client/chrome/content/util/list.js | 11 +++++++++-- Open-ILS/xul/staff_client/server/patron/holds.js | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/list.js b/Open-ILS/xul/staff_client/chrome/content/util/list.js index df7f37d180..f62e10fdbe 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/list.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/list.js @@ -32,6 +32,9 @@ util.list.prototype = { var obj = this; obj.scratch_data = {}; + // If set, save and restore columns as if the tree/list id was the value of columns_saved_under + obj.columns_saved_under = params.columns_saved_under; + JSAN.use('util.widgets'); obj.printer_context = params.printer_context; @@ -259,7 +262,9 @@ util.list.prototype = { '_save_columns_tree' : function (params) { var obj = this; try { - var id = obj.node.getAttribute('id'); if (!id) { + var id = obj.node.getAttribute('id'); + if (obj.columns_saved_under) { id = obj.columns_saved_under; } + if (!id) { alert("FIXME: The columns for this list cannot be saved because the list has no id."); return; } @@ -298,7 +303,9 @@ util.list.prototype = { '_restores_columns_tree' : function (params) { var obj = this; try { - var id = obj.node.getAttribute('id'); if (!id) { + var id = obj.node.getAttribute('id'); + if (obj.columns_saved_under) { id = obj.columns_saved_under; } + if (!id) { alert("FIXME: The columns for this list cannot be restored because the list has no id."); return; } diff --git a/Open-ILS/xul/staff_client/server/patron/holds.js b/Open-ILS/xul/staff_client/server/patron/holds.js index bec92d3c9c..9ba18a63be 100644 --- a/Open-ILS/xul/staff_client/server/patron/holds.js +++ b/Open-ILS/xul/staff_client/server/patron/holds.js @@ -48,6 +48,8 @@ patron.holds.prototype = { obj.shelf = params['shelf']; obj.tree_id = params['tree_id']; + obj.determine_hold_interface_type(); + var progressmeter = document.getElementById('progress'); JSAN.use('circ.util'); @@ -71,6 +73,7 @@ patron.holds.prototype = { JSAN.use('util.list'); obj.list = new util.list( obj.tree_id || 'holds_list'); obj.list.init( { + 'columns_saved_under' : 'holds_' + obj.hold_interface_type, 'columns' : columns.concat( obj.list.fm_columns('acp', { '*' : { 'expanded_label' : true, 'hidden' : true }, -- 2.11.0