From 153eb9f50e4b6cacdc0a0c5f399e555ceaf98bd8 Mon Sep 17 00:00:00 2001 From: Laura_Escamilla Date: Tue, 17 Mar 2026 18:40:38 +0000 Subject: [PATCH] Revert "Bug 40995: Use patron_to_html in patron autocomplete" This reverts commit 775cc4c9803bd994492ed1f3b681facf328a0133. Signed-off-by: Laura Escamilla --- .../intranet-tmpl/prog/js/staff-global.js | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index b2394c6db7..29a1f3b064 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -764,6 +764,11 @@ function patron_autocomplete(node, options) { item.link = null; } + var cardnumber = ""; + if (item.cardnumber != "") { + // Display card number in parentheses if it exists + cardnumber = " (" + item.cardnumber + ") "; + } if (item.library_id == loggedInLibrary) { loggedInClass = "ac-currentlibrary"; } else { @@ -775,7 +780,20 @@ function patron_autocomplete(node, options) { .append( "" + (item.link ? '' : "") + - $patron_to_html(item, { display_cardnumber: true }) + + (item.surname ? item.surname.escapeHtml() : "") + + ", " + + (item.preferred_name + ? item.preferred_name.escapeHtml() + : item.firstname + ? item.firstname.escapeHtml() + : "") + + " " + + (item.middle_name ? item.middle_name.escapeHtml() : "") + + " " + + (item.other_name + ? "(" + item.other_name.escapeHtml() + ")" + : "") + + cardnumber.escapeHtml() + " " + (item.date_of_birth ? $date(item.date_of_birth) +