lost checkin handling
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Jul 2005 22:23:48 +0000 (22:23 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Jul 2005 22:23:48 +0000 (22:23 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1563 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/circ/circ_utils.js
Evergreen/staff_client/chrome/content/evergreen/util/spawn_win.js

index 036639b..a95085b 100644 (file)
@@ -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();
                                }
                        }
                }
index 9a3c765..23a8062 100644 (file)
@@ -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) ) );
                }