Bugzilla – Attachment 188478 Details for
Bug 41111
AutoILLBackendPriority should consider a 'yellow' stage
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41111: Add an yellow state to ILLAutoBackendPriority
Bug-41111-Add-an-yellow-state-to-ILLAutoBackendPri.patch (text/plain), 5.16 KB, created by
Pedro Amorim
on 2025-10-27 15:45:19 UTC
(
hide
)
Description:
Bug 41111: Add an yellow state to ILLAutoBackendPriority
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-10-27 15:45:19 UTC
Size:
5.16 KB
patch
obsolete
>From 81f85c3e392e69e60c21e892e33a3a27f25632c8 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Fri, 24 Oct 2025 13:26:24 +0000 >Subject: [PATCH] Bug 41111: Add an yellow state to ILLAutoBackendPriority > >Originally, AutoILLBackendPriority only considered 2 states: green or red. This patch introduces a yellow state. >Yellow means the Staff UI can pick that backend, but Koha will only suggest that as the goto backend if no other 'green' backends exist. >If both green and yellow backends are returned, Koha will suggest the top green in priority. >OPAC will never consider 'yellow' backends. Functionality there stays the same: Pick first 'green' backend in priority or default to Standard. >--- > .../intranet-tmpl/prog/js/ill-autobackend.js | 40 ++++++++++++++++--- > .../opac-tmpl/bootstrap/js/ill-autobackend.js | 18 ++++++++- > 2 files changed, 50 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js b/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js >index 2670daf1632..445930ebe57 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js >@@ -24,8 +24,13 @@ $(document).ready(function () { > auto_backend.available = 0; > }, > success: function (data) { >- _addSuccessMessage(auto_backend.name, data); >- auto_backend.available = 1; >+ if (data.success) { >+ _addSuccessMessage(auto_backend.name, data); >+ auto_backend.available = 1; >+ } else if (data.warning) { >+ _addWarningMessage(auto_backend.name, data); >+ auto_backend.available = 0; >+ } > }, > error: function (request, textstatus) { > if (textstatus === "timeout") { >@@ -81,6 +86,20 @@ $(document).ready(function () { > _addBackendOption("Standard"); > } > >+ function _addWarningMessage(auto_backend_name, data) { >+ _removeVerifyingMessage(auto_backend_name); >+ $( >+ auto_ill_el + " > #backend-" + auto_backend_name + " #backendcol" >+ ).append( >+ '<div style="color:#8a6804;" class="text-warning mb-2"><i class="fa fa-exclamation-circle"></i> ' + >+ "<strong>" + >+ __("Warning.") + >+ "</strong><br>" + >+ data.warning + >+ "</div>" >+ ); >+ } >+ > function _addSuccessMessage(auto_backend_name, data) { > _removeVerifyingMessage(auto_backend_name); > $( >@@ -189,10 +208,19 @@ $(document).ready(function () { > "background-color": "", > border: "", > }); >- $(this).closest(".list-group-item").css({ >- "background-color": "rgba(0, 128, 0, 0.1)", >- border: "1px solid rgba(0, 128, 0, 0.7)", >- }); >+ if ($(this).parent().siblings().find(".text-success").length > 0) { >+ $(this).closest(".list-group-item").css({ >+ "background-color": "rgba(0, 128, 0, 0.1)", >+ border: "1px solid rgba(0, 128, 0, 0.7)", >+ }); >+ } else if ( >+ $(this).parent().siblings().find(".text-warning").length > 0 >+ ) { >+ $(this).closest(".list-group-item").css({ >+ "background-color": "rgba(255, 228, 0, 0.1)", >+ border: "1px solid rgba(255, 228, 0, 0.7)", >+ }); >+ } > } > ); > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/ill-autobackend.js b/koha-tmpl/opac-tmpl/bootstrap/js/ill-autobackend.js >index 7c59e3d185e..e9e7a356fd1 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/ill-autobackend.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/ill-autobackend.js >@@ -24,8 +24,13 @@ $(document).ready(function () { > auto_backend.available = 0; > }, > success: function (data) { >- _addSuccessMessage(auto_backend.name); >- auto_backend.available = 1; >+ if (data.success) { >+ _addSuccessMessage(auto_backend.name, data); >+ auto_backend.available = 1; >+ } else if (data.warning) { >+ _addWarningMessage(auto_backend.name, data); >+ auto_backend.available = 0; >+ } > }, > error: function (request, textstatus) { > if (textstatus === "timeout") { >@@ -80,6 +85,15 @@ $(document).ready(function () { > _addBackendOption("Standard"); > } > >+ function _addWarningMessage(auto_backend_name, data) { >+ _removeVerifyingMessage(auto_backend_name); >+ $(auto_ill_el + " > #backend-" + auto_backend_name).append( >+ '<span style="color:#8a6804;" class="text-warning"><i class="fa-solid fa-check"></i> ' + >+ __("Warning.").format(auto_backend_name) + >+ "</span>" >+ ); >+ } >+ > function _addSuccessMessage(auto_backend_name) { > _removeVerifyingMessage(auto_backend_name); > $(auto_ill_el + " > #backend-" + auto_backend_name).append( >-- >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 41111
:
188478
|
188520
|
188521