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 2517-2523
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 |
my ($biblionumbertagfield, $biblionumbertagsubfield) = (-1, -1); |
|
|
2521 |
($biblionumbertagfield, $biblionumbertagsubfield) = |
2522 |
&GetMarcFromKohaField( "biblio.biblionumber", '' ) if $isbiblio; |
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! |
2523 |
#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! |
2522 |
while ( $params[$i] ) { # browse all CGI params |
2524 |
while ( $params[$i] ) { # browse all CGI params |
2523 |
my $param = $params[$i]; |
2525 |
my $param = $params[$i]; |
Lines 2541-2548
sub TransformHtmlToMarc {
Link Here
|
2541 |
|
2543 |
|
2542 |
if ( $tag < 10 ) { # no code for theses fields |
2544 |
if ( $tag < 10 ) { # no code for theses fields |
2543 |
# in MARC editor, 000 contains the leader. |
2545 |
# in MARC editor, 000 contains the leader. |
2544 |
next if $tag == $biblionumbertagfield; |
2546 |
if ( $tag == $biblionumbertagfield ) { |
2545 |
if ( $tag eq '000' ) { |
2547 |
# We do nothing and let $i be incremented |
|
|
2548 |
} |
2549 |
elsif ( $tag eq '000' ) { |
2546 |
# Force a fake leader even if not provided to avoid crashing |
2550 |
# Force a fake leader even if not provided to avoid crashing |
2547 |
# during decoding MARC record containing UTF-8 characters |
2551 |
# during decoding MARC record containing UTF-8 characters |
2548 |
$record->leader( |
2552 |
$record->leader( |
Lines 2561-2567
sub TransformHtmlToMarc {
Link Here
|
2561 |
# browse subfields for this tag (reason for _code_ match) |
2565 |
# browse subfields for this tag (reason for _code_ match) |
2562 |
while(defined $params[$j] && $params[$j] =~ /_code_/) { |
2566 |
while(defined $params[$j] && $params[$j] =~ /_code_/) { |
2563 |
last unless defined $params[$j+1]; |
2567 |
last unless defined $params[$j+1]; |
2564 |
$j += 2 and next if $tag == $biblionumbertagfield and $cgi->param($params[$j]) eq $biblionumbertagsubfield; |
2568 |
$j += 2 and next |
|
|
2569 |
if $tag == $biblionumbertagfield and |
2570 |
$cgi->param($params[$j]) eq $biblionumbertagsubfield; |
2565 |
#if next param ne subfield, then it was probably empty |
2571 |
#if next param ne subfield, then it was probably empty |
2566 |
#try next param by incrementing j |
2572 |
#try next param by incrementing j |
2567 |
if($params[$j+1]!~/_subfield_/) {$j++; next; } |
2573 |
if($params[$j+1]!~/_subfield_/) {$j++; next; } |