Bug 36552: Update record 'date entered on file' when duplicating a record
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> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
c6641ef24f
commit
dd8f9e1266
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in New Issue