}
__PACKAGE__->register_method(
+ method => "copy_location_count_summary",
+ api_name => "open-ils.search.biblio.copy_location_counts.summary.retrieve",
+ notes => <<" NOTES");
+ returns an array of these:
+ [ org_id, callnumber_label, copy_location, <status1_count>, <status2_cout>,...]
+ where statusx is a copy status name. the statuses are sorted
+ by id.
+ NOTES
+
+sub copy_location_count_summary {
+ my( $self, $client, $rid, $org, $depth ) = @_;
+ $org ||= 1;
+ $depth ||= 0;
+ my $data = $U->storagereq(
+ 'open-ils.storage.biblio.record_entry.status_copy_location_count.atomic', $rid, $org, $depth );
+
+ return [ sort { $a->[1] cmp $b->[1] || $a->[2] cmp $b->[2] } @$data ];
+}
+
+__PACKAGE__->register_method(
method => "copy_count_location_summary",
api_name => "open-ils.search.biblio.copy_counts.location.summary.retrieve",
notes => <<" NOTES");
var FETCH_USER_PREFS = "open-ils.actor:open-ils.actor.patron.settings.retrieve";
var UPDATE_USER_PREFS = "open-ils.actor:open-ils.actor.patron.settings.update";
var FETCH_COPY_STATUSES = "open-ils.search:open-ils.search.config.copy_status.retrieve.all";
+var FETCH_COPY_LOCATION_COUNTS_SUMMARY = "open-ils.search:open-ils.search.biblio.copy_location_counts.summary.retrieve";
var FETCH_COPY_COUNTS_SUMMARY = "open-ils.search:open-ils.search.biblio.copy_counts.summary.retrieve";
//var FETCH_COPY_COUNTS_SUMMARY = "open-ils.search:open-ils.search.biblio.copy_counts.location.summary.retrieve";
var FETCH_MARC_HTML = "open-ils.search:open-ils.search.biblio.record.html";
<!ENTITY rdetail.copyInfo.headerLabel "Copy Information">
<!ENTITY rdetail.copyInfo.library "Library">
<!ENTITY rdetail.copyInfo.callnumber "Callnumber">
+<!ENTITY rdetail.copyInfo.copylocation "Copy Location">
<!ENTITY rdetail.copyInfo.local "View Copy Information for this location only">
<!ENTITY rdetail.copyInfo.all "View copy information for all libraries">
<!ENTITY rdetail.copyInfo.actions "Actions">
var cpdCounter = 0;
var cpdNodes = {};
-function cpdBuild( contextTbody, contextRow, record, callnumber, orgid, depth ) {
+function cpdBuild( contextTbody, contextRow, record, callnumber, orgid, depth, copy_location ) {
var i = cpdCheckExisting(contextRow);
if(i) return i;
orgid : orgid,
depth : depth,
templateRow : templateRow, /* contains everything */
+ copy_location : copy_location,
mainTbody : mainTbody, /* holds the copy rows */
extrasRow : extrasRow, /* wrapper row for all extras */
counter : counter
var copy = r.getResultObject();
var row = r.row;
+ if (r.args.copy_location && copy.location().name() != r.args.copy_location) {
+ hideMe(row);
+ return;
+ }
+
$n(row, 'barcode').appendChild(text(copy.barcode()));
$n(row, 'location').appendChild(text(copy.location().name()));
$n(row, 'status').appendChild(text(copy.status().name()));
var cachedRecords;
var rdetailShowLocal = true;
+var rdetailShowCopyLocation = true;
function rdetailVolumeDetails(args) {
var row = $(args.rowid);
var tbody = row.parentNode;
- cpdBuild( tbody, row, record, args.cn, args.org, args.depth );
+ cpdBuild( tbody, row, record, args.cn, args.org, args.depth, args.copy_location );
return;
}
function rdetailBuildInfoRows() {
var req;
+ var method = FETCH_COPY_COUNTS_SUMMARY;
+ if (rdetailShowCopyLocation)
+ method = FETCH_COPY_LOCATION_COUNTS_SUMMARY;
+
if( rdetailShowLocal )
- req = new Request(FETCH_COPY_COUNTS_SUMMARY, record.doc_id(), getLocation(), getDepth())
+ req = new Request(method, record.doc_id(), getLocation(), getDepth())
else
- req = new Request(FETCH_COPY_COUNTS_SUMMARY, record.doc_id());
+ req = new Request(method, record.doc_id());
req.callback(_rdetailBuildInfoRows);
req.send();
}
//if(isLocal) unHideMe(rowNode);
unHideMe(rowNode);
+ if (rdetailShowCopyLocation)
+ unHideMe( $n( $('rdetail_copy_info_table'), 'rdetail_copylocation_header') );
+
rdetailSetPath( thisOrg, isLocal );
- rdetailBuildBrowseInfo( rowNode, arr[1], isLocal, thisOrg );
+ rdetailBuildBrowseInfo( rowNode, arr[1], isLocal, thisOrg, arr[2] );
if( i == summary.length - 1 && !defaultCN) defaultCN = arr[1];
}
}
-function rdetailBuildBrowseInfo(row, cn, local, orgNode) {
+function rdetailBuildBrowseInfo(row, cn, local, orgNode, cl) {
if(local) {
var cache = callnumberCache[cn];
$n(row, 'rdetail_callnumber_cell').appendChild(text(cn));
+ if (rdetailShowCopyLocation) {
+ var cl_cell = $n(row, 'rdetail_copylocation_cell');
+ cl_cell.appendChild(text(cl));
+ unHideMe(cl_cell);
+ }
+
_debug('setting action clicks for cn ' + cn);
var dHref = 'javascript:rdetailVolumeDetails('+
- '{rowid : "'+row.id+'", cn :"'+cn+'", depth:"'+depth+'", org:"'+orgNode.id()+'", local: '+local+'});';
+ '{copy_location : "'+cl+'", rowid : "'+row.id+'", cn :"'+cn+'", depth:"'+depth+'", org:"'+orgNode.id()+'", local: '+local+'});';
var bHref = 'javascript:rdetailShowCNBrowse("' + cn + '", '+orgNode.id()+', "'+depth+'");';
<tr>
<td class='rdetail_copy_info_header_cell'>&rdetail.copyInfo.library;</td>
<td class='rdetail_copy_info_header_cell'>&rdetail.copyInfo.callnumber;</td>
+ <td name='rdetail_copylocation_header' class='rdetail_copy_info_header_cell hide_me'>&rdetail.copyInfo.copylocation;</td>
<td class='rdetail_copy_info_header_cell'>&rdetail.copyInfo.actions;</td>
<td nowrap='nowrap' class='rdetail_copy_info_header_cell' id='rdetail_copy_info_status'>
<div name='rdetail_status_cell'> </div>
</a>
</td>
<td name='rdetail_callnumber_cell'> </td>
+ <td class="hide_me" name='rdetail_copylocation_cell'> </td>
<td name='rdetail_actions_cell'>
<div style='padding-bottom: 1px;'>
<a style='font-size: 8pt;'