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

(-)a/C4/Biblio.pm (-20 / +34 lines)
Lines 361-371 sub ModBiblio { Link Here
361
        return 0;
361
        return 0;
362
    }
362
    }
363
363
364
    if ( C4::Context->preference("CataloguingLog") ) {
365
        my $biblio = Koha::Biblios->find($biblionumber);
366
        logaction( "CATALOGUING", "MODIFY", $biblionumber, "biblio BEFORE=>" . $biblio->metadata->record->as_formatted );
367
    }
368
369
    if ( !$options->{disable_autolink} && C4::Context->preference('BiblioAddsAuthorities') ) {
364
    if ( !$options->{disable_autolink} && C4::Context->preference('BiblioAddsAuthorities') ) {
370
        BiblioAutoLink( $record, $frameworkcode );
365
        BiblioAutoLink( $record, $frameworkcode );
371
    }
366
    }
Lines 417-443 sub ModBiblio { Link Here
417
    # update MARC subfield that stores biblioitems.cn_sort
412
    # update MARC subfield that stores biblioitems.cn_sort
418
    _koha_marc_update_biblioitem_cn_sort( $record, $oldbiblio, $frameworkcode );
413
    _koha_marc_update_biblioitem_cn_sort( $record, $oldbiblio, $frameworkcode );
419
414
420
    # update the MARC record (that now contains biblio and items) with the new record data
415
    my $schema = Koha::Database->schema;
421
    ModBiblioMarc( $record, $biblionumber, { skip_record_index => $skip_record_index } );
416
    my $result = 0;
417
    $schema->txn_do(sub{
418
419
        my $biblio = Koha::Biblios->find($biblionumber);
420
        my $orig_rec = $biblio->metadata->record;
421
        if( $orig_rec->field('005')->as_string eq $record->field('005')->as_string ){
422
423
            if ( C4::Context->preference("CataloguingLog") ) {
424
                logaction( "CATALOGUING", "MODIFY", $biblionumber, "biblio BEFORE=>" . $orig_rec->as_formatted );
425
            }
422
426
423
    # modify the other koha tables
427
            # update the MARC record (that now contains biblio and items) with the new record data
424
    _koha_modify_biblio( $dbh, $oldbiblio, $frameworkcode );
428
            ModBiblioMarc( $record, $biblionumber, { skip_record_index => $skip_record_index } );
425
    _koha_modify_biblioitem_nonmarc( $dbh, $oldbiblio );
426
429
427
    _after_biblio_action_hooks({ action => 'modify', biblio_id => $biblionumber });
430
            # modify the other koha tables
431
            _koha_modify_biblio( $dbh, $oldbiblio, $frameworkcode );
432
            _koha_modify_biblioitem_nonmarc( $dbh, $oldbiblio );
428
433
429
    # update OAI-PMH sets
434
            _after_biblio_action_hooks({ action => 'modify', biblio_id => $biblionumber });
430
    if(C4::Context->preference("OAI-PMH:AutoUpdateSets")) {
431
        C4::OAI::Sets::UpdateOAISetsBiblio($biblionumber, $record);
432
    }
433
435
434
    Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue(
436
            # update OAI-PMH sets
435
        {
437
            if(C4::Context->preference("OAI-PMH:AutoUpdateSets")) {
436
            biblio_ids => [ $biblionumber ]
438
                C4::OAI::Sets::UpdateOAISetsBiblio($biblionumber, $record);
439
            }
440
441
            Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue(
442
                {
443
                    biblio_ids => [ $biblionumber ]
444
                }
445
            ) unless $options->{skip_holds_queue} or !C4::Context->preference('RealTimeHoldsQueue');
446
447
            $result = 1;
448
449
        } else {
450
            $result = -1;
437
        }
451
        }
438
    ) unless $options->{skip_holds_queue} or !C4::Context->preference('RealTimeHoldsQueue');
452
    });
439
453
440
    return 1;
454
    return $result;
441
}
455
}
442
456
443
=head2 _strip_item_fields
457
=head2 _strip_item_fields
(-)a/catalogue/search.pl (-1 / +1 lines)
Lines 586-592 for (my $i=0;$i<@servers;$i++) { Link Here
586
        }
586
        }
