From: Jason Stephenson Date: Sun, 13 Aug 2017 17:49:38 +0000 (-0400) Subject: Commit what I've done so far today. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3333df0fc9d72058dc2214bf536356aae6d60f5b;p=working%2FEvergreen.git Commit what I've done so far today. --- 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 8295e12b51..bfea5a1463 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -1000,6 +1000,23 @@ sub load_place_hold { return $self->generic_redirect unless @targets; + # Check for multiple hold placement via the num_copies widget. + my $num_copies = int($cgi->param('num_copies')); # if undefined, we get 0. + if ($num_copies > 1) { + # Only if we have 1 hold target and no parts. + if (scalar(@targets) == 1 && !scalar(@parts)) { + # Also, only for M and T holds. + if ($ctx->{hold_type} eq 'M' || $ctx->{hold_type} eq 'T') { + # Add the extra holds to @targets. NOTE: We start with + # 1 and go to < $num_copies to account for the + # existing target. + for (my $i = 1; $i < $num_copies; $i++) { + push(@targets, $targets[0]); + } + } + } + } + $logger->info("Looking at hold_type: " . $ctx->{hold_type} . " and targets: @targets"); $ctx->{staff_recipient} = $self->editor->retrieve_actor_user([ diff --git a/Open-ILS/src/templates/opac/parts/multi_hold_select.tt2 b/Open-ILS/src/templates/opac/parts/multi_hold_select.tt2 new file mode 100644 index 0000000000..020245b9b3 --- /dev/null +++ b/Open-ILS/src/templates/opac/parts/multi_hold_select.tt2 @@ -0,0 +1,15 @@ +[% # Check if we need to do anything. + hold_type = CGI.param('hold_type'); + max_holds = ctx.get_org_setting(ctx.default_pickup_lib, 'circ.holds.max_duplicate_holds'); + can_dup = ctx.has_perm('CREATE_DUPLICATE_HOLDS', ctx.default_pickup_lib); + IF ctx.hold_data.size == 1 && (hold_type == 'M' || hold_type == 'T') && max_holds && max_holds > 1 && can_dup; +%] +

+ + +

+[% END %] diff --git a/Open-ILS/src/templates/opac/parts/place_hold.tt2 b/Open-ILS/src/templates/opac/parts/place_hold.tt2 index 73192ba3bb..2286852c77 100644 --- a/Open-ILS/src/templates/opac/parts/place_hold.tt2 +++ b/Open-ILS/src/templates/opac/parts/place_hold.tt2 @@ -151,6 +151,7 @@ function toggleActivationDate() { [% END %] [% END %] + [% INCLUDE "opac/parts/multi_hold_select.tt2" IF NOT (this_hold_disallowed AND hdata.part_required); %] [% IF NOT metarecords.disabled %] [% IF CGI.param('hold_type') == 'T' AND hdata.record.metarecord AND !hdata.part_required %]