From 7f6b4b945c49397b5e45a0aad60044a87c440f36 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 8 Nov 2010 13:28:27 +0000 Subject: [PATCH] [SIGNED-OFF] Bug 5375 (Update date/time last transaction (MARC 005) when saving authority record) Content-Type: text/plain; charset="utf-8" Update 005 date/time when saving authority record for MARC21 and UNIMARC. --- C4/AuthoritiesMarc.pm | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index d07cca4..9421be9 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -610,6 +610,16 @@ sub AddAuthority { $format= 'MARC21'; } + #update date/time to 005 for marc and unimarc + my $time=POSIX::strftime("%Y%m%d%H%M%S",localtime); + my $f5=$record->field('005'); + if (!$f5) { + $record->insert_fields_ordered( MARC::Field->new('005',$time.".0") ); + } + else { + $f5->update($time.".0"); + } + if ($format eq "MARC21") { if (!$record->leader) { $record->leader($leader); @@ -619,12 +629,6 @@ sub AddAuthority { MARC::Field->new('003',C4::Context->preference('MARCOrgCode')) ); } - my $time=POSIX::strftime("%Y%m%d%H%M%S",localtime); - if (!$record->field('005')) { - $record->insert_fields_ordered( - MARC::Field->new('005',$time.".0") - ); - } my $date=POSIX::strftime("%y%m%d",localtime); if (!$record->field('008')) { $record->insert_fields_ordered( -- 1.5.6.5