From a14dfafa2e15ee91896f60b28446bdf0016e5bfc Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 25 Apr 2022 12:14:29 +0100 Subject: [PATCH] Bug 21978: Use patron-title.inc in request.tt This patch updates all manual accurences of the patron title display to use the patron-title.inc include (so we get middlename handling) in request.tt. We also add the option to hide the cardnumber from the include and set the link_to to 'members_pay' to retain the current display format on this page. Test plan You'll need to trigger the following cases to test all cases: 1) Too many holds 2) Account expired 3) Has restrictions 4) Outstanding fines 5) Already has hold on item 6) No holds allowed 7) Too many holds for this record 8) Already in possession 9) Already has a hold 10) Already has a recall 11) Pickup library doesn't many patron home library Signed-off-by: Sally Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- .../prog/en/includes/patron-title.inc | 4 +- .../prog/en/modules/reserve/request.tt | 42 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc index d2b61aade6..d0a3267cf5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc @@ -44,7 +44,8 @@ [%- SET data.title = span_start _ data.title _ span_end _ ' ' -%] [%- END -%] [%- SET display_patron_name = 1 -%] -[%- SET display_cardnumber = 1 -%] +[%- SET display_cardnumber = 1 -%] +[%- IF no_cardnumber %][% SET display_cardnumber = 0 %][% END -%] [%- IF hide_patron_infos_if_needed %] [%# Should only be set if patron is set -%] [%- SET can_see_patron_infos = logged_in_user.can_see_patron_infos( patron ) -%] [%- UNLESS can_see_patron_infos -%] @@ -57,6 +58,7 @@ [%- IF hide_patron_infos_if_needed AND ( display_patron_name OR display_cardnumber ) -%] [%- IF link_to == 'circulation_reserves' %] [%- ELSIF link_to == 'circulation_recalls' %] + [%- ELSIF link_to == 'members_pay' %] [%- ELSE %] [%- END -%] [%- END -%] 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 ea2c4a696e..275fe90e53 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -300,7 +300,7 @@ [% FOREACH member IN members %] [% SET patron = member.patron %]
  • - +
    [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]
    [% IF member.exceeded_maxreserves %]
    @@ -396,8 +396,7 @@ [% IF ( biblioloo.alreadyres ) %]
  • - [% patron.firstname | html %] [% patron.surname | html %] - already has a hold on this item + [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] already has a hold on this item
  • [% END %] [% IF ( biblioloo.none_avail || biblioloo.noitems ) %] @@ -435,35 +434,35 @@

    Cannot place hold

      [% IF ( no_reserves_allowed ) %] -
    • No holds allowed: [% patron.firstname | html %] [% patron.surname | html %] cannot place a hold on any of these items.
    • +
    • No holds allowed: [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] cannot place a hold on any of these items.
    • [% ELSIF ( exceeded_maxreserves ) %] -
    • Too many holds: [% patron.firstname | html %] [% patron.surname | html %] can only place a maximum of [% maxreserves | html %] total holds.
    • +
    • Too many holds: [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] can only place a maximum of [% maxreserves | html %] total holds.
    • [% ELSIF ( exceeded_holds_per_record ) %] -
    • Too many holds for this record: [% patron.firstname | html %] [% patron.surname | html %] can only place a maximum of [% max_holds_for_record | html %] hold(s) on this record.
    • +
    • Too many holds for this record: [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] can only place a maximum of [% max_holds_for_record | html %] hold(s) on this record.
    • [% ELSIF ( alreadypossession ) %] -
    • [% patron.firstname | html %] [% patron.surname | html %] is already in possession of one item.
    • +
    • [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 hide_patron_infos_if_needed => 1 %] is already in possession of one item.
    • [% ELSIF ( alreadyreserved ) %] -
    • [% patron.firstname | html %] [% patron.surname | html %] already has a hold on this item.
    • +
    • [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] already has a hold on this item.
    • [% ELSIF ( ageRestricted ) %]
    • Age restricted
    • [% ELSIF ( none_available ) %]
    • No items are available to be placed on hold.
    • [% ELSIF ( maxreserves ) %] -
    • Too many holds: [% patron.firstname | html %] [% patron.surname | html %] has too many holds.
    • +
    • Too many holds: [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] has too many holds.
    • [% ELSIF ( recall ) %] -
    • [% patron.firstname | html %] [% patron.surname | html %] has already placed a recall on this item.
    • +
    • [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] has already placed a recall on this item.
    • [% END # /IF exceeded_maxreserves %]
    [% ELSE # UNLESS multi_hold %]

    Cannot place hold on some items

    [% IF (no_reserves_allowed ) %] -
  • No holds allowed: [% patron.firstname | html %] [% patron.surname | html %] cannot place holds on some of these title's items.
  • +
  • No holds allowed: [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] cannot place holds on some of these title's items.
  • [% ELSIF ( exceeded_maxreserves ) %] -
  • Too many holds: [% patron.firstname | html %] [% patron.surname | html %] can place [% new_reserves_allowed | html %] of the requested [% new_reserves_count | html %] holds for a maximum of [% maxreserves | html %] total holds.
  • +
  • Too many holds: [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] can place [% new_reserves_allowed | html %] of the requested [% new_reserves_count | html %] holds for a maximum of [% maxreserves | html %] total holds.
  • [% ELSIF ( exceeded_holds_per_record ) %] [% FOREACH biblioloo IN biblioloop %] [% IF (biblioloo.tooManyHoldsForThisRecord) %] -
  • Too many holds for [% biblioloo.title | html %]: [% patron.firstname | html %] [% patron.surname | html %] can only place a maximum of [% max_holds_for_record | html %] hold(s) on this record.
  • +
  • Too many holds for [% biblioloo.title | html %]: [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] can only place a maximum of [% max_holds_for_record | html %] hold(s) on this record.
  • [% END %] [% END %] [% ELSIF ( none_available ) %] @@ -477,19 +476,19 @@
      [% IF ( patron.is_expired ) %] -
    • [% patron.firstname | html %] [% patron.surname | html %]: Account has expired
    • +
    • [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]: Account has expired
    • [% END %] [% IF patron.is_debarred %] -
    • [% patron.firstname | html %] [% patron.surname | html %]: Patron has restrictions
    • +
    • [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]: Patron has restrictions
    • [% END %] [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %] -
    • [% patron.firstname | html %] [% patron.surname | html %]: Patron has outstanding fines: [% amount_outstanding | $Price %]
    • +
    • [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 link_to => 'members_pay' %]: Patron has outstanding fines: [% amount_outstanding | $Price %]
    • [% END %] [% IF ( diffbranch ) %] -
    • Pickup library is different. Patron: [% patron.firstname | html %] [% patron.surname | html %] Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
    • +
    • Pickup library is different. Patron: [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] Patron's home library: ([% Branches.GetName(patron.branchcode) | html %] / [% patron.branchcode | html %] )
    • [% END %]
    @@ -533,7 +532,7 @@
  • Patron: [% IF ( patron.borrowernumber ) %] - [% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %]) + [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] [% ELSE %] Not defined yet [% END %] @@ -932,10 +931,9 @@ [% END %] [% IF ( biblioloo.alreadyres ) %] -
  • - [% patron.firstname | html %] [% patron.surname | html %] - already has a hold on this item -
  • +
  • + [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] already has a hold on this item +
  • [% END %] [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
  • No items are available to be placed on hold
  • -- 2.39.5