View | Details | Raw Unified | Return to bug 8862
Collapse All | Expand All

(-)a/cataloguing/merge.pl (-4 / +3 lines)
Lines 81-87 if ($merge) { Link Here
81
    # If some items could not be moved :
81
    # If some items could not be moved :
82
    if (scalar(@notmoveditems) > 0) {
82
    if (scalar(@notmoveditems) > 0) {
83
		my $itemlist = join(' ',@notmoveditems);
83
		my $itemlist = join(' ',@notmoveditems);
84
		push @errors, "The following items could not be moved from the old record to the new one: $itemlist";
84
		push @errors, { code => "CANNOT_MOVE", value => $itemlist };
85
    }
85
    }
86
86
87
    # Moving subscriptions from the other record to the reference record
87
    # Moving subscriptions from the other record to the reference record
Lines 123-129 if ($merge) { Link Here
123
    my $biblionumber = $input->param('biblionumber');
123
    my $biblionumber = $input->param('biblionumber');
124
124
125
    if (scalar(@biblionumber) != 2) {
125
    if (scalar(@biblionumber) != 2) {
126
        push @errors, "An unexpected number of records was provided for merging. Currently only two records at a time can be merged.";
126
        push @errors, { code => "WRONG_COUNT", value => scalar(@biblionumber) };
127
    }
127
    }
128
    else {
128
    else {
129
        my $data1 = GetBiblioData($biblionumber[0]);
129
        my $data1 = GetBiblioData($biblionumber[0]);
Lines 206-213 if ($merge) { Link Here
206
206
207
if (@errors) {
207
if (@errors) {
208
    # Errors
208
    # Errors
209
    my @errors_loop  = map{{error => $_}}@errors;
209
    $template->param( errors  => \@errors );
210
    $template->param( errors  => \@errors_loop );
211
}
210
}
212
211
213
output_html_with_http_headers $input, $cookie, $template->output;
212
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt (-9 / +24 lines)
Lines 183-197 function changeFramework(fw) { Link Here
183
<h1>Merging records</h1>
183
<h1>Merging records</h1>
184
[% IF ( result ) %]
184
[% IF ( result ) %]
185
    [% IF ( errors ) %]
185
    [% IF ( errors ) %]
186
186
	[% FOREACH error IN errors %]
187
	[% FOREACH error IN errors %]
187
	    <div class="dialog alert">[% error.error %].<br />Therefore, the record to be merged has not been deleted.</div>
188
	    <div class="dialog alert">
188
	[% END %]
189
189
190
	[% ELSE %]
190
                [% IF error.code == 'CANNOT_MOVE' %]
191
	<script type="text/javascript">window.location.href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]"</script>	
191
                    The following items could not be moved from the old record to the new one: [% error.value %]
192
	<p>The merging was successful. <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]">Click here to see the merged record.</a></p>
192
                [% ELSE %]
193
                    [% error %]
194
                [% END %]
195
196
            <br />Therefore, the record to be merged has not been deleted.</div>
193
	[% END %]
197
	[% END %]
194
198
199
    [% ELSE %]
200
        <script type="text/javascript">window.location.href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]"</script>	
201
        <p>The merging was successful. <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]">Click here to see the merged record.</a></p>
202
    [% END %]
203
195
[% ELSE %]
204
[% ELSE %]
196
205
197
[% IF ( choosereference ) %]
206
[% IF ( choosereference ) %]
Lines 228-236 function changeFramework(fw) { Link Here
228
[% ELSE %]
237
[% ELSE %]
229
[% IF ( errors ) %]
238
[% IF ( errors ) %]
230
    <div class="dialog alert">
239
    <div class="dialog alert">
231
    [% FOREACH error IN errors %]
240
	[% FOREACH error IN errors %]
232
        <p>[% error.error %]</p>
241
	    <p>
233
    [% END %]
242
                [% IF error.code == 'WRONG_COUNT' %]
243
                    Number of records provided for merging: [% error.value %]. Currently only 2 records can be merged at a time.
244
                [% ELSE %]
245
                    [% error %]
246
                [% END %]
247
248
            </p>
249
	[% END %]
234
    </div>
250
    </div>
235
[% ELSE %]
251
[% ELSE %]
236
<form id="mergeform" action="/cgi-bin/koha/cataloguing/merge.pl" method="post" onsubmit="return mergeformsubmit()">
252
<form id="mergeform" action="/cgi-bin/koha/cataloguing/merge.pl" method="post" onsubmit="return mergeformsubmit()">
237
- 

Return to bug 8862