[open-ils-commits] r17291 - in trunk/Open-ILS/xul/staff_client/server: circ locale/en-US patron (senator)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Aug 20 14:53:17 EDT 2010


Author: senator
Date: 2010-08-20 14:53:12 -0400 (Fri, 20 Aug 2010)
New Revision: 17291

Modified:
   trunk/Open-ILS/xul/staff_client/server/circ/checkout.js
   trunk/Open-ILS/xul/staff_client/server/circ/util.js
   trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
   trunk/Open-ILS/xul/staff_client/server/patron/display.js
   trunk/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul
   trunk/Open-ILS/xul/staff_client/server/patron/display_overlay.xul
   trunk/Open-ILS/xul/staff_client/server/patron/summary.js
   trunk/Open-ILS/xul/staff_client/server/patron/summary.xul
Log:
Booking: more progress on the forward-port from rel_1_6

This completes the merging of changes from r15878 except for those to
Circulate.pm, which are more involved and call for more untangling.

More to come soon.


Modified: trunk/Open-ILS/xul/staff_client/server/circ/checkout.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/checkout.js	2010-08-20 18:38:35 UTC (rev 17290)
+++ trunk/Open-ILS/xul/staff_client/server/circ/checkout.js	2010-08-20 18:53:12 UTC (rev 17291)
@@ -639,7 +639,11 @@
                             return document.getElementById('circStrings').getString('staff.circ.checkout.override.item_rental_fee_required.warning');
                         },
                         '7004' : function(r) {
-                            return r.payload.status().name();
+                            try {
+                                return r.payload.status().name();
+                            } catch (E) {
+                                return "copy not available: (Unexpected error: payload not available)";  // XXX
+                            }
                         },
                         '7010' : function(r) {
                             return r.payload;

Modified: trunk/Open-ILS/xul/staff_client/server/circ/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/util.js	2010-08-20 18:38:35 UTC (rev 17290)
+++ trunk/Open-ILS/xul/staff_client/server/circ/util.js	2010-08-20 18:53:12 UTC (rev 17291)
@@ -2692,6 +2692,86 @@
                         document.getElementById('no_change_label').setAttribute('hidden','false');
                     }
                 break;
+                case 15: // ON_RESERVATION_SHELF
+                    check.route_to = 'RESERVATION SHELF';
+                    if (check.payload.reservation) {
+                        if (check.payload.reservation.pickup_lib() != data.list.au[0].ws_ou()) {
+                            msg += document.getElementById('commonStrings').getString('common.error');
+                            msg += '\nFIXME: ';
+                            msg += document.getElementById('circStrings').getString('staff.circ.utils.route_item_error');
+                            msg += '\n';
+                        } else {
+                            msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to.msg', [check.route_to]);
+                            msg += '.\n';
+                        }
+                    } else {
+                        msg += document.getElementById('commonStrings').getString('common.error');
+                        msg += '\nFIXME: ';
+                        msg += document.getElementById('circStrings').getString('staff.circ.utils.reservation_status_error');
+                        msg += '\n';
+                    }
+                    JSAN.use('util.date');
+                    if (check.payload.reservation) {
+                        JSAN.use('patron.util');
+                        msg += '\n';
+                        msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.reservation.barcode', [check.payload.copy.barcode()]);
+                        msg += '\n';
+                        var payload_title  = (check.payload.record ? check.payload.record.title() : check.payload.copy.dummy_title() );
+                        msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.reservation.title', [payload_title]);
+                        msg += '\n';
+                        var au_obj =
+                            typeof(check.payload.reservation.usr().card) == "function" ?
+                                check.payload.reservation.usr() :
+                                patron.util.retrieve_fleshed_au_via_id(session, check.payload.reservation.usr());
+                        msg += '\n';
+                        if (au_obj.alias()) {
+                            msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.reservation.patron_alias',  [au_obj.alias()]);
+                        } else {
+                            msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.reservation.patron',  [au_obj.family_name() || "", au_obj.first_given_name() || "", au_obj.second_given_name() || ""]);
+                        }
+                        msg += '\n';
+                        msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.reservation.barcode', [au_obj.card().barcode()]);
+                        msg += '\n';
+                        msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.reservation.request_date', [util.date.formatted_date(check.payload.reservation.request_time(),'%F %H:%M')]);
+                        msg += '\n';
+
+                        msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.reservation.start_date', [util.date.formatted_date(check.payload.reservation.start_time(),'%F %H:%M')]);
+                        msg += '\n';
+                    }
+                    var rv = 0;
+                    msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.reservation.slip_date', [util.date.formatted_date(new Date(),'%F')]);
+                    msg += '\n';
+                    if (!auto_print) {
+                        rv = error.yns_alert_formatted(
+                            msg,
+                            document.getElementById('circStrings').getString('staff.circ.utils.reservation_slip'),
+                            document.getElementById('circStrings').getString('staff.circ.utils.reservation_slip.print.yes'),
+                            document.getElementById('circStrings').getString('staff.circ.utils.reservation_slip.print.no'),
+                            null,
+                            document.getElementById('circStrings').getString('staff.circ.confirm.msg'),
+                            '/xul/server/skin/media/images/turtle.gif'
+                        );
+                    }
+                    if (rv == 0) {
+                        try {
+                            JSAN.use('util.print'); var print = new util.print();
+                            msg = msg.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\n/g,'<br/>');
+                            print.simple( msg , { 'no_prompt' : true, 'content_type' : 'text/html' } );
+                        } catch(E) {
+                            var err_msg = document.getElementById('commonStrings').getString('common.error');
+                            err_msg += '\nFIXME: ' + E + '\n';
+                            dump(err_msg);
+                            alert(err_msg);
+                        }
+                    }
+                    msg = '';
+                    if (document.getElementById('no_change_label')) {
+                        var m = document.getElementById('no_change_label').getAttribute('value');
+                        m += document.getElementById('circStrings').getFormattedString('staff.circ.utils.reservation_capture', [params.barcode]);
+                        document.getElementById('no_change_label').setAttribute('value', m);
+                        document.getElementById('no_change_label').setAttribute('hidden','false');
+                    }
+                break;
                 default:
                     check.what_happened = 'error';
                     msg += document.getElementById('commonStrings').getString('common.error');

Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties	2010-08-20 18:38:35 UTC (rev 17290)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties	2010-08-20 18:53:12 UTC (rev 17291)
@@ -341,6 +341,7 @@
 staff.circ.utils.route_to.msg=This item needs to be routed to %1$s
 staff.circ.utils.route_item_error=We should have received a ROUTE_ITEM
 staff.circ.utils.route_item_status_error=status of Holds Shelf, but no actual hold found.
