From 11908331497c514b8ba224f30dfff00277f7f42b Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 15 Dec 2010 20:12:28 -0500 Subject: [PATCH] Bug 5375 (Update date/time last transaction (MARC 005) when saving authority record) Update 005 date/time when saving authority record for MARC21 and UNIMARC. Signed-off-by: Nicole Engard Signed-off-by: Chris Cormack --- C4/AuthoritiesMarc.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index d07cca492c..9421be9f1b 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( -- 2.39.5