[open-ils-commits] r11128 - in trunk/Open-ILS: src/perlmods/OpenILS/Application/Search web/opac/common/js web/opac/locale/en-US web/opac/skin/default/js web/opac/skin/default/xml/rdetail
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Nov 10 22:59:05 EST 2008
Author: miker
Date: 2008-11-10 22:59:03 -0500 (Mon, 10 Nov 2008)
New Revision: 11128
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
trunk/Open-ILS/web/opac/common/js/config.js
trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
trunk/Open-ILS/web/opac/skin/default/js/copy_details.js
trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
trunk/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_copyinfo.xml
Log:
add copy location display based on switch
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm 2008-11-11 02:53:22 UTC (rev 11127)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm 2008-11-11 03:59:03 UTC (rev 11128)
@@ -1330,6 +1330,26 @@
}
__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");
Modified: trunk/Open-ILS/web/opac/common/js/config.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/config.js 2008-11-11 02:53:22 UTC (rev 11127)
+++ trunk/Open-ILS/web/opac/common/js/config.js 2008-11-11 03:59:03 UTC (rev 11128)
@@ -305,6 +305,7 @@
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";
Modified: trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/opac.dtd 2008-11-11 02:53:22 UTC (rev 11127)
+++ trunk/Open-ILS/web/opac/locale/en-US/opac.dtd 2008-11-11 03:59:03 UTC (rev 11128)
@@ -513,6 +513,7 @@
<!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">
Modified: trunk/Open-ILS/web/opac/skin/default/js/copy_details.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/copy_details.js 2008-11-11 02:53:22 UTC (rev 11127)
+++ trunk/Open-ILS/web/opac/skin/default/js/copy_details.js 2008-11-11 03:59:03 UTC (rev 11128)
@@ -2,7 +2,7 @@
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;
@@ -48,6 +48,7 @@
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
@@ -195,6 +196,11 @@
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()));
Modified: trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2008-11-11 02:53:22 UTC (rev 11127)
+++ trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2008-11-11 03:59:03 UTC (rev 11128)
@@ -23,6 +23,7 @@
var cachedRecords;
var rdetailShowLocal = true;
+var rdetailShowCopyLocation = true;
@@ -412,7 +413,7 @@
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;
}
@@ -521,10 +522,14 @@
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();
}
@@ -664,8 +669,11 @@
//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];
}
@@ -674,7 +682,7 @@
}
-function rdetailBuildBrowseInfo(row, cn, local, orgNode) {
+function rdetailBuildBrowseInfo(row, cn, local, orgNode, cl) {
if(local) {
var cache = callnumberCache[cn];
@@ -687,10 +695,16 @@
$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+'");';
Modified: trunk/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_copyinfo.xml
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_copyinfo.xml 2008-11-11 02:53:22 UTC (rev 11127)
+++ trunk/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_copyinfo.xml 2008-11-11 03:59:03 UTC (rev 11128)
@@ -23,6 +23,7 @@
<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>
@@ -38,6 +39,7 @@
</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;'
More information about the open-ils-commits
mailing list