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

(-)a/C4/Biblio.pm (-3 / +7 lines)
Lines 2496-2502 sub _default_ind_to_space { Link Here
2496
=cut
2496
=cut
2497
2497
2498
sub TransformHtmlToMarc {
2498
sub TransformHtmlToMarc {
2499
    my $cgi    = shift;
2499
    my ($cgi, $isbiblio) = @_;
2500
2500
2501
    my @params = $cgi->param();
2501
    my @params = $cgi->param();
2502
2502
Lines 2541-2547 sub TransformHtmlToMarc { Link Here
2541
2541
2542
            if ( $tag < 10 ) {                              # no code for theses fields
2542
            if ( $tag < 10 ) {                              # no code for theses fields
2543
                                                            # in MARC editor, 000 contains the leader.
2543
                                                            # in MARC editor, 000 contains the leader.
2544
                next if $tag == $biblionumbertagfield;
2544
                if ( $isbiblio && $tag == $biblionumbertagfield ) {
2545
                    # We do nothing and let $i be incremented
2546
                }
2545
                if ( $tag eq '000' ) {
2547
                if ( $tag eq '000' ) {
2546
                    # Force a fake leader even if not provided to avoid crashing
2548
                    # Force a fake leader even if not provided to avoid crashing
2547
                    # during decoding MARC record containing UTF-8 characters
2549
                    # during decoding MARC record containing UTF-8 characters
Lines 2561-2567 sub TransformHtmlToMarc { Link Here
2561
                # browse subfields for this tag (reason for _code_ match)
2563
                # browse subfields for this tag (reason for _code_ match)
2562
                while(defined $params[$j] && $params[$j] =~ /_code_/) {
2564
                while(defined $params[$j] && $params[$j] =~ /_code_/) {
2563
                    last unless defined $params[$j+1];
2565
                    last unless defined $params[$j+1];
2564
                    $j += 2 and next if $tag == $biblionumbertagfield and $cgi->param($params[$j]) eq $biblionumbertagsubfield;
2566
                    $j += 2 and next
2567
                        if $isbiblio and $tag == $biblionumbertagfield and
2568
                           $cgi->param($params[$j]) eq $biblionumbertagsubfield;
2565
                    #if next param ne subfield, then it was probably empty
2569
                    #if next param ne subfield, then it was probably empty
2566
                    #try next param by incrementing j
2570
                    #try next param by incrementing j
2567
                    if($params[$j+1]!~/_subfield_/) {$j++; next; }
2571
                    if($params[$j+1]!~/_subfield_/) {$j++; next; }
(-)a/authorities/authorities.pl (-1 / +1 lines)
Lines 612-618 if ($op eq "add") { Link Here
612
    # build indicator hash.
612
    # build indicator hash.
613
    my @ind_tag = $input->param('ind_tag');
613
    my @ind_tag = $input->param('ind_tag');
614
    my @indicator = $input->param('indicator');
614
    my @indicator = $input->param('indicator');
615
    my $record = TransformHtmlToMarc($input);
615
    my $record = TransformHtmlToMarc($input, 0);
616
616
617
    my ($duplicateauthid,$duplicateauthvalue);
617
    my ($duplicateauthid,$duplicateauthvalue);
618
     ($duplicateauthid,$duplicateauthvalue) = FindDuplicateAuthority($record,$authtypecode) if ($op eq "add") && (!$is_a_modif);
618
     ($duplicateauthid,$duplicateauthvalue) = FindDuplicateAuthority($record,$authtypecode) if ($op eq "add") && (!$is_a_modif);
(-)a/authorities/merge.pl (-1 / +1 lines)
Lines 49-55 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
49
if ($merge) {
49
if ($merge) {
50
50
51
    # Creating a new record from the html code
51
    # Creating a new record from the html code
52
    my $record   = TransformHtmlToMarc($input);
52
    my $record   = TransformHtmlToMarc($input, 0);
53
    my $recordid1   = $input->param('recordid1');
53
    my $recordid1   = $input->param('recordid1');
54
    my $recordid2   = $input->param('recordid2');
54
    my $recordid2   = $input->param('recordid2');
55
    my $typecode = $input->param('frameworkcode');
55
    my $typecode = $input->param('frameworkcode');
(-)a/cataloguing/addbiblio.pl (-2 / +2 lines)
Lines 834-840 if ( $op eq "addbiblio" ) { Link Here
834
    );
834
    );
835
    # getting html input
835
    # getting html input
836
    my @params = $input->param();
836
    my @params = $input->param();
837
    $record = TransformHtmlToMarc( $input );
837
    $record = TransformHtmlToMarc( $input, 1 );
838
    # check for a duplicate
838
    # check for a duplicate
839
    my ( $duplicatebiblionumber, $duplicatetitle );
839
    my ( $duplicatebiblionumber, $duplicatetitle );
840
    if ( !$is_a_modif ) {
840
    if ( !$is_a_modif ) {
Lines 948-954 elsif ( $op eq "delete" ) { Link Here
948
    }
948
    }
949
949
950
    if($changed_framework eq "changed"){
950
    if($changed_framework eq "changed"){
951
        $record = TransformHtmlToMarc( $input );
951
        $record = TransformHtmlToMarc( $input, 1 );
952
    }
952
    }
953
    elsif( $record ne -1 ) {
953
    elsif( $record ne -1 ) {
954
#FIXME: it's kind of silly to go from MARC::Record to MARC::File::XML and then back again just to fix the encoding
954
#FIXME: it's kind of silly to go from MARC::Record to MARC::File::XML and then back again just to fix the encoding
(-)a/cataloguing/merge.pl (-2 / +1 lines)
Lines 55-61 if ($merge) { Link Here
55
    my $dbh = C4::Context->dbh;
55
    my $dbh = C4::Context->dbh;
56
56
57
    # Creating a new record from the html code
57
    # Creating a new record from the html code
58
    my $record       = TransformHtmlToMarc( $input );
58
    my $record       = TransformHtmlToMarc( $input, 1 );
59
    my $ref_biblionumber = $input->param('ref_biblionumber');
59
    my $ref_biblionumber = $input->param('ref_biblionumber');
60
    @biblionumbers = grep { $_ != $ref_biblionumber } @biblionumbers;
60
    @biblionumbers = grep { $_ != $ref_biblionumber } @biblionumbers;
61
61
62
- 

Return to bug 6657