From bb5f0eea74c71056e7efdaabeef0b92b2cc769ac Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 21 Apr 2021 16:25:48 +0000 Subject: [PATCH] Bug 27924: Display number of holds awaiting pickup on check out screens This patch modifies the checkout page so that waiting holds are displayed separately depending on whether they are waiting at the current branch or not. A count of each number of waiting holds is displayed too. Unrelated change: A missing has been added for markup validity. To test, apply the patch and view the checkout screen in these situations: - A patron with no waiting holds. - A patron with one or more holds waiting at the current library. - A patron with one or more holds waiting at another library. - A patron with holds waiting at both the current library and at other libraries. In each case, the display of waiting hold information should be correct, including the count of holds of each kind. Signed-off-by: Barbara Johnson Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- .../prog/en/modules/circ/circulation.tt | 66 ++++++++++++++----- 1 file changed, 51 insertions(+), 15 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 2078d9c77b..fb3abec220 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -830,7 +830,7 @@ [% SET ClaimReturnedWarningThreshold = Koha.Preference('ClaimReturnedWarningThreshold') %] [% SET return_claims = patron.return_claims %] [% IF return_claims.count > ClaimReturnedWarningThreshold %] -
  • Return claims: Patron has [% return_claims.count | html %] RETURN CLAIMS. +
  • Return claims: Patron has [% return_claims.count | html %] RETURN CLAIMS.
  • [% END %] @@ -869,24 +869,60 @@ [% IF WaitingHolds.count %]
    -

    Holds waiting:

    + [% SET waiting_here = 0 %] + [% SET waiting_elsewhere = 0 %] [% FOREACH w IN WaitingHolds %] + [% IF ( w.branch.branchcode == Branches.GetLoggedInBranchcode() ) %] + [% waiting_here = waiting_here + 1 %] + [% ELSE %] + [% waiting_elsewhere = waiting_elsewhere + 1 %] + [% END %] + [% END %] + + [% IF ( waiting_here > 0 ) %] +

    Holds waiting here ([% waiting_here | html %])

      -
    • - [% w.biblio.title | html %] - ([% ItemTypes.GetDescription( w.item.effective_itemtype ) | html %]), - [% IF ( w.biblio.author ) %] by [% w.biblio.author | html %] [% END %] - [% IF ( w.item.itemcallnumber ) %] [[% w.item.itemcallnumber | html %]] [% END %] - Hold placed on [% w.reservedate | $KohaDates %]. - -
      - [% IF ( w.branch.branchcode == Branches.GetLoggedInBranchcode() ) %][% ELSE %][% END %] - [% SET expires_on = w.expirationdate %] - Waiting at [% w.branch.branchname | html %] [% IF expires_on %] until [% expires_on | $KohaDates %] [% END %] - -
    • + [% FOREACH w IN WaitingHolds %] + [% IF ( w.branch.branchcode == Branches.GetLoggedInBranchcode() ) %] +
    • + [% w.biblio.title | html %] + ([% ItemTypes.GetDescription( w.item.effective_itemtype ) | html %]), + [% IF ( w.biblio.author ) %] by [% w.biblio.author | html %] [% END %] + [% IF ( w.item.itemcallnumber ) %] [[% w.item.itemcallnumber | html %]] [% END %] + Hold placed on [% w.reservedate | $KohaDates %]. +
      + + [% SET expires_on = w.expirationdate %] + Waiting here [% IF expires_on %] until [% expires_on | $KohaDates %] [% END %] + +
    • + [% END %] + [% END %]
    [% END %] + + [% IF ( waiting_elsewhere > 0 ) %] +

    Holds waiting at other libraries ([% waiting_elsewhere | html %])

    +
      + [% FOREACH w IN WaitingHolds %] + [% IF ( w.branch.branchcode != Branches.GetLoggedInBranchcode() ) %] +
    • + [% w.biblio.title | html %] + ([% ItemTypes.GetDescription( w.item.effective_itemtype ) | html %]), + [% IF ( w.biblio.author ) %] by [% w.biblio.author | html %] [% END %] + [% IF ( w.item.itemcallnumber ) %] [[% w.item.itemcallnumber | html %]] [% END %] + Hold placed on [% w.reservedate | $KohaDates %]. +
      + + [% SET expires_on = w.expirationdate %] + Waiting at [% w.branch.branchname | html %] [% IF expires_on %] until [% expires_on | $KohaDates %] [% END %] + +
    • + [% END %] + [% END %] +
    + [% END %] +
    [% END # /IF WaitingHolds.count %] -- 2.39.5