From: Jane Sandberg Date: Fri, 11 Feb 2022 00:51:10 +0000 (-0800) Subject: WIP: remove legacy booking app X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3feaeabb79b33228e680172e01a3a7a180cef8bd;p=working%2FEvergreen.git WIP: remove legacy booking app Signed-off-by: Jane Sandberg --- diff --git a/Open-ILS/src/templates/booking/capture.tt2 b/Open-ILS/src/templates/booking/capture.tt2 deleted file mode 100644 index 2e02d9c6bd..0000000000 --- a/Open-ILS/src/templates/booking/capture.tt2 +++ /dev/null @@ -1,21 +0,0 @@ -[% WRAPPER "base.tt2" %] - - - - -
- -

-
- - - - -
-
-
-
-[% END %] diff --git a/Open-ILS/src/templates/booking/pickup.tt2 b/Open-ILS/src/templates/booking/pickup.tt2 deleted file mode 100644 index d127e3de81..0000000000 --- a/Open-ILS/src/templates/booking/pickup.tt2 +++ /dev/null @@ -1,78 +0,0 @@ -[% WRAPPER "base.tt2" %] - -
-

-
-
- - - -
-
-
-
-
-
-

-
- - - - - - - - - -
[% l('Title') %][% l('Barcode') %][% l('Start time') %][% l('End time') %]
-
-
- -
-
-
-
-
-

-
- - - - - - - - - -
[% l('Title') %][% l('Barcode') %][% l('Pickup time') %][% l('Due time') %]
-
-
-
-
- -
-
-
- - - - - -[% END %] diff --git a/Open-ILS/src/templates/booking/pull_list.tt2 b/Open-ILS/src/templates/booking/pull_list.tt2 deleted file mode 100644 index 002855f0b2..0000000000 --- a/Open-ILS/src/templates/booking/pull_list.tt2 +++ /dev/null @@ -1,49 +0,0 @@ -[% WRAPPER "base.tt2" %] - - - - -
-

-
-
- - -
-
- - - - - -
- -
-
-
- - - - - - - - - - - - -
- -
-
-
-[% END %] diff --git a/Open-ILS/src/templates/booking/reservation.tt2 b/Open-ILS/src/templates/booking/reservation.tt2 deleted file mode 100644 index 9163e1ced8..0000000000 --- a/Open-ILS/src/templates/booking/reservation.tt2 +++ /dev/null @@ -1,122 +0,0 @@ -[% WRAPPER "base.tt2" %] - -
-
-

-
-
-
-
- -
-
-
-
-
- - - -

-
-
-
- -
-
-
-

- - -
- - -
-
- - -
-
- - -
-
- - -   - - -
-
-
-

-
-
- - -
-
-
- - -
-

-
-
-
-
- -
-
-

-
- - - - - - - - - -
[% l('Type') %][% l('Resource') %][% l('Start time') %][% l('End time') %]
-
- - -
-
-
- - - - -[% END %] diff --git a/Open-ILS/src/templates/booking/return.tt2 b/Open-ILS/src/templates/booking/return.tt2 deleted file mode 100644 index 5c46ab13de..0000000000 --- a/Open-ILS/src/templates/booking/return.tt2 +++ /dev/null @@ -1,88 +0,0 @@ -[% WRAPPER "base.tt2" %] - -
-

-
-
- - - - -
-
-
-
-
-
-

-
- - - - - - - - - -
[% l('Title') %][% l('Barcode') %][% l('Pickup time') %][% l('Due time') %]
-
-
- -
-
-
-
-
-

