@@ -, +, @@ OPAC --- .../bootstrap/en/includes/holds-table.inc | 16 ++++++++++++++++ .../bootstrap/en/modules/opac-reserve.tt | 10 ++++++++++ .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 3 ++- .../bootstrap/en/modules/sco/sco-main.tt | 2 +- koha-tmpl/opac-tmpl/bootstrap/js/holds.js | 5 +++++ opac/opac-reserve.pl | 12 +++++++++++- opac/opac-user.pl | 1 + 7 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/bootstrap/js/holds.js --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc +++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc @@ -64,6 +64,22 @@ [% IF HOLD.item_level_hold %]

Item on hold: [% HOLD.item.barcode | html %]

[% END %] + [% IF HOLD.hold_group_id %] +
+ (part of a hold group) + +
+ [% END %] [% HOLD.reservedate | $KohaDates %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -145,6 +145,16 @@
Hold requests +
+
+
    +
  • + + +
  • +
+
+
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -287,7 +287,7 @@ [% IF ( RESERVES.count ) %] [% WRAPPER tab_item tabname= "opac-user-holds" %] - Holds ([% RESERVES.count | html %]) + Holds ([% reserves_count | html %]) [% END %] [% END %] [% IF Koha.Preference('UseRecalls') && RECALLS.count %] @@ -1467,4 +1467,5 @@ }); [% END %] + [% Asset.js("js/holds.js") | $raw %] [% END %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt @@ -616,6 +616,6 @@ }); - + [% Asset.js("js/holds.js") | $raw %] [% IF ( Koha.Preference('SCOUserJS') ) %][% END %] [% END %] --- a/koha-tmpl/opac-tmpl/bootstrap/js/holds.js +++ a/koha-tmpl/opac-tmpl/bootstrap/js/holds.js @@ -0,0 +1,5 @@ +$(document).ready(function(){ + $("div.group_hold").click(function(){ + $(this).find("div.group_hold_list").toggle(); + }); +}); --- a/opac/opac-reserve.pl +++ a/opac/opac-reserve.pl @@ -180,7 +180,8 @@ $template->param( branch => $branch ); # # if ( $query->param('place_reserve') ) { - my $reserve_cnt = 0; + my $add_to_hold_group = $query->param('add_to_hold_group'); + my $reserve_cnt = 0; if ($maxreserves) { $reserve_cnt = $patron->holds->count_holds; } @@ -213,6 +214,7 @@ if ( $query->param('place_reserve') ) { } my @failed_holds; + my $hold_group; while (@selectedItems) { my $biblioNum = shift(@selectedItems); my $itemNum = shift(@selectedItems); @@ -306,6 +308,13 @@ if ( $query->param('place_reserve') ) { # Here we actually do the reserveration. Stage 3. if ($canreserve) { + if ($add_to_hold_group) { + + #NOTE: We wait to create a hold group until we know that we can actually place a hold/reserve + if ( !$hold_group ) { + $hold_group = Koha::HoldGroup->new->store; + } + } my $reserve_id = AddReserve( { branchcode => $branch, @@ -320,6 +329,7 @@ if ( $query->param('place_reserve') ) { found => undef, itemtype => $itemtype, item_group_id => $item_group_id, + hold_group_id => $hold_group ? $hold_group->id : undef, } ); if( $reserve_id ){ --- a/opac/opac-user.pl +++ a/opac/opac-user.pl @@ -339,6 +339,7 @@ my $reserves = $patron->holds->filter_out_has_cancellation_requests; $template->param( RESERVES => $reserves, + reserves_count => $reserves->count_holds, showpriority => $show_priority, ); --