Booking: This should a) make booking interfaces behave better when a staff
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 4 Apr 2011 16:28:17 +0000 (16:28 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 4 Apr 2011 16:28:17 +0000 (16:28 +0000)
login session times out and is replaced by use of a re-auth dialog, and b)
wrap booking interfaces in a <browser> element with the attendant
back/forward/reload buttons that most similar interfaces already had.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@19942 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/booking/capture.js
Open-ILS/web/js/ui/default/booking/pull_list.js
Open-ILS/web/js/ui/default/booking/reservation.js
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/server/patron/display.js

index 5aa0ffa..0e69a2d 100644 (file)
@@ -195,7 +195,7 @@ function capture() {
             "open-ils.booking",
             "open-ils.booking.resources.capture_for_reservation"
         ],
-        [xulG.auth.session.key, barcode]
+        [openils.User.authtoken, barcode]
     );
 
     if (result && result.ilsevent !== undefined) {
index 8941428..831a9de 100644 (file)
@@ -31,7 +31,7 @@ function retrieve_pull_list(ivl_in_days) {
 
     return fieldmapper.standardRequest(
         ["open-ils.booking", "open-ils.booking.reservations.get_pull_list"],
-        [xulG.auth.session.key, null, secs, owning_lib_selected]
+        [openils.User.authtoken, null, secs, owning_lib_selected]
     );
 }
 
@@ -121,7 +121,7 @@ function get_all_relevant_acp(list) {
                 "open-ils.booking",
                 "open-ils.booking.asset.get_copy_fleshed_just_right"
             ],
-            [xulG.auth.session.key, barcodes]
+            [openils.User.authtoken, barcodes]
         );
 
         if (!results) {
index 01ccb35..7893384 100644 (file)
@@ -215,7 +215,7 @@ function get_brsrc_id_list() {
 
     return fieldmapper.standardRequest(
         ["open-ils.booking", "open-ils.booking.resources.filtered_id_list"],
-        [xulG.auth.session.key, options]
+        [openils.User.authtoken, options]
     );
 }
 
@@ -298,7 +298,7 @@ function create_bresv(resource_list) {
         results = fieldmapper.standardRequest(
             ["open-ils.booking", "open-ils.booking.reservations.create"],
             [
-                xulG.auth.session.key,
+                openils.User.authtoken,
                 barcode,
                 reserve_timestamp_range.get_range(),
                 pickup_lib_selected,
@@ -413,7 +413,7 @@ function create_bresv_on_brt() {
 function get_actor_by_barcode(barcode) {
     var usr = fieldmapper.standardRequest(
         ["open-ils.actor", "open-ils.actor.user.fleshed.retrieve_by_barcode"],
-        [xulG.auth.session.key, barcode]
+        [openils.User.authtoken, barcode]
     );
     if (usr == null) {
         alert(localeStrings.GET_PATRON_NO_RESULT);
@@ -432,7 +432,7 @@ function init_bresv_grid(barcode) {
         ["open-ils.booking",
             "open-ils.booking.reservations.filtered_id_list"
         ],
-        [xulG.auth.session.key, {
+        [openils.User.authtoken, {
             "user_barcode": barcode,
             "fields": {
                 "pickup_time": null,
@@ -480,7 +480,7 @@ function cancel_reservations(bresv_id_list, skip_update) {
     try {
         var result = fieldmapper.standardRequest(
             ["open-ils.booking", "open-ils.booking.reservations.cancel"],
-            [xulG.auth.session.key, bresv_id_list]
+            [openils.User.authtoken, bresv_id_list]
         );
     } catch (E) {
         alert(localeStrings.CXL_BRESV_FAILURE2 + E);
@@ -509,7 +509,7 @@ function munge_specific_resource(barcode) {
             var r = fieldmapper.standardRequest(
                 ["open-ils.booking",
                     "open-ils.booking.resources.create_from_copies"],
-                [xulG.auth.session.key,
+                [openils.User.authtoken,
                     copy_list.map(function(o) { return o.id(); })]
             );
 
index 6800f8e..c3a0801 100644 (file)
@@ -911,75 +911,45 @@ main.menu.prototype = {
             'cmd_booking_reservation' : [
                 ['oncommand'],
                 function() {
-                    obj.set_tab(
+                    open_eg_web_page(
                         "/eg/booking/reservation",
-                        {
-                            "tab_name": offlineStrings.getString(
-                                "menu.cmd_booking_reservation.tab"
-                            ),
-                            "browser": false
-                        },
-                        xulG
+                        "menu.cmd_booking_reservation.tab"
                     );
                 }
             ],
             'cmd_booking_pull_list' : [
                 ['oncommand'],
                 function() {
-                    obj.set_tab(
+                    open_eg_web_page(
                         "/eg/booking/pull_list",
-                        {
-                            "tab_name": offlineStrings.getString(
-                                "menu.cmd_booking_pull_list.tab"
-                            ),
-                            "browser": false
-                        },
-                        xulG
+                        "menu.cmd_booking_pull_list.tab"
                     );
                 }
             ],
             'cmd_booking_capture' : [
                 ['oncommand'],
                 function() {
-                    obj.set_tab(
+                    open_eg_web_page(
                         "/eg/booking/capture",
-                        {
-                            "tab_name": offlineStrings.getString(
-                                "menu.cmd_booking_capture.tab"
-                            ),
-                            "browser": false
-                        },
-                        xulG
+                        "menu.cmd_booking_capture.tab"
                     );
                 }
             ],
             'cmd_booking_reservation_pickup' : [
                 ['oncommand'],
                 function() {
-                    obj.set_tab(
+                    open_eg_web_page(
                         "/eg/booking/pickup",
-                        {
-                            "tab_name": offlineStrings.getString(
-                                "menu.cmd_booking_reservation_pickup.tab"
-                            ),
-                            "browser": false
-                        },
-                        xulG
+                        "menu.cmd_booking_reservation_pickup.tab"
                     );
                 }
             ],
             'cmd_booking_reservation_return' : [
                 ['oncommand'],
                 function() {
-                    obj.set_tab(
+                    open_eg_web_page(
                         "/eg/booking/return",
-                        {
-                            "tab_name": offlineStrings.getString(
-                                "menu.cmd_booking_reservation_return.tab"
-                            ),
-                            "browser": false
-                        },
-                        xulG
+                        "menu.cmd_booking_reservation_return.tab"
                     );
                 }
             ],
index 0b43fad..ba9956e 100644 (file)
@@ -1,4 +1,6 @@
 dump('entering patron/display.js\n');
+dojo.require("openils.User");
+dojo.require("openils.XUL");
 
 function $(id) { return document.getElementById(id); }
 
@@ -385,63 +387,51 @@ patron.display.prototype = {
                     'cmd_patron_reservation' : [
                         ['command'],
                         function(ev) {
-                            if (xulG.auth == undefined) {
-                                xulG.auth = {"session": {"key": ses()}};
-                            }
-                            xulG.bresv_interface_opts = {
-                                "patron_barcode": obj.patron.card().barcode()
-                            };
-                            xulG.new_tab(
+                            openils.XUL.newTabEasy(
                                 "/eg/booking/reservation",
-                                {
-                                    "tab_name": $("offlineStrings").getString(
-                                        "menu.cmd_booking_reservation.tab"
-                                    ),
-                                    "browser": false
+                                $("offlineStrings").getString(
+                                    "menu.cmd_booking_reservation.tab"
+                                ), {
+                                    "bresv_interface_opts": {
+                                        "patron_barcode":
+                                            obj.patron.card().barcode()
+                                    }
                                 },
-                                xulG
+                                true
                             );
                         }
                     ],
                     'cmd_patron_reservation_pickup' : [
                         ['command'],
                         function(ev) {
-                            if (xulG.auth == undefined) {
-                                xulG.auth = {"session": {"key": ses()}};
-                            }
-                            xulG.bresv_interface_opts = {
-                                "patron_barcode": obj.patron.card().barcode()
-                            };
-                            xulG.new_tab(
+                            openils.XUL.newTabEasy(
                                 "/eg/booking/pickup",
-                                {
-                                    "tab_name": $("offlineStrings").getString(
-                                        "menu.cmd_booking_reservation_pickup.tab"
-                                    ),
-                                    "browser": false
+                                $("offlineStrings").getString(
+                                    "menu.cmd_booking_reservation_pickup.tab"
+                                ), {
+                                    "bresv_interface_opts": {
+                                        "patron_barcode":
+                                            obj.patron.card().barcode()
+                                    }
                                 },
-                                xulG
+                                true
                             );
                         }
                     ],
                     'cmd_patron_reservation_return' : [
                         ['command'],
                         function(ev) {
-                            if (xulG.auth == undefined) {
-                                xulG.auth = {"session": {"key": ses()}};
-                            }
-                            xulG.bresv_interface_opts = {
-                                "patron_barcode": obj.patron.card().barcode()
-                            };
-                            xulG.new_tab(
+                            openils.XUL.newTabEasy(
                                 "/eg/booking/return",
-                                {
-                                    "tab_name": $("offlineStrings").getString(
-                                        "menu.cmd_booking_reservation_return.tab"
-                                    ),
-                                    "browser": false
+                                $("offlineStrings").getString(
+                                    "menu.cmd_booking_reservation_return.tab"
+                                ), {
+                                    "bresv_interface_opts": {
+                                        "patron_barcode":
+                                            obj.patron.card().barcode()
+                                    }
                                 },
-                                xulG
+                                true
                             );
                         }
                     ],