Bugzilla – Attachment 187841 Details for
Bug 32176
Correctly display patrons when selected after autocomplete (was js/patron-autocomplete.js need another option)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32176: Fix punctuation in patron search
Bug-32176-Fix-punctuation-in-patron-search.patch (text/plain), 2.60 KB, created by
Jonathan Druart
on 2025-10-13 13:58:43 UTC
(
hide
)
Description:
Bug 32176: Fix punctuation in patron search
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-10-13 13:58:43 UTC
Size:
2.60 KB
patch
obsolete
>From 1fba9a8eda65ebbfd1c7c376ed983842214e8938 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 13 Oct 2025 15:56:00 +0200 >Subject: [PATCH] Bug 32176: Fix punctuation in patron search > >--- > .../intranet-tmpl/prog/js/patron-format.js | 25 +++++++++++++------ > 1 file changed, 18 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/patron-format.js b/koha-tmpl/intranet-tmpl/prog/js/patron-format.js >index 30fd12826ca..10223b07472 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/patron-format.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/patron-format.js >@@ -19,7 +19,6 @@ > "</span>"; > } > >- var name; > var firstname = escape_str(patron.firstname); > var preferred_name = escape_str(patron.preferred_name); > var surname = escape_str(patron.surname); >@@ -33,11 +32,23 @@ > firstname += " (" + escape_str(patron.other_name) + ")"; > preferred_name += " (" + escape_str(patron.other_name) + ")"; > } >- if (config && config.invert_name) { >- name = surname + (preferred_name ? ", " + preferred_name : ""); >+ >+ const nameParts = []; >+ if (config?.invert_name) { >+ // Invert: "Surname, Preferred" >+ if (surname) nameParts.push(surname); >+ if (preferred_name) >+ nameParts.push( >+ surname ? ", " + preferred_name : preferred_name >+ ); >+ name = nameParts.join(""); > } else { >- name = preferred_name + " " + surname; >+ // Normal: "Preferred Surname" >+ if (preferred_name) nameParts.push(preferred_name); >+ if (surname) nameParts.push(surname); >+ name = nameParts.join(" "); > } >+ > if (name.replace(" ", "").length == 0) { > if (patron.library) { > return _("A patron from %s").format(patron.library.name); >@@ -46,11 +57,11 @@ > } > } > >- if (config && config.hide_patron_name) { >+ if (config?.hide_patron_name) { > name = ""; > } > >- if (config && config.display_cardnumber) { >+ if (config?.display_cardnumber) { > if (name.length > 0) { > name = name + " (" + escape_str(patron.cardnumber) + ")"; > } else { >@@ -58,7 +69,7 @@ > } > } > >- if (config && config.url) { >+ if (config?.url) { > if (config.url === "circulation_reserves") { > name = > '<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=' + >-- >2.34.1
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 32176
:
187477
|
187478
|
187479
|
187728
|
187729
|
187730
| 187841 |
187842