Bugzilla – Attachment 189619 Details for
Bug 41249
ILL batches should be compatible with AutoILLBackendPriority
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41249: Preparation Move confirmauto logic to earlier in controller
Bug-41249-Preparation-Move-confirmauto-logic-to-ea.patch (text/plain), 3.65 KB, created by
Pedro Amorim
on 2025-11-14 16:32:58 UTC
(
hide
)
Description:
Bug 41249: Preparation Move confirmauto logic to earlier in controller
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-11-14 16:32:58 UTC
Size:
3.65 KB
patch
obsolete
>From ccf6b7bd1c96f99ddb352c48e141ba6d5358b5a3 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Thu, 13 Nov 2025 14:14:33 +0000 >Subject: [PATCH] Bug 41249: Preparation Move confirmauto logic to earlier in > controller > >This is in order to be able to have a have_batch_auto_backends_json which contains all backends that are compatible with both: >A) AutoILLBackendPriority sys pref and >B) ILL batches >--- > ill/ill-requests.pl | 23 ++++++++++++++----- > .../prog/en/modules/ill/ill-requests.tt | 5 ++++ > 2 files changed, 22 insertions(+), 6 deletions(-) > >diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl >index dec7439dec2..6897a216627 100755 >--- a/ill/ill-requests.pl >+++ b/ill/ill-requests.pl >@@ -66,14 +66,15 @@ my ( $template, $patronnumber, $cookie ) = get_template_and_user( > ); > > # Are we able to actually work? >-my $cfg = Koha::ILL::Request::Config->new; >-my $backends = $cfg->available_backends; >-my $has_branch = $cfg->has_branch; >-my $backends_available = ( scalar @{$backends} > 0 ); >+my $cfg = Koha::ILL::Request::Config->new; >+my $backends = $cfg->available_backends; >+my $has_branch = $cfg->has_branch; >+my $backends_available = ( scalar @{$backends} > 0 ); >+my $have_batch_backends = have_batch_backends($backends); > $template->param( > backends_available => $backends_available, > has_branch => $has_branch, >- have_batch => have_batch_backends($backends) >+ have_batch => $have_batch_backends > ); > > if ( grep( /FreeForm/, @{$backends} ) ) { >@@ -97,6 +98,17 @@ if ($backends_available) { > $template->param( batch_availability_services => encode_json($batch_availability_services) ); > } > >+ # Establish what backends are up for batch autoILL, if enabled >+ my $confirm_auto = Koha::ILL::Request::Workflow::ConfirmAuto->new( $params, 'staff' ); >+ my @auto_backends = $confirm_auto->get_priority_backends('staff'); >+ if ( scalar @auto_backends > 0 && scalar @$have_batch_backends > 0 ) { >+ my @have_batch_auto_backends = grep { >+ my $a = $_; >+ grep { $_ eq $a->{name} } @$have_batch_backends >+ } @auto_backends; >+ $template->param( have_batch_auto_backends_json => scalar encode_json( \@have_batch_auto_backends ) ); >+ } >+ > if ( $op eq 'illview' ) { > > # View the details of an ILL >@@ -137,7 +149,6 @@ if ($backends_available) { > my $history_check = Koha::ILL::Request::Workflow::HistoryCheck->new( $params, 'staff' ); > my $availability = Koha::ILL::Request::Workflow::Availability->new( $params, 'staff' ); > my $type_disclaimer = Koha::ILL::Request::Workflow::TypeDisclaimer->new( $params, 'staff' ); >- my $confirm_auto = Koha::ILL::Request::Workflow::ConfirmAuto->new( $params, 'staff' ); > > # ILLHistoryCheck operation > if ( $history_check->show_history_check($request) ) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >index 6b82dae88df..5c41b6ab0ea 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >@@ -1145,6 +1145,11 @@ > [% ELSE %] > var auto_backends = []; > [% END %] >+ [% IF have_batch_auto_backends_json.length > 0 %] >+ var have_batch_auto_backends = [% have_batch_auto_backends_json | $raw %]; >+ [% ELSE %] >+ var have_batch_auto_backends = []; >+ [% END %] > [% IF metadata.length > 0 %] > var metadata = "[% metadata | $raw %]"; > [% END %] >-- >2.39.5
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 41249
: 189619 |
189620
|
189621
|
189622