-
- - - - - - - - - -
[% l('Title') %][% l('Barcode') %][% l('Due time') %][% l('Return time') %]
-
-
-
-
- -
-
-
- - - - - -[% END %] diff --git a/Open-ILS/src/templates/conify/global/booking/resource.tt2 b/Open-ILS/src/templates/conify/global/booking/resource.tt2 deleted file mode 100644 index 6170199b33..0000000000 --- a/Open-ILS/src/templates/conify/global/booking/resource.tt2 +++ /dev/null @@ -1,74 +0,0 @@ -[% WRAPPER base.tt2 %] -[% ctx.page_title = l('Resources') %] -
-
[% l('Resources') %]
-
- - -
-
-
- [% l('Context Org Unit') %] - -
-
- -
-
- -[% END %] diff --git a/Open-ILS/src/templates/conify/global/booking/resource_attr.tt2 b/Open-ILS/src/templates/conify/global/booking/resource_attr.tt2 deleted file mode 100644 index d984d065db..0000000000 --- a/Open-ILS/src/templates/conify/global/booking/resource_attr.tt2 +++ /dev/null @@ -1,63 +0,0 @@ -[% WRAPPER base.tt2 %] -[% ctx.page_title = l('Resource Attributes') %] -
-
[% l('Resource Attributes') %]
-
- - -
-
-
- [% l('Context Org Unit') %] - -
-
- -
-
- - -[% END %] diff --git a/Open-ILS/src/templates/conify/global/booking/resource_attr_map.tt2 b/Open-ILS/src/templates/conify/global/booking/resource_attr_map.tt2 deleted file mode 100644 index 43d90be89f..0000000000 --- a/Open-ILS/src/templates/conify/global/booking/resource_attr_map.tt2 +++ /dev/null @@ -1,63 +0,0 @@ -[% WRAPPER base.tt2 %] -[% ctx.page_title = l('Resource Attribute Maps') %] -
-
[% l('Resource Attribute Maps') %]
-
- - -
-
-
- [% l('Context Org Unit') %] - -
-
- -
-
- - -[% END %] diff --git a/Open-ILS/src/templates/conify/global/booking/resource_attr_value.tt2 b/Open-ILS/src/templates/conify/global/booking/resource_attr_value.tt2 deleted file mode 100644 index 71130acd3f..0000000000 --- a/Open-ILS/src/templates/conify/global/booking/resource_attr_value.tt2 +++ /dev/null @@ -1,59 +0,0 @@ -[% WRAPPER base.tt2 %] -[% ctx.page_title = l('Resource Attribute Values') %] -
-
[% l('Resource Attribute Values') %]
-
- - -
-
-
- [% l('Context Org Unit') %] - -
-
- -
-
- - -[% END %] diff --git a/Open-ILS/src/templates/conify/global/booking/resource_type.tt2 b/Open-ILS/src/templates/conify/global/booking/resource_type.tt2 deleted file mode 100644 index 4efa432eb3..0000000000 --- a/Open-ILS/src/templates/conify/global/booking/resource_type.tt2 +++ /dev/null @@ -1,61 +0,0 @@ -[% WRAPPER base.tt2 %] -[% ctx.page_title = l('Resource Types') %] -
-
[% l('Resource Types') %]
-
- - -
-
-
- [% l('Context Org Unit') %] - -
-
- -
-
- - -[% END %] diff --git a/Open-ILS/src/templates/staff/admin/booking/index.tt2 b/Open-ILS/src/templates/staff/admin/booking/index.tt2 deleted file mode 100644 index 4c8b5da78f..0000000000 --- a/Open-ILS/src/templates/staff/admin/booking/index.tt2 +++ /dev/null @@ -1,15 +0,0 @@ -[% - WRAPPER "staff/base.tt2"; - ctx.page_title = l("Booking Administration"); - ctx.page_app = "egBookingAdmin"; -%] - -[% BLOCK APP_JS %] - - - -[% END %] - -
- -[% END %] diff --git a/Open-ILS/src/templates/staff/admin/booking/t_splash.tt2 b/Open-ILS/src/templates/staff/admin/booking/t_splash.tt2 deleted file mode 100644 index f51ea00cd0..0000000000 --- a/Open-ILS/src/templates/staff/admin/booking/t_splash.tt2 +++ /dev/null @@ -1,39 +0,0 @@ - -
-
- [% l('Booking Administration') %] -
-
- -
- -[% - interfaces = [ - [ l('Resources'), "./admin/server/booking/resource" ] - ,[ l('Resource Attribute Maps'), "./admin/server/booking/resource_attr_map" ] - ,[ l('Resource Attribute Values'), "./admin/server/booking/resource_attr_value" ] - ,[ l('Resource Attributes'), "./admin/server/booking/resource_attr" ] - ,[ l('Resource Types'), "./admin/server/booking/resource_type" ] - ]; - - USE table(interfaces, cols=3); -%] - -
-[% FOREACH col = table.cols %] -
- [% FOREACH item = col %][% IF item.1 %] -
- -
- [% END %][% END %] -
-[% END %] -
- -
diff --git a/Open-ILS/web/css/skin/default/booking.css b/Open-ILS/web/css/skin/default/booking.css deleted file mode 100644 index f020ded242..0000000000 --- a/Open-ILS/web/css/skin/default/booking.css +++ /dev/null @@ -1,107 +0,0 @@ -div#brsrc_available_outer { - width: 50%; - float: left; - border-right: 1px solid #999999; -} -div#bra_and_brav { -} -div#reserve_right_side { - float: right; - width: 49%; - padding-left: 4px; -} -div#reserve_under { - clear: both; -} -div#reserve_datetime_start { - padding-bottom: 6px; -} -div#reserve_datetime_end { - padding-bottom: 6px; - border-bottom: 1px solid #999999; -} -label.bra { - font-style: italic; - padding-right: 12px; -} -h1.booking, h2.booking, h3.booking { - margin: 0; - padding-top: 0; - padding-bottom: 8px; -} -h1.booking { font-size: 16pt; font-weight: bold; } -select#brsrc_list { - width: 90%; -} -label.reserve_datetime { - font-style: italic; - margin-bottom: 2px; -} -id#patron_barcode { - width: 150px; -} -div.nice_vertical_padding { - padding-top: 6px; - padding-bottom: 6px; -} -span.two_buttons { - text-align: center; -} -option.forced_unavailable { - background-color: #ffcccc; - color: #990000; - font-weight: bold; - font-style: italic; -} -input#arbitrary_resource { margin-left: 8px; margin-right: 8px; } -div#or { font-size: 12pt; font-weight: bold; } -input#interval_in_days { width: 75px; } -table#the_table thead tr th { - vertical-align: top; - background-color: #dddddd; - color: #000000; - font-weight: bold; - padding: 0 6px 0 6px; - border-left: 1px #cccccc solid; - border-right: 1px #333333 solid; -} -tbody#the_table_body td { - vertical-align: top; - padding: 2px; - border-top: 1px #cccccc solid; - border-left: 1px #cccccc solid; - border-bottom: 1px #333333 solid; - border-right: 1px #333333 solid; -} -.capture_failure { color: #cc0000; } -.capture_success { color: #00cc00; } -ul { list-style-type: square; } -.capture_info { font-size: 12pt; font-weight: bold; margin-bottom: 4px; } -.transit_notice { - font-size: 12pt; font-weight: bold; color: #ff6666; - margin-bottom: 4px; margin-top: 4px; -} -span#result_display { margin-left: 12px; } -div#contains_misc_controls { text-align:right; } -div#patron_info { font-size: 12pt; font-weight: bold; } -div#no_ready_bresv, div#no_out_bresv, div#no_in_bresv { - font-style: italic; -} -.tundra .dojoxGridRowSelected { - background-color: #006699 !important; - color: #ffffff; -} -.pull_list_resv_detail { - border-bottom: 1px dashed #999999; - margin-bottom: 4px; -} -.pull_list_will_transit { font-weight: bold; color: #ff6666; } -iframe#printing_iframe { - border-top: 1px dashed #333333; - border-left: 0; - border-right: 0; - border-bottom: 0; -} -button.print_slip { - margin-left: 24px; -} diff --git a/Open-ILS/web/js/dojo/openils/booking/nls/capture.js b/Open-ILS/web/js/dojo/openils/booking/nls/capture.js deleted file mode 100644 index b868babc5f..0000000000 --- a/Open-ILS/web/js/dojo/openils/booking/nls/capture.js +++ /dev/null @@ -1,34 +0,0 @@ -{ - "FAILURE": "Capture failed", - "SUCCESS": "Capture succeeded", - "UNKNOWN_PROBLEM": "An unknown problem occurred during capture attempt.", - "CAPTURED_NOTHING": "Didn't capture anything.", - "NO_PAYLOAD": "We did not receive further information from the server about this attempt to capture.", - "HERES_WHAT_WE_KNOW": "The following information is available about the failed capture:", - "CAPTURE_INFO": "Capture Information", - "CAPTURE_BRESV_DATES": "Reservation time:", - "CAPTURE_BRESV_BRSRC": "Resource barcode:", - "CAPTURE_BRESV_PICKUP_LIB": "Pickup library:", - "CAPTURE_CAUSES_TRANSIT": "This item is now in transit!", - "CAPTURE_TRANSIT_SOURCE": "From:", - "CAPTURE_TRANSIT_DEST": "To:", - "BARCODE": "Barcode", - "TITLE": "Title", - "AUTHOR": "Author", - "RESERVED": "Reserved for patron", - "REQUEST": "Request time", - "DURATION": "Reserved from", - "SLIP_DATE": "Slip date", - "PRINTED_BY": "Printed by", - "AT": "at", - "PRINT": "Print", - "PRINT_ACCESSKEY": "P", - "TRANSIT": "*** TRANSIT ***", - "RESERVATION_SHELF": "RESERVATION SHELF", - "NEEDS_ROUTED_TO": "This item need to be routed to", - - "AUTO_capture_heading": "Capture Reserved Resources", - "AUTO_resource_barcode": "Enter barcode:", - "AUTO_pickup_lib_selector": "Pickup library:", - "AUTO_ATTR_VALUE_capture": "Capture" -} diff --git a/Open-ILS/web/js/dojo/openils/booking/nls/pickup_and_return.js b/Open-ILS/web/js/dojo/openils/booking/nls/pickup_and_return.js deleted file mode 100644 index cf227ba899..0000000000 --- a/Open-ILS/web/js/dojo/openils/booking/nls/pickup_and_return.js +++ /dev/null @@ -1,34 +0,0 @@ -{ - "NO_PATRON_BARCODE": "Please enter a patron barcode.", - "RESERVATIONS_NO_RESPONSE": "No response from server when asking for reservations.", - "RESERVATIONS_ERROR": "Error communicating with server (asking for reservations):", - "PICKUP_NO_RESPONSE": "No response from server when attempting pickup.", - "PICKUP_ERROR": "Error communicating with server (attempting pickup):", - "RETURN_NO_RESPONSE": "No response from server when attempting return.", - "RETURN_ERROR": "Error communicating with server (attempting return):", - "RETURN_SUCCESS": "Return successful.", - "SELECT_SOMETHING": "You have not selected any reservations.", - "NO_SUCH_RETURNABLE_RESOURCE": "No such returnable resource.", - "RETURNABLE_RESOURCE_ERROR": "Error looking up returnable resource:", - "NOTICE_CHANGE_OF_PATRON": - "Note that the resource scanned was out on reservation to a different\npatron than the last resource you scanned. If this is not\nexpected, stop to examine outstanding reservations for your patron\nor on the resource.", - - "AUTO_h1": "Reservations Pickup", - "AUTO_return_h1": "Reservations Return", - "AUTO_patron_barcode": "Enter patron barcode:", - "AUTO_barcode_type": "Return by barcode of", - "AUTO_in_bresv": "Patron has returned these resources today:", - "AUTO_ready_bresv": "Patron has these reservations ready for pickup:", - "AUTO_out_bresv": "Patron currently has these reservations out:", - "AUTO_no_ready_bresv": "Patron has no reservations ready for pickup at this time.", - "AUTO_no_out_bresv": "Patron has no more reservations out at this time.", - "AUTO_no_in_bresv": "Patron has not returned any resources today.", - "AUTO_patron": "Patron", - "AUTO_resource": "Resource", - "AUTO_ATTR_VALUE_go": "Go", - "AUTO_ATTR_VALUE_reset": "Clear / New Patron", - "AUTO_ATTR_VALUE_pickup": "Pick up", - "AUTO_ATTR_VALUE_return": "Return", - "ADDRESS": "${0}\n${1}\n${2}, ${3} ${4}", - "COPY_ALERT": "${0}:\n${1}\n\nDo you wish to process it anyway?" -} diff --git a/Open-ILS/web/js/dojo/openils/booking/nls/pull_list.js b/Open-ILS/web/js/dojo/openils/booking/nls/pull_list.js deleted file mode 100644 index 0d7e1d163b..0000000000 --- a/Open-ILS/web/js/dojo/openils/booking/nls/pull_list.js +++ /dev/null @@ -1,22 +0,0 @@ -{ - "PULL_LIST_NO_RESPONSE": "No response from server trying to get pull list!", - "PULL_LIST_ERROR": "Error trying to fetch pull list: ", - "COPY_LOOKUP_NO_RESPONSE": "No response looking up copies by barcode", - "COPY_LOOKUP_ERROR": "Error looking up copies by barcode: ", - "COPY_MISSING": "Unexpected error: No information for copy: ", - "AT": "at", - "FOR": "for", - - "AUTO_no_results": "No results.", - "AUTO_owning_lib_selector": "See pull list for library:", - "AUTO_pull_list_title": "Booking Pull List", - "AUTO_interval_in_days": "Generate list for this many days hence: ", - "AUTO_ATTR_VALUE_fetch": "Fetch", - "AUTO_th_title_or_name": "Title or name", - "AUTO_th_barcode": "Barcode", - "AUTO_th_call_number": "Call number", - "AUTO_th_copy_location": "Copy location", - "AUTO_th_pickup_lib": "Pickup library", - "AUTO_th_resv_details": "Reservation details", - "AUTO_ATTR_VALUE_print": "Print" -} diff --git a/Open-ILS/web/js/dojo/openils/booking/nls/reservation.js b/Open-ILS/web/js/dojo/openils/booking/nls/reservation.js deleted file mode 100644 index 9b23c5875e..0000000000 --- a/Open-ILS/web/js/dojo/openils/booking/nls/reservation.js +++ /dev/null @@ -1,61 +0,0 @@ -{ - "NO_BRT_RESULTS": "There are no bookable resource types registered.", - "NO_TARG_DIV": "Could not find target div", - "NO_BRA_RESULTS": "Couldn't retrieve booking resource attributes.", - "SELECT_A_BRSRC_THEN": "You have clicked 'Reserve Selected', but nothing is selected!\n\nYou must select a resource from the large box above.\n\n*** If resources that you would select are highlighted in RED, ***\nthese items are not available during the requested time; if\npossible, choose another resource or change the reservation time.", - "CREATE_BRESV_LOCAL_ERROR": "Exception trying to create reservation: ", - "CREATE_BRESV_SERVER_ERROR": "Server error trying to create reservation: ", - "CREATE_BRESV_SERVER_NO_RESPONSE": "No response from server after trying to create reservation.", - "CREATE_BRESV_OK_MISSING_TARGET": "Created ${0} reservation(s), but ${1} of these could not target any resources.\n\nThis means that it won't be possible to fulfill some of these\nreservations until a suitable resource becomes available.", - "CREATE_BRESV_OK_MISSING_TARGET_BLOCKED_BY_CIRC": "The desired reservation(s) are blocked by circulation(s) with the following due date(s):\n${0}", - "CREATE_BRESV_OK_MISSING_TARGET_WILL_CANCEL": "Since the requested resource could not be targeted, this\nreservation will now be canceled.", - "CREATE_BRESV_OK": "Created ${0} reservation(s)", - "WHERES_THE_BARCODE": "Enter a patron's barcode to make a reservation.", - "ACTOR_CARD_NOT_FOUND": "Patron barcode not found. Please try again.", - "GET_BRESV_LIST_ERR": "Error while retrieving reservation list: ", - "GET_BRESV_LIST_NO_RESULT": "No results from server retrieving reservation list.", - "OUTSTANDING_BRESV": "Outstanding reservations for patron", - "UNTARGETED": "None targeted", - "GET_PATRON_NO_RESULT": "No server response after attempting to look up patron by barcode.", - "HERE_ARE_EXISTING_BRESV": "Existing reservations for", - "NO_EXISTING_BRESV": "This user has no existing reservations at this time.", - "NO_USABLE_BRSRC": "No reservable resources. Adjust start and end time\nuntil a resource is available for reservation.", - "CXL_BRESV_SUCCESS": "Canceled ${0} reservation(s)", - "CXL_BRESV_FAILURE": "Error canceling reservations; server silent.", - "CXL_BRESV_FAILURE2": "Error canceling reservations:\n", - "CXL_BRESV_SELECT_SOMETHING": - "You have not selected any reservations to cancel.", - "NEED_EXACTLY_ONE_BRT_PASSED_IN": "Can't book multiple resource types at once", - "COULD_NOT_RETRIEVE_BRT_PASSED_IN": "Error retrieving booking resource type", - "INVALID_TS_RANGE": "You must choose a valid start and end time for the reservation.", - "BRSRC_NOT_FOUND": "Could not locate that resource.", - "BRSRC_RETRIVE_ERROR": "Error retrieving resource: ", - "ON_FLY_NO_RESPONSE": - "No response from server attempting to make item a bookable resource.", - "ON_FLY_ERROR": - "Error attempting to make item a bookable resource:", - "ANY": "ANY", - "ERROR_FETCHING_AOUS": - "Could not retrieve organizational unit settings.\nThis is a non-fatal error, but you may wish to\ncontact your system administrator.", - "AUTO_choose_a_brt": "Choose a Bookable Resource Type", - "AUTO_i_need_this_resource": "I need this resource...", - "AUTO_starting_at": "Between", - "AUTO_ending_at": "and", - "AUTO_with_these_attr": "With these attributes:", - "AUTO_patron_barcode": "Reserve to patron barcode:", - "AUTO_ATTR_VALUE_next": "Next", - "AUTO_ATTR_VALUE_reserve_brsrc": "Reserve Selected", - "AUTO_ATTR_VALUE_reserve_brt": "Reserve Any", - "AUTO_ATTR_VALUE_button_edit_existing": "Edit selected", - "AUTO_ATTR_VALUE_button_cancel_existing": "Cancel selected", - "AUTO_bresv_grid_type": "Type", - "AUTO_bresv_grid_resource": "Resource", - "AUTO_bresv_grid_start_time": "Start time", - "AUTO_bresv_grid_end_time": "End time", - "AUTO_brt_noncat_only": "Show only non-cataloged bookable resource types", - "AUTO_arbitrary_resource": "Enter the barcode of a cataloged, bookable resource:", - "AUTO_explain_bookable": "To reserve an item that is not yet registered as a bookable resource, find it in the catalog or under Display Item, and select Make Item Bookable or Book Item Now there.", - "AUTO_pickup_lib_selector": "Choose the pickup library for this reservation:", - "AUTO_email_notify": "Send email notification when resource is available for pickup.", - "AUTO_or": "- Or -" -} diff --git a/Open-ILS/web/js/ui/default/booking/capture.js b/Open-ILS/web/js/ui/default/booking/capture.js deleted file mode 100644 index 7a53625734..0000000000 --- a/Open-ILS/web/js/ui/default/booking/capture.js +++ /dev/null @@ -1,248 +0,0 @@ -dojo.require("openils.User"); -dojo.require("openils.widget.OrgUnitFilteringSelect"); -dojo.requireLocalization("openils.booking", "capture"); - -const CAPTURE_FAILURE = 0; -const CAPTURE_SUCCESS = 1; -const CAPTURE_UNKNOWN = 2; - -var localeStrings = dojo.i18n.getLocalization("openils.booking", "capture"); - -function CaptureDisplay(control_holder, data_holder) { - this.control_holder = control_holder; - this.data_holder = data_holder; -} -CaptureDisplay.prototype.no_payload = function() { - this.data_holder.appendChild( - document.createTextNode(localeStrings.NO_PAYLOAD) - ); -}; -CaptureDisplay.prototype.dump = function(payload) { - var div = document.createElement("div"); - div.appendChild(document.createTextNode(localeStrings.HERES_WHAT_WE_KNOW)); - this.data_holder.appendChild(div); - - var ul = document.createElement("ul"); - for (var k in payload) { - var li = document.createElement("li"); - li.appendChild(document.createTextNode(k + ": " + payload[k])); - ul.appendChild(li); - } - this.data_holder.appendChild(ul); -}; -CaptureDisplay.prototype._generate_barcode_line = function(payload) { - var div = document.createElement("div"); - div.appendChild(document.createTextNode( - localeStrings.BARCODE + ": " + payload.resource.barcode() - )); - return div; -}; -CaptureDisplay.prototype._generate_title_line = function(payload) { - var div = document.createElement("div"); - div.appendChild(document.createTextNode( - localeStrings.TITLE + ": " + - (payload.mvr ? payload.mvr.title() : payload.type.name()) - )); - return div; -}; -CaptureDisplay.prototype._generate_author_line = function(payload) { - var div = document.createElement("div"); - if (payload.mvr) { - div.appendChild(document.createTextNode( - localeStrings.AUTHOR + ": " + payload.mvr.author() - )); - } - return div; -}; -CaptureDisplay.prototype._generate_transit_notice = function(payload) { - var div = document.createElement("div"); - if (payload.transit) { - div.setAttribute("class", "transit_notice"); - div.appendChild(document.createTextNode(localeStrings.TRANSIT)); - } - return div; -}; -CaptureDisplay.prototype._generate_route_line = function(payload) { - var div = document.createElement("div"); - var strong = document.createElement("strong"); - strong.appendChild(document.createTextNode( - (payload.transit ? - fieldmapper.aou.findOrgUnit(payload.transit.dest()).shortname() : - localeStrings.RESERVATION_SHELF) + ":" - )); - div.appendChild(document.createTextNode( - localeStrings.NEEDS_ROUTED_TO + " " - )); - div.appendChild(strong); - return div; -}; -CaptureDisplay.prototype._generate_notes_line = function(payload) { - var p = document.createElement("p"); - if (payload.reservation.note()) { - p.innerHTML = "" + payload.reservation.note() + ""; - } - return p; -}; -CaptureDisplay.prototype._generate_patron_info = function(payload) { - var p = document.createElement("p"); - p.innerHTML = "" + localeStrings.RESERVED + " " + - formal_name(payload.reservation.usr()) + "
" + - localeStrings.BARCODE + ": " + - payload.reservation.usr().card().barcode(); - return p; -}; -CaptureDisplay.prototype._generate_resv_info = function(payload) { - var p = document.createElement("p"); - p.innerHTML = localeStrings.REQUEST + ": " + - humanize_timestamp_string(payload.reservation.request_time()) + - "
" + - localeStrings.DURATION + ": " + - humanize_timestamp_string(payload.reservation.start_time()) + - " - " + - humanize_timestamp_string(payload.reservation.end_time()); - return p; -}; -CaptureDisplay.prototype._generate_meta_info = function(result) { - var p = document.createElement("p"); - p.innerHTML = localeStrings.SLIP_DATE + ": " + result.servertime + - "
" + localeStrings.PRINTED_BY + " " + - formal_name(openils.User.user) + " " + localeStrings.AT + " " + - fieldmapper.aou.findOrgUnit(openils.User.user.ws_ou()).shortname() - return p; -}; -CaptureDisplay.prototype.display_with_transit_info = function(result) { - var div = document.createElement("div"); - var span = document.createElement("span"); - span.appendChild(document.createTextNode(localeStrings.CAPTURE_INFO)); - span.setAttribute("class", "capture_info"); - this.control_holder.appendChild(span); - - var button = document.createElement("button"); - button.setAttribute("class", "print_slip"); - button.setAttribute("type", "button"); - button.setAttribute("accesskey", localeStrings.PRINT_ACCESSKEY); - button.innerHTML = localeStrings.PRINT; - button.onclick = function() { - try { dojo.byId("printing_iframe").contentWindow.print(); } - catch (E) { alert(E); } /* XXX */ - return false; - }; - this.control_holder.appendChild(button); - - div.appendChild(this._generate_transit_notice(result.payload)); - - var p = document.createElement("p"); - p.appendChild(this._generate_route_line(result.payload)); - p.appendChild(this._generate_barcode_line(result.payload)); - p.appendChild(this._generate_title_line(result.payload)); - p.appendChild(this._generate_author_line(result.payload)); - div.appendChild(p); - - div.appendChild(this._generate_notes_line(result.payload)); - - div.appendChild(this._generate_patron_info(result.payload)); - div.appendChild(this._generate_resv_info(result.payload)); - div.appendChild(this._generate_meta_info(result)); - - this._create_iframe(div); -}; -CaptureDisplay.prototype._create_iframe = function(contents) { - var iframe = document.createElement("iframe"); - iframe.setAttribute("name", "printing_iframe"); - iframe.setAttribute("id", "printing_iframe"); - iframe.setAttribute("src", ""); - iframe.setAttribute("width", "100%"); - iframe.setAttribute("height", "400"); /* hardcode 400px? really? */ - - this.data_holder.appendChild(iframe); - - var w = dojo.byId("printing_iframe").contentWindow; - w.document.open(); - w.document.write( - "" - ); - w.document.close(); - w.document.body.appendChild(contents); - /* FIXME if (determine_autoprint_setting_somehow()) w.print(); */ -}; -CaptureDisplay.prototype.clear = function() { - this.control_holder.innerHTML = ""; - this.data_holder.innerHTML = ""; -}; -CaptureDisplay.prototype.load = function(result) { - try { - this.control_holder.appendChild(document.createElement("hr")); - if (!result.payload) { - this.no_payload(); - } else if (!result.payload.fail_cause && result.payload.captured) { - this.display_with_transit_info(result); - } else { - this.dump(result.payload); - } - } catch (E) { - alert(E); /* XXX */ - } -}; - -var capture_display; -var last_result; - -function clear_for_next() { - if (last_result == CAPTURE_SUCCESS) { - last_result = undefined; - document.getElementById("result_display").innerHTML = ""; - document.getElementById("resource_barcode").value = ""; - } -} - -function capture() { - var barcode = document.getElementById("resource_barcode").value; - var result = fieldmapper.standardRequest( - [ - "open-ils.booking", - "open-ils.booking.resources.capture_for_reservation" - ], - [openils.User.authtoken, barcode] - ); - - if (result && result.ilsevent !== undefined) { - if (result.payload && result.payload.captured > 0) { - capture_display.load(result); - return CAPTURE_SUCCESS; - } else { - capture_display.load(result); - alert(my_ils_error(localeStrings.CAPTURED_NOTHING, result)); - return CAPTURE_FAILURE; - } - } else { - return CAPTURE_UNKNOWN; - } -} - -function attempt_capture() { - var rd = document.getElementById("result_display"); - capture_display.clear(); - switch(last_result = capture()) { - case CAPTURE_FAILURE: - rd.setAttribute("class", "capture_failure"); - rd.innerHTML = localeStrings.FAILURE; - break; - case CAPTURE_SUCCESS: - rd.setAttribute("class", "capture_success"); - rd.innerHTML = localeStrings.SUCCESS; - break; - default: - alert(localeStrings.UNKNOWN_PROBLEM); - break; - } -} - -function my_init() { - init_auto_l10n(dojo.byId("auto_l10n_start_here")); - capture_display = new CaptureDisplay( - dojo.byId("capture_info_top"), - dojo.byId("capture_info_bottom") - ); -} diff --git a/Open-ILS/web/js/ui/default/booking/common.js b/Open-ILS/web/js/ui/default/booking/common.js deleted file mode 100644 index 3bcbe44482..0000000000 --- a/Open-ILS/web/js/ui/default/booking/common.js +++ /dev/null @@ -1,80 +0,0 @@ -dojo.require("dijit.form.Button"); - -/* Quick and dirty way to localize some strings; not recommended for reuse. - * I'm sure dojo provides a better mechanism for this, but at the moment - * this is faster to implement anew than figuring out the Right way to do - * the same thing w/ dojo. - */ -function init_auto_l10n(el) { - function do_it(myel, cls) { - if (cls) { - var clss = cls.split(" "); - for (var k in clss) { - var parts = clss[k].match(/^AUTO_ATTR_([A-Z]+)_.+$/); - if (parts && localeStrings[clss[k]]) { - myel.setAttribute( - parts[1].toLowerCase(), localeStrings[clss[k]] - ); - } else if (clss[k].match(/^AUTO_/) && localeStrings[clss[k]]) { - myel.innerHTML = localeStrings[clss[k]]; - } - } - } - } - - for (var i in el.attributes) { - if (el.attributes[i].nodeName == "class") { - do_it(el, el.attributes[i].value); - break; - } - } - for (var i in el.childNodes) { - if (el.childNodes[i].nodeType == 1) { // element node? - init_auto_l10n(el.childNodes[i]); // recurse! - } - } -} - -function get_keys(L) { var K = []; for (var k in L) K.push(k); return K; } -function hide_dom_element(e) { e.style.display = "none"; }; -function reveal_dom_element(e) { e.style.display = ""; }; -function formal_name(u) { - var name = u.family_name() + ", " + u.first_given_name(); - if (u.second_given_name()) - name += (" " + u.second_given_name()); - return name; -} -function humanize_timestamp_string(ts) { - /* For now, this discards time zones. */ - var parts = ts.split("T"); - var timeparts = parts[1].split("-")[0].split(":"); - return parts[0] + " " + timeparts[0] + ":" + timeparts[1]; -} -function humanize_timestamp_string2(ts) { - /* For now, this discards time zones, too. */ - var parts = ts.split(" "); - parts[1] = parts[1].replace(/[\-\+]\d+$/, ""); - var timeparts = parts[1].split("-")[0].split(":"); - return parts[0] + " " + timeparts[0] + ":" + timeparts[1]; -} -function is_ils_event(e) { return (e.ilsevent != undefined); } -function is_ils_actor_card_error(e) { - return (e.textcode == "ACTOR_CARD_NOT_FOUND"); -} -function my_ils_error(leader, e) { - var s = leader + "\n"; - var keys = [ - "ilsevent", "desc", "textcode", "servertime", "pid", "stacktrace" - ]; - for (var i in keys) { - if (e[keys[i]]) s += ("\t" + keys[i] + ": " + e[keys[i]] + "\n"); - } - return s; -} -function set_datagrid_empty_store(grid, flattener) { - grid.setStore( - new dojo.data.ItemFileReadStore( - {"data": flattener([])} - ) - ); -} diff --git a/Open-ILS/web/js/ui/default/booking/pickup.js b/Open-ILS/web/js/ui/default/booking/pickup.js deleted file mode 100644 index fed016d4a8..0000000000 --- a/Open-ILS/web/js/ui/default/booking/pickup.js +++ /dev/null @@ -1,48 +0,0 @@ -dojo.requireLocalization("openils.booking", "pickup_and_return"); -var localeStrings = dojo.i18n.getLocalization( - "openils.booking", "pickup_and_return" -); -var p; - -function react_to_pass_in(opts) { - if (opts && opts.patron_barcode) { - p.populate({"patron": opts.patron_barcode}); - - hide_dom_element( - document.getElementById("contains_barcode_control") - ); - document.getElementById("patron_barcode").value = opts.patron_barcode; - p._extra_resetting = function() { - reveal_dom_element( - document.getElementById("contains_barcode_control") - ); - }; - } -} - -function my_init() { - p = new Populator({ - "ready": ready_bresv, - "out": out_bresv, - "patron": document.getElementById("patron_info") - }, document.getElementById("patron_barcode")); - init_auto_l10n(document.getElementById("auto_l10n_start_here")); - - setTimeout( - function() { - var opts; - if (typeof xulG != 'undefined' && typeof xulG.bresv_interface_opts != 'undefined') { - opts = xulG.bresv_interface_opts; - } else { - opts = {}; - } - var uri = location.href; - var query = uri.substring(uri.indexOf("?") + 1, uri.length); - var queryObject = dojo.queryToObject(query); - if (typeof queryObject['patron_barcode'] != 'undefined') { - opts.patron_barcode = queryObject['patron_barcode']; - } - react_to_pass_in(opts); - }, 0 - ); -} diff --git a/Open-ILS/web/js/ui/default/booking/populator.js b/Open-ILS/web/js/ui/default/booking/populator.js deleted file mode 100644 index c6927e65f5..0000000000 --- a/Open-ILS/web/js/ui/default/booking/populator.js +++ /dev/null @@ -1,366 +0,0 @@ -/* This module depends on common.js being loaded, as well as the - * localization (Dojo/nls) for pickup and return . */ - -dojo.require("dojo.data.ItemFileReadStore"); -dojo.require("dojo.date.locale"); -dojo.require("openils.PermaCrud"); -dojo.require("dojo.string"); - -function Populator(widgets, primary_input) { - this.widgets = widgets; - - this.all = []; - for (var k in widgets) this.all.push(k); - - if (primary_input) this.primary_input = primary_input; - - this.prepare_cache(); - this.prepare_empty_stores(); - this.reset(); -} -Populator.prototype.prepare_cache = function(data) { - this.cache = {}; - for (var k in this.all) this.cache[this.all[k]] = {}; -}; -Populator.prototype.prepare_empty_stores = function(data) { - this.empty_stores = {}; - - for (var i in this.all) { - var name = this.all[i]; - - if (this.widgets[name] && this["flatten_" + name]) { - this.empty_stores[name] = - new dojo.data.ItemFileReadStore({ - "data": this["flatten_" + name]([]) - }); - this.widgets[name].setStore(this.empty_stores[name]); - } - } -}; -Populator.prototype.flatten_ready = function(data) { - return { - "label": "id", - "identifier": "id", - "items": data.map(function(o) { - return { - "id": o.id(), - "type": o.target_resource_type().name(), - "resource": o.current_resource().barcode(), - "start_time": humanize_timestamp_string(o.start_time()), - "end_time": humanize_timestamp_string(o.end_time()) - }; - }) - }; -}; -Populator.prototype.flatten_out = function(data) { - return { - "label": "id", - "identifier": "id", - "items": data.map(function(o) { - return { - "id": o.id(), - "type": o.target_resource_type().name(), - "resource": o.current_resource().barcode(), - "pickup_time": humanize_timestamp_string(o.pickup_time()), - "end_time": humanize_timestamp_string(o.end_time()) - }; - }) - }; -}; -Populator.prototype.flatten_in = function(data) { - return { - "label": "id", - "identifier": "id", - "items": data.map(function(o) { - return { - "id": o.id(), - "type": o.target_resource_type().name(), - "resource": o.current_resource().barcode(), - "due_time": humanize_timestamp_string(o.end_time()), - "return_time": humanize_timestamp_string(o.return_time()) - }; - }) - }; -}; -Populator.prototype.reveal_container = function(widget) { - var el = document.getElementById("contains_" + widget.id); - if (el) reveal_dom_element(el); -}; -Populator.prototype.hide_container = function(widget) { - var el = document.getElementById("contains_" + widget.id); - if (el) hide_dom_element(el); -}; -Populator.prototype.populate_ready = function(data) { - return this._populate_any_resv_grid(data, "ready"); -}; -Populator.prototype.populate_out = function(data) { - return this._populate_any_resv_grid(data, "out"); -}; -Populator.prototype.populate_in = function(data) { - return this._populate_any_resv_grid(data, "in"); -}; -Populator.prototype._populate_any_resv_grid = function(data, which) { - var flattener = this["flatten_" + which]; - var widget = this.widgets[which]; - var cache = this.cache[which]; - var empty_store = this.empty_stores[which]; - - this.reveal_container(widget); - - if (!data || !data.length) { - widget.setStore(empty_store); - this.toggle_anyness(false, which); - } else { - for (var i in data) cache[data[i].id()] = data[i]; - - widget.setStore( - new dojo.data.ItemFileReadStore({"data": flattener(data)}) - ); - - this.toggle_anyness(true, which); - - /* Arrrgh! Horrid but necessary: */ - setTimeout(function() { widget.sort(); }, 100); - } -}; -Populator.prototype.populate_patron = function(data) { - var h2 = document.createElement("h2"); - h2.setAttribute("class", "booking"); - h2.appendChild(document.createTextNode(formal_name(data))); - - this.widgets.patron.innerHTML = ""; - this.widgets.patron.appendChild(h2); - - this.reveal_container(this.widgets.patron); - /* Maybe add patron's home OU or something here later... */ -}; -Populator.prototype.return_by_resource = function(barcode, override) { - /* XXX instead of talking to the server every time we do this, we could - * also check the "out" cache, iff we have one. */ - var r = fieldmapper.standardRequest( - ["open-ils.booking", - "open-ils.booking.reservations.by_returnable_resource_barcode"], - [openils.User.authtoken, barcode] - ); - if (!r || r.length < 1) { - alert(localeStrings.NO_SUCH_RETURNABLE_RESOURCE); - } else if (is_ils_event(r)) { - alert(my_ils_error(localeStrings.RETURNABLE_RESOURCE_ERROR, r)); - } else { - try { - var new_barcode = r.usr().card().barcode(); - } catch (E) { - alert(localeStrings.RETURN_ERROR + "\nr: " + js2JSON(r) + "\n" + E); - return; - } - if (this.patron_barcode && this.patron_barcode != new_barcode) { - /* XXX make this more subtle, i.e. flash something in background */ - alert(localeStrings.NOTICE_CHANGE_OF_PATRON); - } - this.patron_barcode = new_barcode; - var ret = this.return(r, override); - if (!ret) { - alert(localeStrings.RETURN_NO_RESPONSE); - } else if (is_ils_event(ret) && ret.textcode != "SUCCESS") { - if (ret.textcode == "ROUTE_ITEM") { - display_transit_slip(ret); - } else if (ret.textcode == "COPY_ALERT_MESSAGE") { - if ( - confirm( - dojo.string.substitute( - localeStrings.COPY_ALERT, [ret.desc, ret.payload] - ) - ) - ) { - this.return_by_resource(barcode, true /*override*/); - return; - } - } else { - alert(my_ils_error(localeStrings.RETURN_ERROR, ret)); - } - } else { - /* XXX speedbump should go, but something has to happen else - * there's no indication to staff that anything happened when - * starting from a fresh (blank) return interface. - */ - alert(localeStrings.RETURN_SUCCESS); - } - this.populate(); /* Won't recurse with no args. All is well. */ - } -}; -Populator.prototype.populate = function(barcode, which) { - if (barcode) { - if (barcode.patron) { - this.patron_barcode = barcode.patron; - } - else if (barcode.resource) { /* resource OR patron, not both */ - if (!this.return_by_resource(barcode.resource)) - return; - } - } - if (!this.patron_barcode) { - alert(localeStrings.NO_PATRON_BARCODE); - return; - } - - if (!which) which = this.all; - - var result = fieldmapper.standardRequest( - ["open-ils.booking", "open-ils.booking.reservations.get_captured"], - [openils.User.authtoken, this.patron_barcode, which] - ); - - if (!result) { - this.patron_barcode = undefined; - alert(localeStrings.RESERVATIONS_NO_RESPONSE); - } else if (is_ils_event(result)) { - this.patron_barcode = undefined; - alert(my_ils_error(localeStrings.RESERVATIONS_ERROR, result)); - } else { - for (var k in result) - this["populate_" + k](result[k]); - } -}; -Populator.prototype.toggle_anyness = function(any, which) { - var widget = this.widgets[which].domNode; - var empty_alternate = document.getElementById("no_" + widget.id); - var controls = document.getElementById("controls_" + widget.id); - if (any) { - reveal_dom_element(widget); - if (empty_alternate) hide_dom_element(empty_alternate); - if (controls) reveal_dom_element(controls); - } else { - hide_dom_element(widget); - if (empty_alternate) reveal_dom_element(empty_alternate); - if (controls) hide_dom_element(controls); - } -}; -Populator.prototype.pickup = function(reservation) { - return fieldmapper.standardRequest( - ["open-ils.circ", "open-ils.circ.reservation.pickup"], - [openils.User.authtoken, { - "patron_barcode": this.patron_barcode, - "reservation": reservation - }] - ); -}; -Populator.prototype.return = function(reservation, override) { - var method = "open-ils.circ.reservation.return"; - if (override) method += ".override"; - return fieldmapper.standardRequest( - ["open-ils.circ", method], - [openils.User.authtoken, { - "patron_barcode": this.patron_barcode, - "reservation": reservation.id() - /* yeah just id here ------^; lack of parallelism */ - }] - ); -}; -Populator.prototype.act_on_selected = function(how, which) { - var widget = this.widgets[which]; - var cache = this.cache[which]; - var no_response_msg = localeStrings[how.toUpperCase() + "_NO_RESPONSE"]; - var error_msg = localeStrings[how.toUpperCase() + "_ERROR"]; - - var selected_id_list = - widget.selection.getSelected().map(function(o) { return o.id[0]; }); - - if (!selected_id_list || !selected_id_list.length) { - alert(localeStrings.SELECT_SOMETHING); - return; - } - - var reservations = selected_id_list.map(function(o) { return cache[o]; }); - - /* Do we have to process these one at a time? I think so... */ - var self = this; - function looper(reservation, override) { - if (looper._done) return; - var result = self[how](reservation, override); - if (!result) { - alert(no_response_msg); - } else if (is_ils_event(result) && result.textcode != "SUCCESS") { - if (result.textcode == "ROUTE_ITEM") { - display_transit_slip(result); - } else if (result.textcode == "COPY_ALERT_MESSAGE") { - if (confirm( - dojo.string.substitute( - localeStrings.COPY_ALERT, [result.desc, result.payload] - ) - )) { - looper(reservation, true); - } - return; // continues processing other resvs - } else { - alert(my_ils_error(error_msg, result)); - } - } else { - return; - } - looper._done = true; - } - dojo.forEach(reservations, looper); - - this.populate(); -}; -Populator.prototype.reset = function() { - for (var k in this.widgets) { - this.hide_container(this.widgets[k]); - } - this.patron_barcode = undefined; - - if (typeof(this._extra_resetting) == "function") - this._extra_resetting(); - - if (this.primary_input) { - this.primary_input.value = ""; - this.primary_input.focus(); - } -}; - -/* XXX needs to be combined with the code that shows transit slips in the - * booking capture interface. */ -function display_transit_slip(e) { - var ou = fieldmapper.aou.findOrgUnit(e.org, /* slim_ok */false); - var ma = (new openils.PermaCrud()).retrieve("aoa", ou.mailing_address()); - var mas = ma ? - dojo.string.substitute( - localeStrings.ADDRESS, - [ma.street1(),ma.street2(),ma.city(),ma.state(),ma.post_code()].map( - function(o) { return o ? o : ""; } - ) - ).replace("\n\n", "\n").replace("\n", "
") : "[Unknown address]"; - /* XXX i18n and/or template */ - try { - var win = window.open( - "","","resizeable,width=600,height=400,scrollbars=1,chrome" - ); - win.document.body.innerHTML = - "

