From bd8d019d3232cdef815deef9ee6095c0298baf03 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 10 May 2023 07:37:55 +0100 Subject: [PATCH] Bug 26403: Use accounts include in account management pages This patch updates the credit and debit types management pages to use the proper includes for handling system type translations. This is how it should have been done in the first place on the original bugs that introduced the management of these types but for some reason I think it got dropped during the QA process leading to confusion around these system types with their fixed descriptions. To test: 1. Apply patch 2. Apply the translations ./misc/translator/translate install xx-XX 3. In the staff interface, go to Administration > Credit types --> They should be translated 4. Go to Administration > Debit types --> They should be translated Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../intranet-tmpl/prog/en/modules/admin/credit_types.tt | 5 +++-- .../intranet-tmpl/prog/en/modules/admin/debit_types.tt | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/credit_types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/credit_types.tt index c232a4a17b..2eb8f443b0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/credit_types.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/credit_types.tt @@ -2,6 +2,7 @@ [% USE Asset %] [% USE Branches %] [% SET footerjs = 1 %] +[% PROCESS 'accounts.inc' %] [% INCLUDE 'doc-head-open.inc' %] [% IF op =='add_form' %] @@ -94,7 +95,7 @@ <li> <label for="description" class="required">Description: </label> [% IF credit_type && credit_type.is_system %] - <span>[% credit_type.description | html %]</span> + <span>[%- PROCESS credit_type_description credit_type = credit_type -%]</span> [% ELSE %] <input type="text" name="description" id="description" required="required" class="required" size="80" maxlength="100" value="[% credit_type.description | html %]" /> <span class="required">Required</span> [% END %] @@ -171,7 +172,7 @@ <td>[% credit_type.archived | html %]</td> <td>[% credit_type.is_system | html %]</td> <td>[% credit_type.code | html %]</td> - <td>[% credit_type.description | html %]</td> + <td>[%- PROCESS credit_type_description credit_type = credit_type -%]</td> <td>[% IF credit_type.can_be_added_manually %]Manual credit[% END %]</td> <td>[% IF credit_type.credit_number_enabled %]Yes[% ELSE %]No[% END %]</td> <td> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt index a91c46a7ba..e2a3f9ba24 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt @@ -3,6 +3,7 @@ [% USE Branches %] [% USE Price %] [% SET footerjs = 1 %] +[% PROCESS 'accounts.inc' %] [% INCLUDE 'doc-head-open.inc' %] <title> [% IF op =='add_form' %] @@ -95,7 +96,11 @@ </li> <li> <label for="description" class="required">Description: </label> - <input type="text" name="description" id="description" required="required" class="required" size="80" maxlength="100" value="[% debit_type.description | html %]" /> <span class="required">Required</span> + [% IF debit_type && debit_type.is_system %] + <span>[%- PROCESS debit_type_description debit_type = debit_type -%]</span> + [% ELSE %] + <input type="text" name="description" id="description" required="required" class="required" size="80" maxlength="100" value="[% debit_type.description | html %]" /> <span class="required">Required</span> + [% END %] </li> <li> <label for="can_be_invoiced">Can be manually invoiced? </label> @@ -162,7 +167,7 @@ <td>[% debit_type.archived | html %]</td> <td>[% debit_type.is_system | html %]</td> <td>[% debit_type.code | html %]</td> - <td>[% debit_type.description | html %]</td> + <td>[%- PROCESS debit_type_description debit_type = debit_type -%]</td> <td>[% debit_type.default_amount | $Price %]</td> <td>[% IF debit_type.can_be_invoiced && debit_type.can_be_sold %] <i class="fa fa-id-card-o"></i> Invoicing, <i class="fa fa-shopping-cart"></i> Sale -- 2.39.5