Bugzilla – Attachment 177491 Details for
Bug 39022
Last patron is replaced by current patron on page load
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39022: Display the current previous patron list before updating stored values
Bug-39022-Display-the-current-previous-patron-list.patch (text/plain), 3.56 KB, created by
Roman Dolny
on 2025-02-03 22:18:30 UTC
(
hide
)
Description:
Bug 39022: Display the current previous patron list before updating stored values
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2025-02-03 22:18:30 UTC
Size:
3.56 KB
patch
obsolete
>From e18316afdcd0b558c977bc903883583af90c0d09 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 3 Feb 2025 19:25:24 +0000 >Subject: [PATCH] Bug 39022: Display the current previous patron list before > updating stored values > >This patch just reverses the order so we display the list, then update it. > >To test: > 1 - Enable showLastPatron system preference and set showLastPatronCount to 1 > 2 - Go to a patron, say Ronnie Ballard > 3 - Note you have a link to 'Last patron' - hover or click split dropdown and see it is the patron you are viewing > 4 - Search for another patron, Edna Acosta > 5 - Note the 'Last patron' links point to Edna, and not Ronnie > 6 - Apply patch > 7 - Reload Edna, note last patron lists Edna > 8 - Search for Ronnie > 9 - Confirm previous patron is linked to Edna >10 - Click the link to go to Edna >11 - Confirm last patron now links to Ronnie >12 - Instead of following link, click on another tab for patron >13 - Now the link is updated to current patron, this was behaviour before 21246 as well >14 - Sign off. > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > .../intranet-tmpl/prog/js/staff-global.js | 36 +++++++++---------- > 1 file changed, 18 insertions(+), 18 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index e76bf876f6..4daf327dec 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -213,6 +213,24 @@ $(document).ready(function () { > ); > } > >+ if (previous_patrons.length) { >+ let p = previous_patrons[0]; >+ $("#lastborrowerlink").show(); >+ $("#lastborrowerlink").prop("title", `${p["name"]} (${p["card"]})`); >+ $("#lastborrowerlink").prop( >+ "href", >+ `/cgi-bin/koha/circ/circulation.pl?borrowernumber=${p["borrowernumber"]}` >+ ); >+ $("#lastborrower-window").css("display", "inline-flex"); >+ >+ previous_patrons.reverse(); >+ for (i in previous_patrons) { >+ p = previous_patrons[i]; >+ const el = `<li><a class="dropdown-item" href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=${p["borrowernumber"]}">${p["name"]} (${p["card"]})</a></li>`; >+ $("#lastBorrowerList").prepend(el); >+ } >+ } >+ > if ($("#hiddenborrowernumber").val()) { > // Remove this patron from the list if they are already there > previous_patrons = previous_patrons.filter(function (p) { >@@ -234,24 +252,6 @@ $(document).ready(function () { > JSON.stringify(previous_patrons) > ); > } >- >- if (previous_patrons.length) { >- let p = previous_patrons[0]; >- $("#lastborrowerlink").show(); >- $("#lastborrowerlink").prop("title", `${p["name"]} (${p["card"]})`); >- $("#lastborrowerlink").prop( >- "href", >- `/cgi-bin/koha/circ/circulation.pl?borrowernumber=${p["borrowernumber"]}` >- ); >- $("#lastborrower-window").css("display", "inline-flex"); >- >- previous_patrons.reverse(); >- for (i in previous_patrons) { >- p = previous_patrons[i]; >- const el = `<li><a class="dropdown-item" href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=${p["borrowernumber"]}">${p["name"]} (${p["card"]})</a></li>`; >- $("#lastBorrowerList").prepend(el); >- } >- } > } > > if ($("#hiddenborrowernumber").val()) { >-- >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 39022
:
177476
|
177491
|
177639