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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c3fd42b550)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2022-05-19 12:53:18 +01:00 committed by Lucas Gass
parent bc143d2b87
commit f99bad2f36
3 changed files with 6 additions and 10 deletions

View file

@ -9,7 +9,7 @@
[% SET footerjs = 1 %]
[% PROCESS 'accounts.inc' %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Make a payment for [% patron.firstname | html %] [% patron.surname | html %] &rsaquo; Patrons &rsaquo; Koha</title>
<title>Make a payment for [% INCLUDE 'patron-title.inc' no_html = 1 %] &rsaquo; Patrons &rsaquo; Koha</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
@ -27,7 +27,7 @@
</li>
<li>
<a href="#" aria-current="page">
Make a payment for [% patron.firstname | html %] [% patron.surname | html %]
Make a payment for [% INCLUDE 'patron-title.inc' %]
</a>
</li>
</ol>
@ -171,7 +171,7 @@
</fieldset>
</form>
[% ELSE %]
<p>[% patron.firstname | html %] [% patron.surname | html %] has no outstanding fines.</p>
<p>[% INCLUDE 'patron-title.inc' %] has no outstanding fines.</p>
[% END %]
</div></div>

View file

@ -23,9 +23,9 @@
[% SET registers = Registers.all( filters => { current_branch => 1 } ) %]
<title>
[% IF type == 'WRITEOFF' %]
Write off an amount for [% patron.firstname | html %] [% patron.surname | html %]
Write off an amount for [% INCLUDE 'patron-title.inc' no_html = 1 %]
[% ELSE %]
Collect fine payment for [% patron.firstname | html %] [% patron.surname | html %]
Collect fine payment for [% INCLUDE 'patron-title.inc' no_html = 1 %]
[% END %] &rsaquo; Patrons &rsaquo; Koha
</title>
[% INCLUDE 'doc-head-close.inc' %]
@ -44,7 +44,7 @@
<a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
</li>
<li>
<a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | uri %]">Pay charges for [% patron.firstname | html %] [% patron.surname | html %]</a>
<a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | uri %]">Pay charges for [% INCLUDE 'patron-title.inc' %]</a>
</li>
<li>
<a href="#" aria-current="page">
@ -141,7 +141,6 @@
<input type="hidden" name="amount" id="amount" value="[% amount | html %]" />
<input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding | html %]" />
<input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id | html %]" />
<input type="hidden" name="title" id="title" value="[% patron.title | html %]" />
<input type="hidden" name="change_given" id="change_given" />
<fieldset class="rows">
@ -235,7 +234,6 @@
<input type="hidden" name="debit_type_code" id="debit_type_code" value="[% debit_type_code | html %]" />
<input type="hidden" name="amount" id="amount" value="[% amount | html %]" />
<input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id | html %]" />
<input type="hidden" name="title" id="title" value="[% patron.title | html %]" />
<input type="hidden" name="payment_note" id="payment_note" value="[% payment_note | html %]" />
<input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding | html %]" />
<input type="hidden" name="confirm_writeoff" id="confirm_writeoff" value="1" />

View file

@ -87,14 +87,12 @@ if ( $pay_individual || $writeoff_individual ) {
my $amountoutstanding = $input->param('amountoutstanding');
my $itemnumber = $input->param('itemnumber');
my $description = $input->param('description');
my $title = $input->param('title');
$total_due = $amountoutstanding;
$template->param(
debit_type_code => $debit_type_code,
accountlines_id => $accountlines_id,
amount => $amount,
amountoutstanding => $amountoutstanding,
title => $title,
itemnumber => $itemnumber,
individual_description => $description,
payment_note => $payment_note,