+staff.circ.utils.reservation_status_error=status of Reservation Shelf, but no actual hold found.
 staff.circ.utils.payload.hold.barcode=Barcode: %1$s
 staff.circ.utils.payload.hold.title=Title: %1$s
 staff.circ.utils.ahr_mint_condition=Copy Quality
@@ -360,6 +361,17 @@
 staff.circ.utils.hold_slip=Hold Slip
 staff.circ.utils.hold_slip.print.yes=Print
 staff.circ.utils.hold_slip.print.no=Do Not Print
+staff.circ.utils.payload.reservation.barcode=Barcode: %1$s
+staff.circ.utils.payload.reservation.title=Title: %1$s
+# Hold for patron familyName, firstName secondName
+staff.circ.utils.payload.reservation.patron=Reservation for patron %1$s, %2$s %3$s
+staff.circ.utils.payload.reservation.patron_alias=Reservation for patron %1$s
+staff.circ.utils.payload.reservation.request_date=Request Date: %1$s
+staff.circ.utils.payload.reservation.start_date=Start Date: %1$s
+staff.circ.utils.payload.reservation.slip_date=Slip Date: %1$s
+staff.circ.utils.reservation_slip=Reservation Slip
+staff.circ.utils.reservation_slip.print.yes=Print
+staff.circ.utils.reservation_slip.print.no=Do Not Print
 staff.circ.utils.transit_slip=Transit Slip
 staff.circ.utils.transit_slip.print.yes=Print
 staff.circ.utils.transit_slip.print.no=Do Not Print
@@ -367,6 +379,7 @@
 staff.circ.utils.hold_capture_delayed.titlebar=Hold Capture Delayed
 staff.circ.utils.hold_capture_delayed.prompt_for_nocapture=Do Not Capture 
 staff.circ.utils.hold_capture_delayed.prompt_for_capture=Capture
+staff.circ.utils.reservation_capture=%1$s has been captured for a reservation.
 staff.circ.utils.capture=%1$s has been captured for a hold.
 staff.circ.utils.needs_cataloging=%1$s needs to be cataloged.
 staff.circ.utils.copy_status.error=FIXME -- this case "%1$s" is unhandled.

