Bug 8862 - merge.pl contains untranslatable strings
Signed-off-by: Frédéric Demians <f.demians@tamil.fr> 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 <paul.poulain@biblibre.com>
This commit is contained in:
parent
782e1845f3
commit
80f8c46dc6
2 changed files with 27 additions and 12 deletions
|
@ -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;
|
||||
|
|
|
@ -183,14 +183,23 @@ function changeFramework(fw) {
|
|||
<h1>Merging records</h1>
|
||||
[% IF ( result ) %]
|
||||
[% IF ( errors ) %]
|
||||
|
||||
[% FOREACH error IN errors %]
|
||||
<div class="dialog alert">[% error.error %].<br />Therefore, the record to be merged has not been deleted.</div>
|
||||
<div class="dialog alert">
|
||||
|
||||
[% 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 %]
|
||||
|
||||
<br />Therefore, the record to be merged has not been deleted.</div>
|
||||
[% END %]
|
||||
|
||||
[% ELSE %]
|
||||
<script type="text/javascript">window.location.href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]"</script>
|
||||
<p>The merging was successful. <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]">Click here to see the merged record.</a></p>
|
||||
[% END %]
|
||||
[% ELSE %]
|
||||
<script type="text/javascript">window.location.href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]"</script>
|
||||
<p>The merging was successful. <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]">Click here to see the merged record.</a></p>
|
||||
[% END %]
|
||||
|
||||
[% ELSE %]
|
||||
|
||||
|
@ -228,9 +237,16 @@ function changeFramework(fw) {
|
|||
[% ELSE %]
|
||||
[% IF ( errors ) %]
|
||||
<div class="dialog alert">
|
||||
[% FOREACH error IN errors %]
|
||||
<p>[% error.error %]</p>
|
||||
[% END %]
|
||||
[% FOREACH error IN errors %]
|
||||
<p>
|
||||
[% 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 %]
|
||||
|
||||
</p>
|
||||
[% END %]
|
||||
</div>
|
||||
[% ELSE %]
|
||||
<form id="mergeform" action="/cgi-bin/koha/cataloguing/merge.pl" method="post" onsubmit="return mergeformsubmit()">
|
||||
|
|
Loading…
Reference in a new issue