From 4788e06a66f01b27ead04beea1e9965393609945 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 27 Feb 2014 17:22:52 -0500 Subject: [PATCH] LP#1284864 MR holds display and edit repairs * Repair format icons for MR and non-MR holds * Allow all filters to be cleared from a MR hold (w/o resulting in a server error). * during editing, if a hold has a selection_depth, use that to further limit the available formats and languages in the edit selectors. Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- .../src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm | 8 ++++++-- Open-ILS/src/templates/opac/myopac/holds.tt2 | 2 +- .../src/templates/opac/parts/metarecord_hold_filters.tt2 | 7 ++++--- 3 files changed, 11 insertions(+), 6 deletions(-) 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 d992fdad38..c2e6450d2f 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -583,10 +583,14 @@ sub fetch_user_holds { (undef, @data) = $self->get_records_and_facets( [$hold->target], undef, {flesh => '{mra}', metarecord => 1}); + my $filter_org = $U->org_unit_ancestor_at_depth( + $hold->selection_ou, + $hold->selection_depth); + my $filter_data = $U->simplereq( 'open-ils.circ', 'open-ils.circ.mmr.holds.filters.authoritative.atomic', - $hold->target, $hold->selection_ou, [$hold->id] + $hold->target, $filter_org, [$hold->id] ); $blob->{metarecord_filters} = @@ -1134,7 +1138,7 @@ sub compile_holdable_formats { my $cgi = $self->cgi; # exit early if not needed - return "" unless + return undef unless grep /metarecord_formats_|metarecord_langs_/, $cgi->param; diff --git a/Open-ILS/src/templates/opac/myopac/holds.tt2 b/Open-ILS/src/templates/opac/myopac/holds.tt2 index 0f5555af0c..8d049eaf17 100644 --- a/Open-ILS/src/templates/opac/myopac/holds.tt2 +++ b/Open-ILS/src/templates/opac/myopac/holds.tt2 @@ -151,7 +151,7 @@
[% - formats = attrs.all_formats.size; + formats = attrs.all_formats; IF ahr.hold_type == 'M'; # only show selected formats for metarecords formats = []; diff --git a/Open-ILS/src/templates/opac/parts/metarecord_hold_filters.tt2 b/Open-ILS/src/templates/opac/parts/metarecord_hold_filters.tt2 index 29e8fdf5d7..be444e8b3c 100644 --- a/Open-ILS/src/templates/opac/parts/metarecord_hold_filters.tt2 +++ b/Open-ILS/src/templates/opac/parts/metarecord_hold_filters.tt2 @@ -26,7 +26,7 @@ limiting the set of desired records for a given metarecord. [% BLOCK metarecord_hold_filters_selector; # in edit mode, pull the target from the existing hold - target_id = hold_data.target.id || hold_data.hold.hold.target; + target_id = hold_data.hold.hold.target || hold_data.target.id; selected_formats = {}; selected_langs = {}; @@ -75,8 +75,9 @@ limiting the set of desired records for a given metarecord. IF selected_langs.size; # user has already selected their preferred language(s) SET selected = 1 IF selected_langs.$code; - ELSE; - # no prefered language selected, default to current locale + + ELSIF !hold_data.hold.hold.target; # new hold + # no prefered language selected; use current locale SET selected = 1 IF code == my_lang; END; %] -- 2.43.2