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 {
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')); });
{
'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;
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 {
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 {
g.list.init(
{
'columns' : columns,
- 'map_row_to_columns' : circ.util.std_map_row_to_columns(),
}
);
$('list_actions').appendChild( g.list.render_list_actions() );
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 {
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 {
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 {
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');
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(
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 {
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;
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 {
);
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');
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');
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);
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');
}
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 {
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') {
// '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 {
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');
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');
{
'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;
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';
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';
{
'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;