capture hold interface
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 15 Dec 2005 20:50:26 +0000 (20:50 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 15 Dec 2005 20:50:26 +0000 (20:50 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2411 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/evergreen/main/constants.js
Open-ILS/xul/staff_client/server/circ/hold_capture.js
Open-ILS/xul/staff_client/server/circ/util.js
Open-ILS/xul/staff_client/server/main/menu.js

index 8dea624..022fc10 100644 (file)
@@ -33,6 +33,7 @@ var urls = {
        'remote_debug_filter_console' : '/xul/server/util/filter_console.xul',
        'remote_debug_shell' : '/xul/server/util/shell.html',
        'remote_debug_xuleditor' : '/xul/server/util/xuledit.xul',
+       'remote_hold_capture' : '/xul/server/circ/hold_capture.xul',
        'remote_menu_frame' : '/xul/server/main/menu_frame.xul',
        'remote_patron_barcode_entry' : '/xul/server/patron/barcode_entry.xul',
        'remote_patron_bills' : 'data:text/html,<h1>Bills Here</h1>',
index 5e9f9b6..b507d68 100644 (file)
@@ -22,9 +22,9 @@ circ.hold_capture.prototype = {
                                'barcode' : { 'hidden' : false },
                                'title' : { 'hidden' : false },
                                'status' : { 'hidden' : false },
-                               //'hold_capture_status' : { 'hidden' : false },
-                               'hold_capture_route_to' : { 'hidden' : false },
-                               'hold_capture_text' : { 'hidden' : false, 'flex' : 3 },
+                               //'checkin_status' : { 'hidden' : false },
+                               'checkin_route_to' : { 'hidden' : false },
+                               'checkin_text' : { 'hidden' : false, 'flex' : 3 },
                        } 
                );
                dump('columns = ' + js2JSON(columns) + '\n');
@@ -91,12 +91,22 @@ circ.hold_capture.prototype = {
                        );
                        if (hold_capture) {
                                JSAN.use('patron.util');
-                               var au_obj = patron.util.retrieve_via_id( hold_capture.hold.usr() );
+                               var au_obj;
+                               if (hold_capture.hold && hold_capture.hold.usr()) {
+
+                                       au_obj = patron.util.retrieve_au_via_id( obj.session, hold_capture.hold.usr() );
+
+                               } else {
+
+                                       au_obj = new au(); au_obj.family_name( '???' );
+
+                               }
                                obj.list.append(
                                        {
                                                'row' : {
                                                        'my' : {
-                                                               'patron' : au_obj,
+                                                               'au' : au_obj,
+                                                               'hr' : hold_capture.hold,
                                                                'circ' : hold_capture.circ,
                                                                'mvr' : hold_capture.record,
                                                                'acp' : hold_capture.copy,
@@ -108,16 +118,18 @@ circ.hold_capture.prototype = {
                                        //I could override map_row_to_column here
                                        }
                                );
-                       
-                               alert('To Printer\n' + check.text + '\r\n' + 'Barcode: ' + barcode + '  Title: ' + check.record.title() + 
-                                       '  Author: ' + check.record.author() + '\r\n' +
-                                       'Route To: ' + check.route_to + 
+               
+                               try {
+                               alert('To Printer\n' + hold_capture.text + '\r\n' + 'Barcode: ' + barcode + '  Title: ' + hold_capture.record.title() + 
+                                       '  Author: ' + hold_capture.record.author() + '\r\n' +
+                                       'Route To: ' + hold_capture.route_to + 
                                        '  Patron: ' + au_obj.card().barcode() + ' ' + au_obj.family_name() + ', ' + au_obj.first_given_name() + 
                                        '\r\n'); //FIXME
+                               } catch(E) { dump('errors\n'); }
                                /*
-                               sPrint(check.text + '<br />\r\n' + 'Barcode: ' + barcode + '  Title: ' + check.record.title() + 
-                                       '  Author: ' + check.record.author() + '<br />\r\n' +
-                                       'Route To: ' + check.route_to + 
+                               sPrint(hold_capture.text + '<br />\r\n' + 'Barcode: ' + barcode + '  Title: ' + hold_capture.record.title() + 
+                                       '  Author: ' + hold_capture.record.author() + '<br />\r\n' +
+                                       'Route To: ' + hold_capture.route_to + 
                                        '  Patron: ' + au_obj.card().barcode() + ' ' + au_obj.family_name() + ', ' + au_obj.first_given_name() + 
                                        '<br />\r\n'
                                );
index f51212c..29e4f92 100644 (file)
@@ -190,19 +190,19 @@ circ.util.checkin_via_barcode = function(session,barcode,backdate) {
                                                                check.text = check2.text;
                                                                check.route_to = check2.route_to;
                                                                JSAN.use('patron.util');
-                                                               var patron = patron.util.retrieve_au_via_id( check.hold.usr() );
+                                                               var au_obj = patron.util.retrieve_au_via_id( session, check.hold.usr() );
                                                                alert('To Printer\n' + check.text + '\r\n' + 'Barcode: ' + barcode + '  Title: ' + 
                                                                        check.record.title() + '  Author: ' + check.record.author() + 
                                                                        '\r\n' + 'Route To: ' + check.route_to + '  Patron: ' + 
-                                                                       patron.card().barcode() + ' ' + patron.family_name() + ', ' + 
-                                                                       patron.first_given_name() + '\r\n'); //FIXME
+                                                                       au_obj.card().barcode() + ' ' + au_obj.family_name() + ', ' + 
+                                                                       au_obj.first_given_name() + '\r\n'); //FIXME
 
                                                                /*
                                                                sPrint(check.text + '<br />\r\n' + 'Barcode: ' + barcode + '  Title: ' + 
                                                                        check.record.title() + '  Author: ' + check.record.author() + 
                                                                        '<br />\r\n' + 'Route To: ' + check.route_to + '  Patron: ' + 
-                                                                       patron.card().barcode() + ' ' + patron.family_name() + ', ' + 
-                                                                       patron.first_given_name() + '<br />\r\n'
+                                                                       au_obj.card().barcode() + ' ' + au_obj.family_name() + ', ' + 
+                                                                       au_obj.first_given_name() + '<br />\r\n'
                                                                );
                                                                */
 
@@ -225,11 +225,11 @@ circ.util.checkin_via_barcode = function(session,barcode,backdate) {
                                break;
                                case '2': case 2: /* LOST??? */
                                        JSAN.use('patron.util');
-                                       var patron = patron.util.retrieve_au_via_id( check.circ.usr() );
+                                       var au_obj = patron.util.retrieve_au_via_id( session, 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();
+                                                       'Patron: ' + au_obj.card().barcode() + ' ' + au_obj.family_name() + ', ' +
+                                                       au_obj.first_given_name();
                                        var pcheck = error.yns_alert(
                                                msg,
                                                'Lost Item',
@@ -244,7 +244,7 @@ circ.util.checkin_via_barcode = function(session,barcode,backdate) {
                                                var w = mw.spawn_main();
                                                setTimeout(
                                                        function() {
-                                                               mw.spawn_patron_display(w.document,'new_tab','main_tabbox',{'patron':patron});
+                                                               mw.spawn_patron_display(w.document,'new_tab','main_tabbox',{'patron':au_obj});
                                                                mw.spawn_batch_copy_editor(w.document,'new_tab','main_tabbox',
                                                                        {'copy_ids':[ check.copy.id() ]});
                                                        }, 0
@@ -332,12 +332,20 @@ circ.util.hold_capture_via_copy_barcode = function ( session, barcode, retrieve_
        try {
                JSAN.use('util.network'); var network = new util.network();
                JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
-               var check = network.request(
+               var robj = network.request(
                        api.capture_copy_for_hold_via_barcode.app,
                        api.capture_copy_for_hold_via_barcode.method,
                        [ session, barcode, retrieve_flag ]
-               )[0];
-               check.text = 'Captured for Hold';
+               );
+               var check = robj.payload;
+               if (!check) {
+                       check = {};
+                       check.status = robj.ilsevent;
+                       check.copy = new acp(); check.copy.barcode( barcode );
+               }
+               check.text = robj.textcode;
+               check.route_to = robj.route_to;
+               //check.text = 'Captured for Hold';
                if (parseInt(check.route_to)) check.route_to = data.hash.aou[ check.route_to ].shortname();
                return check;
        } catch(E) {
index 563b78c..38dda01 100644 (file)
@@ -80,6 +80,12 @@ main.menu.prototype = {
                                        obj.set_tab(urls.remote_patron_barcode_entry + '?session='+obj.w.escape(session),{},{});
                                }
                        ],
+                       'cmd_circ_hold_capture' : [
+                               ['command','keypress'],
+                               function() { 
+                                       obj.set_tab(urls.remote_hold_capture + '?session='+obj.w.escape(session),{},{});
+                               }
+                       ],
 
 
                        /* Admin menu */