Revert "Bug 40995: Use patron_to_html in patron autocomplete"

This reverts commit 775cc4c980.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
This commit is contained in:
Laura_Escamilla 2026-03-17 18:40:38 +00:00 committed by Laura Escamilla
parent 4c8bd8f561
commit 153eb9f50e
No known key found for this signature in database
GPG Key ID: 6B1D9CA1AF817BC3
1 changed files with 19 additions and 1 deletions

View File

@ -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 ? '<a href="' + item.link + '">' : "<a>") +
$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) +