[open-ils-commits] r16692 - in branches/rel_1_6/Open-ILS/web/js: dojo/openils/booking/nls ui/default/booking (senator)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Jun 11 17:36:48 EDT 2010


Author: senator
Date: 2010-06-11 17:36:42 -0400 (Fri, 11 Jun 2010)
New Revision: 16692

Modified:
   branches/rel_1_6/Open-ILS/web/js/dojo/openils/booking/nls/reservation.js
   branches/rel_1_6/Open-ILS/web/js/ui/default/booking/reservation.js
Log:
Repair abuse of dojo translatable string bundle for Booking.
These should be JSON only, no code.


Modified: branches/rel_1_6/Open-ILS/web/js/dojo/openils/booking/nls/reservation.js
===================================================================
--- branches/rel_1_6/Open-ILS/web/js/dojo/openils/booking/nls/reservation.js	2010-06-11 21:20:46 UTC (rev 16691)
+++ branches/rel_1_6/Open-ILS/web/js/dojo/openils/booking/nls/reservation.js	2010-06-11 21:36:42 UTC (rev 16692)
@@ -1,107 +1,60 @@
 {
-    '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\n" +
-        "You must select a resource from the large box above.\n\n" +
-        "***  If resources that you would select are highlighted in RED, ***\n"+
-        "these items are not available during the requested time; if\n" +
-        "possible, 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.",
-    /* FIXME: Users aren't likely to be able to do anything with the following
-     * message.  Figure out a way to do something more helpful.
-     */
-    'CREATE_BRESV_OK_MISSING_TARGET': function(n, m, d, c) {
-        var s = "Created " + n + " reservation(s), but " + m + " of these " +
-            "could not target any resources.\n\n";
-        var t;
-        if (d && d.length) {
-            var gram = d.length == 1 ?
-                ["A circulation blocks", ""] : ["Circulations block", "s"];
-            t = s + gram[0] + " the desired reservation(s), " +
-                "with due date" + gram[1] + ":\n";
-
-            for (var k in d) { t += "\t" + d[k] + "\n"; }
-        } else {
-            t = s +
-            "This means that it won't be possible to fulfill some of these\n" +
-            "reservations until a suitable resource becomes available.";
-        }
-        if (c) {
-            t +="\n\nSince the requested resource could not be targeted, " +
-                "this\nreservation will now be canceled.";
-        }
-        return t;
-    },
-    'CREATE_BRESV_OK': function(n) {
-        return "Created " + n + " reservation" + (n == 1 ? "" : "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\n" +
-        "until a resource is available for reservation.",
-    'CXL_BRESV_SUCCESS': function(n) {
-        return ("Canceled " + n + " reservation" + (n == 1 ? "" : "s") + ".");
-    },
-    'CXL_BRESV_FAILURE': "Error canceling reservations; server silent.",
-    'CXL_BRESV_FAILURE2': "Error canceling reservations:\n",
-    'CXL_BRESV_SELECT_SOMETHING':
+    "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':
+    "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':
+    "ON_FLY_ERROR":
         "Error attempting to make item a bookable resource:",
-    'ANY': "ANY",
-    'ERROR_FETCHING_AOUS':
-        "Could not retrieve organizational unit settings.\n" +
-        "This is a non-fatal error, but you may wish to\n" +
-        "contact 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 <em>Display Item</em>, and "+
-        "select <em>Make Item Bookable</em> or <em>Book Item Now</em> there.",
-    'AUTO_pickup_lib_selector':
-        "Choose the pickup library for this reservation:",
-    'AUTO_or': '- Or -'
+    "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 <em>Display Item</em>, and select <em>Make Item Bookable</em> or <em>Book Item Now</em> there.",
+    "AUTO_pickup_lib_selector": "Choose the pickup library for this reservation:",
+    "AUTO_or": "- Or -"
 }

Modified: branches/rel_1_6/Open-ILS/web/js/ui/default/booking/reservation.js
===================================================================
--- branches/rel_1_6/Open-ILS/web/js/ui/default/booking/reservation.js	2010-06-11 21:20:46 UTC (rev 16691)
+++ branches/rel_1_6/Open-ILS/web/js/ui/default/booking/reservation.js	2010-06-11 21:36:42 UTC (rev 16692)
@@ -324,10 +324,17 @@
             var targeting = check_bresv_targeting(results);
             if (targeting.missing) {
                 if (aous_cache["booking.require_successful_targeting"]) {
-                    alert(localeStrings.CREATE_BRESV_OK_MISSING_TARGET(
-                        results.length, targeting.missing, targeting.due_dates,
-                        true /* will cancel */
-                    ));
+                    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; },
@@ -335,12 +342,23 @@
                         )
                     );
                 } else {
-                    alert(localeStrings.CREATE_BRESV_OK_MISSING_TARGET(
-                        results.length, targeting.missing, targeting.due_dates
-                    ));
+                    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(localeStrings.CREATE_BRESV_OK(results.length));
+                alert(
+                    dojo.string.substitute(
+                        localeStrings.CREATE_BRESV_OK, [results.length]
+                    )
+                );
             }
             update_brsrc_list();
             update_bresv_grid();
@@ -475,7 +493,11 @@
     } else if (is_ils_event(result)) {
         alert(my_ils_error(localeStrings.CXL_BRESV_FAILURE2, result));
     } else {
-        alert(localeStrings.CXL_BRESV_SUCCESS(result.length));
+        alert(
+            dojo.string.substitute(
+                localeStrings.CXL_BRESV_SUCCESS, [result.length]
+            )
+        );
     }
 }
 



More information about the open-ils-commits mailing list