Modified: trunk/Open-ILS/xul/staff_client/server/patron/display.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/display.js	2010-08-20 18:38:35 UTC (rev 17290)
+++ trunk/Open-ILS/xul/staff_client/server/patron/display.js	2010-08-20 18:53:12 UTC (rev 17291)
@@ -390,7 +390,7 @@
                             xulG.new_tab(
                                 "/eg/booking/reservation",
                                 {
-                                    "tab_name": offlineStrings.getString(
+                                    "tab_name": $("offlineStrings").getString(
                                         "menu.cmd_booking_reservation.tab"
                                     ),
                                     "browser": false
@@ -411,7 +411,7 @@
                             xulG.new_tab(
                                 "/eg/booking/pickup",
                                 {
-                                    "tab_name": offlineStrings.getString(
+                                    "tab_name": $("offlineStrings").getString(
                                         "menu.cmd_booking_reservation_pickup.tab"
                                     ),
                                     "browser": false
@@ -432,7 +432,7 @@
                             xulG.new_tab(
                                 "/eg/booking/return",
                                 {
-                                    "tab_name": offlineStrings.getString(
+                                    "tab_name": $("offlineStrings").getString(
                                         "menu.cmd_booking_reservation_return.tab"
                                     ),
                                     "browser": false

Modified: trunk/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul	2010-08-20 18:38:35 UTC (rev 17290)
+++ trunk/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul	2010-08-20 18:53:12 UTC (rev 17291)
@@ -94,7 +94,7 @@
                                     <menuitem label="&staff.patron.info.stat_cats.label;" accesskey="&staff.patron.info.stat_cats.accesskey;" command="cmd_patron_info_stats"/>
                                     <menu id="PatronNavBar_other_booking" label="&staff.main.menu.booking.label;" accesskey="&staff.main.menu.booking.accesskey;">
                                         <menupopup id="PatronNavBar_other_booking_popup">
-                                            <menuitem label="&staff.main.menu.booking.reservation.label;" accesskey="&staff.main.menu.booking.reservation.accesskey;" command="cmd_patron_reservation" />
+                                            <menuitem label="&staff.main.menu.booking.reservation.label_alt;" accesskey="&staff.main.menu.booking.reservation.accesskey;" command="cmd_patron_reservation" />
                                             <menuitem label="&staff.main.menu.booking.reservation_pickup.label;" accesskey="&staff.main.menu.booking.reservation_pickup.accesskey;" command="cmd_patron_reservation_pickup" />
                                             <menuitem label="&staff.main.menu.booking.reservation_return.label;" accesskey="&staff.main.menu.booking.reservation_return.accesskey;" command="cmd_patron_reservation_return" />
                                         </menupopup>

Modified: trunk/Open-ILS/xul/staff_client/server/patron/display_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/display_overlay.xul	2010-08-20 18:38:35 UTC (rev 17290)
+++ trunk/Open-ILS/xul/staff_client/server/patron/display_overlay.xul	2010-08-20 18:53:12 UTC (rev 17291)
@@ -94,7 +94,7 @@
                                     <menuitem label="&staff.patron.info.stat_cats.label;" accesskey="&staff.patron.info.stat_cats.accesskey;" command="cmd_patron_info_stats"/>
                                     <menu id="PatronNavBar_other_booking" label="&staff.main.menu.booking.label;" accesskey="&staff.main.menu.booking.accesskey;">
                                         <menupopup id="PatronNavBar_other_booking_popup">
-                                            <menuitem label="&staff.main.menu.booking.reservation.label;" accesskey="&staff.main.menu.booking.reservation.accesskey;" command="cmd_patron_reservation" />
+                                            <menuitem label="&staff.main.menu.booking.reservation.label_alt;" accesskey="&staff.main.menu.booking.reservation.accesskey;" command="cmd_patron_reservation" />
                                             <menuitem label="&staff.main.menu.booking.reservation_pickup.label;" accesskey="&staff.main.menu.booking.reservation_pickup.accesskey;" command="cmd_patron_reservation_pickup" />
                                             <menuitem label="&staff.main.menu.booking.reservation_return.label;" accesskey="&staff.main.menu.booking.reservation_return.accesskey;" command="cmd_patron_reservation_return" />
                                         </menupopup>

Modified: trunk/Open-ILS/xul/staff_client/server/patron/summary.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/summary.js	2010-08-20 18:38:35 UTC (rev 17290)
+++ trunk/Open-ILS/xul/staff_client/server/patron/summary.js	2010-08-20 18:53:12 UTC (rev 17291)
@@ -2,6 +2,7 @@
 
 function $(id) { return document.getElementById(id); }
 var patronStrings = $('patronStrings');
+var offlineStrings = $('offlineStrings');
 
 if (typeof patron == 'undefined') patron = {};
 patron.summary = function (params) {

Modified: trunk/Open-ILS/xul/staff_client/server/patron/summary.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/summary.xul	2010-08-20 18:38:35 UTC (rev 17290)
+++ trunk/Open-ILS/xul/staff_client/server/patron/summary.xul	2010-08-20 18:53:12 UTC (rev 17291)
@@ -141,6 +141,7 @@
     </script>
     
     <messagecatalog id="patronStrings" src="/xul/server/locale/<!--#echo var='locale'-->/patron.properties"/>
+    <messagecatalog id="offlineStrings" src="/xul/server/locale/<!--#echo var='locale'-->/offline.properties"/>
 
     <commandset id="patron_summary_cmds" />
     <popupset id="patron_summary_popups" />



More information about the open-ils-commits mailing list