[Koha-patches] [PATCH] (bug #2904) support of 856$u and 856$z in UNIMARC

Nahuel ANGELINETTI nahuel.angelinetti at biblibre.com
Fri Jan 9 10:52:00 CET 2009


This patch change the linktext as the label of the link(in 856$z), and set the url from the 856$u.
---
 C4/Biblio.pm |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/C4/Biblio.pm b/C4/Biblio.pm
index ed3e473..726f84c 100644
--- a/C4/Biblio.pm
+++ b/C4/Biblio.pm
@@ -1132,8 +1132,9 @@ 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;
+        #warn Data::Dumper::Dumper($field);
         my $url = $field->subfield('u');
         my @notes;
         for my $note ( $field->subfield('z')) {
@@ -1161,7 +1162,9 @@ 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 ;
+            warn Data::Dumper::Dumper($marcurl);
         }
         push @marcurls, $marcurl;    
     }
-- 
1.5.6.3




More information about the Koha-patches mailing list