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'
},
],
"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"};
}
"join" => {
"acn" => {
"field" => "id",
- "fkey" => "call_number"
+ "fkey" => "call_number",
+ "join" => {
+ "acnp" => {
+ "field" => "id",
+ "fkey" => "prefix"
+ },
+ "acns" => {
+ "field" => "id",
+ "fkey" => "suffix"
+ }
+ }
},
"acplo" => {
"field" => "org",
"ahr" => ["usr", "current_copy"],
"au" => ["card"],
"acp" => ["location", "call_number"],
- "acn" => ["record"]
+ "acn" => ["record","prefix","suffix"]
}
}
]);
<!-- 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>
<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>
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(
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;
}
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;
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) {
}
}
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();
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'
},
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'
},