Bugzilla – Attachment 184866 Details for
Bug 40552
Allow selecting all holds from a group
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40552: Preparation: Move patron page logic for reusability
Bug-40552-Preparation-Move-patron-page-logic-for-r.patch (text/plain), 2.25 KB, created by
Pedro Amorim
on 2025-07-30 11:56:08 UTC
(
hide
)
Description:
Bug 40552: Preparation: Move patron page logic for reusability
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-07-30 11:56:08 UTC
Size:
2.25 KB
patch
obsolete
>From 72883e7c8a1d4f00bf76cc7bc3b76af0b2d75881 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Wed, 30 Jul 2025 11:32:26 +0000 >Subject: [PATCH] Bug 40552: Preparation: Move patron page logic for > reusability > >--- > koha-tmpl/intranet-tmpl/prog/js/holds.js | 8 +------- > koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 15 +++++++++++++++ > 2 files changed, 16 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js >index 394e06d63d8..3c9d419b6eb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/holds.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js >@@ -107,13 +107,7 @@ function display_pickup_location(state) { > > /* global __ borrowernumber SuspendHoldsIntranet */ > $(document).ready(function () { >- var url = window.location.href; >- let patron_page; >- if (url.indexOf("/circ/circulation.pl?borrowernumber=") !== -1) >- patron_page = "circ"; >- else if (url.indexOf("/members/moremember.pl?borrowernumber=") !== -1) >- patron_page = "borrower"; >- >+ let patron_page = holds_table_patron_page(); > function suspend_hold(hold_ids, end_date) { > var params = { hold_ids: hold_ids }; > if (end_date !== null && end_date !== "") params.end_date = end_date; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index ed6f0b35f7b..2dff3328bd2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -1005,6 +1005,21 @@ function toggleBtnIcon(element, start, replacement) { > }); > } > >+/** >+ * Determines which patron page we are on based on the URL >+ * @return {string} The patron page we are on, "circ" or "borrower", or null >+ * if neither page is matched >+ */ >+function holds_table_patron_page() { >+ var url = window.location.href; >+ if (url.indexOf("/circ/circulation.pl?borrowernumber=") !== -1) >+ return "circ"; >+ else if (url.indexOf("/members/moremember.pl?borrowernumber=") !== -1) >+ return "borrower"; >+ >+ return null; >+} >+ > /** > * Returns a roughly ideal position to scroll an element into view > * @param {string} target - The HTML id of the element to scroll into view >-- >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 40552
: 184866 |
184867