Transit Slip

\n" + - //"\n" + - "

Destination: " + ou.name() + "

\n" + - "

" + mas + "

\n" + - "

Barcode: " + e.payload.copy.barcode() + "
\n" + - "Title:
\n" + - "Author:
\n" + - "Slip Date: " + - dojo.date.locale.format(new Date(), {"formatLength": "short"}) + - "

"; - fieldmapper.standardRequest( - ["open-ils.search", "open-ils.search.biblio.mods_from_copy"], { - "params": [e.payload.copy.id()], - "async": true, - "onresponse": function(r) { - var mvr = openils.Util.readResponse(r); - dojo.byId("title", win.document).innerHTML = mvr.title(); - dojo.byId("author", win.document).innerHTML = mvr.author(); - }, - "oncomplete": function() { - win[confirm("Print transit slip?") ? "print" : "close"](); - } - } - ); - } catch (E) { - alert("exception rendering transit slip: " + E); // XXX - } -} diff --git a/Open-ILS/web/js/ui/default/booking/pull_list.js b/Open-ILS/web/js/ui/default/booking/pull_list.js deleted file mode 100644 index 831a9de536..0000000000 --- a/Open-ILS/web/js/ui/default/booking/pull_list.js +++ /dev/null @@ -1,210 +0,0 @@ -dojo.require("openils.User"); -dojo.require("openils.PermaCrud"); -dojo.require("fieldmapper.OrgUtils"); -dojo.require("openils.widget.OrgUnitFilteringSelect"); -dojo.requireLocalization("openils.booking", "pull_list"); - -var localeStrings = dojo.i18n.getLocalization("openils.booking", "pull_list"); -var pcrud = new openils.PermaCrud(); - -var owning_lib_selected; -var acp_cache = {}; - -function init_owning_lib_selector() { - var User = new openils.User(); - User.buildPermOrgSelector( - "RETRIEVE_RESERVATION_PULL_LIST", owning_lib_selector, null, - function() { - owning_lib_selected = owning_lib_selector.getValue(); - dojo.connect(owning_lib_selector, "onChange", - function() { owning_lib_selected = this.getValue(); } - ) - } - ); -} - -function retrieve_pull_list(ivl_in_days) { - var secs = Number(ivl_in_days) * 86400; - - if (isNaN(secs) || secs < 1) - throw new Error("Invalid interval"); - - return fieldmapper.standardRequest( - ["open-ils.booking", "open-ils.booking.reservations.get_pull_list"], - [openils.User.authtoken, null, secs, owning_lib_selected] - ); -} - -function dom_table_rowid(resource_id) { - return "pull_list_resource_" + resource_id; -} - -function generate_result_row(one) { - function cell(id, content) { - var td = document.createElement("td"); - if (id != undefined) td.setAttribute("id", id); - td.appendChild(document.createTextNode(content)); - return td; - } - - function render_pickup_lib(pickup_lib) { - var span = document.createElement("span"); - if (pickup_lib != owning_lib_selected) - span.setAttribute("class", "pull_list_will_transit"); - span.innerHTML = localeStrings.AT + " " + - fieldmapper.aou.findOrgUnit(pickup_lib).shortname(); - return span; - } - - function reservation_info_cell(one) { - var td = document.createElement("td"); - for (var i in one.reservations) { - var one_resv = one.reservations[i]; - var div = document.createElement("div"); - div.setAttribute("class", "pull_list_resv_detail"); - var content = [ - document.createTextNode( - humanize_timestamp_string(one_resv.start_time()) + - " - " + humanize_timestamp_string(one_resv.end_time()) - ), - document.createElement("br"), - render_pickup_lib(one_resv.pickup_lib()), - document.createTextNode( - " " + localeStrings.FOR + " " + formal_name(one_resv.usr()) - ) - ]; - for (var k in content) { div.appendChild(content[k]); } - td.appendChild(div); - } - return td; - } - - var baseid = dom_table_rowid(one.current_resource.id()); - - var cells = []; - cells.push(cell(undefined, one.target_resource_type.name())); - cells.push(cell(undefined, one.current_resource.barcode())); - cells.push(cell(baseid + "_call_number", "-")); - cells.push(cell(baseid + "_copy_location", "-")); - cells.push(reservation_info_cell(one)); - - var row = document.createElement("tr"); - row.setAttribute("id", baseid); - - for (var i in cells) row.appendChild(cells[i]); - return row; -} - -function render_pull_list_fundamentals(list) { - var rows = []; - - for (var i in list) - rows.push(generate_result_row(list[i])); - - document.getElementById("the_table_body").innerHTML = ""; - - for (var i in rows) - document.getElementById("the_table_body").appendChild(rows[i]); -} - -function get_all_relevant_acp(list) { - var barcodes = []; - for (var i in list) { - if (list[i].target_resource_type.catalog_item()) { - /* There shouldn't be any duplicates. No need to worry bout that */ - barcodes.push(list[i].current_resource.barcode()); - } - } - if (barcodes.length > 0) { - var results = fieldmapper.standardRequest( - [ - "open-ils.booking", - "open-ils.booking.asset.get_copy_fleshed_just_right" - ], - [openils.User.authtoken, barcodes] - ); - - if (!results) { - alert(localeStrings.COPY_LOOKUP_NO_RESPONSE); - return null; - } else if (is_ils_event(results)) { - alert(my_ils_error(localeStrings.COPY_LOOKUP_ERROR, results)); - return null; - } else { - return results; - } - } - return null; -} - -function fill_in_pull_list_details(list, acp_cache) { - for (var i in list) { - var one = list[i]; - if (one.target_resource_type.catalog_item() == "t") { - /* FIXME: This block could stand to be a lot more elegant. */ - var call_number_el = document.getElementById( - dom_table_rowid(one.current_resource.id()) + "_call_number" - ); - var copy_location_el = document.getElementById( - dom_table_rowid(one.current_resource.id()) + "_copy_location" - ); - var bc = one.current_resource.barcode(); - - if (acp_cache[bc]) { - if (call_number_el && acp_cache[bc].call_number()) { - var value = acp_cache[bc].call_number().label(); - if (value) call_number_el.innerHTML = value; - } - if (copy_location_el && acp_cache[bc].location()) { - var value = acp_cache[bc].location().name(); - if (value) copy_location_el.innerHTML = value; - } - } else { - alert(localeStrings.COPY_MISSING + bc); - } - } - } -} - -function populate_pull_list(form) { - /* Step 1: get the pull list from the server. */ - try { - var results = retrieve_pull_list(form.interval_in_days.value); - } catch (E) { - alert(localeStrings.PULL_LIST_ERROR + E); - return; - } - if (results == null) { - alert(localeStrings.PULL_LIST_NO_RESPONSE); - return; - } else if (is_ils_event(results)) { - alert(my_ils_error(localeStrings.PULL_LIST_ERROR, results)); - return; - } - - if (results.length) { - reveal_dom_element(document.getElementById("table_goes_here")); - hide_dom_element(document.getElementById("no_results")); - - /* Step 2: render the table with the pull list */ - render_pull_list_fundamentals(results); - - /* Step 3: asynchronously fill in the copy details we're missing */ - setTimeout(function() { - var acp_cache = {}; - if ((acp_cache = get_all_relevant_acp(results))) - fill_in_pull_list_details(results, acp_cache); - }, 0); - } else { - hide_dom_element(document.getElementById("table_goes_here")); - reveal_dom_element(document.getElementById("no_results")); - } - -} - -function my_init() { - hide_dom_element(document.getElementById("table_goes_here")); - hide_dom_element(document.getElementById("no_results")); - init_owning_lib_selector(); - init_auto_l10n(document.getElementById("auto_l10n_start_here")); -} diff --git a/Open-ILS/web/js/ui/default/booking/reservation.js b/Open-ILS/web/js/ui/default/booking/reservation.js deleted file mode 100644 index 1e9901c523..0000000000 --- a/Open-ILS/web/js/ui/default/booking/reservation.js +++ /dev/null @@ -1,856 +0,0 @@ -/* - * Details, details... - */ -dojo.require("fieldmapper.OrgUtils"); -dojo.require("openils.PermaCrud"); -dojo.require("openils.User"); -dojo.require("openils.widget.OrgUnitFilteringSelect"); -dojo.require("dojo.data.ItemFileReadStore"); -dojo.require("dijit.form.DateTextBox"); -dojo.require("dijit.form.TimeTextBox"); -dojo.require("dojo.date.stamp"); -dojo.requireLocalization("openils.booking", "reservation"); - -/* - * Globals; prototypes and their instances - */ -var localeStrings = dojo.i18n.getLocalization("openils.booking", "reservation"); -var pcrud = new openils.PermaCrud(); -var opts; -var our_brt; -var pickup_lib_selected; -var brt_list = []; -var brsrc_index = {}; -var bresv_index = {}; -var just_reserved_now = {}; -var aous_cache = {}; - -function AttrValueTable() { this.t = {}; } -AttrValueTable.prototype.set = function(attr, value) { this.t[attr] = value; }; -AttrValueTable.prototype.update_from_selector = function(selector) { - var attr = selector.name.match(/_(\d+)$/)[1]; - var value = selector.options[selector.selectedIndex].value; - if (attr) - attr_value_table.set(attr, value); -}; -AttrValueTable.prototype.get_all_values = function() { - var values = []; - for (var k in this.t) { - if (this.t[k] != undefined && this.t[k] != "") - values.push(this.t[k]); - } - return values; -}; -var attr_value_table = new AttrValueTable(); - -function TimestampRange() { - this.start = new Date(); - this.end = new Date(); - - this.validity = {"start": false, "end": false}; - this.nodes = { - "start": {"date": undefined, "time": undefined}, - "end": {"date": undefined, "time": undefined} - }; - this.saved_style_properties = {}; - this.invalid_style_properties = { - "backgroundColor": "#ffcccc", - "color": "#990000", - "borderColor": "#990000", - "fontWeight": "bold" - }; -} -TimestampRange.prototype.get_timestamp = function(when) { - return dojo.date.stamp.toISOString(this[when]). - replace("T", " ").substr(0, 19); -}; -TimestampRange.prototype.get_range = function() { - return this.is_backwards() ? - [this.get_timestamp("end"), this.get_timestamp("start")] : - [this.get_timestamp("start"), this.get_timestamp("end")]; -}; -TimestampRange.prototype.update_from_widget = function(widget) { - var when = widget.name.match(/(start|end)/)[1]; - var which = widget.name.match(/(date|time)/)[1]; - - if (this.nodes[when][which] == undefined) - this.nodes[when][which] = widget.domNode; /* We'll need this later */ - - if (when && which) { - this.update_timestamp(when, which, widget.attr("value")); - } - - this.compute_validity(); - this.paint_validity(); -}; -TimestampRange.prototype.compute_validity = function() { - if (Math.abs(this.start - this.end) < 1000) { - this.validity.end = false; - } else { - if (this.start < this.current_minimum()) - this.validity.start = false; - else - this.validity.start = true; - - if (this.end < this.current_minimum()) - this.validity.end = false; - else - this.validity.end = true; - } -}; -/* This method provides the minimum timestamp that is considered valid. For - * now it's arbitrarily "now + 15 minutes", meaning that all reservations - * must be made at least 15 minutes in the future. - * - * For reasons of keeping the middle layer happy, this should always return - * a time that is at least somewhat in the future. The ML isn't able to target - * any resources for a reservation with a start date that isn't in the future. - */ -TimestampRange.prototype.current_minimum = function() { - /* XXX This is going to be a problem with local clocks that are off. */ - var n = new Date(); - n.setTime(n.getTime() + 1000 * 900); /* XXX 15 minutes; stop hardcoding! */ - return n; -}; -TimestampRange.prototype.update_timestamp = function(when, which, value) { - if (which == "date") { - this[when].setFullYear(value.getFullYear()); - /* month and date MUST be done together */ - this[when].setMonth(value.getMonth(), value.getDate()); - } else { /* "time" */ - this[when].setHours(value.getHours()); - this[when].setMinutes(value.getMinutes()); - this[when].setSeconds(0); - } -}; -TimestampRange.prototype.is_backwards = function() { - return (this.start > this.end); -}; -TimestampRange.prototype.paint_validity = function() { - for (var when in this.validity) { - if (this.validity[when]) { - this.paint_valid_node(this.nodes[when].date); - this.paint_valid_node(this.nodes[when].time); - } else { - this.paint_invalid_node(this.nodes[when].date); - this.paint_invalid_node(this.nodes[when].time); - } - } -}; -TimestampRange.prototype.paint_invalid_node = function(node) { - if (node) { - /* Just toggling the class of something would be better than - * manually setting style here, but I haven't been able to get that - * to play nicely with dojo's styling of the date/time textboxen. - */ - if (this.saved_style_properties.backgroundColor == undefined) { - for (var k in this.invalid_style_properties) { - this.saved_style_properties[k] = node.style[k]; - } - } - for (var k in this.invalid_style_properties) { - node.style[k] = this.invalid_style_properties[k]; - } - } -}; -TimestampRange.prototype.paint_valid_node = function(node) { - if (node) { - for (var k in this.saved_style_properties) { - node.style[k] = this.saved_style_properties[k]; - } - } -}; -TimestampRange.prototype.is_valid = function() { - return (this.validity.start && this.validity.end); -}; -var reserve_timestamp_range = new TimestampRange(); - -function SelectorMemory(selector) { - this.selector = selector; - this.memory = {}; -} -SelectorMemory.prototype.save = function() { - for (var i = 0; i < this.selector.options.length; i++) { - if (this.selector.options[i].selected) { - this.memory[this.selector.options[i].value] = true; - } - } -}; -SelectorMemory.prototype.restore = function() { - for (var i = 0; i < this.selector.options.length; i++) { - if (this.memory[this.selector.options[i].value]) { - if (!this.selector.options[i].disabled) - this.selector.options[i].selected = true; - } - } -}; - -/* - * These functions communicate with the middle layer. - */ -function get_all_noncat_brt() { - return pcrud.search("brt", - {"id": {"!=": null}, "catalog_item": "f"}, - {"order_by": {"brt":"name"}} - ); -} - -function get_brt_by_id(id) { - return pcrud.retrieve("brt", id); -} - -function get_brsrc_id_list() { - var options = {"type": our_brt.id(), "pickup_lib": pickup_lib_selected}; - - /* This mechanism for avoiding the passing of an empty 'attribute_values' - * option is essential because if you pass such an option to the - * middle layer API at all, it won't return any IDs for brsrcs that - * don't have at least one attribute of some kind. - */ - var attribute_values = attr_value_table.get_all_values(); - if (attribute_values.length > 0) - options.attribute_values = attribute_values; - - options.available = reserve_timestamp_range.get_range(); - - return fieldmapper.standardRequest( - ["open-ils.booking", "open-ils.booking.resources.filtered_id_list"], - [openils.User.authtoken, options] - ); -} - -/* FIXME: We need failure checking after pcrud.retrieve() */ -function add_brsrc_to_index_if_needed(list, further) { - for (var i in list) { - if (!brsrc_index[list[i]]) { - brsrc_index[list[i]] = pcrud.retrieve("brsrc", list[i]); - } - if (further) - further(brsrc_index[list[i]]); - } -} - -function sync_brsrc_index_from_ids(available_list, additional_list) { - /* Default states for everything in the index. Read the further comments. */ - for (var i in brsrc_index) { - brsrc_index[i].isdeleted(true); - brsrc_index[i].ischanged(false); - } - - /* Populate the cache with anything that's missing and tag everything - * in the "available" list as *not* deleted, and tag everything in the - * additional list as "changed." See below. */ - add_brsrc_to_index_if_needed( - available_list, function(o) { o.isdeleted(false); } - ); - add_brsrc_to_index_if_needed( - additional_list, - function(o) { - if (!(o.id() in just_reserved_now)) o.ischanged(true); - } - ); - /* NOTE: We lightly abuse the isdeleted() and ischanged() magic fieldmapper - * attributes of the brsrcs in our cache. Because we're not going to - * pass back any brsrcs to the middle layer, it doesn't really matter - * what we set this attribute to. What we're using it for is to indicate - * in our little brsrc cache how a given brsrc should be displayed in this - * UI's current state (based on whether the brsrc matches timestamp range - * availability (isdeleted(false)) and whether the brsrc has been forced - * into the list because it was selected in a previous interface (like - * the catalog) (ischanged(true))). - */ -} - -function check_bresv_targeting(results) { - var missing = 0; - var due_dates = []; - for (var i in results) { - var targ = results[i].targeting; - if (!(targ && targ.current_resource)) { - missing++; - if (targ) { - if (targ.error == "NO_COPIES" && targ.conflicts) { - for (var k in targ.conflicts) { - /* Could potentially get more circ information from - * targ.conflicts for display in the future. */ - due_dates.push(humanize_timestamp_string2(targ.conflicts[k].due_date())); - } - } - } - } else { - just_reserved_now[results[i].targeting.current_resource] = true; - } - } - return {"missing": missing, "due_dates": due_dates}; -} - -function create_bresv(resource_list) { - var barcode = document.getElementById("patron_barcode").value; - if (barcode == "") { - alert(localeStrings.WHERES_THE_BARCODE); - return; - } else if (!reserve_timestamp_range.is_valid()) { - alert(localeStrings.INVALID_TS_RANGE); - return; - } - var email_notify = document.getElementById("email_notify").checked ? true : false; - var results; - try { - results = fieldmapper.standardRequest( - ["open-ils.booking", "open-ils.booking.reservations.create"], - [ - openils.User.authtoken, - barcode, - reserve_timestamp_range.get_range(), - pickup_lib_selected, - our_brt.id(), - resource_list, - attr_value_table.get_all_values(), - email_notify - ] - ); - } catch (E) { - alert(localeStrings.CREATE_BRESV_LOCAL_ERROR + E); - } - if (results) { - if (is_ils_event(results)) { - if (is_ils_actor_card_error(results)) { - alert(localeStrings.ACTOR_CARD_NOT_FOUND); - } else { - alert(my_ils_error( - localeStrings.CREATE_BRESV_SERVER_ERROR, results - )); - } - } else { - var targeting = check_bresv_targeting(results); - if (targeting.missing) { - if (aous_cache["booking.require_successful_targeting"]) { - alert( - dojo.string.substitute( - localeStrings.CREATE_BRESV_OK_MISSING_TARGET, - [results.length, targeting.missing] - ) + "\n\n" + - dojo.string.substitute( - localeStrings.CREATE_BRESV_OK_MISSING_TARGET_BLOCKED_BY_CIRC, - [targeting.due_dates] - ) + "\n\n" + - localeStrings.CREATE_BRESV_OK_MISSING_TARGET_WILL_CANCEL - ); - cancel_reservations( - results.map( - function(o) { return o.bresv; }, - true /* skip_update */ - ) - ); - } else { - alert( - dojo.string.substitute( - localeStrings.CREATE_BRESV_OK_MISSING_TARGET, - [results.length, targeting.missing] - ) + "\n\n" + - dojo.string.substitute( - localeStrings.CREATE_BRESV_OK_MISSING_TARGET_BLOCKED_BY_CIRC, - [targeting.due_dates] - ) - ); - } - } else { - alert( - dojo.string.substitute( - localeStrings.CREATE_BRESV_OK, [results.length] - ) - ); - } - update_brsrc_list(); - update_bresv_grid(); - } - } else { - alert(localeStrings.CREATE_BRESV_SERVER_NO_RESPONSE); - } -} - -function flatten_to_dojo_data(obj_list) { - return { - "label": "id", - "identifier": "id", - "items": obj_list.map(function(o) { - var new_obj = { - "id": o.id(), - "type": o.target_resource_type().name(), - "start_time": humanize_timestamp_string(o.start_time()), - "end_time": humanize_timestamp_string(o.end_time()) - }; - - if (o.current_resource()) - new_obj["resource"] = o.current_resource().barcode(); - else if (o.target_resource()) - new_obj["resource"] = "* " + o.target_resource().barcode(); - else - new_obj["resource"] = "* " + localeStrings.UNTARGETED + " *"; - return new_obj; - }) - }; -} - -function create_bresv_on_brsrc() { - var selector = document.getElementById("brsrc_list"); - var selected_values = []; - for (var i in selector.options) { - if (selector.options[i] && selector.options[i].selected) - selected_values.push(selector.options[i].value); - } - if (selected_values.length > 0) - create_bresv(selected_values); - else - alert(localeStrings.SELECT_A_BRSRC_THEN); -} - -function create_bresv_on_brt() { - if (any_usable_brsrc()) - create_bresv(); - else - alert(localeStrings.NO_USABLE_BRSRC); -} - -function get_actor_by_barcode(barcode) { - var usr = fieldmapper.standardRequest( - ["open-ils.actor", "open-ils.actor.user.fleshed.retrieve_by_barcode"], - [openils.User.authtoken, barcode] - ); - if (usr == null) { - alert(localeStrings.GET_PATRON_NO_RESULT); - } else if (is_ils_event(usr)) { - return null; /* XXX inelegant: this function is quiet about errors - here because to report them would be redundant with - another function that gets called right after this one. - */ - } else { - return usr; - } -} - -function init_bresv_grid(barcode) { - var result = fieldmapper.standardRequest( - ["open-ils.booking", - "open-ils.booking.reservations.filtered_id_list" - ], - [openils.User.authtoken, { - "user_barcode": barcode, - "fields": { - "pickup_time": null, - "cancel_time": null, - "return_time": null - } - }, /* whole_obj */ true] - ); - if (result == null) { - set_datagrid_empty_store(bresvGrid, flatten_to_dojo_data); - alert(localeStrings.GET_BRESV_LIST_NO_RESULT); - } else if (is_ils_event(result)) { - set_datagrid_empty_store(bresvGrid, flatten_to_dojo_data); - if (is_ils_actor_card_error(result)) { - alert(localeStrings.ACTOR_CARD_NOT_FOUND); - } else { - alert(my_ils_error(localeStrings.GET_BRESV_LIST_ERR, result)); - } - } else { - if (result.length < 1) { - document.getElementById("bresv_grid_alt_explanation").innerHTML = - localeStrings.NO_EXISTING_BRESV; - hide_dom_element(document.getElementById("bresv_grid")); - reveal_dom_element(document.getElementById("reserve_under")); - } else { - document.getElementById("bresv_grid_alt_explanation").innerHTML = - ""; - reveal_dom_element(document.getElementById("bresv_grid")); - reveal_dom_element(document.getElementById("reserve_under")); - } - /* May as well do the following in either case... */ - bresvGrid.setStore( - new dojo.data.ItemFileReadStore( - {"data": flatten_to_dojo_data(result)} - ) - ); - bresv_index = {}; - for (var i in result) { - bresv_index[result[i].id()] = result[i]; - } - } -} - -function cancel_reservations(bresv_id_list, skip_update) { - try { - var result = fieldmapper.standardRequest( - ["open-ils.booking", "open-ils.booking.reservations.cancel"], - [openils.User.authtoken, bresv_id_list] - ); - } catch (E) { - alert(localeStrings.CXL_BRESV_FAILURE2 + E); - return; - } - if (!skip_update) setTimeout(update_bresv_grid, 0); - if (!result) { - alert(localeStrings.CXL_BRESV_FAILURE); - } else if (is_ils_event(result)) { - alert(my_ils_error(localeStrings.CXL_BRESV_FAILURE2, result)); - } else { - alert( - dojo.string.substitute( - localeStrings.CXL_BRESV_SUCCESS, [result.length] - ) - ); - } -} - -function munge_specific_resource(barcode) { - try { - var copy_list = pcrud.search( - "acp", {"barcode": barcode, "deleted": "f"} - ); - if (copy_list && copy_list.length > 0) { - var r = fieldmapper.standardRequest( - ["open-ils.booking", - "open-ils.booking.resources.create_from_copies"], - [openils.User.authtoken, - copy_list.map(function(o) { return o.id(); })] - ); - - if (!r) { - alert(localeStrings.ON_FLY_NO_RESPONSE); - } else if (is_ils_event(r)) { - alert(my_ils_error(localeStrings.ON_FLY_ERROR, r)); - } else { - if (!(our_brt = get_brt_by_id(r.brt[0][0]))) { - alert(localeStrings.COULD_NOT_RETRIEVE_BRT_PASSED_IN); - } else { - opts.booking_results = r; - init_reservation_interface(); - } - } - } else { - alert(localeStrings.BRSRC_NOT_FOUND); - } - } catch (E) { - alert(localeStrings.BRSRC_RETRIEVE_ERROR + E); - } -} - -/* - * These functions deal with interface tricks (populating widgets, - * changing the page, etc.). - */ -function init_pickup_lib_selector() { - var User = new openils.User(); - User.buildPermOrgSelector( - "ADMIN_BOOKING_RESERVATION", pickup_lib_selector, null, - function() { - pickup_lib_selected = pickup_lib_selector.getValue(); - dojo.connect(pickup_lib_selector, "onChange", - function() { - pickup_lib_selected = this.getValue(); - update_brsrc_list(); - } - ) - } - ); -} - -function provide_brt_selector(targ_div) { - if (!targ_div) { - alert(localeStrings.NO_TARG_DIV); - } else { - brt_list = get_all_noncat_brt(); - if (!brt_list || brt_list.length < 1) { - document.getElementById("select_noncat_brt_block"). - style.display = "none"; - } else { - var selector = document.createElement("select"); - selector.setAttribute("id", "brt_selector"); - selector.setAttribute("name", "brt_selector"); - /* I'm reluctantly hardcoding this "size" attribute as 8 - * because you can't accomplish this with CSS anyway. - */ - selector.setAttribute("size", 8); - for (var i in brt_list) { - var option = document.createElement("option"); - option.setAttribute("value", brt_list[i].id()); - option.appendChild(document.createTextNode(brt_list[i].name())); - selector.appendChild(option); - } - targ_div.innerHTML = ""; - targ_div.appendChild(selector); - } - } -} - -function init_resv_iface_arb() { - init_reservation_interface(document.getElementById("arbitrary_resource")); -} - -function init_resv_iface_sel() { - init_reservation_interface(document.getElementById("brt_selector")); -} - -function init_reservation_interface(widget) { - /* Show or hide the email notification checkbox depending on org unit setting. */ - if (!aous_cache["booking.allow_email_notify"]) { - hide_dom_element(document.getElementById("contain_email_notify")); - } - /* Save a global reference to the brt we're going to reserve */ - if (widget && (widget.selectedIndex != undefined)) { - our_brt = brt_list[widget.selectedIndex]; - } else if (widget != undefined) { - if (!munge_specific_resource(widget.value)) - return; - } - - /* Hide and reveal relevant divs. */ - var search_block = document.getElementById("brt_search_block"); - var reserve_block = document.getElementById("brt_reserve_block"); - hide_dom_element(search_block); - reveal_dom_element(reserve_block); - - /* Get a list of attributes that can apply to that brt. */ - var bra_list = pcrud.search("bra", {"resource_type": our_brt.id()}); - if (!bra_list) { - alert(localeString.NO_BRA_LIST); - return; - } - - /* Get a table of values that can apply to the above attributes. */ - var brav_by_bra = {}; - bra_list.map(function(o) { - brav_by_bra[o.id()] = pcrud.search("brav", {"attr": o.id()}); - }); - - /* Hide the label over the attributes widgets if we have nothing to show. */ - var domf = (bra_list.length < 1) ? hide_dom_element : reveal_dom_element; - domf(document.getElementById("bra_and_brav_header")); - - /* Create DOM widgets to represent each attribute/values set. */ - for (var i in bra_list) { - var bra_div = document.createElement("div"); - bra_div.setAttribute("class", "nice_vertical_padding"); - - var bra_select = document.createElement("select"); - bra_select.setAttribute("name", "bra_" + bra_list[i].id()); - bra_select.setAttribute( - "onchange", - "attr_value_table.update_from_selector(this); update_brsrc_list();" - ); - - var bra_opt_any = document.createElement("option"); - bra_opt_any.appendChild(document.createTextNode(localeStrings.ANY)); - bra_opt_any.setAttribute("value", ""); - - bra_select.appendChild(bra_opt_any); - - var bra_label = document.createElement("label"); - bra_label.setAttribute("class", "bra"); - bra_label.appendChild(document.createTextNode(bra_list[i].name())); - - var j = bra_list[i].id(); - for (var k in brav_by_bra[j]) { - var bra_opt = document.createElement("option"); - bra_opt.setAttribute("value", brav_by_bra[j][k].id()); - bra_opt.appendChild( - document.createTextNode(brav_by_bra[j][k].valid_value()) - ); - bra_select.appendChild(bra_opt); - } - - bra_div.appendChild(bra_label); - bra_div.appendChild(bra_select); - document.getElementById("bra_and_brav").appendChild(bra_div); - } - /* Add a prominent label reminding the user what resource type they're - * asking about. */ - document.getElementById("brsrc_list_header").innerHTML = our_brt.name(); - init_pickup_lib_selector(); - update_brsrc_list(); -} - -function update_brsrc_list() { - var brsrc_id_list = get_brsrc_id_list(); - var force_list = (opts.booking_results && opts.booking_results.brsrc) ? - opts.booking_results.brsrc.map(function(o) { return o[0]; }) : []; - - sync_brsrc_index_from_ids(brsrc_id_list, force_list); - - var target_selector = document.getElementById("brsrc_list"); - var selector_memory = new SelectorMemory(target_selector); - selector_memory.save(); - target_selector.innerHTML = ""; - - for (var i in brsrc_index) { - if (brsrc_index[i].isdeleted() && (!brsrc_index[i].ischanged())) - continue; - - var opt = document.createElement("option"); - opt.setAttribute("value", brsrc_index[i].id()); - opt.appendChild(document.createTextNode(brsrc_index[i].barcode())); - - if (brsrc_index[i].isdeleted() && (brsrc_index[i].ischanged())) { - opt.setAttribute("class", "forced_unavailable"); - opt.setAttribute("disabled", "disabled"); - } - - target_selector.appendChild(opt); - } - - selector_memory.restore(); -} - -function any_usable_brsrc() { - for (var i in brsrc_index) { - if (!brsrc_index[i].isdeleted()) - return true; - } - return false; -} - -function update_bresv_grid() { - var widg = document.getElementById("patron_barcode"); - if (widg.value != "") { - setTimeout(function() { - var target = document.getElementById( - "existing_reservation_patron_line" - ); - var patron = get_actor_by_barcode(widg.value); - if (patron) { - target.innerHTML = ( - localeStrings.HERE_ARE_EXISTING_BRESV + " " + - formal_name(patron) + ": " - ); - } else { - target.innerHTML = ""; - } - }, 0); - setTimeout(function() { init_bresv_grid(widg.value); }, 0); - } -} - -function init_timestamp_widgets() { - var when = ["start", "end"]; - for (var i in when) { - reserve_timestamp_range.update_from_widget( - new dijit.form.TimeTextBox({ - name: "reserve_time_" + when[i], - value: new Date(), - constraints: { - timePattern: "HH:mm", - clickableIncrement: "T00:15:00", - visibleIncrement: "T00:15:00", - visibleRange: "T01:30:00" - }, - onChange: function() { - reserve_timestamp_range.update_from_widget(this); - update_brsrc_list(); - } - }, "reserve_time_" + when[i]) - ); - reserve_timestamp_range.update_from_widget( - new dijit.form.DateTextBox({ - name: "reserve_date_" + when[i], - value: new Date(), - onChange: function() { - reserve_timestamp_range.update_from_widget(this); - update_brsrc_list(); - } - }, "reserve_date_" + when[i]) - ); - } -} - -function cancel_selected_bresv(bresv_dojo_items) { - if (bresv_dojo_items && bresv_dojo_items.length > 0 && - (bresv_dojo_items[0].length == undefined || - bresv_dojo_items[0].length > 0)) { - cancel_reservations( - bresv_dojo_items.map(function(o) { return o.id[0]; }) - ); - /* After some delay to allow the cancellations a chance to get - * committed, refresh the brsrc list as it might reflect newly - * available resources now. */ - if (our_brt) setTimeout(update_brsrc_list, 2000); - } else { - alert(localeStrings.CXL_BRESV_SELECT_SOMETHING); - } -} - -/* The following function should return true if the reservation interface - * should start normally (show a list of brt to choose from) or false if - * it should not (because we've "started" it some other way by setting up - * and displaying other widgets). - */ -function early_action_passthru() { - if (opts.booking_results) { - if (opts.booking_results.brt.length != 1) { - alert(localeStrings.NEED_EXACTLY_ONE_BRT_PASSED_IN); - return true; - } else if (!(our_brt = get_brt_by_id(opts.booking_results.brt[0][0]))) { - alert(localeStrings.COULD_NOT_RETRIEVE_BRT_PASSED_IN); - return true; - } - - init_reservation_interface(); - return false; - } - - var uri = location.href; - var query = uri.substring(uri.indexOf("?") + 1, uri.length); - var queryObject = dojo.queryToObject(query); - if (typeof queryObject['patron_barcode'] != 'undefined') { - opts.patron_barcode = queryObject['patron_barcode']; - } - - if (opts.patron_barcode) { - document.getElementById("contain_patron_barcode").style.display="none"; - document.getElementById("patron_barcode").value = opts.patron_barcode; - update_bresv_grid(); - } - - return true; -} - -function init_aous_cache() { - /* The following method call could be given a longer - * list of OU settings to fetch in the future if needed. */ - var results = fieldmapper.aou.fetchOrgSettingBatch( - openils.User.user.ws_ou(), ["booking.require_successful_targeting", "booking.allow_email_notify"] - ); - if (results && !is_ils_event(results)) { - for (var k in results) { - if (results[k] != undefined) - aous_cache[k] = results[k].value; - } - } else if (results) { - alert(my_ils_error(localeStrings.ERROR_FETCHING_AOUS, results)); - } else { - alert(localeStrings.ERROR_FETCHING_AOUS); - } -} - -/* - * my_init - */ -function my_init() { - hide_dom_element(document.getElementById("brt_reserve_block")); - reveal_dom_element(document.getElementById("brt_search_block")); - hide_dom_element(document.getElementById("reserve_under")); - init_auto_l10n(document.getElementById("auto_l10n_start_here")); - init_aous_cache(); - init_timestamp_widgets(); - - setTimeout( - function() { - if (typeof xulG != 'undefined' && typeof xulG.bresv_interface_opts != 'undefined') { - opts = xulG.bresv_interface_opts; - } else { - opts = {}; - } - if (early_action_passthru()) - provide_brt_selector(document.getElementById("brt_selector_here")); - }, 0 - ); -} diff --git a/Open-ILS/web/js/ui/default/booking/return.js b/Open-ILS/web/js/ui/default/booking/return.js deleted file mode 100644 index b47156bb89..0000000000 --- a/Open-ILS/web/js/ui/default/booking/return.js +++ /dev/null @@ -1,57 +0,0 @@ -dojo.requireLocalization("openils.booking", "pickup_and_return"); -var localeStrings = dojo.i18n.getLocalization( - "openils.booking", "pickup_and_return" -); -var p; - -function react_to_pass_in(opts) { - if (opts && opts.patron_barcode) { - p.populate({"patron": opts.patron_barcode}); - - hide_dom_element( - document.getElementById("contains_barcode_control") - ); - - document.getElementById("barcode").value = opts.patron_barcode; - var barcode_type = document.getElementById("barcode_type"); - for (var i in barcode_type.options) { - if (barcode_type.options[i].value == "patron") { - barcode_type.selectedIndex = i; - break; - } - } - - p._extra_resetting = function() { - reveal_dom_element( - document.getElementById("contains_barcode_control") - ); - }; - } -} - -function my_init() { - p = new Populator({ - "out": out_bresv, - "in": in_bresv, - "patron": document.getElementById("patron_info") - }, document.getElementById("barcode")); - init_auto_l10n(document.getElementById("auto_l10n_start_here")); - - setTimeout( - function() { - var opts; - if (typeof xulG != 'undefined' && typeof xulG.bresv_interface_opts != 'undefined') { - opts = xulG.bresv_interface_opts; - } else { - opts = {}; - } - var uri = location.href; - var query = uri.substring(uri.indexOf("?") + 1, uri.length); - var queryObject = dojo.queryToObject(query); - if (typeof queryObject['patron_barcode'] != 'undefined') { - opts.patron_barcode = queryObject['patron_barcode']; - } - react_to_pass_in(opts); - }, 0 - ); -} diff --git a/Open-ILS/web/js/ui/default/staff/admin/booking/app.js b/Open-ILS/web/js/ui/default/staff/admin/booking/app.js deleted file mode 100644 index 46f54d834e..0000000000 --- a/Open-ILS/web/js/ui/default/staff/admin/booking/app.js +++ /dev/null @@ -1,16 +0,0 @@ -angular.module('egBookingAdmin', - ['ngRoute', 'ui.bootstrap', 'egCoreMod','egUiMod']) - -.config(['$routeProvider','$locationProvider','$compileProvider', - function($routeProvider , $locationProvider , $compileProvider) { - - $locationProvider.html5Mode(true); - $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|blob):/); - var resolver = {delay : function(egStartup) {return egStartup.go()}}; - - // default page - $routeProvider.otherwise({ - templateUrl : './admin/booking/t_splash', - resolve : resolver - }); -}]) diff --git a/Open-ILS/web/js/ui/default/staff/booking/app.js b/Open-ILS/web/js/ui/default/staff/booking/app.js deleted file mode 100644 index 8b92d2769a..0000000000 --- a/Open-ILS/web/js/ui/default/staff/booking/app.js +++ /dev/null @@ -1,46 +0,0 @@ -angular.module('egBooking', - ['ngRoute', 'ui.bootstrap', 'egCoreMod','egUiMod']) - -.config(['$routeProvider','$locationProvider','$compileProvider', - function($routeProvider , $locationProvider , $compileProvider) { - - $locationProvider.html5Mode(true); - $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|blob):/); - var resolver = {delay : function(egStartup) {return egStartup.go()}}; - - var eframe_template = - ''; - - $routeProvider.when('/booking/legacy/:noun/:verb', { - template: eframe_template, - controller: 'EmbedBookingCtl', - resolve : resolver - }); - - // default page - $routeProvider.otherwise({ - templateUrl : './t_splash', - resolve : resolver - }); -}]) - -.controller('EmbedBookingCtl', - ['$scope','$routeParams','$location','egCore', -function($scope , $routeParams , $location , egCore) { - - $scope.funcs = { - ses : egCore.auth.token(), - } - - var booking_path = '/eg/' + - $routeParams.noun + '/' + $routeParams.verb + location.search; - - // embed URL must include protocol/domain or it will be loaded via - // push-state, resulting in an infinitely nested pages. - $scope.booking_url = - $location.absUrl().replace(/\/eg\/staff.*/, booking_path); - - console.log('Loading Booking URL: ' + $scope.booking_url); - -}]) - diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index 96e31fa2fc..ea77fd2175 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -212,11 +212,7 @@ var api = { 'FM_AUSP_REMOVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.penalty.remove' }, 'FM_AUSP_PCRUD_UPDATE' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.update.ausp', 'secure' : false }, 'FM_AUSP_UPDATE_NOTE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.penalty.note.update' }, - 'FM_BOOKING_CREATE_BRT_AND_BRSRC' : { 'app' : 'open-ils.booking', 'method' : 'open-ils.booking.create_brt_and_brsrc_from_copies' }, 'FM_BPT_PCRUD_SEARCH' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.bpt.atomic', 'secure' : false }, - 'FM_BRESV_RETRIEVE_VIA_PCRUD' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.bresv.atomic' }, - 'FM_BRSRC_RETRIEVE_VIA_PCRUD' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.brsrc.atomic' }, - 'FM_BRT_RETRIEVE_VIA_PCRUD' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.brt.atomic' }, 'FM_BRE_RETRIEVE_VIA_ID' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record.metadata.retrieve', 'secure' : false }, 'FM_BRE_RETRIEVE_VIA_ID.authoritative' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record.metadata.retrieve.authoritative', 'secure' : false }, 'FM_BRE_ID_VIA_BARCODE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.bib_id.by_barcode', 'secure' : false }, @@ -284,7 +280,6 @@ var api = { 'FM_MP_NOTE_EDIT' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.money.payment.note.edit' }, 'FM_MG_CREATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.money.grocery.create' }, 'FM_MG_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.money.grocery.retrieve' }, - 'FM_BRESV_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.booking.reservation.retrieve' }, 'FM_MOBTS_HAVING_BALANCE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.transactions.have_balance' }, 'FM_MOBTS_HAVING_BALANCE.authoritative' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.transactions.have_balance.authoritative' }, 'FM_MOBTS_TOTAL_HAVING_BALANCE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.transactions.have_balance.total' }, @@ -516,10 +511,6 @@ var urls = { 'CUSTOM_JS' : '/xul/server/skin/custom.js', 'ACQ_LINEITEM' : 'oils://remote/eg/acq/lineitem/related/', 'SERIAL_LIST_SUBSCRIPTION' : 'oils://remote/eg/serial/list_subscription', - 'BOOKING_RESOURCE' : 'oils://remote/eg/conify/global/booking/resource', - 'BOOKING_RESERVATION' : 'oils://remote/eg/booking/reservation', - 'BOOKING_PICKUP' : 'oils://remote/eg/booking/pickup', - 'BOOKING_RETURN' : 'oils://remote/eg/booking/return', 'ALT_HOLDS_PRINT' : 'oils://remote/opac/extras/circ/alt_holds_print.html', 'SERIAL_PRINT_ROUTING_LIST_USERS' : 'oils://remote/eg/serial/print_routing_list_users', 'XUL_SERIAL_BATCH_RECEIVE': 'oils://remote/xul/server/serial/batch_receive.xul', 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 26034babed..fe81c89651 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -1112,26 +1112,6 @@ main.menu.prototype = { ['oncommand'], function(event) { open_eg_web_page('conify/global/cat/authority/thesaurus', null, event); } ], - 'cmd_server_admin_booking_resource': [ - ['oncommand'], - function(event) { open_eg_web_page('conify/global/booking/resource', null, event); } - ], - 'cmd_server_admin_booking_resource_type': [ - ['oncommand'], - function(event) { open_eg_web_page('conify/global/booking/resource_type', null, event); } - ], - 'cmd_server_admin_booking_resource_attr': [ - ['oncommand'], - function(event) { open_eg_web_page('conify/global/booking/resource_attr', null, event); } - ], - 'cmd_server_admin_booking_resource_attr_value': [ - ['oncommand'], - function(event) { open_eg_web_page('conify/global/booking/resource_attr_value', null, event); } - ], - 'cmd_server_admin_booking_resource_attr_map': [ - ['oncommand'], - function(event) { open_eg_web_page('conify/global/booking/resource_attr_map', null, event); } - ], 'cmd_local_admin_address_alert' : [ ['oncommand'], function(event) { open_eg_web_page('conify/global/actor/address_alert', null, event); } @@ -1192,56 +1172,6 @@ main.menu.prototype = { ['oncommand'], function(event) { open_eg_web_page('acq/financial/claim_eligible', 'menu.cmd_acq_claim_eligible.tab', event); } ], - 'cmd_booking_reservation' : [ - ['oncommand'], - function(event) { - open_eg_web_page( - "/eg/booking/reservation", - "menu.cmd_booking_reservation.tab", - event - ); - } - ], - 'cmd_booking_pull_list' : [ - ['oncommand'], - function(event) { - open_eg_web_page( - "/eg/booking/pull_list", - "menu.cmd_booking_pull_list.tab", - event - ); - } - ], - 'cmd_booking_capture' : [ - ['oncommand'], - function(event) { - open_eg_web_page( - "/eg/booking/capture", - "menu.cmd_booking_capture.tab", - event - ); - } - ], - 'cmd_booking_reservation_pickup' : [ - ['oncommand'], - function(event) { - open_eg_web_page( - "/eg/booking/pickup", - "menu.cmd_booking_reservation_pickup.tab", - event - ); - } - ], - 'cmd_booking_reservation_return' : [ - ['oncommand'], - function(event) { - open_eg_web_page( - "/eg/booking/return", - "menu.cmd_booking_reservation_return.tab", - event - ); - } - ], 'cmd_server_admin_conify_remote_account' : [ ['oncommand'], function(event) { diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul index b7f3eef6fb..bc4da24195 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul @@ -113,12 +113,6 @@ - - - - - - @@ -299,11 +293,6 @@ - - - - - @@ -480,16 +469,6 @@ - - - - - - - - - - @@ -693,15 +672,6 @@ - - - - - - - - - diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_overlay.xul b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_overlay.xul index c96cefc4bd..6aba763d9c 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_overlay.xul +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_overlay.xul @@ -246,31 +246,6 @@ tooltiptext="&staff.main.menu.acq.view_local_inv.label;" command="cmd_acq_view_local_inv" templateid="acq_view_local_inv" /> - - - - - - diff --git a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties index b16e2a1830..016859925f 100644 --- a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties +++ b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties @@ -251,13 +251,7 @@ menu.cmd_acq_user_requests.tab=Patron Requests menu.cmd_acq_claim_eligible.tab=Claim-Ready Items menu.cmd_serial_batch_receive.tab=Batch Receive menu.cmd_url_verify.tab=Link Checker -menu.cmd_booking_resource.tab=Resources -menu.cmd_booking_reservation.tab=Reservations -menu.cmd_booking_reservation_pickup.tab=Reservation Pickup -menu.cmd_booking_reservation_return.tab=Reservation Return menu.cmd_server_admin_conify_remote_account.tab=Remote Accounts -menu.cmd_booking_pull_list.tab=Booking Pull List -menu.cmd_booking_capture.tab=Booking Capture menu.cmd_authority_manage.tab=Manage Authorities menu.cmd_search_prefs.tab=Search Preferences menu.local_admin.barcode_completion.tab=Barcode Completion @@ -322,7 +316,6 @@ barcode_choice.choice_label=Found Barcodes: barcode_choice.actor_label=Patron : %1$s barcode_choice.asset_label=Item : %1$s barcode_choice.serial_label=Serial : %1$s -barcode_choice.booking_label=Booking : %1$s staff.main.button_bar.none=None staff.main.button_bar.default=Default util.hide_elements.title=Hide UI Elements diff --git a/Open-ILS/xul/staff_client/chrome/skin/global.css b/Open-ILS/xul/staff_client/chrome/skin/global.css index bcd696117c..c27b4d214e 100644 --- a/Open-ILS/xul/staff_client/chrome/skin/global.css +++ b/Open-ILS/xul/staff_client/chrome/skin/global.css @@ -152,11 +152,6 @@ help { -moz-binding: url('chrome://open_ils_staff_client/content/main/bindings.x #main_toolbox toolbarbutton[command="cmd_acq_create_invoice"] { list-style-image: url("chrome://open_ils_staff_client/skin/media/images/toolbar_blue/acq_create_invoice_toolbar.png"); } #main_toolbox toolbarbutton[command="cmd_acq_view_local_inv"] { list-style-image: url("chrome://open_ils_staff_client/skin/media/images/toolbar_blue/acq_invoice_search_toolbar.png"); } #main_toolbox toolbarbutton[command="cmd_acq_view_local_po"] { list-style-image: url("chrome://open_ils_staff_client/skin/media/images/toolbar_blue/acq_po_search_toolbar.png"); } -#main_toolbox toolbarbutton[command="cmd_booking_reservation"] { list-style-image: url("chrome://open_ils_staff_client/skin/media/images/toolbar_blue/booking_reservation_toolbar.png"); } -#main_toolbox toolbarbutton[command="cmd_booking_pull_list"] { list-style-image: url("chrome://open_ils_staff_client/skin/media/images/toolbar_blue/booking_pull_list_toolbar.png"); } -#main_toolbox toolbarbutton[command="cmd_booking_capture"] { list-style-image: url("chrome://open_ils_staff_client/skin/media/images/toolbar_blue/booking_capture_toolbar.png"); } -#main_toolbox toolbarbutton[command="cmd_booking_reservation_pickup"] { list-style-image: url("chrome://open_ils_staff_client/skin/media/images/toolbar_blue/booking_reservation_pickup_toolbar.png"); } -#main_toolbox toolbarbutton[command="cmd_booking_reservation_return"] { list-style-image: url("chrome://open_ils_staff_client/skin/media/images/toolbar_blue/booking_reservation_return_toolbar.png"); } /* Temp icons because tsbere is lazy - Someone please find/make new ones ;) */ #main_toolbox toolbarbutton[command="cmd_create_marc"] { list-style-image: url("chrome://open_ils_staff_client/skin/media/images/HILLBLU_indici_toolbar.png"); } diff --git a/Open-ILS/xul/staff_client/imagesources/licenses.txt b/Open-ILS/xul/staff_client/imagesources/licenses.txt index e4f65ad8ca..9afdcc4cb6 100644 --- a/Open-ILS/xul/staff_client/imagesources/licenses.txt +++ b/Open-ILS/xul/staff_client/imagesources/licenses.txt @@ -8,11 +8,6 @@ toolbar_blue/blue_acq_unified_search.svg toolbar_blue/blue_acq_upload.svg toolbar_blue/blue_acq_user_requests.svg toolbar_blue/blue_acq_view_my_pl.svg -toolbar_blue/blue_booking_capture.svg -toolbar_blue/blue_booking_pull_list.svg -toolbar_blue/blue_booking_reservation_pickup.svg -toolbar_blue/blue_booking_reservation_return.svg -toolbar_blue/blue_booking_reservation.svg toolbar_blue/blue_browse_holds_shelf.svg toolbar_blue/blue_circ_hold_pull_list.svg toolbar_blue/blue_circ_renew.svg diff --git a/Open-ILS/xul/staff_client/imagesources/toolbar_blue/blue_booking_capture.svg b/Open-ILS/xul/staff_client/imagesources/toolbar_blue/blue_booking_capture.svg deleted file mode 100644 index 9c35436867..0000000000 --- a/Open-ILS/xul/staff_client/imagesources/toolbar_blue/blue_booking_capture.svg +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Open-ILS/xul/staff_client/imagesources/toolbar_blue/blue_booking_pull_list.svg b/Open-ILS/xul/staff_client/imagesources/toolbar_blue/blue_booking_pull_list.svg deleted file mode 100644 index e8f0cae5d0..0000000000 --- a/Open-ILS/xul/staff_client/imagesources/toolbar_blue/blue_booking_pull_list.svg +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Open-ILS/xul/staff_client/imagesources/toolbar_blue/blue_booking_reservation.svg b/Open-ILS/xul/staff_client/imagesources/toolbar_blue/blue_booking_reservation.svg deleted file mode 100644 index d301d5e08c..0000000000 --- a/Open-ILS/xul/staff_client/imagesources/toolbar_blue/blue_booking_reservation.svg +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Open-ILS/xul/staff_client/imagesources/toolbar_blue/blue_booking_reservation_pickup.svg b/Open-ILS/xul/staff_client/imagesources/toolbar_blue/blue_booking_reservation_pickup.svg deleted file mode 100644 index d6145c8f87..0000000000 --- a/Open-ILS/xul/staff_client/imagesources/toolbar_blue/blue_booking_reservation_pickup.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Open-ILS/xul/staff_client/imagesources/toolbar_blue/blue_booking_reservation_return.svg b/Open-ILS/xul/staff_client/imagesources/toolbar_blue/blue_booking_reservation_return.svg deleted file mode 100644 index 264897b21c..0000000000 --- a/Open-ILS/xul/staff_client/imagesources/toolbar_blue/blue_booking_reservation_return.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.js b/Open-ILS/xul/staff_client/server/cat/copy_browser.js index 327b45b70b..0fced4dddb 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js @@ -226,56 +226,6 @@ cat.copy_browser.prototype = { ); } ], - 'cmd_create_brt' : [ - ['command'], - function() { - JSAN.use("cat.util"); - JSAN.use("util.functional"); - - /* Filter selected rows that aren"t copies. */ - var list = util.functional.filter_list( - obj.sel_list, - function (o) { - return o.split(/_/)[0] == "acp"; - } - ); - var results = cat.util.make_bookable( - util.functional.map_list( - list, function (o) { - return obj.map_acp[o].id(); - } - ) - ); - if (results && results["brsrc"]) { - cat.util.edit_new_brsrc(results["brsrc"]); - } - } - ], - 'cmd_book_item_now' : [ - ['command'], - function() { - JSAN.use("cat.util"); - JSAN.use("util.functional"); - - /* Filter selected rows that aren"t copies. */ - var list = util.functional.filter_list( - obj.sel_list, - function (o) { - return o.split(/_/)[0] == "acp"; - } - ); - var results = cat.util.make_bookable( - util.functional.map_list( - list, function (o) { - return obj.map_acp[o].id(); - } - ) - ); - if (results) { - cat.util.edit_new_bresv(results); - } - } - ], 'cmd_add_items' : [ ['command'], function() { @@ -1940,7 +1890,6 @@ cat.copy_browser.prototype = { obj.controller.view.cmd_transfer_volume.setAttribute('disabled','true'); obj.controller.view.cmd_transfer_items.setAttribute('disabled','true'); obj.controller.view.sel_copy_details.setAttribute('disabled','true'); - obj.controller.view.cmd_create_brt.setAttribute('disabled','true'); obj.controller.view.cmd_book_item_now.setAttribute('disabled','true'); obj.controller.view.sel_patron.setAttribute('disabled','true'); obj.controller.view.sel_mark_items_damaged.setAttribute('disabled','true'); @@ -1966,7 +1915,6 @@ cat.copy_browser.prototype = { obj.controller.view.cmd_print_spine_labels.setAttribute('disabled','false'); obj.controller.view.cmd_transfer_items.setAttribute('disabled','false'); obj.controller.view.sel_copy_details.setAttribute('disabled','false'); - obj.controller.view.cmd_create_brt.setAttribute('disabled','false'); obj.controller.view.sel_patron.setAttribute('disabled','false'); var L = 0; for (var k in sel_copy_libs) L++; diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.xul b/Open-ILS/xul/staff_client/server/cat/copy_browser.xul index 51ee003416..4f5161a87b 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_browser.xul +++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.xul @@ -72,7 +72,6 @@ vim:noet:sw=4:ts=4: - @@ -108,9 +107,6 @@ vim:noet:sw=4:ts=4: - - - @@ -167,7 +163,6 @@ vim:noet:sw=4:ts=4: - diff --git a/Open-ILS/xul/staff_client/server/cat/util.js b/Open-ILS/xul/staff_client/server/cat/util.js index 2f4e93aac1..322cf5802f 100644 --- a/Open-ILS/xul/staff_client/server/cat/util.js +++ b/Open-ILS/xul/staff_client/server/cat/util.js @@ -8,7 +8,7 @@ cat.util = {}; cat.util.EXPORT_OK = [ 'spawn_copy_editor', 'add_copies_to_bucket', 'show_in_opac', 'spawn_spine_editor', 'transfer_copies', 'transfer_title_holds', 'mark_item_missing', 'mark_item_damaged', 'replace_barcode', 'fast_item_add', - 'make_bookable', 'edit_new_brsrc', 'edit_new_bresv', 'batch_edit_volumes', 'render_fine_level', + 'batch_edit_volumes', 'render_fine_level', 'render_loan_duration', 'mark_item_as_missing_pieces', 'render_callnumbers_for_bib_menu', 'render_cn_prefix_menuitems', 'render_cn_suffix_menuitems', 'render_cn_class_menu', 'render_cn_prefix_menu', 'render_cn_suffix_menu', 'transfer_specific_title_holds', @@ -648,81 +648,6 @@ cat.util.fast_item_add = function(doc_id,cn_label,cp_barcode) { } } -cat.util.make_bookable = function(copy_ids) { - if (!copy_ids) { return; } - copy_ids = util.functional.filter_list( copy_ids, function(o) { return o != null; } ); - if (copy_ids.length < 1) { return; } - var results = fieldmapper.standardRequest( - ["open-ils.booking", "open-ils.booking.resources.create_from_copies"], - [ses(), copy_ids] - ); - if (results == null) { - alert(document.getElementById("catStrings").getString( - "staff.cat.copy_browser.make_bookable.create_failed_silent" - )); - } - else if (typeof results.ilsevent != "undefined") { - alert(document.getElementById("catStrings").getFormattedString( - "staff.cat.copy_browser.make_bookable.create_failed", - [results.ilsevent, results.textcode, results.desc, results.debug] - )); - } - return results; -} - -cat.util.edit_new_brsrc = function(brsrc_list) { - /* Spawn new tab to allow editing new resources. */ - try { - xulG.resultant_brsrc = brsrc_list.map(function(o) { return o[0]; }); - xulG.new_tab( - urls.XUL_BROWSER + "?url=" + window.encodeURIComponent( - xulG.url_prefix("BOOKING_RESOURCE") - ), { - "tab_name": offlineStrings.getString( - "menu.cmd_booking_resource.tab" - ), - "browser" : true - }, { - "no_xulG": false, - "show_print_button": false, - "show_nav_buttons": true, - "passthru_content_params": xulG - } - ); - } catch(E) { - alert( - document.getElementById("catStrings").getFormattedString( - "staff.cat.copy_browser.make_bookable.newtab_failed" - ), E - ); - } -} - -cat.util.edit_new_bresv = function(booking_results) { - /* Spawn new tab to allow editing new reservations. */ - try { - if (xulG.auth == undefined) { - xulG.auth = {"session": {"key": ses()}}; - } - xulG.bresv_interface_opts = {"booking_results": booking_results}; - xulG.new_tab( - xulG.url_prefix("/eg/booking/reservation"), - { - "tab_name": offlineStrings.getString( - "menu.cmd_booking_reservation.tab" - ), - "browser" : false - }, xulG - ); - } catch(E) { - alert( - document.getElementById("catStrings").getString( - "staff.cat.copy_browser.make_bookable.newtab_failed" - ) + E - ); - } -} - cat.util.batch_edit_volumes = function(fleshed_volumes) { try { if (!fleshed_volumes || fleshed_volumes.length < 1) { return false; } diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status.js b/Open-ILS/xul/staff_client/server/circ/copy_status.js index 253a4cc568..c09d43a7e6 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.js +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.js @@ -68,8 +68,6 @@ circ.copy_status.prototype = { obj.controller.view.sel_mark_items_missing.setAttribute('disabled','true'); obj.controller.view.sel_patron.setAttribute('disabled','true'); obj.controller.view.cmd_triggered_events.setAttribute('disabled','true'); - obj.controller.view.cmd_create_brt.setAttribute('disabled','true'); - obj.controller.view.cmd_book_item_now.setAttribute('disabled','true'); obj.controller.view.cmd_request_items.setAttribute('disabled','true'); obj.controller.view.cmd_find_acq_po.setAttribute('disabled','true'); obj.controller.view.sel_spine.setAttribute('disabled','true'); @@ -105,7 +103,6 @@ circ.copy_status.prototype = { obj.controller.view.cmd_book_item_now.setAttribute('disabled','true'); } obj.controller.view.cmd_request_items.setAttribute('disabled','false'); - obj.controller.view.cmd_create_brt.setAttribute('disabled','false'); obj.controller.view.cmd_find_acq_po.setAttribute("disabled", obj.selection_list.length == 1 ? "false" : "true"); obj.controller.view.sel_spine.setAttribute('disabled','false'); obj.controller.view.sel_transit_abort.setAttribute('disabled','false'); @@ -204,42 +201,6 @@ circ.copy_status.prototype = { } } ], - 'cmd_create_brt' : [ - ['command'], - function() { - JSAN.use("cat.util"); - JSAN.use("util.functional"); - - var results = cat.util.make_bookable( - util.functional.map_list( - obj.selection_list, function (o) { - return o.copy_id; - } - ) - ); - if (results && results["brsrc"]) { - cat.util.edit_new_brsrc(results["brsrc"]); - } - } - ], - 'cmd_book_item_now' : [ - ['command'], - function() { - JSAN.use("cat.util"); - JSAN.use("util.functional"); - - var results = cat.util.make_bookable( - util.functional.map_list( - obj.selection_list, function (o) { - return o.copy_id; - } - ) - ); - if (results) { - cat.util.edit_new_bresv(results); - } - } - ], 'cmd_request_items' : [ ['command'], function() { diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status.xul b/Open-ILS/xul/staff_client/server/circ/copy_status.xul index f12f209576..0ee810872d 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.xul +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.xul @@ -127,8 +127,6 @@ - - diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status_overlay.xul b/Open-ILS/xul/staff_client/server/circ/copy_status_overlay.xul index 7dbc3c235d..66940a85b5 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status_overlay.xul +++ b/Open-ILS/xul/staff_client/server/circ/copy_status_overlay.xul @@ -19,10 +19,6 @@ - - - - @@ -167,10 +163,6 @@ - - - - diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties b/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties index 92792346b3..18746621cf 100644 --- a/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties +++ b/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties @@ -25,10 +25,6 @@ staff.cat.manage_multi_bib_items.prompt.confirm.unlink_item_from_bib.plural=Unli staff.cat.copy_browser.add_item.title=Add Item staff.cat.copy_browser.add_item.error=copy browser -> add copies staff.cat.copy_browser.add_items_bucket.error=copy browser -> add copies to bucket -staff.cat.copy_browser.make_bookable.create_failed_silent=No response from server -staff.cat.copy_browser.make_bookable.create_failed=Error from server: %1$d %2$s\n%3$s\n%4$s -staff.cat.copy_browser.make_bookable.newtab_failed=Could not open new tab -staff.cat.copy_browser.make_bookable.newtab_name=Resources staff.cat.copy_browser.replace_barcode.failed=Barcode %1$s not likely replaced. staff.cat.copy_browser.replace_barcode.error=copy browser -> replace barcode staff.cat.copy_browser.edit_items.error=Copy Browser -> Edit Items diff --git a/Open-ILS/xul/staff_client/server/patron/bill_details.js b/Open-ILS/xul/staff_client/server/patron/bill_details.js index 8bb2fcc592..1f59fa0290 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill_details.js +++ b/Open-ILS/xul/staff_client/server/patron/bill_details.js @@ -53,18 +53,6 @@ function retrieve_grocery() { ); } -function retrieve_reservation() { - JSAN.use('util.widgets'); - g.network.simple_request('FM_BRESV_RETRIEVE', [ ses(), g.mbts_id ], - function (req) { - var r_bresv = req.getResultObject(); - if (instanceOf(r_bresv,bresv)) { - $('billing_location').value = g.data.hash.aou[ r_bresv.pickup_lib() ].shortname() + ' : ' + g.data.hash.aou[ r_bresv.pickup_lib() ].name(); - } - } - ); -} - function retrieve_circ() { JSAN.use('util.widgets'); g.network.simple_request('FM_CIRC_RETRIEVE_VIA_ID', [ ses(), g.mbts_id ], diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js index 04a9dd7137..807578c208 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.js +++ b/Open-ILS/xul/staff_client/server/patron/display.js @@ -425,57 +425,6 @@ patron.display.prototype = { } } ], - 'cmd_patron_reservation' : [ - ['command'], - function(ev) { - openils.XUL.newTabEasy( - "BOOKING_RESERVATION", - $("offlineStrings").getString( - "menu.cmd_booking_reservation.tab" - ), { - "bresv_interface_opts": { - "patron_barcode": - obj.patron.card().barcode() - } - }, - true - ); - } - ], - 'cmd_patron_reservation_pickup' : [ - ['command'], - function(ev) { - openils.XUL.newTabEasy( - "BOOKING_PICKUP", - $("offlineStrings").getString( - "menu.cmd_booking_reservation_pickup.tab" - ), { - "bresv_interface_opts": { - "patron_barcode": - obj.patron.card().barcode() - } - }, - true - ); - } - ], - 'cmd_patron_reservation_return' : [ - ['command'], - function(ev) { - openils.XUL.newTabEasy( - "BOOKING_RETURN", - $("offlineStrings").getString( - "menu.cmd_booking_reservation_return.tab" - ), { - "bresv_interface_opts": { - "patron_barcode": - obj.patron.card().barcode() - } - }, - true - ); - } - ], 'cmd_patron_exit' : [ ['command'], function(ev) { diff --git a/Open-ILS/xul/staff_client/server/patron/display.xul b/Open-ILS/xul/staff_client/server/patron/display.xul index 3b70f7abf1..d0bf575ee2 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.xul +++ b/Open-ILS/xul/staff_client/server/patron/display.xul @@ -114,9 +114,6 @@ - - - diff --git a/Open-ILS/xul/staff_client/server/patron/display_horiz.xul b/Open-ILS/xul/staff_client/server/patron/display_horiz.xul index 8e3e353df8..a1c14bff2b 100644 --- a/Open-ILS/xul/staff_client/server/patron/display_horiz.xul +++ b/Open-ILS/xul/staff_client/server/patron/display_horiz.xul @@ -114,9 +114,6 @@ - - - diff --git a/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul b/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul index f148e29516..2cc30bde86 100644 --- a/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul +++ b/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul @@ -98,13 +98,6 @@ - - - - - - - diff --git a/Open-ILS/xul/staff_client/server/patron/display_overlay.xul b/Open-ILS/xul/staff_client/server/patron/display_overlay.xul index 13b527a0ad..fa0c8964ff 100644 --- a/Open-ILS/xul/staff_client/server/patron/display_overlay.xul +++ b/Open-ILS/xul/staff_client/server/patron/display_overlay.xul @@ -98,13 +98,6 @@ - - - - - - -