Bug 16778 - Use Bootstrap modal for card printing on patron lists page
Summary: Use Bootstrap modal for card printing on patron lists page
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL: /cgi-bin/koha/patron_lists/lists.pl
Keywords:
Depends on: 16602
Blocks: 8290
  Show dependency treegraph
 
Reported: 2016-06-20 13:56 UTC by Owen Leonard
Modified: 2017-12-07 22:16 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 8290 - Replace usage of Greybox modals with Bootstrap modals (7.12 KB, patch)
2016-06-20 14:03 UTC, Owen Leonard
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 16778: Replace usage of Greybox modals with Bootstrap modals (7.12 KB, patch)
2016-06-20 17:06 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 16778: Replace usage of Greybox modals with Bootstrap modals (7.16 KB, patch)
2016-06-24 17:49 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2016-06-20 13:56:11 UTC
In patron lists, one of the options for each list is "Print patron cards." This operation takes place in a Greybox modal. This can be replaced with a Bootstrap modal.
Comment 1 Owen Leonard 2016-06-20 14:03:08 UTC Comment hidden (obsolete)
Comment 2 Héctor Eduardo Castro Avalos 2016-06-20 17:06:43 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2016-06-21 13:00:29 UTC
Comment on attachment 52613 [details] [review]
[SIGNED-OFF]Bug 16778: Replace usage of Greybox modals with Bootstrap modals

Review of attachment 52613 [details] [review]:
-----------------------------------------------------------------

::: koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt
@@ +31,5 @@
> +            patronExportModal.modal("show");
> +        });
> +
> +        patronExportModal.on("hidden", function(){
> +            patronExportModalBody.html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");

Is this really useful?
Comment 4 Owen Leonard 2016-06-21 13:30:10 UTC
(In reply to Jonathan Druart from comment #3)

> Is this really useful?

It is useful if you happen to trigger more than one instance of the modal during one session. Triggering the modal populates the contents with certain data. The next time the modal is triggered, there may be a delay between when it is displayed and when the new information is loaded.

Populating the modal body with the "loading" indicator when the modal is closed means that when it is triggered again the user sees "loading" instead of data from the last operation.
Comment 5 Kyle M Hall 2016-06-24 17:49:25 UTC
Created attachment 52855 [details] [review]
Bug 16778: Replace usage of Greybox modals with Bootstrap modals

This patch is a proof-of-concept for replacing Greybox modals in
situations where in-modal page transitions happen. This one addresses
patron card export from the patron lists page.

To test you must have at least one patron lists containing patrons.

- Apply the patch and go to Patrons -> Patron lists.
- In the 'Actions' menu associated with your list, choose 'Print patron
  cards.' A modal window should be triggered.
- In the modal window, change settings as necessary and click the
  "Export" button.
- The modal should reload and display a link to download a PDF. Confirm
  that the PDF download works correctly and that the correct patron
  batch was processed.
- Repeat the process and confirm at each step that clicking the 'X'
  button or the 'Cancel' link dismisses the modal window.

To confirm that changes to the patron card print template has not
adversely affected printing patron cards from the patron card creator
page:

- Go to Tools -> Patron card creator.
- Choose Manage -> Card batches.
- Click 'Export' for any batch.
- Confirm that the Greybox modal still works correctly for patron card
  export.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Kyle M Hall 2016-07-08 14:42:24 UTC
Pushed to master for 16.11, thanks Owen!
Comment 7 Frédéric Demians 2016-08-01 13:35:36 UTC
Pushed in 16.05. Will be in 16.05.02.