From: senator Date: Mon, 4 Apr 2011 16:28:17 +0000 (+0000) Subject: Booking: This should a) make booking interfaces behave better when a staff X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9c056636969e3d8342c39c2924bb3c0d6b418505;p=evergreen%2Fbjwebb.git Booking: This should a) make booking interfaces behave better when a staff login session times out and is replaced by use of a re-auth dialog, and b) wrap booking interfaces in a 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 --- diff --git a/Open-ILS/web/js/ui/default/booking/capture.js b/Open-ILS/web/js/ui/default/booking/capture.js index 5aa0ffa1d..0e69a2dc7 100644 --- a/Open-ILS/web/js/ui/default/booking/capture.js +++ b/Open-ILS/web/js/ui/default/booking/capture.js @@ -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) { diff --git a/Open-ILS/web/js/ui/default/booking/pull_list.js b/Open-ILS/web/js/ui/default/booking/pull_list.js index 8941428c7..831a9de53 100644 --- a/Open-ILS/web/js/ui/default/booking/pull_list.js +++ b/Open-ILS/web/js/ui/default/booking/pull_list.js @@ -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) { diff --git a/Open-ILS/web/js/ui/default/booking/reservation.js b/Open-ILS/web/js/ui/default/booking/reservation.js index 01ccb359d..789338471 100644 --- a/Open-ILS/web/js/ui/default/booking/reservation.js +++ b/Open-ILS/web/js/ui/default/booking/reservation.js @@ -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(); })] ); diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js index 6800f8eda..c3a080136 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -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" ); } ], diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js index 0b43fad4b..ba9956ede 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.js +++ b/Open-ILS/xul/staff_client/server/patron/display.js @@ -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 ); } ],