$ctx->{copy_offset} = $copy_offset;
$ctx->{have_holdings_to_show} = 0;
+ $ctx->{have_mfhd_to_show} = 0;
$self->get_hold_copy_summary($rec_id, $org);
$cstore->kill_me;
- # XXX TODO we'll also need conditional logic to show MFHD-based holdings
if (
$ctx->{get_org_setting}->
($org, "opac.fully_compressed_serial_holdings")
scalar(@{$ctx->{holding_summaries}->{basic}}) ||
scalar(@{$ctx->{holding_summaries}->{index}}) ||
scalar(@{$ctx->{holding_summaries}->{supplement}});
+ } else {
+ $ctx->{mfhd_summaries} =
+ $self->get_mfhd_summaries($rec_id, $org, $depth);
+
+ if ($ctx->{mfhd_summaries} && scalar(@{$ctx->{mfhd_summaries}})
+ ) {
+ $ctx->{have_mfhd_to_show} = 1;
+ };
}
my %expandies = (
return $result;
}
+sub get_mfhd_summaries {
+ my ($self, $rec_id, $org, $depth) = @_;
+
+ # XXX TODO Filter results on OU / depth before returning
+ # Perhaps in a modified form of the osrf method, rather than here
+ my $serial = create OpenSRF::AppSession("open-ils.search");
+ my $result = $serial->request(
+ "open-ils.search.serial.record.bib.retrieve",
+ $rec_id
+ )->gather(1);
+
+ $serial->kill_me;
+ return $result;
+}
+
sub get_expanded_holdings {
my ($self, $rec_id, $org, $depth) = @_;
{name => 'annotation', label => l('Annotation'), hide => 1},
{name => 'awards', label => l('Awards, Reviews, & Suggested Reads')},
{name => 'excerpt', label => l('Excerpt'), hide => 1},
- {name => 'issues', label => l('Issues Held'), hide => !ctx.have_holdings_to_show},
+ {name => 'issues', label => l('Issues Held'), hide => !(ctx.have_holdings_to_show || ctx.have_mfhd_to_show)},
{name => 'preview', label => l('Preview'), hide => 1},
{name => 'cnbrowse', label => l('Shelf Browser')},
{name => 'marchtml', label => l('MARC Record')}
[% END %]
</div>
[% END %]
+[% IF ctx.mfhd_summaries.size; %]
+ <div class="rdetail-mfhd-holdings">
+ <table>
+[%
+ mfhd = {
+ basic_holdings = l('Volumes'),
+ basic_holdings_add = l('Additional Volume Information'),
+ supplement_holdings = l('Supplements'),
+ supplement_holdings_add = l('Additional Supplement Information'),
+ index_holdings = l('Indexes'),
+ index_holdings_add = l('Additional Index Information'),
+ online = l('Online'),
+ missing = l('Missing'),
+ incomplete = l('Incomplete'),
+ };
+
+ FOREACH serial IN ctx.mfhd_summaries;
+ FOREACH type IN mfhd.keys;
+ NEXT UNLESS serial.$type.size;
+%]
+ <tr>
+ <td class="rdetail-mfhd-type">[% mfhd.$type %]</td>
+ <td class="rdetail-mfhd-contents">[% serial.$type.join(', ') %]</td>
+ </tr>
+ [% END %]
+ [% END %]
+ </table>
+ </div>
+[% END %]
</div>