Bug 24565: Add patron profile to ILL list pages
authorAndrew Isherwood <andrew.isherwood@ptfs-europe.com>
Mon, 3 Feb 2020 11:14:50 +0000 (11:14 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 11 Mar 2020 13:41:13 +0000 (13:41 +0000)
We need the API call to get ILL requests on the patron profile page,
this commit allows this.

Test plan:
- Do not apply the patch.
- Go to the "Ill requests history" page for a patron who has made ILL
  requests
- TEST: Observe that no requests are displayed
- Apply the patch
- Refresh the page
- TEST: Observe that requests are displayed
- Go to the main "ILL requests" page
- TEST: Observe that requests are displayed

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js

index 5e23d7b..1365174 100644 (file)
@@ -363,8 +363,16 @@ $(document).ready(function() {
     // Get our data from the API and process it prior to passing
     // it to datatables
     var filterParam = prefilters ? '&' + prefilters : '';
-    // Only fire the request if we're on the ILL list page
-    if (window.location.search.length == 0) {
+    // Only fire the request if we're on an appropriate page
+    if (
+        (
+            // ILL list requests page
+            window.location.href.match(/ill\/ill-requests\.pl/) &&
+            window.location.search.length == 0
+        ) ||
+        // Patron profile page
+        window.location.href.match(/members\/ill-requests\.pl/)
+    ) {
         var ajax = $.ajax(
             '/api/v1/illrequests?embed=metadata,patron,capabilities,library,status_alias,comments,requested_partners'
             + filterParam