(bug #2904) support of 856$u and 856$z in UNIMARC
authorNahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Fri, 9 Jan 2009 09:54:30 +0000 (10:54 +0100)
committerHenri-Damien LAURENT <henridamien@koha-fr.org>
Tue, 27 Jan 2009 11:19:45 +0000 (12:19 +0100)
This patch change the linktext as the label of the link(in 856$z), and set the url from the 856$u.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
C4/Biblio.pm

index 0a1e5a0..3f361a1 100644 (file)
@@ -1128,8 +1128,8 @@ Assumes web resources (not uncommon in MARC21 to omit resource type ind)
 sub GetMarcUrls {
     my ($record, $marcflavour) = @_;
     my @marcurls;
-    my $marcurl;
     for my $field ($record->field('856')) {
+        my $marcurl;
         my $url = $field->subfield('u');
         my @notes;
         for my $note ( $field->subfield('z')) {
@@ -1157,7 +1157,8 @@ sub GetMarcUrls {
             $marcurl->{'part'} = $s3 if($link);
             $marcurl->{'toc'} = 1 if($s3 =~ /^[Tt]able/) ;
         } else {
-            $marcurl->{'linktext'} = $url || C4::Context->preference('URLLinkText') ;
+            $marcurl->{'linktext'} = $field->subfield('z') || C4::Context->preference('URLLinkText') || $url;
+            $marcurl->{'MARCURL'} = $url ;
         }
         push @marcurls, $marcurl;    
     }