From cdb9220d74acb80c3442a695f3dad1ec6d1a9040 Mon Sep 17 00:00:00 2001 From: tipaul Date: Thu, 10 Jul 2003 10:37:19 +0000 Subject: [PATCH] fix for copyrightdate problem, #514 --- C4/Biblio.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 0c5eccad0a..798ad3b25e 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1,6 +1,9 @@ package C4::Biblio; # $Id$ # $Log$ +# Revision 1.52 2003/07/10 10:37:19 tipaul +# fix for copyrightdate problem, #514 +# # Revision 1.51 2003/07/02 14:47:17 tipaul # fix for #519 : items.dateaccessioned imports incorrectly # @@ -1095,6 +1098,15 @@ sub MARCmarc2koha { } # additional authors : specific $result = &MARCmarc2kohaOneField($sth,"additionalauthors","additionalauthors",$record,$result); +# modify copyrightdate to keep only the 1st year found + my $temp = $result->{'copyrightdate'}; + $temp =~ m/c(\d\d\d\d)/; # search cYYYY first + if ($1>0) { + $result->{'copyrightdate'} = $1; + } else { # if no cYYYY, get the 1st date. + $x =~ m/(\d\d\d\d)/; + $result->{'copyrightdate'} = $1; + } return $result; } -- 2.39.2