Merge branch 'master' of git.evergreen-ils.org:Evergreen into template-toolkit-opac
authorMike Rylander <mrylander@gmail.com>
Wed, 18 May 2011 13:28:17 +0000 (09:28 -0400)
committerMike Rylander <mrylander@gmail.com>
Wed, 18 May 2011 13:28:17 +0000 (09:28 -0400)
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
Open-ILS/web/opac/skin/default/js/rdetail.js
Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
Open-ILS/xul/staff_client/server/cat/spine_labels.js
Open-ILS/xul/staff_client/server/circ/util.js

index f56a52d..03f947f 100644 (file)
@@ -1348,7 +1348,7 @@ __PACKAGE__->register_method(
         desc   => 'Returns a stream of fleshed holds',
         params => [
             { desc => 'Authtoken', type => 'string'},
-            { desc => 'Hash of optional param: Org unit ID (defaults to workstation org unit), limit, offset, sort (array of: acplo.position, call_number, request_time)',
+            { desc => 'Hash of optional param: Org unit ID (defaults to workstation org unit), limit, offset, sort (array of: acplo.position, prefix, call_number, suffix, request_time)',
               type => 'object'
             },
         ],
@@ -1383,8 +1383,12 @@ sub print_hold_pull_list_stream {
                     "class" => "acplo", "field" => "position",
                     "transform" => "coalesce", "params" => [999]
                 };
+            } elsif ($s eq 'prefix') {
+                push @$sort, {"class" => "acnp", "field" => "label_sortkey"};
             } elsif ($s eq 'call_number') {
-                push @$sort, {"class" => "acn", "field" => "label"};
+                push @$sort, {"class" => "acn", "field" => "label_sortkey"};
+            } elsif ($s eq 'suffix') {
+                push @$sort, {"class" => "acns", "field" => "label_sortkey"};
             } elsif ($s eq 'request_time') {
                 push @$sort, {"class" => "ahr", "field" => "request_time"};
             }
@@ -1407,7 +1411,17 @@ sub print_hold_pull_list_stream {
                         "join" => {
                             "acn" => {
                                 "field" => "id",
-                                "fkey" => "call_number" 
+                                "fkey" => "call_number",
+                                "join" => {
+                                    "acnp" => {
+                                        "field" => "id",
+                                        "fkey" => "prefix"
+                                    },
+                                    "acns" => {
+                                        "field" => "id",
+                                        "fkey" => "suffix"
+                                    }
+                                }
                             },
                             "acplo" => {
                                 "field" => "org",
@@ -1448,7 +1462,7 @@ sub print_hold_pull_list_stream {
                     "ahr" => ["usr", "current_copy"],
                     "au"  => ["card"],
                     "acp" => ["location", "call_number"],
-                    "acn" => ["record"]
+                    "acn" => ["record","prefix","suffix"]
                 }
             }
         ]);
index 405aaed..5801df2 100644 (file)
@@ -31,7 +31,7 @@
         <!-- Dojo goodness -->
         <script type="text/javascript">
             var djConfig = {parseOnLoad:true,isDebug:false,AutoIDL:['aou','aout','pgt','ahr','acp','acn']};
-            var sort_order = ["acplo.position", "call_number", "request_time"];
+            var sort_order = ["acplo.position", "prefix", "call_number", "suffix", "request_time"];
         </script>
         <script type="text/javascript" src="/js/dojo/dojo/dojo.js"></script>
         <script type="text/javascript" src="/js/dojo/dojo/openils_dojo.js"></script>
@@ -93,7 +93,7 @@
                     <td type='opac/slot-data' query='datafield[tag=245]'></td>
                     <td type='opac/slot-data' query='datafield[tag^=1]' limit='1'> </td>
                     <td>${current_copy.location.name}</td>
-                    <td>${current_copy.call_number.label}</td>
+                    <td>${current_copy.call_number.prefix.label} ${current_copy.call_number.label} ${current_copy.call_number.suffix.label}</td>
                     <td>${current_copy.barcode}</td>
                 </tr>
             </tbody>
index 31a21c1..a3f0378 100644 (file)
@@ -35,6 +35,8 @@ function do_pull_list() {
                 hold.current_copy.location = hold_fm.current_copy().location().toHash(true);
                 hold.current_copy.call_number = hold_fm.current_copy().call_number().toHash(true);
                 hold.current_copy.call_number.record = hold_fm.current_copy().call_number().record().toHash(true);
+                hold.current_copy.call_number.prefix = hold_fm.current_copy().call_number().prefix().toHash(true);
+                hold.current_copy.call_number.suffix = hold_fm.current_copy().call_number().suffix().toHash(true);
 
                 // clone the template's html
                 var tr = dojo.clone(
index fd7b94a..c74c385 100644 (file)
@@ -801,7 +801,7 @@ function rdetailShowExtra(type, args) {
                case 'cn':
                        addCSSClass($('rdetail_viewcn_link'), 'rdetail_extras_selected');
                        unHideMe($('rdetail_cn_browse_div'));
-                       rdetailShowCNBrowse(defaultCN, getLocation(), null, true);
+                       rdetailShowCNBrowse(defaultCN[1], getLocation(), null, true);
                        break;
 
        }
index f73f071..17a1ac9 100644 (file)
@@ -181,6 +181,16 @@ OpenILS.data.prototype = {
             var obj = this; var found;
             if (obj.hash[key] && obj.hash[key][value]) return obj.hash[key][value];
             switch(key) {
+                case 'acnp':
+                    found = obj.network.simple_request('FM_ACNP_RETRIEVE_VIA_PCRUD',[ ses(), { 'id' : { '=' : value } }]);
+                    if (typeof found.ilsevent != 'undefined') throw(js2JSON(found));
+                    found = found[0];
+                break;
+                case 'acns':
+                    found = obj.network.simple_request('FM_ACNS_RETRIEVE_VIA_PCRUD',[ ses(), { 'id' : { '=' : value } }]);
+                    if (typeof found.ilsevent != 'undefined') throw(js2JSON(found));
+                    found = found[0];
+                break;
                 case 'acpl': 
                     found = obj.network.simple_request('FM_ACPL_RETRIEVE_VIA_ID.authoritative',[ value ]);
                 break;
index c1c104c..58d6484 100644 (file)
                         dump('on_oils_persist: <<< ' + target.nodeName + '.id = ' + target.id + '\t' + bk + '\n');
                         for (var j = 0; j < attribute_list.length; j++) {
                             var key = base_key + attribute_list[j];
-                            var value = encodeURI(target.getAttribute( attribute_list[j] ));
+                            var value;
+                            try {
+                                value = encodeURI(target.getAttribute( attribute_list[j] ));
+                            } catch(E) {
+                                dump('Error in persist_helper with encodeURI: ' + E + '\n');
+                                value = target.getAttribute( attribute_list[j] );
+                            }
                             if ( attribute_list[j] == 'checked' && ['checkbox','toolbarbutton'].indexOf( target.nodeName ) > -1 ) {
                                 value = target.checked;
                                 dump('\t' + value + ' <== .' + attribute_list[j] + '\n');
                 for (var j = 0; j < attribute_list.length; j++) {
                     var key = base_key + attribute_list[j];
                     var has_key = prefs.prefHasUserValue(key);
-                    var value = has_key ? decodeURI(prefs.getCharPref(key)) : null;
+                    var value;
+                    try {
+                        value = has_key ? decodeURI(prefs.getCharPref(key)) : null;
+                    } catch(E) {
+                        dump('Error in persist_helper with decodeURI: ' + E + '\n');
+                        value = has_key ? prefs.getCharPref(key) : null;
+                    }
                     if (value == 'true') { value = true; }
                     if (value == 'false') { value = false; }
                     if (has_key) {
index 2db3a6e..04aff17 100644 (file)
                         }
                     }
                     if ($('call_number').checked && $('call_number_line').value == j + 1) {
-                        tb2.value = volume.label().substr(0,label_cfg.pocket_width);
+                        tb2.value = (
+                            (volume.prefix() + ' ' + volume.label() + ' ' + volume.suffix())
+                            .replace(/\s+$/,'')
+                            .replace(/^\s+/,'')
+                            .substr(0,label_cfg.pocket_width)
+                        );
                     }
                     if ($('owning_lib_shortname').checked && $('owning_lib_shortname_line').value == j + 1) {
                         var lib = volume.owning_lib();
index 14bffab..9859415 100644 (file)
@@ -641,7 +641,7 @@ circ.util.columns = function(modify,params) {
                 if (typeof my.acn == 'undefined') return '';
                 return (typeof my.acn.prefix() == 'object')
                     ? my.acn.prefix().label()
-                    : data.hash.acnp[ my.acn.prefix() ].label();
+                    : data.lookup("acnp", my.acn.prefix() ).label();
             },
             'persist' : 'hidden width ordinal'
         },
@@ -656,7 +656,7 @@ circ.util.columns = function(modify,params) {
                 if (typeof my.acn == 'undefined') return '';
                 return (typeof my.acn.suffix() == 'object')
                     ? my.acn.suffix().label()
-                    : data.hash.acns[ my.acn.suffix() ].label();
+                    : data.lookup("acns", my.acn.suffix() ).label();
             },
             'persist' : 'hidden width ordinal'
         },