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

(-)a/C4/Biblio.pm (-3 / +4 lines)
Lines 356-362 sub ModBiblio { Link Here
356
356
357
    if (!$record) {
357
    if (!$record) {
358
        carp 'No record passed to ModBiblio';
358
        carp 'No record passed to ModBiblio';
359
        return 0;
359
        return (0, 0);
360
    }
360
    }
361
361
362
    if ( C4::Context->preference("CataloguingLog") ) {
362
    if ( C4::Context->preference("CataloguingLog") ) {
Lines 386-397 sub ModBiblio { Link Here
386
    _strip_item_fields($record, $frameworkcode);
386
    _strip_item_fields($record, $frameworkcode);
387
387
388
    # apply overlay rules
388
    # apply overlay rules
389
    my $blocked;
389
    if (   C4::Context->preference('MARCOverlayRules')
390
    if (   C4::Context->preference('MARCOverlayRules')
390
        && $biblionumber
391
        && $biblionumber
391
        && defined $options
392
        && defined $options
392
        && exists $options->{overlay_context} )
393
        && exists $options->{overlay_context} )
393
    {
394
    {
394
        $record = ApplyMarcOverlayRules(
395
        ($blocked, $record) = ApplyMarcOverlayRules(
395
            {
396
            {
396
                biblionumber    => $biblionumber,
397
                biblionumber    => $biblionumber,
397
                record          => $record,
398
                record          => $record,
Lines 429-435 sub ModBiblio { Link Here
429
        C4::OAI::Sets::UpdateOAISetsBiblio($biblionumber, $record);
430
        C4::OAI::Sets::UpdateOAISetsBiblio($biblionumber, $record);
430
    }
431
    }
431
432
432
    return 1;
433
    return ($blocked, 1);
433
}
434
}
434
435
435
=head2 _strip_item_fields
436
=head2 _strip_item_fields
(-)a/Koha/MarcOverlayRules.pm (-2 / +9 lines)
Lines 134-140 sub merge_records { Link Here
134
    my $rules = $self->context_rules($context);
134
    my $rules = $self->context_rules($context);
135
135
136
    # Default when no rules found is to overwrite with incoming record
136
    # Default when no rules found is to overwrite with incoming record
137
    return $incoming_record unless $rules;
137
    return (0, $incoming_record) unless $rules;
138
138
139
    my $fields_by_tag = sub {
139
    my $fields_by_tag = sub {
140
        my ($record) = @_;
140
        my ($record) = @_;
Lines 219-224 sub merge_records { Link Here
219
    # Then we get the intersection of fields, present both in
219
    # Then we get the intersection of fields, present both in
220
    # current and incoming record (possibly to be overwritten)
220
    # current and incoming record (possibly to be overwritten)
221
    my @common_field_tags = grep { exists $incoming_fields->{$_} } keys %{$current_fields};
221
    my @common_field_tags = grep { exists $incoming_fields->{$_} } keys %{$current_fields};
222
    my $blocked;
222
    foreach my $tag (@common_field_tags) {
223
    foreach my $tag (@common_field_tags) {
223
        my $rule = $get_matching_field_rule->($tag);
224
        my $rule = $get_matching_field_rule->($tag);
224
225
Lines 236-241 sub merge_records { Link Here
236
                push @{$merged_record_fields{$tag}}, @{$incoming_fields->{$tag}};
237
                push @{$merged_record_fields{$tag}}, @{$incoming_fields->{$tag}};
237
            }
238
            }
238
            else {
239
            else {
240
                $blocked = 1;
239
                push @{$merged_record_fields{$tag}}, @{$current_fields->{$tag}};
241
                push @{$merged_record_fields{$tag}}, @{$current_fields->{$tag}};
240
            }
242
            }
241
        }
243
        }
Lines 269-274 sub merge_records { Link Here
269
                }
271
                }
270
                else {
272
                else {
271
                    # else keep existing subfield order
273
                    # else keep existing subfield order
274
                    $blocked = 1;
272
                    push @merged_fields, map { $_->[0] } @{$common_fields};
275
                    push @merged_fields, map { $_->[0] } @{$common_fields};
273
                }
276
                }
274
            }
277
            }
Lines 276-287 sub merge_records { Link Here
276
            if (@{$current_fields_only}) {
279
            if (@{$current_fields_only}) {
277
                if (!$rule->{remove}->{allow}) {
280
                if (!$rule->{remove}->{allow}) {
278
                    push @merged_fields, @{$current_fields_only};
281
                    push @merged_fields, @{$current_fields_only};
282
                } else {
283
                    $blocked = 1;
279
                }
284
                }
280
            }
285
            }
281
            # Appended
286
            # Appended
282
            if (@{$incoming_fields_only}) {
287
            if (@{$incoming_fields_only}) {
283
                if ($rule->{append}->{allow}) {
288
                if ($rule->{append}->{allow}) {
284
                    push @merged_fields, @{$incoming_fields_only};
289
                    push @merged_fields, @{$incoming_fields_only};
290
                } else {
291
                    $blocked = 1;
285
                }
292
                }
286
            }
293
            }
287
            $merged_record_fields{$tag} //= [];
294
            $merged_record_fields{$tag} //= [];
Lines 301-307 sub merge_records { Link Here
301
            $merged_record->append_fields(@{$merged_record_fields{$tag}});
308
            $merged_record->append_fields(@{$merged_record_fields{$tag}});
302
        }
309
        }
303
    }
310
    }
304
    return $merged_record;
311
    return ($blocked, $merged_record);
305
}
312
}
306
313
307
sub _clear_caches {
314
sub _clear_caches {
(-)a/catalogue/detail.pl (-1 / +2 lines)
Lines 60-65 use Koha::SearchEngine::QueryBuilder; Link Here
60
my $query = CGI->new();
60
my $query = CGI->new();
61
61
62
my $analyze = $query->param('analyze');
62
my $analyze = $query->param('analyze');
63
my $blocked = $query->param('blocked');
63
64
64
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
65
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
65
    {
66
    {
Lines 605-610 if ( C4::Context->preference('UseCourseReserves') ) { Link Here
605
    $template->param( course_reserves => $course_reserves );
606
    $template->param( course_reserves => $course_reserves );
606
}
607
}
607
608
608
$template->param(biblio => $biblio);
609
$template->param(biblio => $biblio, blocked => $blocked);
609
610
610
output_html_with_http_headers $query, $cookie, $template->output;
611
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/cataloguing/addbiblio.pl (-2 / +5 lines)
Lines 862-872 if ( $op eq "addbiblio" ) { Link Here
862
    }
862
    }
863
    my $confirm_not_duplicate = $input->param('confirm_not_duplicate');
863
    my $confirm_not_duplicate = $input->param('confirm_not_duplicate');
864
    # it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate)
864
    # it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate)
865
    my $blocked;
865
    if ( !$duplicatebiblionumber or $confirm_not_duplicate ) {
866
    if ( !$duplicatebiblionumber or $confirm_not_duplicate ) {
866
        my $oldbibitemnum;
867
        my $oldbibitemnum;
867
        if ( $is_a_modif ) {
868
        if ( $is_a_modif ) {
868
            my $member = Koha::Patrons->find($loggedinuser);
869
            my $member = Koha::Patrons->find($loggedinuser);
869
            ModBiblio(
870
            my $x;
871
            ($blocked, $x)= ModBiblio(
870
                $record,
872
                $record,
871
                $biblionumber,
873
                $biblionumber,
872
                $frameworkcode,
874
                $frameworkcode,
Lines 878-883 if ( $op eq "addbiblio" ) { Link Here
878
                    }
880
                    }
879
                }
881
                }
880
            );
882
            );
883
            $template->param(has_been_blocked => $blocked);
881
        }
884
        }
882
        else {
885
        else {
883
            ( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode );
886
            ( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode );
Lines 913-919 if ( $op eq "addbiblio" ) { Link Here
913
            } elsif  ($defaultview eq 'labeled_marc' && $views->{can_view_labeledMARC}) {
916
            } elsif  ($defaultview eq 'labeled_marc' && $views->{can_view_labeledMARC}) {
914
                print $input->redirect("/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=$biblionumber&searchid=$searchid");
917
                print $input->redirect("/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=$biblionumber&searchid=$searchid");
915
            } else {
918
            } else {
916
                print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid");
919
                print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid&blocked=$blocked");
917
            }
920
            }
918
            exit;
921
            exit;
919
922
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +1 lines)
Lines 94-99 Link Here
94
[% CoceHost        = Koha.Preference('CoceHost') %]
94
[% CoceHost        = Koha.Preference('CoceHost') %]
95
95
96
[% INCLUDE 'cat-toolbar.inc' %]
96
[% INCLUDE 'cat-toolbar.inc' %]
97
[% IF blocked %]<p>HAS BEEN BLOCKED</p>[% END %]
97
    [% IF decoding_error %]
98
    [% IF decoding_error %]
98
        <div>
99
        <div>
99
           <span class="biberror">
100
           <span class="biberror">
100
- 

Return to bug 14957