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

(-)a/C4/AuthoritiesMarc.pm (-20 / +13 lines)
Lines 1461-1467 sub merge { Link Here
1461
    @record_to = $MARCto->field($auth_tag_to_report_to)->subfields() if $MARCto->field($auth_tag_to_report_to);
1461
    @record_to = $MARCto->field($auth_tag_to_report_to)->subfields() if $MARCto->field($auth_tag_to_report_to);
1462
    my @record_from;
1462
    my @record_from;
1463
    @record_from = $MARCfrom->field($auth_tag_to_report_from)->subfields() if $MARCfrom->field($auth_tag_to_report_from);
1463
    @record_from = $MARCfrom->field($auth_tag_to_report_from)->subfields() if $MARCfrom->field($auth_tag_to_report_from);
1464
    
1464
1465
    my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' );
1466
1465
    my @reccache;
1467
    my @reccache;
1466
    # search all biblio tags using this authority.
1468
    # search all biblio tags using this authority.
1467
    #Getting marcbiblios impacted by the change.
1469
    #Getting marcbiblios impacted by the change.
Lines 1482-1493 sub merge { Link Here
1482
            'biblioserver',
1484
            'biblioserver',
1483
            $oResult->record($z)->raw()
1485
            $oResult->record($z)->raw()
1484
        );
1486
        );
1485
        my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' );
1487
        my $biblionumber = ( $biblionumbertagfield < 10 )
1486
        my $i = ($biblionumbertagfield < 10)
1487
            ? $marcrecordzebra->field( $biblionumbertagfield )->data
1488
            ? $marcrecordzebra->field( $biblionumbertagfield )->data
1488
            : $marcrecordzebra->subfield( $biblionumbertagfield, $biblionumbertagsubfield );
1489
            : $marcrecordzebra->subfield( $biblionumbertagfield, $biblionumbertagsubfield );
1489
        my $marcrecorddb = GetMarcBiblio($i);
1490
        my $marcrecorddb = GetMarcBiblio($biblionumber);
1490
        push @reccache, $marcrecorddb;
1491
        push @reccache, {
1492
            biblionumber => $biblionumber,
1493
            marcrecord   => $marcrecorddb,
1494
        };
1491
        $z++;
1495
        $z++;
1492
    }
1496
    }
1493
    $oResult->destroy();
1497
    $oResult->destroy();
Lines 1509-1516 sub merge { Link Here
1509
    }  
1513
    }  
1510
    # BulkEdit marc records
1514
    # BulkEdit marc records
1511
    # May be used as a template for a bulkedit field  
1515
    # May be used as a template for a bulkedit field  
1512
    foreach my $marcrecord(@reccache){
1516
    foreach ( @reccache ) {
1513
        my $update;           
1517
        my $biblionumber = $_->{'biblionumber'};
1518
        my $marcrecord = $_->{'marcrecord'};
1519
        my $update;
1514
        foreach my $tagfield (@tags_using_authtype){
1520
        foreach my $tagfield (@tags_using_authtype){
1515
#             warn "tagfield : $tagfield ";
1521
#             warn "tagfield : $tagfield ";
1516
            foreach my $field ($marcrecord->field($tagfield)){
1522
            foreach my $field ($marcrecord->field($tagfield)){
Lines 1536-1553 sub merge { Link Here
1536
                }
1542
                }
1537
            }#for each tag
1543
            }#for each tag
1538
        }#foreach tagfield
1544
        }#foreach tagfield
1539
        my ($bibliotag,$bibliosubf) = GetMarcFromKohaField("biblio.biblionumber","") ;
1540
        my $biblionumber;
1541
        if ($bibliotag<10){
1542
            $biblionumber=$marcrecord->field($bibliotag)->data;
1543
        }
1544
        else {
1545
            $biblionumber=$marcrecord->subfield($bibliotag,$bibliosubf);
1546
        }
1547
        unless ($biblionumber){
1548
            warn "pas de numéro de notice bibliographique dans : ".$marcrecord->as_formatted;
1549
            next;
1550
        }
1551
        if ($update==1){
1545
        if ($update==1){
1552
            &ModBiblio($marcrecord,$biblionumber,GetFrameworkCode($biblionumber)) ;
1546
            &ModBiblio($marcrecord,$biblionumber,GetFrameworkCode($biblionumber)) ;
1553
            $counteditedbiblio++;
1547
            $counteditedbiblio++;
1554
- 

Return to bug 13762