From 5bf5706f11fddb8dd84741f623f0abf3498aa03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20Rodr=C3=ADguez?= Date: Thu, 30 Nov 2023 15:12:13 +0100 Subject: [PATCH] Fix - Bug 35452 - Provide more info when using Link authorities automatically Test plan 1 Edit a record and add several 7xx and 6xx 2 Click on Link authorities automatically and check that the result only shows the field numbers 3 Apply patch, restart services 4 Click on Link authorities automatically and check that the result shows the field numbers and the info of the entry --- C4/Biblio.pm | 20 +++++++++---------- .../prog/en/modules/cataloguing/addbiblio.tt | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index ab895b2575..289588eaee 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -657,7 +657,7 @@ sub LinkBibHeadingsToAuthorities { if ( defined $current_link && (!$allowrelink || !C4::Context->preference('LinkerRelink')) ) { $results{'linked'}->{ $heading->display_form() }++; - push(@{$results{'details'}}, { tag => $field->tag(), authid => $current_link, status => 'UNCHANGED'}) if $verbose; + push(@{$results{'details'}}, { tag => $field->tag(), authid => $current_link, status => 'UNCHANGED', data => $heading->display_form()}) if $verbose; next; } @@ -666,14 +666,14 @@ sub LinkBibHeadingsToAuthorities { $results{ $fuzzy ? 'fuzzy' : 'linked' } ->{ $heading->display_form() }++; if(defined $current_link and $current_link == $authid) { - push(@{$results{'details'}}, { tag => $field->tag(), authid => $current_link, status => 'UNCHANGED'}) if $verbose; + push(@{$results{'details'}}, { tag => $field->tag(), authid => $current_link, status => 'UNCHANGED', data => $heading->display_form()}) if $verbose; next; } $field->delete_subfield( code => '9' ) if defined $current_link; $field->add_subfields( '9', $authid ); $num_headings_changed++; - push(@{$results{'details'}}, { tag => $field->tag(), authid => $authid, status => 'LOCAL_FOUND'}) if $verbose; + push(@{$results{'details'}}, { tag => $field->tag(), authid => $authid, status => 'LOCAL_FOUND', data => $heading->display_form()}) if $verbose; } else { my $authority_type = Koha::Authority::Types->find( $heading->auth_type() ); @@ -681,14 +681,14 @@ sub LinkBibHeadingsToAuthorities { && (!$allowrelink || C4::Context->preference('LinkerKeepStale')) ) { $results{'fuzzy'}->{ $heading->display_form() }++; - push(@{$results{'details'}}, { tag => $field->tag(), authid => $current_link, status => 'UNCHANGED'}) if $verbose; + push(@{$results{'details'}}, { tag => $field->tag(), authid => $current_link, status => 'UNCHANGED', data => $heading->display_form()}) if $verbose; } elsif ( C4::Context->preference('AutoCreateAuthorities') ) { if ( _check_valid_auth_link( $current_link, $field ) ) { $results{'linked'}->{ $heading->display_form() }++; } elsif ( $match_count > 1 ) { $results{'unlinked'}->{ $heading->display_form() }++; - push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'MULTIPLE_MATCH', auth_type => $heading->auth_type(), tag_to_report => $authority_type->auth_tag_to_report}) if $verbose; + push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'MULTIPLE_MATCH', auth_type => $heading->auth_type(), tag_to_report => $authority_type->auth_tag_to_report, data => $heading->display_form() }) if $verbose; } elsif ( !$match_count ) { my $authority_type = Koha::Authority::Types->find( $heading->auth_type() ); my $marcrecordauth = MARC::Record->new(); @@ -759,28 +759,28 @@ sub LinkBibHeadingsToAuthorities { $num_headings_changed++; $linker->update_cache($heading, $authid); $results{'added'}->{ $heading->display_form() }++; - push(@{$results{'details'}}, { tag => $field->tag(), authid => $authid, status => 'CREATED'}) if $verbose; + push(@{$results{'details'}}, { tag => $field->tag(), authid => $authid, status => 'CREATED', data => $heading->display_form()}) if $verbose; } } elsif ( defined $current_link ) { if ( _check_valid_auth_link( $current_link, $field ) ) { $results{'linked'}->{ $heading->display_form() }++; - push(@{$results{'details'}}, { tag => $field->tag(), authid => $authid, status => 'UNCHANGED'}) if $verbose; + push(@{$results{'details'}}, { tag => $field->tag(), authid => $authid, status => 'UNCHANGED', data => $heading->display_form()}) if $verbose; } else { $field->delete_subfield( code => '9' ); $num_headings_changed++; $results{'unlinked'}->{ $heading->display_form() }++; - push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'NONE_FOUND', auth_type => $heading->auth_type(), tag_to_report => $authority_type->auth_tag_to_report}) if $verbose; + push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'NONE_FOUND', auth_type => $heading->auth_type(), tag_to_report => $authority_type->auth_tag_to_report, data => $heading->display_form()}) if $verbose; } } elsif ( $match_count > 1 ) { $results{'unlinked'}->{ $heading->display_form() }++; - push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'MULTIPLE_MATCH', auth_type => $heading->auth_type(), tag_to_report => $authority_type->auth_tag_to_report}) if $verbose; + push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'MULTIPLE_MATCH', auth_type => $heading->auth_type(), tag_to_report => $authority_type->auth_tag_to_report, data => $heading->display_form() }) if $verbose; } else { $results{'unlinked'}->{ $heading->display_form() }++; - push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'NONE_FOUND', auth_type => $heading->auth_type(), tag_to_report => $authority_type->auth_tag_to_report}) if $verbose; + push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'NONE_FOUND', auth_type => $heading->auth_type(), tag_to_report => $authority_type->auth_tag_to_report, data => $heading->display_form()}) if $verbose; } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index 68cb3126ce..56a0eb8a30 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -391,7 +391,7 @@ function updateHeadingLinks(links) { tag_subfield_line.append(image); // Add the message to the dialog - message_dialog_ul.append('
  • ' + heading.tag + ' - ' + message + '
  • '); + message_dialog_ul.append('
  • ' + heading.tag + ' - ' + heading.data + ' - ' + message + '
  • '); // Add a link to create a new authority if none was found if(heading.status == 'NONE_FOUND' && tag_subfield_line.find('i').length == 1) { -- 2.30.2