From: Jason Etheridge Date: Mon, 18 Jul 2011 21:17:30 +0000 (-0400) Subject: remove circ.util.std_map_row_to_columns; default to the one provided by list.js X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=cc3052adc7abb92f152a157c3d23ecda3d8fb243;p=evergreen%2Ftadl.git remove circ.util.std_map_row_to_columns; default to the one provided by list.js Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/xul/staff_client/server/admin/transit_list.js b/Open-ILS/xul/staff_client/server/admin/transit_list.js index 545a3292ea..4024ec1b93 100644 --- a/Open-ILS/xul/staff_client/server/admin/transit_list.js +++ b/Open-ILS/xul/staff_client/server/admin/transit_list.js @@ -216,7 +216,6 @@ admin.transit_list.prototype = { obj.list.init( { 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'retrieve_row' : function(params) { var row = params.row; try { diff --git a/Open-ILS/xul/staff_client/server/admin/work_log.js b/Open-ILS/xul/staff_client/server/admin/work_log.js index 88daa1abed..9a1eb75004 100644 --- a/Open-ILS/xul/staff_client/server/admin/work_log.js +++ b/Open-ILS/xul/staff_client/server/admin/work_log.js @@ -45,11 +45,10 @@ function init_lists() { list1 = new util.list('work_action_log'); list2 = new util.list('work_patron_log'); - JSAN.use('circ.util'); var columns = circ.util.work_log_columns({}); var column_mapper_func = circ.util.std_map_row_to_columns(); + JSAN.use('circ.util'); var columns = circ.util.work_log_columns({}); list1.init( { 'columns' : columns, - 'map_row_to_columns' : column_mapper_func, 'on_select' : function(ev) { JSAN.use('util.functional'); var sel = list1.retrieve_selection(); selected1 = util.functional.map_list( sel, function(o) { return JSON2js(o.getAttribute('retrieve_id')); }); diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.js b/Open-ILS/xul/staff_client/server/cat/copy_browser.js index f522ee6b1c..e56944c48b 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js @@ -1663,7 +1663,6 @@ cat.copy_browser.prototype = { { 'no_auto_select' : true, 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(' '), 'retrieve_row' : function(params) { var row = params.row; diff --git a/Open-ILS/xul/staff_client/server/cat/copy_buckets.js b/Open-ILS/xul/staff_client/server/cat/copy_buckets.js index d9abdfbd21..05d4966ab2 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_buckets.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_buckets.js @@ -79,7 +79,6 @@ cat.copy_buckets.prototype = { obj.list1.init( { 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'retrieve_row' : retrieve_row, 'on_select' : function(ev) { try { @@ -109,7 +108,6 @@ cat.copy_buckets.prototype = { obj.list2.init( { 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'retrieve_row' : retrieve_row, 'on_select' : function(ev) { try { diff --git a/Open-ILS/xul/staff_client/server/cat/copy_summary.xul b/Open-ILS/xul/staff_client/server/cat/copy_summary.xul index 3a459a2078..9ab9a0494e 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_summary.xul +++ b/Open-ILS/xul/staff_client/server/cat/copy_summary.xul @@ -82,7 +82,6 @@ g.list.init( { 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), } ); $('list_actions').appendChild( g.list.render_list_actions() ); diff --git a/Open-ILS/xul/staff_client/server/cat/record_buckets.js b/Open-ILS/xul/staff_client/server/cat/record_buckets.js index 07a0aade5e..b0d0f88d28 100644 --- a/Open-ILS/xul/staff_client/server/cat/record_buckets.js +++ b/Open-ILS/xul/staff_client/server/cat/record_buckets.js @@ -151,7 +151,6 @@ cat.record_buckets.prototype = { obj.list0.init( { 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'retrieve_row' : retrieve_row, 'on_select' : function(ev) { try { @@ -180,7 +179,6 @@ cat.record_buckets.prototype = { obj.list1.init( { 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'retrieve_row' : retrieve_row, 'on_select' : function(ev) { try { @@ -211,7 +209,6 @@ cat.record_buckets.prototype = { obj.list2.init( { 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'retrieve_row' : retrieve_row, 'on_select' : function(ev) { try { diff --git a/Open-ILS/xul/staff_client/server/cat/z3950.js b/Open-ILS/xul/staff_client/server/cat/z3950.js index dc8ad86954..34f37d2f56 100644 --- a/Open-ILS/xul/staff_client/server/cat/z3950.js +++ b/Open-ILS/xul/staff_client/server/cat/z3950.js @@ -53,7 +53,6 @@ cat.z3950.prototype = { obj.list.init( { 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'on_select' : function(ev) { try { JSAN.use('util.functional'); diff --git a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js index bfb015c023..eb2b28eafa 100644 --- a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js +++ b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js @@ -46,10 +46,10 @@ function my_init() { var columns = circ.util.transit_columns({}); transit_list = new util.list('transit'); - transit_list.init( { 'columns' : columns, 'map_row_to_columns' : circ.util.std_map_row_to_columns(), }); + transit_list.init( { 'columns' : columns }); hold_list = new util.list('hold'); - hold_list.init( { 'columns' : columns, 'map_row_to_columns' : circ.util.std_map_row_to_columns(), }); + hold_list.init( { 'columns' : columns }); // timeout so xulG gets a chance to get pushed in setTimeout( diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.js b/Open-ILS/xul/staff_client/server/circ/checkin.js index 31dd9a15a0..d4fff66723 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.js +++ b/Open-ILS/xul/staff_client/server/circ/checkin.js @@ -46,7 +46,6 @@ circ.checkin.prototype = { obj.list.init( { 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'retrieve_row' : obj.gen_list_retrieve_row_func(), 'on_select' : function(ev) { try { diff --git a/Open-ILS/xul/staff_client/server/circ/checkout.js b/Open-ILS/xul/staff_client/server/circ/checkout.js index fe65d7ff9e..dad749fccc 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkout.js +++ b/Open-ILS/xul/staff_client/server/circ/checkout.js @@ -31,7 +31,6 @@ circ.checkout.prototype = { obj.list.init( { 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'on_select' : function() { var sel = obj.list.retrieve_selection(); document.getElementById('clip_button').disabled = sel.length < 1; diff --git a/Open-ILS/xul/staff_client/server/circ/copy_details.xul b/Open-ILS/xul/staff_client/server/circ/copy_details.xul index 3fcd465f2b..9046ef5d16 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_details.xul +++ b/Open-ILS/xul/staff_client/server/circ/copy_details.xul @@ -118,7 +118,7 @@ JSAN.use('circ.util'); var columns = circ.util.transit_columns({}); JSAN.use('util.list'); g.list = new util.list('transit'); - g.list.init( { 'columns' : columns, 'map_row_to_columns' : circ.util.std_map_row_to_columns(), }); + g.list.init( { 'columns' : columns }); g.list.append( { 'row' : { 'my' : { 'atc' : g.transit, } } }); } else { @@ -146,7 +146,7 @@ ); JSAN.use('util.list'); g.list = new util.list('hold'); - g.list.init( { 'columns' : columns, 'map_row_to_columns' : circ.util.std_map_row_to_columns(), }); + g.list.init( { 'columns' : columns }); g.list.append( { 'row' : { 'my' : { 'ahr' : better_fleshed_hold_blob.hold, 'acp' : g.copy, 'status' : status_robj, } } }); JSAN.use('patron.util'); diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status.js b/Open-ILS/xul/staff_client/server/circ/copy_status.js index 4bd765709a..6026a85ce8 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.js +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.js @@ -43,7 +43,6 @@ circ.copy_status.prototype = { obj.list.init( { 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'on_select' : function(ev) { try { JSAN.use('util.functional'); diff --git a/Open-ILS/xul/staff_client/server/circ/in_house_use.js b/Open-ILS/xul/staff_client/server/circ/in_house_use.js index d6d63556c9..e3d7be529a 100644 --- a/Open-ILS/xul/staff_client/server/circ/in_house_use.js +++ b/Open-ILS/xul/staff_client/server/circ/in_house_use.js @@ -37,7 +37,6 @@ circ.in_house_use.prototype = { obj.list.init( { 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'on_select' : function() { var sel = obj.list.retrieve_selection(); obj.controller.view.sel_clip.setAttribute('disabled', sel.length < 1); diff --git a/Open-ILS/xul/staff_client/server/circ/renew.js b/Open-ILS/xul/staff_client/server/circ/renew.js index 8dbe7c27a5..3264c84cee 100644 --- a/Open-ILS/xul/staff_client/server/circ/renew.js +++ b/Open-ILS/xul/staff_client/server/circ/renew.js @@ -47,7 +47,6 @@ circ.renew.prototype = { obj.list.init( { 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'on_select' : function(ev) { try { JSAN.use('util.functional'); diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js index 52fd368fce..84bec40f23 100644 --- a/Open-ILS/xul/staff_client/server/circ/util.js +++ b/Open-ILS/xul/staff_client/server/circ/util.js @@ -2514,63 +2514,6 @@ circ.util.hold_columns = function(modify,params) { } return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } ); }; -/* -circ.util.std_map_row_to_column = function(error_value) { - return function(row,col) { - // row contains { 'my' : { 'acp' : {}, 'circ' : {}, 'mvr' : {} } } - // col contains one of the objects listed above in columns - - // mimicking some of the obj in circ.checkin and circ.checkout where map_row_to_column is usually defined - var obj = {}; - JSAN.use('util.error'); obj.error = new util.error(); - JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'}); - JSAN.use('util.network'); obj.network = new util.network(); - JSAN.use('util.money'); - - var my = row.my; - var value; - try { - value = eval( col.render ); - } catch(E) { - obj.error.sdump('D_WARN','map_row_to_column: ' + E); - if (error_value) value = error_value; else value = ' '; - } - return value; - } -}; -*/ -circ.util.std_map_row_to_columns = function(error_value) { - return function(row,cols,scratch) { - // row contains { 'my' : { 'acp' : {}, 'circ' : {}, 'mvr' : {} } } - // cols contains all of the objects listed above in columns - // scratch is a temporary space shared by all cells/rows (or just per row if not explicitly passed in) - if (!scratch) { scratch = {}; } - - var obj = {}; - JSAN.use('util.error'); obj.error = new util.error(); - JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'}); - JSAN.use('util.network'); obj.network = new util.network(); - JSAN.use('util.money'); - - var my = row.my; - var values = []; - var cmd = ''; - try { - for (var i = 0; i < cols.length; i++) { - switch (typeof cols[i].render) { - case 'function': try { values[i] = cols[i].render(my,scratch); } catch(E) { values[i] = error_value; obj.error.sdump('D_COLUMN_RENDER_ERROR',E); } break; - case 'string' : cmd += 'try { ' + cols[i].render + '; values['+i+'] = v; } catch(E) { values['+i+'] = error_value; }'; break; - default: cmd += 'values['+i+'] = "??? '+(typeof cols[i].render)+'"; '; - } - } - if (cmd) eval( cmd ); - } catch(E) { - obj.error.sdump('D_WARN','map_row_to_column: ' + E); - if (error_value) { value = error_value; } else { value = ' ' }; - } - return values; - } -}; circ.util.checkin_via_barcode = function(session,params,backdate,auto_print,async) { try { diff --git a/Open-ILS/xul/staff_client/server/patron/hold_details.js b/Open-ILS/xul/staff_client/server/patron/hold_details.js index a4a4f1be7b..aa28075f52 100644 --- a/Open-ILS/xul/staff_client/server/patron/hold_details.js +++ b/Open-ILS/xul/staff_client/server/patron/hold_details.js @@ -115,7 +115,6 @@ function init_list() { g.list.init( { 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'retrieve_row' : function(params) { var row = params.row; if (typeof params.on_retrieve == 'function') { diff --git a/Open-ILS/xul/staff_client/server/patron/holds.js b/Open-ILS/xul/staff_client/server/patron/holds.js index c48600917d..8df66cfca3 100644 --- a/Open-ILS/xul/staff_client/server/patron/holds.js +++ b/Open-ILS/xul/staff_client/server/patron/holds.js @@ -75,7 +75,6 @@ patron.holds.prototype = { // 'acp_circ_modifier' : { 'hidden' : false } }) ), - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'retrieve_row' : function(params) { var row = params.row; try { diff --git a/Open-ILS/xul/staff_client/server/patron/items.js b/Open-ILS/xul/staff_client/server/patron/items.js index b0ec8ec81e..63c1d1cf75 100644 --- a/Open-ILS/xul/staff_client/server/patron/items.js +++ b/Open-ILS/xul/staff_client/server/patron/items.js @@ -730,7 +730,6 @@ patron.items.prototype = { obj.list.init( { 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'retrieve_row' : retrieve_row, 'on_select' : function(ev) { JSAN.use('util.functional'); @@ -758,7 +757,6 @@ patron.items.prototype = { obj.list2.init( { 'columns' : columns2, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'retrieve_row' : retrieve_row, 'on_select' : function(ev) { JSAN.use('util.functional'); diff --git a/Open-ILS/xul/staff_client/server/serial/manage_dists.js b/Open-ILS/xul/staff_client/server/serial/manage_dists.js index 1a5cacec2a..8d56f605a7 100644 --- a/Open-ILS/xul/staff_client/server/serial/manage_dists.js +++ b/Open-ILS/xul/staff_client/server/serial/manage_dists.js @@ -1110,7 +1110,6 @@ serial.manage_dists.prototype = { { 'no_auto_select' : true, 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(' '), 'retrieve_row' : function(params) { var row = params.row; diff --git a/Open-ILS/xul/staff_client/server/serial/manage_items.js b/Open-ILS/xul/staff_client/server/serial/manage_items.js index c5108480a3..5e734ff40d 100644 --- a/Open-ILS/xul/staff_client/server/serial/manage_items.js +++ b/Open-ILS/xul/staff_client/server/serial/manage_items.js @@ -762,7 +762,6 @@ serial.manage_items.prototype = { obj.lists.main.init( { 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'retrieve_row' : retrieve_row, 'on_select' : function(ev) { obj.selected_list = 'main'; @@ -788,7 +787,6 @@ serial.manage_items.prototype = { obj.lists.workarea.init( { 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(), 'retrieve_row' : retrieve_row, 'on_select' : function(ev) { obj.selected_list = 'workarea'; diff --git a/Open-ILS/xul/staff_client/server/serial/manage_subs.js b/Open-ILS/xul/staff_client/server/serial/manage_subs.js index 93fd587a5d..fa5c4c6fe3 100644 --- a/Open-ILS/xul/staff_client/server/serial/manage_subs.js +++ b/Open-ILS/xul/staff_client/server/serial/manage_subs.js @@ -1566,7 +1566,6 @@ serial.manage_subs.prototype = { { 'no_auto_select' : true, 'columns' : columns, - 'map_row_to_columns' : circ.util.std_map_row_to_columns(' '), 'retrieve_row' : function(params) { var row = params.row;