$ctx->{copies} = $copy_rec->gather(1);
# Add public copy notes to each copy - and while we're in there, grab peer bib records
+ # and copy tags
my %cached_bibs = ();
foreach my $copy (@{$ctx->{copies}}) {
$copy->{notes} = $U->simplereq(
{itemid => $copy->{id}, pub => 1 }
);
$self->timelog("past copy note retrieval call");
+ my $meth = 'open-ils.circ.copy_tags.retrieve';
+ $meth .= ".staff" if $ctx->{is_staff};
+ $copy->{tags} = $U->simplereq(
+ 'open-ils.circ',
+ $meth,
+ {
+ ($ctx->{is_staff} ? (authtoken => $ctx->{authtoken}) : ()),
+ copy_id => $copy->{id},
+ scope => $org,
+ depth => $copy_depth,
+ }
+ );
+ $self->timelog("past copy tag retrieval call");
$copy->{peer_bibs} = $U->simplereq(
'open-ils.search',
'open-ils.search.multi_home.bib_ids.by_barcode',
$parts{$_} = [ $cgi->param($_) ] for (@part_names);
my $full_query = '';
+ my @bookplate_queries = ();
for (my $i = 0; $i < scalar @{$parts{'qtype'}}; $i++) {
my ($qtype, $contains, $query, $bool) = map { $parts{$_}->[$i] } @part_names;
next unless $query =~ /\S/;
+ # Hack for bookplates; "bookplate" is not a real search
+ # class, so grabbing them out of the advanced search query
+ # params to convert to a copy_tag(*,...) filter later
+ if ($qtype eq 'bookplate') {
+ $query =~ s/[)(]/ /g; # don't break on 'foo(bar)baz'
+ push @bookplate_queries, $query;
+ next;
+ }
+
# Hack for journal title
my $jtitle = 0;
if ($qtype eq 'jtitle') {
$full_query = $full_query ? "($full_query $bool $query)" : $query;
}
- return $full_query;
+ return $full_query, \@bookplate_queries;
}
sub _prepare_biblio_search {
my ($cgi, $ctx) = @_;
# XXX This will still contain the jtitle hack...
- my $user_query = _prepare_biblio_search_basics($cgi) || '';
+ my ($user_query, $bookplate_queries) = _prepare_biblio_search_basics($cgi);
+ $user_query //= '';
+ $bookplate_queries //= [];
my $query = $user_query;
+ if (@$bookplate_queries) {
+ $query .= " " . join(" ", map { "copy_tag(*,$_)" } @$bookplate_queries);
+ # hack to handle the case where a bookplate comes from the
+ # simple search box
+ $user_query = $bookplate_queries->[0] if $user_query eq '';
+ }
$query .= ' ' . $ctx->{global_search_filter} if $ctx->{global_search_filter};
word-wrap:normal;
}
+#rdetails_status tbody td.copy_tag {
+ border-color: [% css_colors.primary %];
+ border-style: dashed;
+ border-width: 2px;
+}
+#rdetails_status tbody .copy_tag_value {
+ font-weight: bolder;
+}
+
.rdetail_extras {
background-color: [% css_colors.primary_fade %];
border: 1px solid [% css_colors.primary %];
{value => "author", label => l("Author"), plural_label => l("Authors"), browse => 1},
{value => "subject", label => l("Subject"), plural_label => l("Subjects"), browse => 1},
{value => "series", label => l("Series"), plural_label => l("Series"), browse => 1}
-] %]
+];
+ IF ctx.get_org_setting(ctx.search_ou, 'opac.search.enable_bookplate_search');
+ query_types.push(
+ {value => "bookplate", label => l("Digital Bookplate"), plural_label => l("Digital Bookplates")}
+ );
+ END;
+-%]
<select name="[% name || 'qtype' %]"[% IF id; ' id="'; id ; '"' ; END -%]
title="[% l('Select query type:') %]">
[% query_type = query_type || CGI.param('qtype') || search.default_qtypes.0;
[% END %]
[% END %]
+ [% IF copy_info.tags; %]
+ [% FOREACH tag IN copy_info.tags; %]
+ <tr class="copy_tag_row">
+ <td> </td>
+ <td class="copy_tag" colspan="4"</td>
+ <span class="copy_tag_value">[% tag.value | html %]</span>
+ </td>
+ <tr>
+ [% END %]
+ [% END %]
+
<tr><td>
[%- IF copy_info.peer_bib_marc.size > 1;
'<ul>';