alert messages and hold availability notice
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 19 Jul 2006 20:26:29 +0000 (20:26 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 19 Jul 2006 20:26:29 +0000 (20:26 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5091 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 76e3adc..6ae4548 100644 (file)
@@ -318,9 +318,24 @@ patron.display.prototype = {
                                                        obj._checkout_spawned = true;
                                                }
 
-                                               if (patron.alert_message()) {
-                                                       obj.error.yns_alert('"' + patron.alert_message() + '"','Alert Message','OK',null,null,'Check here to confirm this message.');
-                                               }
+                                               obj.network.simple_request(
+                                                       'FM_AHR_COUNT_RETRIEVE',
+                                                       [ ses(), patron.id() ],
+                                                       function(req) {
+                                                               try {
+                                                                       var msg = '';
+                                                                       if (patron.alert_message()) msg += patron.alert_message() + '\n';
+                                                                       var holds = req.getResultObject();
+                                                                       if (holds.ready && holds.ready > 0) msg += 'Holds available: ' + holds.ready;
+                                                                       if (msg) {
+                                                                               obj.error.yns_alert('"' + msg + '"','Alert Message','OK',null,null,'Check here to confirm this message.');
+                                                                       }
+                                                               } catch(E) {
+                                                                       obj.error.standard_unexpected_error_alert('Error showing patron alert and holds availability.',E);
+                                                               }
+                                                       }
+                                               );
+
                                        },
                                        'on_error' : function(E) {
                                                try {