From 5dd9a2546aea0870674bf2190a8f46c280b9beb2 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. Signed-off-by: Owen Leonard Note: Filed Bug 17093 for JS error on patron entry form. Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall --- .../prog/en/includes/noadd-warnings.inc | 11 +++++++++++ .../intranet-tmpl/prog/en/modules/members/member.tt | 13 ++----------- .../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 0000000000..e0fdc2a6ae --- /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 06fbc75bb9..b1496544ec 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 efc0587f05..54695170da 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.39.5