Bugzilla – Attachment 168215 Details for
Bug 37205
Printing patron cards causes error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37205: Fix printing patron cards from the patron lists page
Bug-37205-Fix-printing-patron-cards-from-the-patro.patch (text/plain), 4.30 KB, created by
Eric Garcia
on 2024-06-27 19:43:02 UTC
(
hide
)
Description:
Bug 37205: Fix printing patron cards from the patron lists page
Filename:
MIME Type:
Creator:
Eric Garcia
Created:
2024-06-27 19:43:02 UTC
Size:
4.30 KB
patch
obsolete
>From 96f3c36136d773e2678b753ee358cbd4ff1c16f3 Mon Sep 17 00:00:00 2001 >From: Sam Lau <samalau@gmail.com> >Date: Wed, 26 Jun 2024 22:33:19 +0000 >Subject: [PATCH] Bug 37205: Fix printing patron cards from the patron lists > page > >This patch allows for the printing of patron cards from the patron lists page. Previously when attempting to do this, some errors show up, saying : "Programming error - op 'cud-export' must not start with 'cud-' for GET ...". To fix this issue, rather than send this info as a GET request, we can send it as a POST request to print.pl and extract the correct html code. > >To test: >1) Go to Tools -> Patron lists >2) Create a new patron list >3) Populate with patrons >4) Go back to Tools -> Patron lists >5) Find your list, click on 'Action' and select 'Print patron cards', then select "Export" >6) Notice infinite load as well as error in dev tools >7) Apply patch >8) Go back to your patron list and attempt to print patron cards again. >9) When you select "Export" this time, it should load properly giving you a pdf of the patron cards like requested. > >Signed-off-by: Eric Garcia <cubingguy714@gmail.com> >--- > .../prog/en/modules/patron_lists/lists.tt | 34 +++++++++++++------ > 1 file changed, 23 insertions(+), 11 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt >index 29fd544762..4d03a3c4f7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt >@@ -118,15 +118,15 @@ > <!-- Modal to print patron cards --> > <div class="modal" id="patronExportModal" tabindex="-1" role="dialog" aria-labelledby="patronExportModal_label" aria-hidden="true"> > <div class="modal-dialog"> >- <div class="modal-content"> >- <div class="modal-header"> >- <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> >- <h3 id="patronExportModal_label">Print patron cards</h3> >- </div> >- <div class="modal-body"> >- <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div> >- </div> >- </div> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> >+ <h3 id="patronExportModal_label">Print patron cards</h3> >+ </div> >+ <div class="modal-body"> >+ <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div> >+ </div> >+ </div> > </div> > </div> > >@@ -203,11 +203,23 @@ > > patronExportModal.on("submit", "#exportingf", function(e){ > e.preventDefault(); >- modal_body = patronExportModalBody; >+ var modal_body = patronExportModalBody; > modal_body.html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); > target_url = $(this).attr("action"); > params = $( this ).serialize(); >- $("#patronExportModal .modal-body").load( target_url + "?" + params + " #export_patron_list"); >+ $.ajax({ >+ url: target_url, >+ type: "POST", >+ data: params, >+ success: function(response) { >+ // Extract and load the #export_patron_list part of the response into the modal body >+ var html = $(response).find("#export_patron_list").html(); >+ modal_body.html(html); >+ }, >+ error: function() { >+ modal_body.html("<div class='error'>An error occurred while processing the request.</div>"); >+ } >+ }); > }); > > patronExportModal.on("click",".closebtn,.gb-close",function(e){ >-- >2.30.2
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 37205
:
168184
| 168215