[open-ils-commits] r8570 -
trunk/Open-ILS/xul/staff_client/server/patron
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Feb 1 12:52:52 EST 2008
Author: phasefx
Date: 2008-02-01 12:25:05 -0500 (Fri, 01 Feb 2008)
New Revision: 8570
Modified:
trunk/Open-ILS/xul/staff_client/server/patron/items.js
Log:
single-row refresh does not realize when an item needs to move between lists, as in the Item Outs interface with Mark Lost or Claimed Returned. This is a quick fix, needs testing
Modified: trunk/Open-ILS/xul/staff_client/server/patron/items.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/items.js 2008-02-01 16:58:13 UTC (rev 8569)
+++ trunk/Open-ILS/xul/staff_client/server/patron/items.js 2008-02-01 17:25:05 UTC (rev 8570)
@@ -375,8 +375,16 @@
var barcode = retrieve_ids[i].barcode;
dump('Mark barcode lost = ' + barcode);
var robj = obj.network.simple_request( 'MARK_ITEM_LOST', [ ses(), { barcode: barcode } ]);
- if (typeof robj.ilsevent != 'undefined') { if (robj.ilsevent != 0) throw(robj); }
- obj.refresh(retrieve_ids[i].circ_id);
+ if (typeof robj.ilsevent != 'undefined') {
+ switch(robj.ilsevent) {
+ case 7018 /* COPY_MARKED_LOST */ :
+ alert( 'Item Barcode ' + barcode + '\n' + robj.desc );
+ break;
+ default: throw(robj);
+ }
+ } else {
+ obj.refresh(retrieve_ids[i].circ_id,true);
+ }
}
} catch(E) {
obj.error.standard_unexpected_error_alert('The items were not likely marked lost.',E);
@@ -433,7 +441,7 @@
if (typeof robj.ilsevent != 'undefined') { if (robj.ilsevent != 0) throw(robj); }
}
}
- for (var i = 0; i < retrieve_ids.length; i++) obj.refresh(retrieve_ids[i].circ_id);
+ for (var i = 0; i < retrieve_ids.length; i++) obj.refresh(retrieve_ids[i].circ_id,true);
} catch(E) {
obj.error.standard_unexpected_error_alert('The items were not likely marked Claimed Returned.',E);
}
@@ -456,8 +464,8 @@
ses(), { 'copy_id' : copy_id }
);
/* circ.util.checkin_via_barcode handles errors currently */
- obj.refresh(retrieve_ids[i].circ_id);
}
+ obj.retrieve();
} catch(E) {
obj.error.standard_unexpected_error_alert('Checkin probably did not happen.',E);
}
@@ -660,19 +668,25 @@
);
},
- 'refresh' : function(circ_id) {
+ 'refresh' : function(circ_id,move_to_bottom_list) {
var obj = this;
try {
var nparams = obj.list_circ_map[circ_id];
- var which_list = nparams.which_list;
- switch(which_list) {
- case 1: case '1':
- setTimeout(function(){try{obj.list2.refresh_row(nparams);}catch(E){obj.error.standard_unexpected_error_alert('2 Error refreshing row in list\ncirc_id = ' + circ_id + '\nnparams = ' + nparams,E);}},1000);
- break;
- default:
- setTimeout(function(){try{obj.list.refresh_row(nparams);}catch(E){obj.error.standard_unexpected_error_alert('2 Error refreshing row in list\ncirc_id = ' + circ_id + '\nnparams = ' + nparams,E);}},1000);
- break;
- }
+ if (move_to_bottom_list) {
+ obj.list_circ_map[circ_id].my_node.setAttribute('hidden','true');
+ var nparams2 = obj.list2.append( { 'row' : { 'my' : { 'circ_id' : circ_id } }, 'to_bottom' : true, 'which_list' : 1 } );
+ obj.list_circ_map[circ_id] = nparams2;
+ } else {
+ var which_list = nparams.which_list;
+ switch(which_list) {
+ case 1: case '1':
+ setTimeout(function(){try{obj.list2.refresh_row(nparams);}catch(E){obj.error.standard_unexpected_error_alert('2 Error refreshing row in list\ncirc_id = ' + circ_id + '\nnparams = ' + nparams,E);}},1000);
+ break;
+ default:
+ setTimeout(function(){try{obj.list.refresh_row(nparams);}catch(E){obj.error.standard_unexpected_error_alert('2 Error refreshing row in list\ncirc_id = ' + circ_id + '\nnparams = ' + nparams,E);}},1000);
+ break;
+ }
+ }
} catch(E) {
obj.error.standard_unexpected_error_alert('Error refreshing row in list\ncirc_id = ' + circ_id + '\nnparams = ' + nparams,E);
}
More information about the open-ils-commits
mailing list