From 58d5b5571dc6690fdd185b2f4f82b3aabcbc97af Mon Sep 17 00:00:00 2001
From: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Date: Tue, 19 Nov 2024 15:07:43 +0000
Subject: [PATCH] Bug 35604: Follow-up

Consider success message from backend and present it.
Add btn-primary class to auto ILL screen

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
---
 koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt | 2 +-
 koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js          | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

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 3de1af9c90f..6c04a44cbc8 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
@@ -964,7 +964,7 @@
                                 <input type="hidden" name="method" value="create" />
                                 <input type="hidden" name="stage" value="form">
                                 <input type="hidden" name="confirm_auto_submitted" value="1">
-                                <input type="submit" value="Confirm" />
+                                <input type="submit" class="btn btn-primary" value="Confirm" />
                                 <a class="cancel" href="ill-requests.pl">Cancel</a>
                             </fieldset>
                         </form>
diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js b/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js
index 64ecb33a56b..b06557b47fc 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js
+++ b/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js
@@ -24,7 +24,7 @@ $(document).ready(function () {
                 auto_backend.available = 0;
             },
             success: function (data) {
-                _addSuccessMessage(auto_backend.name);
+                _addSuccessMessage(auto_backend.name, data);
                 auto_backend.available = 1;
             },
             error: function (request, textstatus) {
@@ -84,11 +84,11 @@ $(document).ready(function () {
         _addBackendOption("Standard");
     }
 
-    function _addSuccessMessage(auto_backend_name) {
+    function _addSuccessMessage(auto_backend_name, data) {
         _removeVerifyingMessage(auto_backend_name);
         $(auto_ill_el + " > #backend-" + auto_backend_name).append(
             '<span class="text-success"><i class="fa-solid fa-check"></i> ' +
-                __("Available.").format(auto_backend_name) +
+                __("Available.").format(auto_backend_name) + " " + data.success +
                 "</span>"
         );
     }
-- 
2.47.1