Fix a problem in the clear holds shelf list printer
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 28 Sep 2011 20:50:03 +0000 (16:50 -0400)
committerMike Rylander <mrylander@gmail.com>
Tue, 15 Nov 2011 21:00:25 +0000 (16:00 -0500)
This is a "special" interface that you get to via Admin -> For
Developers -> Local Administration in the staff client.

The addition features to one "side" of this hackish interface of label affix
and parts had caused breakage on the other "side."  This fixes that.

Also improve document printing, making it less likely the progress
dialog itself gets printed.

One day this will be replaced with something better.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>

Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
Open-ILS/web/opac/extras/circ/alt_holds_print.html
Open-ILS/web/opac/extras/circ/alt_holds_print.js

index ad5e9ad..4b7737c 100644 (file)
@@ -3197,6 +3197,8 @@ sub clear_shelf_cache {
                         first_given_name second_given_name family_name alias
                     /],
                     "acn" => ["label"],
+                    "acnp" => [{column => "label", alias => "prefix"}],
+                    "acns" => [{column => "label", alias => "suffix"}],
                     "bre" => ["marc"],
                     "acpl" => ["name"],
                     "ahr" => ["id"]
@@ -3211,6 +3213,12 @@ sub clear_shelf_cache {
                                     "join" => {
                                         "bre" => {
                                             "field" => "id", "fkey" => "record"
+                                        },
+                                        "acnp" => {
+                                            "field" => "id", "fkey" => "prefix"
+                                        },
+                                        "acns" => {
+                                            "field" => "id", "fkey" => "suffix"
                                         }
                                     }
                                 },
index a7a1619..e1d2033 100644 (file)
@@ -46,6 +46,7 @@
                     cgi.param("ses") || dojo.cookie("ses");
 
                 if (cgi.param("do") == "shelf_expired_holds") {
+                    dojo.query("th[name=barcode_part]")[0].innerHTML = "Barcode";  /* XXX i18n. also, no support for part labels in this interface, at least for now */
                     dojo.byId("clear_holds_launcher").onclick = function() {
                         if (confirm("Are you sure you're ready to clear the expired holds from the shelf?")) { /* XXX i18n */
                             do_clear_holds(cgi);
@@ -81,7 +82,7 @@
                     <th>Author</th>
                     <th>Shelving Location</th>
                     <th>Call Number</th>
-                    <th>Barcode/Part</th>
+                    <th name="barcode_part">Barcode/Part</th>
                 </tr>
             </thead>
             <tbody id='target'>
index 724e4e7..65199ab 100644 (file)
@@ -117,6 +117,9 @@ function hashify_fields(fields) {
         function(k) { hold.usr[k] = fields[k]; }
     );
 
+    hold.current_copy.call_number.prefix = fields.prefix;
+    hold.current_copy.call_number.suffix = fields.suffix;
+    hold.current_copy.parts_stringified = '';   /* no real support for parts here */
     return hold;
 }
 
@@ -200,10 +203,12 @@ function do_clear_holds_from_cache(cache_key) {
             },
             "oncomplete": function() {
                 progress_dialog.hide();
-                if (any)
-                    window.print();
-                else
-                    alert(dojo.byId("no_results").innerHTML);
+                setTimeout(
+                    function() {
+                        if (any) window.print();
+                        else alert(dojo.byId("no_results").innerHTML);
+                    }, 500  /* give the progress_dialog more time to go away */
+                );
             }
         }
     );