Bugzilla – Attachment 2861 Details for
Bug 5374
Update date/time last transaction (MARC 005) when saving biblio record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
signed off patch
0002--SIGNED-OFF-Bug-5374-update-transaction-date-when-s.patch (text/plain), 2.83 KB, created by
Nicole C. Engard
on 2010-12-16 14:11:47 UTC
(
hide
)
Description:
signed off patch
Filename:
MIME Type:
Creator:
Nicole C. Engard
Created:
2010-12-16 14:11:47 UTC
Size:
2.83 KB
patch
obsolete
>From 474d9550770b9fd29249f64495bb9bc9c048d9cf Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <M.de.Rooy@rijksmuseum.nl> >Date: Tue, 9 Nov 2010 16:04:27 +0000 >Subject: [PATCH] [SIGNED-OFF]Bug 5374 (update transaction date when saving biblio) RESENT with small fix >Content-Type: text/plain; charset="utf-8" > >Currently, the plugin marc21_field_005 and its unimarc opponent fill field 005 >when this field gets focus. This implies that updating a record without >touching this field does not update 005. >At the same time, a user could accidentally delete a character in the 005 when >having focus. This mutilated field value will be saved however. > >I would suggest to add a few lines to ModBiblioMarc in Biblio.pm to ascertain >that adding or updating a record always updates 005 in marc21 as well as >unimarc. > >Signed-off-by: Nicole Engard <nengard@bywatersolutions.com> >--- > C4/Biblio.pm | 9 +++++++++ > cataloguing/value_builder/marc21_field_005.pl | 25 ++++--------------------- > 2 files changed, 13 insertions(+), 21 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index c3a3094..879dd0a 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -3241,6 +3241,15 @@ sub ModBiblioMarc { > $record->insert_grouped_field( MARC::Field->new( 100, "", "", "a" => $string ) ); > } > } >+ >+ #enhancement 5374: update transaction date (005) for marc21/unimarc >+ if($encoding =~ /MARC21|UNIMARC/) { >+ my @a= (localtime) [5,4,3,2,1,0]; $a[0]+=1900; $a[1]++; >+ # YY MM DD HH MM SS (update year and month) >+ my $f005= $record->field('005'); >+ $f005->update(sprintf("%4d%02d%02d%02d%02d%04.1f",@a)) if $f005; >+ } >+ > my $oldRecord; > if ( C4::Context->preference("NoZebra") ) { > >diff --git a/cataloguing/value_builder/marc21_field_005.pl b/cataloguing/value_builder/marc21_field_005.pl >index 7db29b7..2be76b5 100755 >--- a/cataloguing/value_builder/marc21_field_005.pl >+++ b/cataloguing/value_builder/marc21_field_005.pl >@@ -19,7 +19,7 @@ > > use strict; > #use warnings; FIXME - Bug 2505 >-use C4::Context; >+#use C4::Context; > > =head1 > >@@ -52,26 +52,9 @@ sub plugin_javascript { > my $function_name= $field_number; > > # find today's date >- my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); >- $year +=1900; >- $mon +=1; >- if (length($mon)==1) { >- $mon = "0".$mon; >- } >- if (length($mday)==1) { >- $mday = "0".$mday; >- } >- if (length($hour)==1) { >- $hour = "0".$hour; >- } >- if (length($min)==1) { >- $min = "0".$min; >- } >- if (length($sec)==1) { >- $hour = "0".$sec; >- } >- >- my $date = "$year$mon$mday$hour$min$sec".".0"; >+ my @a= (localtime) [5,4,3,2,1,0]; $a[0]+=1900; $a[1]++; >+ my $date = sprintf("%4d%02d%02d%02d%02d%04.1f",@a); >+ > my $res = " > <script type=\"text/javascript\"> > //<![CDATA[ >-- >1.5.6.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5374
: 2861