Bug 33247: Flag the authority pending deletion in the result list

When an authority is removed from the result list it is not removed from
the search engine yet.
This patch suggests to add a note in the summary column to tell the user
that the deletion is pending.

Test plan:
1 - Go to authorities home and perform a search;
2 - Delete any authority;
3 - After the confirmation, the page is refreshed but still contains the
deleted authority, with a red note explaining that the deletion is
pending.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-05-11 13:48:50 +02:00 committed by Tomas Cohen Arazi
parent b3c739872a
commit c58bae15ea
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
2 changed files with 5 additions and 0 deletions

View File

@ -46,6 +46,7 @@ my $authid = $query->param('authid') || '';
my ( $template, $loggedinuser, $cookie );
my $authority_types = Koha::Authority::Types->search( {}, { order_by => ['authtypetext'] } );
my $pending_deletion_authid;
if ( $op eq "delete" ) {
( $template, $loggedinuser, $cookie ) = get_template_and_user(
@ -64,6 +65,8 @@ if ( $op eq "delete" ) {
});
DelAuthority({ authid => $authid });
# FIXME No error handling here, DelAuthority needs adjustments
$pending_deletion_authid = $authid;
if ( $query->param('operator') ) {
# query contains search params so perform search
@ -238,6 +241,7 @@ my $servers = Koha::Z3950Servers->search(
$template->param(
servers => $servers,
authority_types => $authority_types,
pending_deletion_authid => $pending_deletion_authid,
op => $op,
);

View File

@ -73,6 +73,7 @@
[% ELSE %]
[% PROCESS authresult summary=resul.summary authid=resul.authid %]
[% END %]
[% IF pending_deletion_authid == resul.authid %]<span style="color: red;">Pending deletion</span>[% END %]
</td>
<td>[% resul.authtype | html %]</td>
[% UNLESS ( resul.isEDITORS ) %]