[open-ils-commits] r14110 - trunk/Open-ILS/xul/staff_client/server/patron (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Sep 22 22:56:19 EDT 2009
Author: phasefx
Date: 2009-09-22 22:56:17 -0400 (Tue, 22 Sep 2009)
New Revision: 14110
Modified:
trunk/Open-ILS/xul/staff_client/server/patron/hold_details.js
trunk/Open-ILS/xul/staff_client/server/patron/holds.js
Log:
Fix a long-standing undiscoverd bug in the Bib Summary for what was Show Notices for non-title holds. We're getting a lot of objects related to holds already, so re-use that data where we can.
Modified: trunk/Open-ILS/xul/staff_client/server/patron/hold_details.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/hold_details.js 2009-09-23 02:13:35 UTC (rev 14109)
+++ trunk/Open-ILS/xul/staff_client/server/patron/hold_details.js 2009-09-23 02:56:17 UTC (rev 14110)
@@ -44,7 +44,7 @@
var bib_brief = document.createElement('iframe'); x.appendChild(bib_brief);
bib_brief.setAttribute('flex',1);
bib_brief.setAttribute('src',urls.XUL_BIB_BRIEF);
- get_contentWindow(bib_brief).xulG = { 'docid' : g.ahr.target() };
+ get_contentWindow(bib_brief).xulG = { 'docid' : g.blob.mvr.doc_id() };
retrieve_notes(); render_notes();
@@ -58,9 +58,14 @@
function fetch_hold(id) {
try {
g.ahr_id = xulG.ahr_id;
- g.ahr = g.network.simple_request('FM_AHR_RETRIEVE',[ ses(), g.ahr_id ]);
- if (typeof g.ahr.ilsevent != 'undefined') { throw(g.ahr); }
- g.ahr = g.ahr[0];
+ g.blob = xulG.blob;
+ if (g.blob) {
+ g.ahr = xulG.blob.hold;
+ } else {
+ g.blob = g.network.simple_request('FM_AHR_BLOB_RETRIEVE',[ ses(), g.ahr_id ]);
+ if (typeof g.ahr.ilsevent != 'undefined') { throw(g.ahr); }
+ g.ahr = g.blob.hold;
+ }
} catch(E) {
alert('Error in hold_details.js, fetch_hold(): ' + E);
}
@@ -101,28 +106,6 @@
'map_row_to_columns' : circ.util.std_map_row_to_columns(),
'retrieve_row' : function(params) {
var row = params.row;
- try {
- switch(row.my.ahr.hold_type()) {
- case 'M' :
- row.my.mvr = g.network.request(
- api.MODS_SLIM_METARECORD_RETRIEVE.app,
- api.MODS_SLIM_METARECORD_RETRIEVE.method,
- [ row.my.ahr.target() ]
- );
- break;
- default:
- row.my.mvr = g.network.simple_request(
- 'MODS_SLIM_RECORD_RETRIEVE.authoritative',
- [ row.my.ahr.target() ]
- );
- if (row.my.ahr.current_copy()) {
- row.my.acp = g.network.simple_request( 'FM_ACP_RETRIEVE', [ row.my.ahr.current_copy() ]);
- }
- break;
- }
- } catch(E) {
- g.error.sdump('D_ERROR','retrieve_row: ' + E );
- }
if (typeof params.on_retrieve == 'function') {
params.on_retrieve(row);
}
@@ -139,6 +122,10 @@
'row' : {
'my' : {
'ahr' : g.ahr,
+ 'acp' : g.blob.copy,
+ 'acn' : g.blob.volume,
+ 'mvr' : g.blob.mvr,
+ 'blob' : g.blob
}
},
'no_auto_select' : true,
Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds.js 2009-09-23 02:13:35 UTC (rev 14109)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds.js 2009-09-23 02:56:17 UTC (rev 14110)
@@ -93,7 +93,7 @@
copy_id = row.my.acp.id();
}
- obj.holds_map[ row.my.ahr.id() ] = row.my.ahr;
+ obj.holds_map[ row.my.ahr.id() ] = blob;
params.row_node.setAttribute('retrieve_id',
js2JSON({
'copy_id':copy_id,
@@ -211,6 +211,7 @@
if (obj.retrieve_ids.length == 0) return;
var f = obj.browser.get_content();
xulG.ahr_id = obj.retrieve_ids[0].id;
+ xulG.blob = obj.holds_map[ xulG.ahr_id ];
xulG.patron_rendered_elsewhere = (obj.hold_interface_type == 'patron');
f.xulG = xulG;
f.fetch_and_render_all();
@@ -331,7 +332,7 @@
);
if (r == 0) {
for (var i = 0; i < obj.retrieve_ids.length; i++) {
- var hold = obj.holds_map[ obj.retrieve_ids[i].id ];
+ var hold = obj.holds_map[ obj.retrieve_ids[i].id ].hold;
hold.selection_depth( obj.data.hash.aout[selection].depth() ); hold.ischanged('1');
hold = obj.flatten_copy(hold);
var robj = obj.network.simple_request('FM_AHR_UPDATE',[ ses(), hold ]);
@@ -353,7 +354,7 @@
var deny_edit_because_of_transit = false;
for (var i = 0; i < obj.retrieve_ids.length; i++) {
- var hold = obj.holds_map[ obj.retrieve_ids[i].id ];
+ var hold = obj.holds_map[ obj.retrieve_ids[i].id ].hold;
if (hold.status() == 3 /* In-Transit */) deny_edit_because_of_transit = true;
}
if (deny_edit_because_of_transit) {
@@ -416,7 +417,7 @@
);
if (r == 0) {
for (var i = 0; i < obj.retrieve_ids.length; i++) {
- var hold = obj.holds_map[ obj.retrieve_ids[i].id ];
+ var hold = obj.holds_map[ obj.retrieve_ids[i].id ].hold;
hold.pickup_lib( pickup_lib ); hold.ischanged('1');
hold = obj.flatten_copy(hold);
var robj = obj.network.simple_request('FM_AHR_UPDATE',[ ses(), hold ]);
@@ -474,7 +475,7 @@
);
if (r == 0) {
for (var i = 0; i < obj.retrieve_ids.length; i++) {
- var hold = obj.holds_map[ obj.retrieve_ids[i].id ];
+ var hold = obj.holds_map[ obj.retrieve_ids[i].id ].hold;
hold.phone_notify( phone ); hold.ischanged('1');
hold = obj.flatten_copy(hold);
var robj = obj.network.simple_request('FM_AHR_UPDATE',[ ses(), hold ]);
@@ -541,7 +542,7 @@
);
if (r == 0) {
for (var i = 0; i < obj.retrieve_ids.length; i++) {
- var hold = obj.holds_map[ obj.retrieve_ids[i].id ];
+ var hold = obj.holds_map[ obj.retrieve_ids[i].id ].hold;
hold.email_notify( email ); hold.ischanged('1');
hold = obj.flatten_copy(hold);
var robj = obj.network.simple_request('FM_AHR_UPDATE',[ ses(), hold ]);
@@ -572,7 +573,7 @@
if (r == 0) {
var already_suspended = [];
for (var i = 0; i < obj.retrieve_ids.length; i++) {
- var hold = obj.holds_map[ obj.retrieve_ids[i].id ];
+ var hold = obj.holds_map[ obj.retrieve_ids[i].id ].hold;
if ( get_bool( hold.frozen() ) ) {
already_suspended.push( hold.id() );
continue;
@@ -614,7 +615,7 @@
if (r == 0) {
var already_activated = [];
for (var i = 0; i < obj.retrieve_ids.length; i++) {
- var hold = obj.holds_map[ obj.retrieve_ids[i].id ];
+ var hold = obj.holds_map[ obj.retrieve_ids[i].id ].hold;
if ( ! get_bool( hold.frozen() ) ) {
already_activated.push( hold.id() );
continue;
@@ -673,7 +674,7 @@
}
if (thaw_date || thaw_date == '') {
for (var i = 0; i < obj.retrieve_ids.length; i++) {
- var hold = obj.holds_map[ obj.retrieve_ids[i].id ];
+ var hold = obj.holds_map[ obj.retrieve_ids[i].id ].hold;
hold.frozen('t');
hold.thaw_date( thaw_date == '' ? null : util.date.formatted_date(thaw_date + ' 00:00:00','%{iso8601}') ); hold.ischanged('1');
hold = obj.flatten_copy(hold);
@@ -722,7 +723,7 @@
}
if (expire_time || expire_time == '') {
for (var i = 0; i < obj.retrieve_ids.length; i++) {
- var hold = obj.holds_map[ obj.retrieve_ids[i].id ];
+ var hold = obj.holds_map[ obj.retrieve_ids[i].id ].hold;
hold.expire_time( expire_time == '' ? null : util.date.formatted_date(expire_time + ' 00:00:00','%{iso8601}') ); hold.ischanged('1');
hold = obj.flatten_copy(hold);
var robj = obj.network.simple_request('FM_AHR_UPDATE',[ ses(), hold ]);
@@ -795,7 +796,7 @@
if (r == 0) {
var transits = [];
for (var i = 0; i < obj.retrieve_ids.length; i++) {
- if (obj.holds_map[ obj.retrieve_ids[i].id ].transit()) {
+ if (obj.holds_map[ obj.retrieve_ids[i].id ].hold.transit()) {
transits.push( obj.retrieve_ids[i].barcode );
}
var robj = obj.network.simple_request('FM_AHR_CANCEL',[ ses(), obj.retrieve_ids[i].id]);
More information about the open-ils-commits
mailing list