some circ tweaks
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 25 Jul 2005 17:47:50 +0000 (17:47 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 25 Jul 2005 17:47:50 +0000 (17:47 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1440 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/circ/circ_utils.js
Evergreen/staff_client/chrome/content/evergreen/circ/hold_capture.js
Evergreen/staff_client/chrome/content/evergreen/util/error.js
Evergreen/staff_client/chrome/content/evergreen/util/print.js

index 4ff70cf..8ec9066 100644 (file)
@@ -64,6 +64,8 @@ function hold_capture_by_copy_barcode( barcode, retrieve_flag ) {
                        'open-ils.circ.hold.capture_copy.barcode',
                        [ mw.G.auth_ses[0], barcode, retrieve_flag ]
                )[0];
+               check.text = 'Captured for Hold';
+               if (parseInt(check.route_to)) check.route_to = mw.G.org_tree_hash[ check.route_to ].shortname();
                return check;
        } catch(E) {
                handle_error(E, true);
@@ -97,7 +99,7 @@ function checkin_by_copy_barcode(barcode, backdate, f) {
                                        case '1': case 1: /* possible hold capture */
                                                var rv = yns_alert(
                                                        check.text,
-                                                       'Check Check In Interrupt',
+                                                       'Alert',
                                                        "Capture",
                                                        "Don't Capture",
                                                        null,
@@ -110,8 +112,9 @@ function checkin_by_copy_barcode(barcode, backdate, f) {
                                                                if (check2) {
                                                                        sdump('D_CIRC_UTILS','check2 = ' + js2JSON(check2) + '\n');
                                                                        check.copy = check2.copy;
-                                                                       check.text = 'Captured for Hold';
-                                                                       check.route_to = mw.G.org_tree_hash[ check2.route_to ].shortname();
+                                                                       check.text = check2.text;
+                                                                       check.route_to = check2.route_to;
+                                                                       sPrint(check.record.title() + '<br />\r\n' + check.text + '\r\n<br />Barcode: ' + barcode + '  Route to: ' + check.route_to + '\r\n' );
                                                                }
 
                                                        } catch(E) { 
@@ -130,10 +133,25 @@ function checkin_by_copy_barcode(barcode, backdate, f) {
                                                }
                                        break;
 
-                                       default: s_alert(check.text ); break;
+                                       default: 
+                                               if (parseInt(check.route_to)) check.route_to = mw.G.org_tree_hash[ check.route_to ].shortname();
+                                               var msg = check.text + '\r\nBarcode: ' + barcode + '  Route To: ' + check.route_to;
+                                               var pcheck = yns_alert(
+                                                       msg,
+                                                       'Alert',
+                                                       'Print Receipt',
+                                                       "Don't Print",
+                                                       null,
+                                                       "Check here to confirm this message"
+                                               ); 
+                                               if (pcheck == 0) {
+                                                       sPrint( msg.match( /\n/g, '<br />\r\n'), true );
+                                               }
+                                       break;
                                }
                        }
                }
+               if (parseInt(check.route_to)) check.route_to = mw.G.org_tree_hash[ check.route_to ].shortname();
                return check;
        } catch(E) {
                handle_error(E, true);
@@ -273,7 +291,7 @@ function circ_cols() {
        return  [
                {
                        'id' : 'barcode', 'label' : getString('acp_label_barcode'), 'flex' : 1,
-                       'primary' : true, 'hidden' : false, 'fm_class' : 'acp', 'fm_field_render' : '.barcode()'
+                       'primary' : false, 'hidden' : false, 'fm_class' : 'acp', 'fm_field_render' : '.barcode()'
                },
                {
                        'id' : 'call_number', 'label' : getString('acp_label_call_number'), 'flex' : 1,
index f4323ff..a8ee3d5 100755 (executable)
@@ -51,7 +51,7 @@ function hold_capture_hold_capture_items_init(p) {
        p.attempt_hold_capture = function(barcode) {
                try {
                        //if (! is_barcode_valid(barcode) ) throw('Invalid Barcode');
-                       var check = hold_capture_by_copy_barcode( barcode, true );
+                       var check = hold_capture_by_copy_barcode( barcode, true );  // barcode, flesh
                        if (check) {
                                sdump('D_HOLD_CAPTURE','check = ' + check + '\n' + pretty_print( js2JSON( check ) ) + '\n');
 
index 6175bcc..b90c620 100644 (file)
@@ -17,8 +17,8 @@ var sdump_levels = {
        'D_TIMEOUT' :  false,
        'D_FILTER' : false,
        'D_CONSTRUCTOR' : false,
-       'D_FIREFOX' : true,
-       'D_LEGACY' : true,
+       'D_FIREFOX' : false,
+       'D_LEGACY' : false,
 
        'D_CLAM' : false,
        'D_PAGED_TREE' : false,
@@ -30,25 +30,25 @@ var sdump_levels = {
 
        'D_OPAC' : false,
 
-       'D_PATRON_SEARCH' : true,
-       'D_PATRON_SEARCH_FORM' : true,
-       'D_PATRON_SEARCH_RESULTS' : true,
+       'D_PATRON_SEARCH' : false,
+       'D_PATRON_SEARCH_FORM' : false,
+       'D_PATRON_SEARCH_RESULTS' : false,
 
-       'D_PATRON_DISPLAY' : true,
-       'D_PATRON_DISPLAY_STATUS' : true,
-       'D_PATRON_DISPLAY_CONTACT' : true,
+       'D_PATRON_DISPLAY' : false,
+       'D_PATRON_DISPLAY_STATUS' : false,
+       'D_PATRON_DISPLAY_CONTACT' : false,
 
-       'D_PATRON_ITEMS' : true,
-       'D_PATRON_CHECKOUT_ITEMS' : true,
+       'D_PATRON_ITEMS' : false,
+       'D_PATRON_CHECKOUT_ITEMS' : false,
        'D_PATRON_HOLDS' : true,
-       'D_PATRON_BILLS' : true,
-       'D_PATRON_EDIT' : true,
+       'D_PATRON_BILLS' : false,
+       'D_PATRON_EDIT' : false,
 
        'D_CHECKIN' : true,
-       'D_CHECKIN_ITEMS' : true,
+       'D_CHECKIN_ITEMS' : false,
 
        'D_HOLD_CAPTURE' : true,
-       'D_HOLD_CAPTURE_ITEMS' : true,
+       'D_HOLD_CAPTURE_ITEMS' : false,
 
        'D_CAT' : false,
 
index d59a649..f5ab613 100644 (file)
@@ -195,19 +195,19 @@ function last_sPrint() {
        sPrint( mw.G.last_receipt );
 }
 
-function sPrint(s) {
+function sPrint(s,silent) {
        sdump('D_PRINT',arg_dump(arguments));
        mw.G.last_receipt = s;
        var w = new_window('data:text/html,<html>' + s + '</html>\r\n', { 'window_name':'LastPrint' });
        w.minimize(); mw.minimize();
        setTimeout(
                function() {
-                       NSPrint(w); w.minimize(); w.close(); mw.minimize();
+                       NSPrint(w,silent); w.minimize(); w.close(); mw.minimize();
                },0
        );
 }
 
-function NSPrint(w)
+function NSPrint(w,silent)
 {
        sdump('D_PRINT',arg_dump(arguments));
        if (!w) { w = this; }
@@ -217,7 +217,8 @@ function NSPrint(w)
                        .getInterface(Components.interfaces.nsIWebBrowserPrint);
                if (webBrowserPrint) {
                        var gPrintSettings = GetPrintSettings();
-                       gPrintSettings.printSilent = true;
+                       if (silent) gPrintSettings.printSilent = true;
+                       else gPrintSettings.printSilent = false;
                        /*
                         gPrintSettings.marginTop = 0;
                         gPrintSettings.marginLeft = 0;