go back to patron barcode scan on bad scan. Might want to do a quick existence check...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 28 Dec 2005 19:43:05 +0000 (19:43 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 28 Dec 2005 19:43:05 +0000 (19:43 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2543 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/display.js
Open-ILS/xul/staff_client/server/patron/summary.js

index 25ab774..58e1d90 100644 (file)
@@ -245,6 +245,11 @@ patron.display.prototype = {
                                                        spawn_checkout_interface();
                                                        obj._checkout_spawned = true;
                                                }
+                                       },
+                                       'on_error' : function(E) {
+                                               location.href = urls.remote_patron_barcode_entry + '?session='
+                                                       + window.escape(obj.session);
+                                               alert(E);
                                        }
                                }
                        );
index 0c4e68f..bd86a57 100644 (file)
@@ -567,13 +567,13 @@ patron.summary.prototype = {
                                        var card = new ac(); card.barcode( obj.barcode );
                                        obj.patron.card( card );
                                        obj.patron.family_name( 'Could not retrieve patron' );
-                               alert('FIXME: Need better alert and error handling.\nProblem with barcode: ' 
+                               var error = ('FIXME: Need better alert and error handling.\nProblem with barcode: ' 
                                        + obj.barcode + '\n' + E);
 
                                if (typeof window.xulG == 'object' && typeof window.xulG.on_error == 'function') {
                                        obj.error.sdump('D_PATRON_SUMMARY',
                                                'patron.summary: Calling external .on_error()\n');
-                                       window.xulG.on_error(E);
+                                       window.xulG.on_error(error);
                                } else {
                                        obj.error.sdump('D_PATRON_SUMMARY','patron.summary: No external .on_error()\n');
                                }
@@ -584,7 +584,11 @@ patron.summary.prototype = {
                } catch(E) {
                        var error = ('patron.summary.retrieve : ' + js2JSON(E));
                        this.error.sdump('D_ERROR',error);
-                       alert(error);
+                       if (typeof window.xulG == 'object' && typeof window.xulG.on_error == 'function') {
+                               window.xulG.on_error(error);
+                       } else {
+                               alert(error);
+                       }
                }
        }
 }