LP1182519 Per-Hold Behind Desk Hold Receipt
authorBill Erickson <berick@esilibrary.com>
Fri, 31 May 2013 13:51:59 +0000 (09:51 -0400)
committerBill Erickson <berick@esilibrary.com>
Fri, 31 May 2013 13:51:59 +0000 (09:51 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/xul/staff_client/server/circ/util.js

index b783ea3..46e7ab7 100644 (file)
@@ -3041,26 +3041,20 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che
                         } else {
                             print_data.route_to_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to.msg', [check.route_to]);
                             print_data.route_to = check.route_to;
-                            var behind_the_desk_support = String( data.hash.aous['circ.holds.behind_desk_pickup_supported'] ) == 'true';
-                            if (behind_the_desk_support) {
-                               var usr_settings = network.simple_request('FM_AUS_RETRIEVE',[ses(),check.payload.hold.usr()]); 
-                                if (typeof usr_settings['circ.holds_behind_desk'] != 'undefined') {
-                                    if (usr_settings['circ.holds_behind_desk']) {
-                                        print_data.prefer_behind_holds_desk = true;
-                                        check.route_to = document.getElementById('circStrings').getString('staff.circ.route_to.private_hold_shelf');
-                                        print_data.route_to_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to.msg', [check.route_to]);
-                                        print_data.route_to = check.route_to;
-                                    } else {
-                                        check.route_to = document.getElementById('circStrings').getString('staff.circ.route_to.public_hold_shelf');
-                                        print_data.route_to_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to.msg', [check.route_to]);
-                                        print_data.route_to = check.route_to;
-                                    }
-                                } else {
-                                    check.route_to = document.getElementById('circStrings').getString('staff.circ.route_to.public_hold_shelf');
-                                    print_data.route_to_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to.msg', [check.route_to]);
-                                    print_data.route_to = check.route_to;
-                                }
+
+                            // If the hold is marked as behind-shelf, report it as such 
+                            // in the receipt, regardless of any org or user settings.  
+                            if (isTrue(check.payload.hold.behind_desk())) {
+                                print_data.prefer_behind_holds_desk = true;
+                                check.route_to = document.getElementById('circStrings').getString('staff.circ.route_to.private_hold_shelf');
+                                print_data.route_to_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to.msg', [check.route_to]);
+                                print_data.route_to = check.route_to;
+                            } else {
+                                check.route_to = document.getElementById('circStrings').getString('staff.circ.route_to.public_hold_shelf');
+                                print_data.route_to_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to.msg', [check.route_to]);
+                                print_data.route_to = check.route_to;
                             }
+
                             print_data.destination_shelf_msg = print_data.route_to_msg;
                             print_data.destination_shelf = print_data.route_to;
                             msg += print_data.route_to_msg;