[open-ils-commits] r15289 - in trunk/Open-ILS: web/js/dojo/openils/booking/nls web/js/ui/default/booking web/opac/locale/en-US web/templates/default/booking xul/staff_client/server/admin (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Jan 8 16:14:01 EST 2010


Author: miker
Date: 2010-01-08 16:13:56 -0500 (Fri, 08 Jan 2010)
New Revision: 15289

Modified:
   trunk/Open-ILS/web/js/dojo/openils/booking/nls/pull_list.js
   trunk/Open-ILS/web/js/ui/default/booking/pickup.js
   trunk/Open-ILS/web/js/ui/default/booking/populator.js
   trunk/Open-ILS/web/js/ui/default/booking/pull_list.js
   trunk/Open-ILS/web/js/ui/default/booking/return.js
   trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
   trunk/Open-ILS/web/templates/default/booking/pull_list.tt2
   trunk/Open-ILS/xul/staff_client/server/admin/index.xhtml
Log:
Patch from Lebbeous Fogle-Weekley adding non-menu entry points for critical reservation (booking) interfaces (side-step a new staff client, for now), patron interface integration, and I18n

Modified: trunk/Open-ILS/web/js/dojo/openils/booking/nls/pull_list.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/booking/nls/pull_list.js	2010-01-08 20:58:30 UTC (rev 15288)
+++ trunk/Open-ILS/web/js/dojo/openils/booking/nls/pull_list.js	2010-01-08 21:13:56 UTC (rev 15289)
@@ -5,6 +5,7 @@
     'COPY_LOOKUP_ERROR': "Error looking up copies by barcode: ",
     'COPY_MISSING': "Unexpected error: No information for copy: ",
 
+    '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: ",

Modified: trunk/Open-ILS/web/js/ui/default/booking/pickup.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/booking/pickup.js	2010-01-08 20:58:30 UTC (rev 15288)
+++ trunk/Open-ILS/web/js/ui/default/booking/pickup.js	2010-01-08 21:13:56 UTC (rev 15289)
@@ -4,6 +4,22 @@
 );
 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,
@@ -12,13 +28,5 @@
     }, document.getElementById("patron_barcode"));
     init_auto_l10n(document.getElementById("auto_l10n_start_here"));
 
-    /* The following would be for pass-in from the patron interface, but
-     * doesn't yet work/is cheap and needs improved anyway. */
-//    try {
-//        document.getElementById("patron_barcode").value =
-//            xulG.bresv_interface_opts.patron_barcode;
-//        document.getElementById("lookup").submit();
-//    } catch (E) {
-//        ;
-//    }
+    react_to_pass_in(xulG.bresv_interface_opts);
 }

Modified: trunk/Open-ILS/web/js/ui/default/booking/populator.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/booking/populator.js	2010-01-08 20:58:30 UTC (rev 15288)
+++ trunk/Open-ILS/web/js/ui/default/booking/populator.js	2010-01-08 21:13:56 UTC (rev 15289)
@@ -200,8 +200,8 @@
 };
 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); 
+    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);
@@ -267,6 +267,10 @@
         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();

Modified: trunk/Open-ILS/web/js/ui/default/booking/pull_list.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/booking/pull_list.js	2010-01-08 20:58:30 UTC (rev 15288)
+++ trunk/Open-ILS/web/js/ui/default/booking/pull_list.js	2010-01-08 21:13:56 UTC (rev 15289)
@@ -175,18 +175,29 @@
         return;
     }
 
