From 1d558a85bfe0463178cc36e2cc6995d816de69d9 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 29 Oct 2018 12:15:19 -0300 Subject: [PATCH] Bug 21715: Ease translation of account and account offset type descriptions This patch moves accounts-related descriptions into a single file to ease finding them, and also encloses descriptions inside tags to make it easier to translate. To test: - Apply this patch - Verify the templates work as expected => SUCCESS: No behaviour change - Sign off :-D Bonus: there were two cases in which the INCLUDE line used 'accountline' as parameter, making it fail to pick the right account type! Signed-off-by: Josef Moravec Signed-off-by: Katrin Fischer --- .../prog/en/includes/account_offset_type.inc | 10 ------ .../intranet-tmpl/prog/en/includes/accounts.inc | 39 ++++++++++++++++++++++ .../intranet-tmpl/prog/en/includes/accounttype.inc | 24 ------------- .../prog/en/modules/members/accountline-details.tt | 8 +++-- .../prog/en/modules/members/boraccount.tt | 5 ++- .../prog/en/modules/members/moremember-print.tt | 5 ++- .../prog/en/modules/members/printfeercpt.tt | 5 ++- .../prog/en/modules/members/printinvoice.tt | 5 ++- 8 files changed, 60 insertions(+), 41 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/account_offset_type.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/accounttype.inc diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/account_offset_type.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/account_offset_type.inc deleted file mode 100644 index 94edb239f4..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/account_offset_type.inc +++ /dev/null @@ -1,10 +0,0 @@ -[% SWITCH account_offset.type %] - [% CASE 'Credit Applied' %]Credit applied - [% CASE 'Payment' %]Payment - [% CASE 'Manual Credit' %]Manual credit - [% CASE 'Manual Debit' %]Manual invoice - [% CASE 'Lost Item' %]Lost item returned - [% CASE 'Writeoff' %]Writeoff - [% CASE 'Void Payment' %]Void payment - [% CASE %][% account_offset.type | html %] -[%- END -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc new file mode 100644 index 0000000000..cf388239fb --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc @@ -0,0 +1,39 @@ +[%- BLOCK account_type_description -%] + [%- SWITCH account.accounttype -%] + [%- CASE 'Pay' -%]Payment, thanks + [%- CASE 'Pay00' -%]Payment, thanks (cash via SIP2) + [%- CASE 'Pay01' -%]Payment, thanks (VISA via SIP2) + [%- CASE 'Pay02' -%]Payment, thanks (credit card via SIP2) + [%- CASE 'VOID' -%]Voided + [%- CASE 'N' -%]New card + [%- CASE 'F' -%]Fine + [%- CASE 'A' -%]Account management fee + [%- CASE 'M' -%]Sundry + [%- CASE 'L' -%]Lost item + [%- CASE 'W' -%]Writeoff + [%- CASE 'FU' -%]Accruing fine + [%- CASE 'HE' -%]Hold waiting too long + [%- CASE 'Rent' -%]Rental fee + [%- CASE 'FOR' -%]Forgiven + [%- CASE 'LR' -%]Lost item fee refund + [%- CASE 'PF' -%]Processing fee + [%- CASE 'PAY' -%]Payment + [%- CASE 'WO' -%]Writeoff + [%- CASE 'C' -%]Credit + [%- CASE 'CR' -%]Credit + [%- CASE -%][% account.accounttype | html %] + [%- END -%] +[%- END -%] + +[%- BLOCK offset_type_description -%] + [%- SWITCH account_offset.type -%] + [%- CASE 'Credit Applied' -%]Credit applied + [%- CASE 'Payment' -%]Payment + [%- CASE 'Manual Credit' -%]Manual credit + [%- CASE 'Manual Debit' -%]Manual invoice + [%- CASE 'Lost Item' -%]Lost item returned + [%- CASE 'Writeoff' -%]Writeoff + [%- CASE 'Void Payment' -%]Void payment + [%- CASE -%][% account_offset.type | html %] + [%- END -%] +[%- END -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/accounttype.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/accounttype.inc deleted file mode 100644 index 0d30f65356..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounttype.inc +++ /dev/null @@ -1,24 +0,0 @@ -[% SWITCH account.accounttype %] - [% CASE 'Pay' %]Payment, thanks - [% CASE 'Pay00' %]Payment, thanks (cash via SIP2) - [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2) - [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2) - [% CASE 'VOID' %]Voided - [% CASE 'N' %]New card - [% CASE 'F' %]Fine - [% CASE 'A' %]Account management fee - [% CASE 'M' %]Sundry - [% CASE 'L' %]Lost item - [% CASE 'W' %]Writeoff - [% CASE 'FU' %]Accruing fine - [% CASE 'HE' %]Hold waiting too long - [% CASE 'Rent' %]Rental fee - [% CASE 'FOR' %]Forgiven - [% CASE 'LR' %]Lost item fee refund - [% CASE 'PF' %]Processing fee - [% CASE 'PAY' %]Payment - [% CASE 'WO' %]Writeoff - [% CASE 'C' %]Credit - [% CASE 'CR' %]Credit - [% CASE %][% account.accounttype | html %] -[%- END -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt index dc5ad32a74..ae66f7ed52 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt @@ -3,6 +3,8 @@ [%- USE AuthorisedValues -%] [%- USE Branches -%] +[% PROCESS 'accounts.inc' %] + [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › Account for [% INCLUDE 'patron-title.inc' %] [% INCLUDE 'doc-head-close.inc' %] @@ -41,7 +43,7 @@ [% accountline.date |$KohaDates %] - [%- INCLUDE 'accounttype.inc' account => accountline -%] + [%- PROCESS account_type_description account=accountline -%] [%- IF accountline.payment_type -%] , [% AuthorisedValues.GetByCode('PAYMENT_TYPE', accountline.payment_type) | html %] [%- END =%] @@ -109,12 +111,12 @@ [% offset_accountline.timestamp | $KohaDates with_hours => 1 | html %] [% offset_accountline.amount | $Price %] [% offset_accountline.amountoutstanding | $Price %] - [% INCLUDE 'accounttype.inc' account => offset_accountline %] + [% PROCESS account_type_description account=offset_accountline %] [% offset_accountline.note | html %] [% IF offset_accountline.manager_id %][% offset_accountline.manager_id | html %][% END %] [% ao.created_on | $KohaDates with_hours => 1 | html %] [% ao.amount | $Price %] - [% INCLUDE 'account_offset_type.inc' account_offset => ao %] + [% PROCESS offset_type_description account_offset=ao %] Details [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt index 44015bb14c..a36954021d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -8,6 +8,9 @@ [% USE Price %] [% USE Branches %] [% SET footerjs = 1 %] + +[% PROCESS 'accounts.inc' %] + [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › Account for [% INCLUDE 'patron-title.inc' no_html = 1 %] [% INCLUDE 'doc-head-close.inc' %] @@ -61,7 +64,7 @@ [% account.date |$KohaDates %] - [% INCLUDE 'accounttype.inc' accountline => account %] + [% PROCESS account_type_description account=account %] [%- IF account.payment_type %], [% AuthorisedValues.GetByCode('PAYMENT_TYPE', account.payment_type) | html %][% END %] [%- IF account.description %], [% account.description | html %][% END %]  [% IF ( account.itemnumber ) %][% account.item.biblio.title | html %][% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt index 9deff583ef..3df5ab4ee5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt @@ -3,6 +3,9 @@ [% USE KohaDates %] [% USE Price %] [% SET footerjs = 1 %] + +[% PROCESS 'accounts.inc' %] + [% INCLUDE 'doc-head-open.inc' %] Summary for [% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %]) [% INCLUDE 'doc-head-close.inc' %] @@ -109,7 +112,7 @@ [% account.date | $KohaDates %] - [% INCLUDE 'accounttype.inc' accountline => account %] + [% PROCESS account_type_description account=account %] [%- IF account.payment_type %] , [% AuthorisedValues.GetByCode('PAYMENT_TYPE', account.payment_type) | html %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt index 74fbc2559c..45d6eda698 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt @@ -5,6 +5,9 @@ [% USE Branches %] [% USE Price %] [% SET footerjs = 1 %] + +[% PROCESS 'accounts.inc' %] + [% INCLUDE 'doc-head-open.inc' %] Print receipt for [% patron.cardnumber | html %] [% INCLUDE 'doc-head-close.inc' %] @@ -51,7 +54,7 @@ [% account.date | $KohaDates %] - [% INCLUDE 'accounttype.inc' account => account %] + [% PROCESS account_type_description account=account %] [%- IF account.description %], [% account.description | html %][% END %] [% account.note | html %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt index 33ae62cfdf..a28ac03e34 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt @@ -5,6 +5,9 @@ [% USE KohaDates %] [% USE Price %] [% SET footerjs = 1 %] + +[% PROCESS 'accounts.inc' %] + [% INCLUDE 'doc-head-open.inc' %] Print receipt for [% patron.cardnumber | html %] [% INCLUDE 'doc-head-close.inc' %] @@ -51,7 +54,7 @@ [% account.date | $KohaDates%] - [% INCLUDE 'accounttype.inc' account => account %] + [% PROCESS account_type_description account=account %] [%- IF account.description %], [% account.description | html %][% END %] [% account.note | html %] -- 2.11.0