[Koha-bugs] [Bug 30055] Rewrite some of the patron searches to make them use the REST API routes

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Mar 29 15:42:57 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30055

--- Comment #61 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 132419
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132419&action=edit
Bug 30055: Make patron searches use the REST API

This patch will rewrite some of our patron searches to make them use the
REST API routes (and so the powerful the DataTables wrapper which will
bring all the nice DT feature to filter, sort, etc.)

The patron searches we will take into account here are those that we use
to select a patron in a pop-up:
 * Guarantor
 * Suggestion's manager
 * Patron's card
 * Serial routing list
 * Users to notify when order is received
 * Manager of an acquisition basket
 * Owner and users of a fund

Regarding permissions there are two main problematics:
 * Filter a patron set by patrons having a
specific subpermissions (in case of adding a manager to a suggestion or
when we deal with acquisition and funds). We added a new
Koha::Patrons->filter_by_have_subpermission method that will take in
parameter a subpermission. To make thing transparent for the callers we
are adding new routes, like /suggestions/managers to list the possible
managers of suggestions.
 * Restrict/allow access to the default patron searches /patrons
We need to access it when a logged in patron does not have borrowers
permission.
Ideally we need a separate "search_borrowers" subpermissions but it's
considered outside the scope of this change.

For each patch you will take care of testing the different permissions
that are into effect (either for the logged in patron or the patrons
returned by the search).

The tables should contain the same columns as prior to this patch,
except for "categories" and "library". We have the filter on top of the
page and so we need to add them to the table as new columns if they
weren't there before.

Test plan (for this patch):
Search for guarantor and select

Test plan (for all patches):
Add/Select patrons from the correct place where you can search for
patrons, play extensively with the filters/pagination/etc

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list