From: Bill Erickson Date: Thu, 6 Feb 2014 19:47:44 +0000 (-0500) Subject: LP#1053397 tpac single-rec MR jumps to detail page X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ce65bfb8d5080056816ea886baa2993e07c0b16b;p=working%2FEvergreen.git LP#1053397 tpac single-rec MR jumps to detail page Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index 5b0a0a2149..feb8e83e66 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -800,8 +800,6 @@ sub load_place_hold { my $type_dispatch = { M => sub { - warn "OMG HERE\n"; - # target metarecords my $mrecs = $e->batch_retrieve_metabib_metarecord([ \@targets, @@ -819,8 +817,6 @@ sub load_place_hold { my $holdable_formats = $self->compile_holdable_formats($mr->id); - warn "holdable formats: $holdable_formats\n"; - push(@hold_data, $data_filler->({ target => $mr, record => $mr->master_record, @@ -1125,8 +1121,6 @@ sub compile_holdable_formats { my $e = $self->editor; my $cgi = $self->cgi; - warn "MR looking at params param = $_\n" for $cgi->param; - # exit early if not needed return "" unless grep /metarecord_formats_|metarecord_langs_/, diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm index 0fb53acc26..39742a48ab 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm @@ -504,6 +504,11 @@ sub load_rresults { $ctx->{metarecord_master} = $rec if $metarecord_master and $metarecord_master eq $rec_id; + + # MR's with multiple constituent records will have a + # null value in position 2 of the result set. + my ($res_rec) = grep { $_->[0] == $rec_id} @{$results->{ids}}; + $rec->{mr_has_multi} = !$res_rec->[2]; } if ($tag_circs) { @@ -512,7 +517,8 @@ sub load_rresults { # index 1 in the per-record result array is a boolean which # indicates whether the record in question is in the users # accessible circ history list - $rec->{user_circulated} = 1 if $res_rec->[1]; + my $index = $is_meta ? 3 : 1; + $rec->{user_circulated} = 1 if $res_rec->[$index]; } } diff --git a/Open-ILS/src/templates/opac/parts/result/table.tt2 b/Open-ILS/src/templates/opac/parts/result/table.tt2 index 33368ba5fd..2e102addaa 100644 --- a/Open-ILS/src/templates/opac/parts/result/table.tt2 +++ b/Open-ILS/src/templates/opac/parts/result/table.tt2 @@ -37,9 +37,15 @@ # note: rec.id refers to the record identifier, regardless # of the type of record. i.e. rec.id = mmr_id ? mmr_id : bre_id IF rec.mmr_id; - # metarecords link to record list page - record_url = mkurl(ctx.opac_root _ '/results', - {metarecord => rec.mmr_id}, ['page']); + IF rec.mr_has_multi; + # metarecords link to record list page + record_url = mkurl(ctx.opac_root _ '/results', + {metarecord => rec.mmr_id}, ['page']); + ELSE; + # for MR, bre_id refers to the master and in + # this case, only, record + record_url = mkurl(ctx.opac_root _ '/record/' _ rec.bre_id); + END; hold_type = 'M'; ELSE; record_url = mkurl(ctx.opac_root _ '/record/' _ rec.bre_id);