more checkout / checkin event handling
authorBill Erickson <berick@esilibrary.com>
Tue, 17 Jun 2014 21:32:17 +0000 (17:32 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 17 Jun 2014 21:32:17 +0000 (17:32 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/staff/circ/share/circ_strings.tt2
Open-ILS/web/js/ui/default/staff/circ/services/circ.js

index 2bc8be2..0148f50 100644 (file)
@@ -2,18 +2,22 @@
 
 <script>
 angular.module('egCoreMod').run(['egStrings', function(s) {
-s.PATRON_CARD_INACTIVE=
+s.PATRON_CARD_INACTIVE =
   "[% l('The card used to retrieve this account is inactive and may not be used to circulate items.') %]";
-s.PATRON_INACTIVE=
+s.PATRON_INACTIVE =
   "[% l('This account is inactive and may not circulate items.') %]";
-s.PATRON_ACCOUNT_EXPIRED=
+s.PATRON_ACCOUNT_EXPIRED =
   "[% l('This account has expired and may not circulate items.') %]";
-s.CHECKOUT_FAILED_GENERIC=
-  "[% l('Unable to checkout copy [_1] : [_2]', '{{barcode}}', '{{textcode}}') %]"
-s.COPY_ALERT_MSG_DIALOG_TITLE=
-    '[% l('Copy Alert Message for {{copy_barcode}}') %]';
+s.CIRC_CLAIMS_RETURNED = 
+  '[% l('Item "[_1]" is marked as Claims Returned', '{{barcode}}') %]';
+s.CHECKOUT_FAILED_GENERIC =
+  '[% l('Unable to checkout copy "[_1]" : [_2]', '{{barcode}}', '{{textcode}}') %]';
+s.COPY_ALERT_MSG_DIALOG_TITLE =
+    '[% l('Copy Alert Message for "[_1]"', '{{copy_barcode}}') %]';
 s.UNCAT_ALERT_DIALOG =
-    '[% l('Copy "{{copy_barcode}}" was mis-scanned or is not cataloged') %]';
+    '[% l('Copy "[_1]" was mis-scanned or is not cataloged', '{{copy_barcode}}') %]';
+s.PERMISSION_DENIED = 
+    '[% l('Permission Denied : [_1]', '{{permission}}') %]';
 }]);
 </script>
 
index 3bf61ea..1b9259d 100644 (file)
@@ -182,19 +182,24 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog) {
             case 'PATRON_CARD_INACTIVE':
             case 'PATRON_INACTIVE':
             case 'PATRON_ACCOUNT_EXPIRED':
-                return service.exit_alert(egCore.strings[evt.textcode]);
-
+            case 'CIRC_CLAIMS_RETURNED':
+                return service.exit_alert(
+                    egCore.strings[evt.textcode],
+                    {barcode : params.copy_barcode}
+                );
 
-            /* stuff yet to consider 
-            PERM_FAILURE
-            CIRC_CLAIMS_RETURNED
-            */
+            case 'PERM_FAILURE':
+                return service.exit_alert(
+                    egCore.strings[evt.textcode],
+                    {permission : evt.ilsperm}
+                );
 
             default:
                 return service.exit_alert(
                     egCore.strings.CHECKOUT_FAILED_GENERIC, {
                         barcode : params.copy_barcode,
-                        textcode : evt.textcode
+                        textcode : evt.textcode,
+                        desc : evt.desc
                     }
                 );
         }
@@ -376,7 +381,7 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog) {
     // units locally.
     service.find_copy_transit = function(evt, params, options) {
 
-        if (evt && evt.payload && (transit = evt.payload.transit)) { // not ==
+        if (evt && evt.payload && (transit = evt.payload.transit)) {
             transit.source(egCore.org.get(transit.source()));
             transit.dest(egCore.org.get(transit.dest()));
             return $q.when(transit);
@@ -568,7 +573,7 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog) {
                     var template = 'transit_slip';
                     if (holdUser) {
                         template = 'hold_transit_slip';
-                        print_context.hold = egCore.idl.toHash(evt.payload.hold),
+                        print_context.hold = egCore.idl.toHash(evt.payload.hold);
                         print_context.patron = egCore.idl.toHash(holdUser);
                     }