diff --git a/Koha/Holds.pm b/Koha/Holds.pm index dcdd08584d..300c10d4b1 100644 --- a/Koha/Holds.pm +++ b/Koha/Holds.pm @@ -218,10 +218,8 @@ Return the number of holds, where a hold group is counted as one hold. sub count_holds { my ( $self, $search_params ) = @_; - - $search_params = { - hold_group_id => undef, - }; + $search_params = {} if !$search_params; + $search_params->{hold_group_id} = undef; my $holds_without_group_count = $self->search($search_params)->count(); $search_params = { diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 67cd533daf..23ac7e4541 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -221,6 +221,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('DefaultToLoggedInLibraryNoticesSlips', '0', NULL , 'If enabled,slips and notices editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.', 'YesNo'), ('DefaultToLoggedInLibraryOverdueTriggers', '0', NULL , 'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.', 'YesNo'), ('Display856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding staff interface XSLT option must be on','Choice'), +('DisplayAddHoldGroups','1','','Display the ability to create hold groups which are fulfilled by one item','YesNo'), ('DisplayClearScreenButton','no','no|issueslip|issueqslip','If set to ON, a clear screen button will appear on the circulation page.','Choice'), ('displayFacetCount','0',NULL,NULL,'YesNo'), ('DisplayIconsXSLT','1','','If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 0162b93707..3997826396 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -960,6 +960,12 @@ Circulation: 1: Enable 0: "Don't enable" - "the ability to place holds on different items at the same time in staff interface and OPAC." + - + - pref: DisplayAddHoldGroups + choices: + 1: Enable + 0: "Don't enable" + - "the ability to create hold groups which are fulfilled by one item" - - pref: TransferWhenCancelAllWaitingHolds choices: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index 19ad42c216..0e84982fb1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -619,14 +619,6 @@ A non priority hold doesn't prevent a current checkout from renewing - - [% IF ( Koha.Preference('DisplayAddHoldGroups') && ( multi_hold ) ) %] -
  • - - - Place a hold on the next available title from this group -
  • - [% END %]
    @@ -1097,6 +1089,14 @@ + + [% IF ( Koha.Preference('DisplayAddHoldGroups') ) %] +
  • + + + Place a hold on the next available title from this group +
  • + [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc index 2df921a1db..43cc5e75d0 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc +++ b/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 %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt index 6a7fb94e4f..b5c5120c23 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -110,6 +110,18 @@ [% INCLUDE 'csrf-token.inc' %] Hold requests + [% IF ( Koha.Preference('DisplayAddHoldGroups') && ( multi_hold ) ) %] +
    +
    +
      +
    • + + +
    • +
    +
    +
    + [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 1c63a78d03..e17f760b01 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -272,7 +272,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 %] @@ -1443,4 +1443,5 @@ }); [% END %] + [% Asset.js("js/holds.js") | $raw %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt index c6a11c06cc..aea8958b32 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt @@ -522,6 +522,7 @@ }); }); + [% Asset.js("js/holds.js") | $raw %] [% IF ( Koha.Preference('SCOUserJS') ) %]