From 83cca02a4669593c379aec4c01819a2101890d8b Mon Sep 17 00:00:00 2001 From: tipaul Date: Wed, 6 Aug 2003 12:54:52 +0000 Subject: [PATCH] fix for publicationyear : extracting numeric value from MARC string, like for copyrightdate. (note that copyrightdate still extracted to get numeric format) --- C4/Biblio.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 82af73b0bb..8d39a43287 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1,6 +1,10 @@ package C4::Biblio; # $Id$ # $Log$ +# Revision 1.58 2003/08/06 12:54:52 tipaul +# fix for publicationyear : extracting numeric value from MARC string, like for copyrightdate. +# (note that copyrightdate still extracted to get numeric format) +# # Revision 1.57 2003/07/15 23:09:18 slef # change show columns to use biblioitems bnotes too # @@ -1120,6 +1124,15 @@ sub MARCmarc2koha { $temp =~ m/(\d\d\d\d)/; $result->{'copyrightdate'} = $1; } +# modify publicationyear to keep only the 1st year found + my $temp = $result->{'publicationyear'}; + $temp =~ m/c(\d\d\d\d)/; # search cYYYY first + if ($1>0) { + $result->{'publicationyear'} = $1; + } else { # if no cYYYY, get the 1st date. + $temp =~ m/(\d\d\d\d)/; + $result->{'publicationyear'} = $1; + } return $result; } -- 2.39.5