-    /* Step 2: render the table with the pull list */
-    render_pull_list_fundamentals(results);
+    if (results.length) {
+        reveal_dom_element(document.getElementById("table_goes_here"));
+        hide_dom_element(document.getElementById("no_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);
+        /* 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"));
 }

Modified: trunk/Open-ILS/web/js/ui/default/booking/return.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/booking/return.js	2010-01-08 20:58:30 UTC (rev 15288)
+++ trunk/Open-ILS/web/js/ui/default/booking/return.js	2010-01-08 21:13:56 UTC (rev 15289)
@@ -4,6 +4,31 @@
 );
 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,
@@ -12,15 +37,5 @@
     }, document.getElementById("barcode"));
     init_auto_l10n(document.getElementById("auto_l10n_start_here"));
 
-    /* The following would handle pass-in from the patron interface, but
-     * doesn't work (dirty solution, will come back to it, make it work,
-     * clean it up). */
-//    try {
-//        document.getElementById("barcode").value =
-//            xulG.bresv_interface_opts.patron_barcode;
-//        document.getElementById("barcode_type").selectedIndex = 1;
-//        document.getElementById("lookup").submit();
-//    } catch (E) {
-//        alert(E);
-//    }
+    react_to_pass_in(xulG.bresv_interface_opts);
 }

Modified: trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-01-08 20:58:30 UTC (rev 15288)
+++ trunk/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-01-08 21:13:56 UTC (rev 15289)
@@ -1712,7 +1712,14 @@
 <!ENTITY staff.server.admin.index.transit_list "Transit List">
 <!ENTITY staff.server.admin.index.conify "Server Settings">
 
+<!ENTITY staff.server.admin.index.booking "Booking">
+<!ENTITY staff.server.admin.index.booking.reservation "Create/Cancel Reservations">
+<!ENTITY staff.server.admin.index.booking.pull_list "Pull List">
+<!ENTITY staff.server.admin.index.booking.capture "Capture">
+<!ENTITY staff.server.admin.index.booking.pickup "Pickup Reservations">
+<!ENTITY staff.server.admin.index.booking.return "Return Reservations">
 
+
 <!ENTITY staff.server.admin.org_settings.title "Evergreen: Library Settings Editor">
 <!-- This will be followed by the user's name -->
 <!ENTITY staff.server.admin.org_settings.greeting "Welcome ">

Modified: trunk/Open-ILS/web/templates/default/booking/pull_list.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/booking/pull_list.tt2	2010-01-08 20:58:30 UTC (rev 15288)
+++ trunk/Open-ILS/web/templates/default/booking/pull_list.tt2	2010-01-08 21:13:56 UTC (rev 15289)
@@ -39,11 +39,12 @@
             <tbody id="the_table_body">
             </tbody>
         </table>
+        <div id="print_holder" class="nice_vertical_padding">
+            <!-- XXX Print button probably won't stay right here -->
+            <input type="button" class="AUTO_ATTR_VALUE_print"
+                onclick="window.print();" /><!-- XXX too simplistic? -->
+        </div>
     </div>
-    <div id="print_holder" class="nice_vertical_padding">
-        <!-- XXX Print button probably won't stay right here -->
-        <input type="button" class="AUTO_ATTR_VALUE_print"
-            onclick="window.print();" /><!-- XXX too simplistic? -->
-    </div>
+    <div id="no_results" class="AUTO_no_results"></div>
 </div>
 [% END %]

Modified: trunk/Open-ILS/xul/staff_client/server/admin/index.xhtml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/index.xhtml	2010-01-08 20:58:30 UTC (rev 15288)
+++ trunk/Open-ILS/xul/staff_client/server/admin/index.xhtml	2010-01-08 21:13:56 UTC (rev 15289)
@@ -9,6 +9,8 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
     <head>
         <title>&staff.server.admin.index.title;</title>
+        <script type="text/javascript" src="/js/dojo/dojo/dojo.js"
+            djConfig="parseOnLoad: true, isDebug:false"></script>
         <script>
             function _l(l,p) { 
                 var url = l + location.search;
@@ -20,12 +22,19 @@
                 location.href = url;
             }
             function getBuildId() { return location.href.match(/\/xul\/(.+?)\/server\//)[1]; }
+
+            function my_init() {
+                try {
+                    dojo.require("dojo.cookie");
+                    window.xulG.auth = {"session": {"key": dojo.cookie("ses")}};
+                } catch(E) { /* XXX ignorable except for booking links */ }
+            }
         </script>
         <style type='text/css'>
             body { background-color: white; }
         </style>
     </head>
-    <body>
+    <body onload="my_init();">
         <center>
             <div style='height: 40px; margin-top: 20px; font-weight: bold; font-size: 14pt;'>
                 &staff.server.admin.index.title;
@@ -38,9 +47,10 @@
             <table width='100%'>
                 <thead>
                     <tr>
-                        <th width='30%'>&staff.server.admin.index.workstation_configuration;</th>
-                        <th width='30%'>&staff.server.admin.index.library_configuration;</th>
-                        <th width='30%'>&staff.server.admin.index.maintenance_reports;</th>
+                        <th width='25%'>&staff.server.admin.index.workstation_configuration;</th>
+                        <th width='25%'>&staff.server.admin.index.library_configuration;</th>
+                        <th width='25%'>&staff.server.admin.index.maintenance_reports;</th>
+                        <th width='25%'>&staff.server.admin.index.booking;</th>
                     </tr>
                 </thead>
                 <tbody>
@@ -84,6 +94,22 @@
                             <div style='padding: 8px;'>
                                 <a href='javascript:window.xulG.new_tab("/xul/server/admin/transit_list.xul",{"tab_name":"&staff.server.admin.index.transits;"},{});'>&staff.server.admin.index.transit_list;</a>
                             </div>
+                        </td><td>
+                            <div style='padding: 8px;'>
+                                <a href='javascript:window.xulG.new_tab("/eg/booking/reservation",{"tab_name":"&staff.server.admin.index.booking.reservation;","browser":false},window.xulG);'>&staff.server.admin.index.booking.reservation;</a> <span style="color: red">&staff.server.admin.index.testing;</span>
+                            </div>
+                            <div style='padding: 8px;'>
+                                <a href='javascript:window.xulG.new_tab("/eg/booking/pull_list",{"tab_name":"&staff.server.admin.index.booking.pull_list;","browser":false},window.xulG);'>&staff.server.admin.index.booking.pull_list;</a> <span style="color: red">&staff.server.admin.index.testing;</span>
+                            </div>
+                            <div style='padding: 8px;'>
+                                <a href='javascript:window.xulG.new_tab("/eg/booking/capture",{"tab_name":"&staff.server.admin.index.booking.capture;","browser":false},window.xulG);'>&staff.server.admin.index.booking.capture;</a> <span style="color: red">&staff.server.admin.index.testing;</span>
+                            </div>
+                            <div style='padding: 8px;'>
+                                <a href='javascript:window.xulG.new_tab("/eg/booking/pickup",{"tab_name":"&staff.server.admin.index.booking.pickup;","browser":false},window.xulG);'>&staff.server.admin.index.booking.pickup;</a> <span style="color: red">&staff.server.admin.index.testing;</span>
+                            </div>
+                            <div style='padding: 8px;'>
+                                <a href='javascript:window.xulG.new_tab("/eg/booking/return",{"tab_name":"&staff.server.admin.index.booking.return;","browser":false},window.xulG);'>&staff.server.admin.index.booking.return;</a> <span style="color: red">&staff.server.admin.index.testing;</span>
+                            </div>
                         </td>
                     </tr>
                 </tbody>



More information about the open-ils-commits mailing list