From ccffb35178754772a0ef46405ced4da0ef563b95 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 28 Feb 2014 10:07:11 -0500 Subject: [PATCH] LP#1284864 MR holds w/o formats disallowed During MR hold placement, if the MR has zero holdable formats, disallow the hold. Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- Open-ILS/src/templates/opac/css/style.css.tt2 | 13 +++++++ .../src/templates/opac/parts/place_hold.tt2 | 39 +++++++++++++++++-- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/templates/opac/css/style.css.tt2 b/Open-ILS/src/templates/opac/css/style.css.tt2 index 2832f2fdaa..85367aa490 100644 --- a/Open-ILS/src/templates/opac/css/style.css.tt2 +++ b/Open-ILS/src/templates/opac/css/style.css.tt2 @@ -1202,6 +1202,19 @@ a.dash-link:hover { text-decoration: underline !important; } .hold-items-list-title { font-size: [% css_fonts.size_bigger %]; } .hold-items-list-problem { color: [% css_colors.text_alert %]; } +.mr_holds_no_formats { + padding: 5px; + margin-left: 25px; + font-size: 110%; + font-weight: bold; + color: [% css_colors.text_invert %]; + background: [% css_colors.primary %]; +} + +.holds_item_row_separator td { + border-top: 2px dashed [% css_colors.accent_medium %]; +} + .big-strong {font-weight: bold; font-size: [% css_fonts.size_bigger %]; } .results_header_btns, .results_header_sel { diff --git a/Open-ILS/src/templates/opac/parts/place_hold.tt2 b/Open-ILS/src/templates/opac/parts/place_hold.tt2 index 5383753a7e..1a497f7da8 100644 --- a/Open-ILS/src/templates/opac/parts/place_hold.tt2 +++ b/Open-ILS/src/templates/opac/parts/place_hold.tt2 @@ -5,6 +5,9 @@

[% l('Place Hold') %]

+ + [% some_holds_allowed = -1 %] +
[% @@ -49,12 +52,25 @@ [% FOR hdata IN ctx.hold_data; attrs = {marc_xml => hdata.marc_xml}; - PROCESS get_marc_attrs args=attrs %] + PROCESS get_marc_attrs args=attrs; + this_hold_disallowed = 0; + + IF CGI.param('hold_type') == 'M'; + IF hdata.metarecord_filters.formats.size == 0; + this_hold_disallowed = 1; + # if this is the first hold and it's disallowed, + # assume all holds are, until we proven otherwise + SET some_holds_allowed = 0 IF some_holds_allowed == -1; + ELSE; some_holds_allowed = 1; END; + END %] + + + [% IF this_hold_disallowed %] + + [% END %] + + [% IF !loop.last AND ctx.hold_data.size > 1 %] + + [% END %] + [% END %]
+ [% IF !this_hold_disallowed %] + [% END %]
[% attrs.title_extended | html %]
- [% IF hdata.parts %] + [% IF hdata.parts AND !this_hold_disallowed %] [% IF hdata.parts.size > 0 %]
+
+ [% l('This item does not have any formats available for holds placement') %] +
+
+ [% IF some_holds_allowed %] +

[%- org_select_id = 'pickup_lib'; -%] @@ -128,8 +159,10 @@ [% END %]

- + [% END # some_holds_allowed %]
-- 2.43.2