587
587
588
        ## If there's just one result, redirect to the detail page unless doing an index scan
588
        ## If there's just one result, redirect to the detail page unless doing an index scan
589
        if ($total == 1 && !$scan) {
589
        if ($total == 1 && !$scan && 0) {
590
            my $biblionumber = $newresults[0]->{biblionumber};
590
            my $biblionumber = $newresults[0]->{biblionumber};
591
            my $defaultview = C4::Context->preference('IntranetBiblioDefaultView');
591
            my $defaultview = C4::Context->preference('IntranetBiblioDefaultView');
592
            my $views = { C4::Search::enabled_staff_search_views };
592
            my $views = { C4::Search::enabled_staff_search_views };
(-)a/cataloguing/addbiblio.pl (-1 / +24 lines)
Lines 868-874 if ( $op eq "addbiblio" ) { Link Here
868
        my $oldbibitemnum;
868
        my $oldbibitemnum;
869
        if ( $is_a_modif ) {
869
        if ( $is_a_modif ) {
870
            my $member = Koha::Patrons->find($loggedinuser);
870
            my $member = Koha::Patrons->find($loggedinuser);
871
            ModBiblio(
871
            my $success = ModBiblio(
872
                $record,
872
                $record,
873
                $biblionumber,
873
                $biblionumber,
874
                $frameworkcode,
874
                $frameworkcode,
Lines 880-885 if ( $op eq "addbiblio" ) { Link Here
880
                    }
880
                    }
881
                }
881
                }
882
            );
882
            );
883
            unless( $success > 0 ){
884
                $success ||= 1;
885
                build_tabs ($template, $record, $dbh,$encoding,$input);
886
                $template->param(
887
                    biblionumber             => $biblionumber,
888
                    biblioitemnumber         => $biblioitemnumber,
889
                    duplicatebiblionumber    => $duplicatebiblionumber,
890
                    duplicatebibid           => $duplicatebiblionumber,
891
                    duplicatetitle           => $duplicatetitle,
892
                    mod_error                => $success
893
                );
894
                $template->param(
895
                    popup => $mode,
896
                    frameworkcode => $frameworkcode,
897
                    itemtype => $frameworkcode,
898
                    borrowernumber => $loggedinuser,
899
                    tab => scalar $input->param('tab')
900
                );
901
                $template->{'VARS'}->{'searchid'} = $searchid;
902
903
                output_html_with_http_headers $input, $cookie, $template->output;
904
                exit;
905
            }
883
        }
906
        }
884
        else {
907
        else {
885
            ( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode );
908
            ( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-2 / +13 lines)
Lines 822-828 function PopupMARCFieldDoc(field) { Link Here
822
                    [% END %]
822
                    [% END %]
823
                </h1>
823
                </h1>
824
824
825
                [% UNLESS ( number ) %]
825
                [% UNLESS ( number && !mod_error ) %]
826
                    <!-- show duplicate warning on tab 0 only -->
826
                    <!-- show duplicate warning on tab 0 only -->
827
                    [% IF ( duplicatebiblionumber ) %]
827
                    [% IF ( duplicatebiblionumber ) %]
828
                        <div class="dialog alert">
828
                        <div class="dialog alert">
Lines 848-853 function PopupMARCFieldDoc(field) { Link Here
848
                            </form>
848
                            </form>
849
                        </div> <!-- /.dialog.alert -->
849
                        </div> <!-- /.dialog.alert -->
850
                    [% END # /IF duplicatebiblionumber %]
850
                    [% END # /IF duplicatebiblionumber %]
851
                    [% IF (mod_error == -1 ) %]
852
                        <div class="dialog alert">
853
                            <h3>Record edited elsewhere</h3>
854
                            <p>Someone else beat you to it!</p>
855
                        </div>
856
                    [% ELSIF (mod_error == 1) %]
857
                        <div class="dialog alert">
858
                            <h3>Error</h3>
859
                            <p>Something is not right!</p>
860
                        </div>
861
                    [% END %]
862
                    
851
                [% END # /UNLESS number %]
863
                [% END # /UNLESS number %]
852
864
853
                [% IF ( done ) %]
865
                [% IF ( done ) %]
854
- 

Return to bug 31109