Bugzilla – Attachment 179103 Details for
Bug 38993
Merge fetch files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38993: Restore add patrons to list
Bug-38993-Restore-add-patrons-to-list.patch (text/plain), 4.62 KB, created by
Jonathan Druart
on 2025-03-10 12:05:39 UTC
(
hide
)
Description:
Bug 38993: Restore add patrons to list
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-03-10 12:05:39 UTC
Size:
4.62 KB
patch
obsolete
>From 871cb63e2eaa2448d5102882ea848734f142b890 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 30 Jan 2025 10:06:18 +0100 >Subject: [PATCH] Bug 38993: Restore add patrons to list > >Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> >--- > .../prog/en/modules/members/member.tt | 2 +- > .../intranet-tmpl/prog/js/fetch/api-client.js | 2 ++ > .../prog/js/fetch/patron-api-client.js | 4 +-- > .../prog/js/fetch/patron-list-api-client.js | 29 +++++++++++++++++++ > 4 files changed, 34 insertions(+), 3 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/js/fetch/patron-list-api-client.js > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >index 8b22763c7df..318f56a6885 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >@@ -309,7 +309,7 @@ > function patronListAdd() { > var borrowernumbers = JSON.parse(localStorage.getItem("patron_search_selections")) || []; > if (borrowernumbers.length > 0) { >- const client = APIClient.patron; >+ const client = APIClient.patron_list; > client.lists.add_patrons({ patron_ids: borrowernumbers, new_list_name: $("#new_patron_list").val(), list_id: $("#add_to_patron_list").val() }).then( > success => { > $("#patron_list_dialog").show(); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/fetch/api-client.js b/koha-tmpl/intranet-tmpl/prog/js/fetch/api-client.js >index d10a1f32de3..2d623b6f9bd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/fetch/api-client.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/fetch/api-client.js >@@ -8,6 +8,7 @@ import ClubAPIClient from "./club-api-client.js"; > import CoverImageAPIClient from "./cover-image-api-client.js"; > import LocalizationAPIClient from "./localization-api-client.js"; > import PatronAPIClient from "./patron-api-client.js"; >+import PatronListAPIClient from "./patron-list-api-client.js"; > import RecallAPIClient from "./recall-api-client.js"; > import SysprefAPIClient from "./system-preferences-api-client.js"; > import TicketAPIClient from "./ticket-api-client.js"; >@@ -21,6 +22,7 @@ export const APIClient = { > cover_image: new CoverImageAPIClient(HttpClient), > localization: new LocalizationAPIClient(HttpClient), > patron: new PatronAPIClient(HttpClient), >+ patron_list: new PatronListAPIClient(HttpClient), > recall: new RecallAPIClient(HttpClient), > sysprefs: new SysprefAPIClient(HttpClient), > ticket: new TicketAPIClient(HttpClient), >diff --git a/koha-tmpl/intranet-tmpl/prog/js/fetch/patron-api-client.js b/koha-tmpl/intranet-tmpl/prog/js/fetch/patron-api-client.js >index 835952242b3..2ec8b8c2600 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/fetch/patron-api-client.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/fetch/patron-api-client.js >@@ -1,7 +1,7 @@ > export class PatronAPIClient { > constructor(HttpClient) { > this.httpClient = new HttpClient({ >- baseURL: "/api/v1/", >+ baseURL: "/api/v1/patrons/", > }); > } > >@@ -9,7 +9,7 @@ export class PatronAPIClient { > return { > get: id => > this.httpClient.get({ >- endpoint: "patrons/" + id, >+ endpoint: id, > }), > }; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/js/fetch/patron-list-api-client.js b/koha-tmpl/intranet-tmpl/prog/js/fetch/patron-list-api-client.js >new file mode 100644 >index 00000000000..bf8a4528594 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/js/fetch/patron-list-api-client.js >@@ -0,0 +1,29 @@ >+export class PatronAPIClient { >+ constructor(HttpClient) { >+ this.httpClient = new HttpClient({ >+ baseURL: "/cgi-bin/koha/svc/", >+ }); >+ } >+ >+ get lists() { >+ return { >+ add_patrons: ({ patron_ids, list_id, new_list_name }) => >+ this.httpClient.post({ >+ endpoint: "members/add_to_list", >+ body: "add_to_patron_list=%s&new_patron_list=%s&%s".format( >+ list_id, >+ new_list_name, >+ patron_ids >+ .map(id => "borrowernumber=%s".format(id)) >+ .join("&") >+ ), >+ headers: { >+ "Content-Type": >+ "application/x-www-form-urlencoded;charset=utf-8", >+ }, >+ }), >+ }; >+ } >+} >+ >+export default PatronAPIClient; >-- >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 38993
:
177316
|
177317
|
177318
|
177337
|
177338
|
177339
|
177342
|
177343
|
177344
|
177345
|
177346
|
177347
|
177348
|
179100
|
179101
|
179102
|
179103
|
179106
|
179107
|
179108
|
179109
|
179513
|
179550