Bug 30807

Summary: Use patron-title.inc in patron payments pages
Product: Koha Reporter: Martin Renvoize <martin.renvoize>
Component: TemplatesAssignee: Martin Renvoize <martin.renvoize>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david, jonathan.druart, lucas, oleonard, testopia, tomascohen
Version: masterKeywords: Academy
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement updates the templates for patron accounting - make a payment tab and payment pages (pay and write off options) to use the patron-title.inc include wherever patron names are referenced. This is used to format patron name names consistently, rather than a custom format each time the patron name is referenced. The patron name is now displayed as "Make a payment for firstname lastname (patron card number)" and "Pay charges for firstname lastname (patron card number)".
Version(s) released in:
22.11.00, 22.05.03
Bug Depends on:    
Bug Blocks: 30617    
Attachments: Bug 30807: Migrate to patron-title in pay and paycollect
Bug 30807: Migrate to patron-title in pay and paycollect
Bug 30807: Migrate to patron-title in pay and paycollect

Description Martin Renvoize 2022-05-19 11:52:52 UTC
We should use the patron-title include everwhere we display a patron title instead of templates mixing up formats.
Comment 1 Martin Renvoize 2022-05-19 11:57:21 UTC
Created attachment 135201 [details] [review]
Bug 30807: Migrate to patron-title in pay and paycollect

This patch updates the member-flags template to use the patron-title.inc
include wherever patron names are referenced.

Test plan
1) Navigate to a patron and click through to their accounts tab
2) Note how the patron name displays in the title, breadcrumb and
   headings
3) Click through to make a payment
4) Note how the patron name displays in the title, breadcrumb and
   headings
5) Apply the patch and reload the page
6) Confirm the patron name still appears in each location and is
   consistently formatted and linked as you would expect

Note: This patch also removes a superflous hidden title form element
that was simply passed to and from the controller but not actually used
in any way.
Comment 2 David Nind 2022-05-23 18:45:49 UTC
Created attachment 135285 [details] [review]
Bug 30807: Migrate to patron-title in pay and paycollect

This patch updates the member-flags template to use the patron-title.inc
include wherever patron names are referenced.

Test plan
1) Navigate to a patron and click through to their accounts tab
2) Note how the patron name displays in the title, breadcrumb and
   headings
3) Click through to make a payment
4) Note how the patron name displays in the title, breadcrumb and
   headings
5) Apply the patch and reload the page
6) Confirm the patron name still appears in each location and is
   consistently formatted and linked as you would expect

Note: This patch also removes a superflous hidden title form element
that was simply passed to and from the controller but not actually used
in any way.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2022-05-23 19:07:57 UTC
The patch description needs updating - it currently says "...the member-flags template..." when it covers the patron payments pages. 8-)
Comment 4 David Nind 2022-05-23 22:58:12 UTC
Also, do we need to update the text for Accounting > Make a payment > Pay (or Write off) when a payment is made or a charge is written off? It currently says "fine", when I think we are now using "charge".

It currently says:
- For pay: "Pay an individual fine" as the title, breadcrumb, and block title after the Pay and Write off buttons, and "Collect fine payment for XXXX" in the browser tab title.
- For write off "Write off an individual fine" as the title, breadcrumb, and block title after the Pay and Write off buttons, and "Collect fine payment for XXXX" in the browser tab title.

If so, probably a separate bug... am happy to create.
Comment 5 Jonathan Druart 2022-05-31 07:27:40 UTC
Certainly a coding preference, but I personally prefer to explicitly pass the variable, even if not needed, like

[% INCLUDE 'patron-title.inc' patron=patron %]
instead of
[% INCLUDE 'patron-title.inc' %]

It prevent future cleaning to easily miss a variable that would be called from an include file.
Comment 6 Jonathan Druart 2022-05-31 07:28:07 UTC
Created attachment 135470 [details] [review]
Bug 30807: Migrate to patron-title in pay and paycollect

This patch updates the member-flags template to use the patron-title.inc
include wherever patron names are referenced.

Test plan
1) Navigate to a patron and click through to their accounts tab
2) Note how the patron name displays in the title, breadcrumb and
   headings
3) Click through to make a payment
4) Note how the patron name displays in the title, breadcrumb and
   headings
5) Apply the patch and reload the page
6) Confirm the patron name still appears in each location and is
   consistently formatted and linked as you would expect

Note: This patch also removes a superflous hidden title form element
that was simply passed to and from the controller but not actually used
in any way.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Tomás Cohen Arazi 2022-06-08 14:50:59 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 8 Lucas Gass 2022-07-12 19:18:41 UTC
Backported to 22.05.x for 22.05.03