From 239b7bd447b7a4ffa039959cc50b719f4c24878c Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 2 Oct 2012 08:58:40 -0400 Subject: [PATCH] Bug 8862 - merge.pl contains untranslatable strings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Frédéric Demians It works: (1) merging's still effective, and (2) two new error messages appear in staff .po file after update it. Signed-off-by: Paul Poulain Conflicts: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt Signed-off-by: Chris Cormack --- cataloguing/merge.pl | 7 ++-- .../prog/en/modules/cataloguing/merge.tt | 34 ++++++++++++++----- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/cataloguing/merge.pl b/cataloguing/merge.pl index 020001d010..1492f1ffd0 100755 --- a/cataloguing/merge.pl +++ b/cataloguing/merge.pl @@ -81,7 +81,7 @@ if ($merge) { # If some items could not be moved : if (scalar(@notmoveditems) > 0) { my $itemlist = join(' ',@notmoveditems); - push @errors, "The following items could not be moved from the old record to the new one: $itemlist"; + push @errors, { code => "CANNOT_MOVE", value => $itemlist }; } # Moving subscriptions from the other record to the reference record @@ -123,7 +123,7 @@ if ($merge) { my $biblionumber = $input->param('biblionumber'); if (scalar(@biblionumber) != 2) { - push @errors, "An unexpected number of records was provided for merging. Currently only two records at a time can be merged."; + push @errors, { code => "WRONG_COUNT", value => scalar(@biblionumber) }; } else { my $data1 = GetBiblioData($biblionumber[0]); @@ -206,8 +206,7 @@ if ($merge) { if (@errors) { # Errors - my @errors_loop = map{{error => $_}}@errors; - $template->param( errors => \@errors_loop ); + $template->param( errors => \@errors ); } output_html_with_http_headers $input, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt index 745680c4f3..ab5901ae2a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt @@ -183,15 +183,24 @@ function changeFramework(fw) {

Merging records

[% IF ( result ) %] [% IF ( errors ) %] + [% FOREACH error IN errors %] -
[% error.error %].
Therefore, the record to be merged has not been deleted.
- [% END %] +
- [% ELSE %] - -

The merging was successful. Click here to see the merged record.

+ [% IF error.code == 'CANNOT_MOVE' %] + The following items could not be moved from the old record to the new one: [% error.value %] + [% ELSE %] + [% error %] + [% END %] + +
Therefore, the record to be merged has not been deleted.
[% END %] + [% ELSE %] + +

The merging was successful. Click here to see the merged record.

+ [% END %] + [% ELSE %] [% IF ( choosereference ) %] @@ -227,9 +236,18 @@ function changeFramework(fw) { [% ELSE %] [% IF ( errors ) %] - [% FOREACH error IN errors %] -
[% error.error %]
- [% END %] +
+ [% FOREACH error IN errors %] +

+ [% IF error.code == 'WRONG_COUNT' %] + Number of records provided for merging: [% error.value %]. Currently only 2 records can be merged at a time. + [% ELSE %] + [% error %] + [% END %] + +

+ [% END %] +
[% ELSE %]
-- 2.39.5