From 4ff5b2c2e27a1cf1ba28848c49387db6a0b602e4 Mon Sep 17 00:00:00 2001 From: Marc Date: Mon, 8 Aug 2016 17:47:31 +0200 Subject: [PATCH] Bug 17082: Translatability: Fix sentence splitting in member.tt This patch fixes sentences splitting in file koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt Fix is done with a new .inc file because the code is the same as in koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt To test: - Carefully review code changes - Test on a fresh install without example data (or save database and test with empty tables 'branches' and 'categories') - Go to Home > Patrons (members-home.pl) - Verify that a warnings appears aubout missing libraries and patron categories - Try to add a new patron (memberentry.pl) - Verify that the same messages are triggered - Verify that messages disappear as appropriate as soon as a library and a patron category are defined. --- koha-tmpl/intranet-tmpl/prog/en/includes/noadd-warnings.inc | 11 +++++++++++ koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt | 13 ++----------- .../intranet-tmpl/prog/en/modules/members/memberentrygen.tt | 4 +--- 3 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/noadd-warnings.inc diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/noadd-warnings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/noadd-warnings.inc new file mode 100644 index 0000000..e0fdc2a --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/noadd-warnings.inc @@ -0,0 +1,11 @@ +[% IF ( no_add ) %] +
+

Cannot add patron

+ [% IF ( no_branches ) %] +

There are no libraries defined. [% IF ( CAN_user_parameters ) %]Please add a library.[% ELSE %]An administrator must define at least one library.[% END %]

+ [% END %] + [% IF ( no_categories ) %] +

There are no patron categories defined. [% IF ( CAN_user_parameters ) %]Please add a patron category.[% ELSE %]An administrator must define at least one patron category.[% END %]

+ [% END %] +
+[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt index 06fbc75..b149654 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt @@ -334,17 +334,8 @@ function filterByFirstLetterSurname(letter) { [% END %] [% INCLUDE 'patron-toolbar.inc' %] - [% IF ( no_add ) %] -
-

Cannot add patron

- [% IF ( no_branches ) %] -

There are no libraries defined. [% IF ( CAN_user_parameters ) %]Please add a library.[% ELSE %]An administrator must define at least one library.[% END %]

- [% END %] - [% IF ( no_categories ) %] -

There are no patron categories defined. [% IF ( CAN_user_parameters ) %]Please add a patron category.[% ELSE %]An administrator must define at least one patron category.[% END %]

- [% END %] -
- [% END %] + [% INCLUDE 'noadd-warnings.inc' %] +
Browse by last name: [% FOREACH letter IN alphabet.split(' ') %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 20725bd..8e3e6f7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -125,9 +125,7 @@ $(document).ready(function() {
Email has been sent.
[% END %] - [% IF ( no_add ) %]

Cannot add patron

- [% IF ( no_branches ) %]

There are no libraries defined. [% IF ( CAN_user_parameters ) %]Please add a library.[% ELSE %]An administrator must define at least one library.[% END %]

[% END %] - [% IF ( no_categories ) %]

There are no patron categories defined. [% IF ( CAN_user_parameters ) %]Please add a patron category.[% ELSE %]An administrator must define at least one patron category.

[% END %][% END %]
[% END %] + [% INCLUDE 'noadd-warnings.inc' %] [% UNLESS ( no_add ) %]

[% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron [% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]([%IF ( categoryname ) %][% categoryname %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %])

-- 2.1.4