example handling of possible hold capture on checkin
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 19 Jul 2005 21:51:11 +0000 (21:51 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 19 Jul 2005 21:51:11 +0000 (21:51 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1292 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 50fa3c7..8516ed1 100644 (file)
@@ -68,7 +68,35 @@ function checkin_by_copy_barcode(barcode, f) {
                )[0];
                if (!f) {
                        sdump('D_CIRC_UTILS','check = ' + js2JSON(check) + '\n');
-                       if (check.status != 0) s_alert(check.text );
+                       if (check.status != 0) {
+                               switch(check.status) {
+                                       case 1: /* possible hold capture */
+                                               var rv = yns_alert(
+                                                       check.text,
+                                                       'Check Check In Interrupt',
+                                                       "Capture",
+                                                       "Don't Capture",
+                                                       null,
+                                                       "Check here to confirm this message"
+                                               );
+                                               switch(rv) {
+                                                       case 0: /* capture */
+                                                       try {
+                                                               capture_hold( barcode );
+                                                               check.text = 'Captured for Hold';
+
+                                                       } catch(E) { sdump('D_ERROR',E + '\n'); }
+                                                       break;
+                                                       case 1: /* don't capture */
+
+                                                               check.text = 'Not Captured for Hold';
+                                                       break;
+                                               }
+                                       break;
+
+                                       default: s_alert(check.text ); break;
+                               }
+                       }
                }
                return check;
        } catch(E) {