From dc5b48deb827711c7c634dd24e4034ae04246ab9 Mon Sep 17 00:00:00 2001 From: phasefx Date: Wed, 27 Jul 2005 22:23:48 +0000 Subject: [PATCH] lost checkin handling git-svn-id: svn://svn.open-ils.org/ILS/trunk@1563 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../content/evergreen/circ/circ_utils.js | 38 ++++++++++++++----- .../content/evergreen/util/spawn_win.js | 1 + 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/Evergreen/staff_client/chrome/content/evergreen/circ/circ_utils.js b/Evergreen/staff_client/chrome/content/evergreen/circ/circ_utils.js index 036639b3aa..a95085b5ef 100644 --- a/Evergreen/staff_client/chrome/content/evergreen/circ/circ_utils.js +++ b/Evergreen/staff_client/chrome/content/evergreen/circ/circ_utils.js @@ -172,9 +172,29 @@ function checkin_by_copy_barcode(barcode, backdate, f) { } break; case '2': case 2: /* LOST??? */ - var msg = pretty_print( js2JSON( check ) ); - sdump('D_CIRC_UTILS',msg); - alert(msg); + var patron = retrieve_patron_by_id( check.circ.usr() ); + var msg = check.text + '\r\n' + 'Barcode: ' + barcode + ' Title: ' + + check.record.title() + ' Author: ' + check.record.author() + '\r\n' + + 'Patron: ' + patron.card().barcode() + ' ' + patron.family_name() + ', ' + + patron.first_given_name(); + var pcheck = yns_alert( + msg, + 'Lost Item', + 'Edit Copy & Patron', + "Just Continue", + null, + "Check here to confirm this message" + ); + if (pcheck == 0) { + var w = mw.spawn_main(); + setTimeout( + function() { + mw.spawn_patron_display(w.document,'new_tab','main_tabbox',{'patron':patron}); + mw.spawn_batch_copy_editor(w.document,'new_tab','main_tabbox', + {'copy_ids':[ check.copy.id() ]}); + }, 0 + ); + } break; case '3': case 3: /* TRANSIT ELSEWHERE */ if (parseInt(check.route_to)) check.route_to = mw.G.org_tree_hash[ check.route_to ].shortname(); @@ -231,12 +251,12 @@ function checkin_by_copy_barcode(barcode, backdate, f) { break; } } else { // status == 0 - if (parseInt(check.route_to)) { - if (check.route_to != mw.G.user_ou.id()) { - check.route_to = mw.G.org_tree_hash[ check.route_to ].shortname(); - } else { - check.route_to = mw.G.acpl_hash[ check.copy.location() ].name(); - } + } + if (parseInt(check.route_to)) { + if (check.route_to != mw.G.user_ou.id()) { + check.route_to = mw.G.org_tree_hash[ check.route_to ].shortname(); + } else { + check.route_to = mw.G.acpl_hash[ check.copy.location() ].name(); } } } diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/spawn_win.js b/Evergreen/staff_client/chrome/content/evergreen/util/spawn_win.js index 9a3c765584..23a80625bc 100644 --- a/Evergreen/staff_client/chrome/content/evergreen/util/spawn_win.js +++ b/Evergreen/staff_client/chrome/content/evergreen/util/spawn_win.js @@ -84,6 +84,7 @@ function spawn_main() { if (!w) { throw('window ref == null'); } try { w.params = {}; + return w; } catch(E) { alert('Hrmm. ' + pretty_print( js2JSON(E) ) ); } -- 2.43.2