Bugzilla – Attachment 164800 Details for
Bug 36552
Update record 'date entered on file' when duplicating a record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36552: Update record 'date entered on file' when duplicating a record
Bug-36552-Update-record-date-entered-on-file-when-.patch (text/plain), 3.16 KB, created by
Marcel de Rooy
on 2024-04-12 08:12:41 UTC
(
hide
)
Description:
Bug 36552: Update record 'date entered on file' when duplicating a record
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-04-12 08:12:41 UTC
Size:
3.16 KB
patch
obsolete
>From 83a87b136bce5622e97222b18d363196ca5b0489 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Thu, 27 Apr 2023 01:04:48 +0200 >Subject: [PATCH] Bug 36552: Update record 'date entered on file' when > duplicating a record >Content-Type: text/plain; charset=utf-8 > >The 'date entered on file' (MARC21: 008/0-5, UNIMARC: 100a/0=7) of a record created >by duplication of an existing record should be set to the current date instead of >having the value of the original record. > >Test plan >========= >1. Check the 'date entered on file' of an existing biblio / authotiry record > (MARC21: 008/0-5, UNIMARC: 100a/0=7). >2. Duplicate the record by Edit > Edit as new (duplicate) >3. Control the 'date entered on file' value - it will equal to that of the > original record. >4. Apply the patch (restart plack). >5. Repeat step 2. >6. Check the date - it should be the current date. > >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > authorities/authorities.pl | 11 +++++++++++ > cataloguing/addbiblio.pl | 13 +++++++++++++ > 2 files changed, 24 insertions(+) > >diff --git a/authorities/authorities.pl b/authorities/authorities.pl >index 3da263b74f..42d96bfc77 100755 >--- a/authorities/authorities.pl >+++ b/authorities/authorities.pl >@@ -638,6 +638,17 @@ if ($op eq "cud-add") { > } else { > if ( $op eq "duplicate" ) { > $authid = ""; >+ if ( C4::Context->preference('marcflavour') eq 'MARC21' && $record->field('008') ) { >+ my $s008 = $record->field('008')->data; >+ my $date = POSIX::strftime( "%y%m%d", localtime ); >+ substr( $s008, 0, 6, $date ); >+ $record->field('008')->update($s008); >+ } elsif ( C4::Context->preference('marcflavour') eq 'UNIMARC' && $record->subfield( '100', 'a' ) ) { >+ my $s100a = $record->subfield( '100', 'a' ); >+ my $date = POSIX::strftime( "%Y%m%d", localtime ); >+ substr( $s100a, 0, 8, $date ); >+ $record->field('100')->update( a => $s100a ); >+ } > } > > if ( $changed_authtype ) { >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index a340c6ebbf..fdcabeae66 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -606,6 +606,19 @@ if ( $record && $op eq 'duplicate' && > my @control_num = $record->field('001'); > $record->delete_fields(@control_num); > } >+if ( $record && $op eq 'duplicate' ) { >+ if ( C4::Context->preference('marcflavour') eq 'MARC21' && $record->field('008') ) { >+ my $s008 = $record->field('008')->data; >+ my $date = POSIX::strftime( "%y%m%d", localtime ); >+ substr( $s008, 0, 6, $date ); >+ $record->field('008')->update($s008); >+ } elsif ( C4::Context->preference('marcflavour') eq 'UNIMARC' && $record->subfield( '100', 'a' ) ) { >+ my $s100a = $record->subfield( '100', 'a' ); >+ my $date = POSIX::strftime( "%Y%m%d", localtime ); >+ substr( $s100a, 0, 8, $date ); >+ $record->field('100')->update( a => $s100a ); >+ } >+} > #populate hostfield if hostbiblionumber is available > if ($hostbiblionumber) { > my $marcflavour = C4::Context->preference("marcflavour"); >-- >2.30.2
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 36552
:
164556
|
164687
| 164800 |
164801
|
164802