[open-ils-commits] r17187 - in branches/seials-integration/Open-ILS: src/perlmods/OpenILS/Application/Search web/opac/skin/default/js (dbwells)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Aug 12 09:41:56 EDT 2010
Author: dbwells
Date: 2010-08-12 09:41:54 -0400 (Thu, 12 Aug 2010)
New Revision: 17187
Modified:
branches/seials-integration/Open-ILS/src/perlmods/OpenILS/Application/Search/Serial.pm
branches/seials-integration/Open-ILS/web/opac/skin/default/js/rdetail.js
Log:
Small OPAC serial holdings display changes
Modified: branches/seials-integration/Open-ILS/src/perlmods/OpenILS/Application/Search/Serial.pm
===================================================================
--- branches/seials-integration/Open-ILS/src/perlmods/OpenILS/Application/Search/Serial.pm 2010-08-12 13:33:31 UTC (rev 17186)
+++ branches/seials-integration/Open-ILS/src/perlmods/OpenILS/Application/Search/Serial.pm 2010-08-12 13:41:54 UTC (rev 17187)
@@ -109,14 +109,14 @@
# note => "Given a bibliographic record ID, return MFHD holdings"
#);
-sub bib_to_mfhd {
+sub bib_to_svr {
my ($self, $client, $bib) = @_;
- my $mfhd;
+ my $svrs;
my $e = OpenILS::Utils::CStoreEditor->new();
# TODO: 'deleted' ssub support
- my $sdists = $e->search_serial_distribution([{ "+ssub" => {"record_entry" => $bib} }, { "flesh" => 1, "flesh_fields" => {'sdist' => [ "record_entry", "basic_summary", "supplement_summary", "index_summary" ]}, "join" => {"ssub" => {}} }]);
+ my $sdists = $e->search_serial_distribution([{ "+ssub" => {"record_entry" => $bib} }, { "flesh" => 1, "flesh_fields" => {'sdist' => [ "record_entry", "holding_lib", "basic_summary", "supplement_summary", "index_summary" ]}, "join" => {"ssub" => {}} }]);
my $sres = $e->search_serial_record_entry([{ record => $bib, deleted => 'f', "+sdist" => {"id" => undef} }, { "join" => {"sdist" => { 'type' => 'left' }} }]);
if (!ref $sres and !ref $sdists) {
return undef;
@@ -130,7 +130,7 @@
} else {
$svr = Fieldmapper::serial::virtual_record->new;
$svr->sre_id(-1);
- $svr->location(-1); #TODO: location support
+ $svr->location($_->holding_lib->name);
$svr->owning_lib($_->holding_lib);
$svr->basic_holdings([]);
$svr->supplement_holdings([]);
@@ -166,20 +166,23 @@
push(@{$svr->index_holdings_add}, $_->index_summary->textual_holdings);
}
}
- push(@$mfhd, $svr);
+ push(@$svrs, $svr);
}
foreach (@$sres) {
- push(@$mfhd, $mfhd_parser->generate_svr($_->id, $_->marc, $_->owning_lib));
+ push(@$svrs, $mfhd_parser->generate_svr($_->id, $_->marc, $_->owning_lib));
}
- return $mfhd;
+ # do a basic location sort for simple predictability
+ @$svrs = sort { $a->location cmp $b->location } @$svrs;
+
+ return $svrs;
}
__PACKAGE__->register_method(
- method => "bib_to_mfhd",
+ method => "bib_to_svr",
api_name => "open-ils.search.serial.record.bib.retrieve",
argc => 1,
- note => "Given a bibliographic record ID, return MFHD holdings"
+ note => "Given a bibliographic record ID, return holdings in svr form"
);
1;
Modified: branches/seials-integration/Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- branches/seials-integration/Open-ILS/web/opac/skin/default/js/rdetail.js 2010-08-12 13:33:31 UTC (rev 17186)
+++ branches/seials-integration/Open-ILS/web/opac/skin/default/js/rdetail.js 2010-08-12 13:41:54 UTC (rev 17187)
@@ -298,10 +298,17 @@
entryNumString = ' [Entry #'+entryNumInc+'] ';
}
- dojo.place("<table style='width: 100%;'><caption id='mfhdHoldingsCaption" + entryNum + "' class='rdetail_header color_1'>" +
- dojo.string.substitute(opac_strings.HOLDINGS_TABLE_CAPTION, [hloc]) +
+ var refNode;
+ if (entryNum > 0) {
+ refNode = 'rdetail_holdings_table_' + (entryNum - 1);
+ } else {
+ refNode = 'rdetail_details_table';
+ }
+
+ dojo.place("<table style='width: 100%;' id='rdetail_holdings_table_"+entryNum+"'><caption id='mfhdHoldingsCaption" + entryNum + "' class='rdetail_header color_1'>" +
+ dojo.string.substitute(opac_strings.HOLDINGS_TABLE_CAPTION, [hloc]) + entryNumString +
"</caption><tbody id='rdetail_holdings_tbody_" + entryNum +
- "'></tbody></table>", "rdetail_details_table", "after"
+ "'></tbody></table>", refNode, "after"
);
if (hb.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.BASIC_HOLDINGS, hb); }
if (hba.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.BASIC_HOLDINGS_ADD, hba); }
More information about the open-ils-commits
mailing list