Skip to content

Commit c33ee27

Browse files
committed
Add lenderLibraryName to status screen and decline reason note when request is declined
1 parent 511b1ba commit c33ee27

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

Koha/Plugin/Com/PTFSEurope/IncDocs.pm

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ use Koha::ILL::Request::Workflow;
3737
use Koha::Libraries;
3838
use Koha::Patrons;
3939

40-
our $VERSION = "1.2.2";
40+
our $VERSION = "1.2.3";
4141

4242
our $metadata = {
4343
name => 'IncDocs',
4444
author => 'PTFS-Europe',
4545
date_authored => '2024-11-18',
46-
date_updated => "2025-01-20",
46+
date_updated => "2025-01-23",
4747
minimum_version => '25.05.00.000',
4848
maximum_version => undef,
4949
version => $VERSION,
@@ -1755,6 +1755,11 @@ sub status {
17551755
};
17561756
}
17571757

1758+
my $lenderLibraryName =
1759+
$request->extended_attributes->find( { type => 'lenderLibraryName' } )
1760+
? $request->extended_attributes->find( { type => 'lenderLibraryName' } )->value
1761+
: undef;
1762+
$result->{lenderLibraryName} = $lenderLibraryName;
17581763
$result->{illrequest_id} = $request->illrequest_id;
17591764
$result->{request_status} = $request->status;
17601765

@@ -1771,8 +1776,12 @@ sub status {
17711776
$request->status('COMP');
17721777
} elsif ( $result->{status} eq 'declined' ) {
17731778
$request->status('REQREV');
1774-
$request->append_to_note(
1775-
'IncDocs library ID ' . $result->{lenderLibraryId} . ' decline reason: ' . $result->{declinedReason} );
1779+
my $note = "IncDocs library ID $result->{lenderLibraryId}";
1780+
if (defined $result->{lenderLibraryName}) {
1781+
$note .= " ($result->{lenderLibraryName})";
1782+
}
1783+
$note .= " decline reason: $result->{declinedReason}";
1784+
$request->append_to_note($note);
17761785

17771786
my $declined_lenderLibraryId_list =
17781787
$params->{request}->extended_attributes->find( { type => 'declined_lenderLibraryId_list' } );

0 commit comments

Comments
 (0)