Bugzilla – Attachment 178120 Details for
Bug 39095
Clicking 'Cancel' for article requests in the OPAC patron account does not respond
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39095: Fix problems with article request deletion
Bug-39095-Fix-problems-with-article-request-deleti.patch (text/plain), 4.91 KB, created by
David Nind
on 2025-02-14 20:42:12 UTC
(
hide
)
Description:
Bug 39095: Fix problems with article request deletion
Filename:
MIME Type:
Creator:
David Nind
Created:
2025-02-14 20:42:12 UTC
Size:
4.91 KB
patch
obsolete
>From e47caa19c3446daf52c6ffc03b6ce009a8a1a38d Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 12 Feb 2025 19:50:26 +0000 >Subject: [PATCH] Bug 39095: Fix problems with article request deletion > >This patch fixes a number of issues with article request deletion in the >OPAC: > - Cancel button should work when initially hidden by DataTables' > responsive behavior. > - Table row hiding upon deletion should work when DataTables' > responsive behavior has created a secondary row to display the hidden > columns. >- Tab and table caption article count should correctly update when a > request is canceled. > >To test, apply the patch and enable ArticleRequests if necessary. If >enabling ArticleRequests for the first time you may need to update your >circulation rules to allow article requests on some patrons or item >types. > >- Log in to the OPAC and place several article requests. >- Go to your user summary page and open the article requests tab. >- Narrow your browser window until at least the last column is hidden by > DataTables. >- Click the "+" button to show the hidden details, which should include > the cancel button. >- Click the cancel button. After confirming the deletion the original > row should be hidden along with the row shown by DataTables. >- The article request count in the article requests tab should now be > updated to reflect the new number of requests. >- The same should be true of the article requests table heading. > >Sponsored-by: Athens County Public Libraries >Signed-off-by: David Nind <david@davidnind.com> >--- > .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index 438878a6f1..42c49a2403 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -942,7 +942,7 @@ > > <tbody> > [% FOREACH ar IN current_article_requests %] >- <tr> >+ <tr id="article_[% ar.id | html %]"> > <td class="article-request-record-title"> > [% INCLUDE 'biblio-title.inc' biblio=ar.biblio link=> 1 %] > [% ar.item.enumchron | html %] >@@ -1095,7 +1095,7 @@ > [% IF ( opac_user_article_requests ) %] > $("#opac-user-views a[href='#opac-user-article-requests_panel']").tab("show"); > [% END %] >- $('#opac-user-article-requests caption .count').html(AR_CAPTION_COUNT.format('[% current_article_requests.size | html %]')); >+ $('#article-requests-table caption .count').html(AR_CAPTION_COUNT.format('[% current_article_requests.size | html %]')); > > $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs"); > >@@ -1123,7 +1123,7 @@ > ); > }); > >- $(".btn-delete-article-request").on("click", function(e){ >+ $("#article-requests-table").on("click", ".btn-delete-article-request", function(e){ > e.preventDefault(); > var article_request = $(this).data("title"); > var article_request_id = $(this).data("article-request_id"); >@@ -1134,16 +1134,18 @@ > type: "DELETE", > url: '/api/v1/public/patrons/'+borrowernumber+'/article_requests/'+article_request_id+'?cancellation_reason=OPAC', > success: function( data ) { >- row.parents('tr').hide({ >+ $("#article_" + article_request_id ).hide({ > duration: 'slow', > complete: function() { >- var ar_tab = $('a[href="#opac-user-article-requests"'); >+ $(this).siblings(".child").hide(); >+ var ar_tab = $('a[href="#opac-user-article-requests_panel"'); > var ar_table = $('#article-requests-table'); > var ar_length = $('tbody tr:visible', ar_table).length; > var ar_count = $('caption .count', ar_table); > > ar_tab.html(ar_tab.html().replace(/\(\d+\)/, '('+ar_length+')')); > ar_count.html(AR_CAPTION_COUNT.format(ar_length)); >+ > } > }); > } >-- >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 39095
:
178102
|
178120
|
178133