Lines 2517-2522
sub TransformHtmlToMarc {
Link Here
|
2517 |
my $record = MARC::Record->new(); |
2517 |
my $record = MARC::Record->new(); |
2518 |
my $i = 0; |
2518 |
my $i = 0; |
2519 |
my @fields; |
2519 |
my @fields; |
|
|
2520 |
my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' ); |
2520 |
#FIXME This code assumes that the CGI params will be in the same order as the fields in the template; this is no absolute guarantee! |
2521 |
#FIXME This code assumes that the CGI params will be in the same order as the fields in the template; this is no absolute guarantee! |
2521 |
while ( $params[$i] ) { # browse all CGI params |
2522 |
while ( $params[$i] ) { # browse all CGI params |
2522 |
my $param = $params[$i]; |
2523 |
my $param = $params[$i]; |
Lines 2524-2530
sub TransformHtmlToMarc {
Link Here
|
2524 |
|
2525 |
|
2525 |
# if we are on biblionumber, store it in the MARC::Record (it may not be in the edited fields) |
2526 |
# if we are on biblionumber, store it in the MARC::Record (it may not be in the edited fields) |
2526 |
if ( $param eq 'biblionumber' ) { |
2527 |
if ( $param eq 'biblionumber' ) { |
2527 |
my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' ); |
|
|
2528 |
if ( $biblionumbertagfield < 10 ) { |
2528 |
if ( $biblionumbertagfield < 10 ) { |
2529 |
$newfield = MARC::Field->new( $biblionumbertagfield, $cgi->param($param), ); |
2529 |
$newfield = MARC::Field->new( $biblionumbertagfield, $cgi->param($param), ); |
2530 |
} else { |
2530 |
} else { |
Lines 2541-2546
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 ( $tag eq '000' ) { |
2545 |
if ( $tag eq '000' ) { |
2545 |
# Force a fake leader even if not provided to avoid crashing |
2546 |
# Force a fake leader even if not provided to avoid crashing |
2546 |
# during decoding MARC record containing UTF-8 characters |
2547 |
# during decoding MARC record containing UTF-8 characters |
Lines 2560-2565
sub TransformHtmlToMarc {
Link Here
|
2560 |
# browse subfields for this tag (reason for _code_ match) |
2561 |
# browse subfields for this tag (reason for _code_ match) |
2561 |
while(defined $params[$j] && $params[$j] =~ /_code_/) { |
2562 |
while(defined $params[$j] && $params[$j] =~ /_code_/) { |
2562 |
last unless defined $params[$j+1]; |
2563 |
last unless defined $params[$j+1]; |
|
|
2564 |
$j += 2 and next if $tag == $biblionumbertagfield and $cgi->param($params[$j]) eq $biblionumbertagsubfield; |
2563 |
#if next param ne subfield, then it was probably empty |
2565 |
#if next param ne subfield, then it was probably empty |
2564 |
#try next param by incrementing j |
2566 |
#try next param by incrementing j |
2565 |
if($params[$j+1]!~/_subfield_/) {$j++; next; } |
2567 |
if($params[$j+1]!~/_subfield_/) {$j++; next; } |
2566 |
- |
|
|