Bug 7547

Summary: Printing a sorted cart
Product: Koha Reporter: Nicole C. Engard <nengard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Josef Moravec <josef.moravec>
Severity: enhancement    
Priority: P5 - low CC: barton, jonathan.druart, josef.moravec, marjorie.barry-vila, martin.renvoize, nick, patrick.robitaille
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Medium patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 21145, 25274    
Attachments: Cart, sorted by "Items" then printed using the browser's "Print" option (Control-P)
Same cart, sorted identically, but printed using the koha print button.
Bug 7547: printing a sorted cart
Bug 7547: printing a sorted cart
Bug 7547: printing a sorted cart
Bug 7547: (QA follow-up) Make button background transparent for consistency
Bug 7547: printing a sorted cart
Bug 7547: (QA follow-up) Make button background transparent for consistency
Bug 7547: (RM follow-up) Compiled css

Description Nicole C. Engard 2012-02-15 20:26:21 UTC
It would be nice if in the OPAC cart you could sort the contents before printing (and print the sorted contents).

Even if someone tries to sort results by call number before putting them into
the cart, the cart is often the product of multiple searches so the patron ends
up with a mixed-up list of call numbers.
Comment 1 Barton Chittenden 2014-08-19 21:06:23 UTC
I had one of our partners report this as an issue today.
Comment 2 Barton Chittenden 2014-08-19 21:10:43 UTC
Created attachment 31000 [details]
Cart, sorted by "Items" then printed using the browser's "Print" option (Control-P)
Comment 3 Barton Chittenden 2014-08-19 21:12:28 UTC
Created attachment 31001 [details]
Same cart, sorted identically, but printed using the koha print button.
Comment 4 Barton Chittenden 2014-08-19 21:15:52 UTC
Note that the issue occurs in both OPAC and Staff Client.
Comment 5 Patrick Robitaille 2018-04-27 19:25:14 UTC
Hi, 

I wonder if someone is working on the problem. It still persists in version 17.05 of Koha.

Thanks, Patrick.
Comment 6 Katrin Fischer 2018-04-29 22:14:56 UTC
Updating to be a bug.
Comment 7 Owen Leonard 2018-06-21 18:13:24 UTC Comment hidden (obsolete)
Comment 8 Katrin Fischer 2018-06-25 06:39:00 UTC
This seems to work well, but I want to check the other changed pages still. 

Something I notices on the printout is that the printing runs into the footers/headers in Firefox and there is only very little to no margin on the left and right. Not sure if we can do something about this, seems similar with the existing print feature.
Comment 9 Katrin Fischer 2018-06-25 20:18:54 UTC Comment hidden (obsolete)
Comment 10 Josef Moravec 2018-06-27 13:20:35 UTC Comment hidden (obsolete)
Comment 11 Josef Moravec 2018-06-27 13:20:40 UTC Comment hidden (obsolete)
Comment 12 Nick Clemens (kidclamp) 2018-07-02 11:58:05 UTC
Created attachment 76623 [details] [review]
Bug 7547: printing a sorted cart

This patch adds a DataTables-generated print button to the OPAC cart. To
make that process easier, the DataTables plugin has been upgraded to the
latest version (1.10.18) with the Buttons plugin included.

Changes to the OPAC LESS file style the DataTables button to look like
the static version.

Other templates in the OPAC which use the DataTables plugin have been
modified to use up-to-date option names.

To test, apply the patch and add several titles to the cart.

 - Open the cart
 - Re-sort the cart using something other than the default sort
 - Click the 'Print' button.
   - A print view should open in a separate window, sorted correctly,
     and automatically show the print dialog.
 - Click the cart's 'More details' button and click the print button.
   - This should trigger the print dialog directly.

 - Test DataTables sorting on other modified pages:
    - Bibliographic detail page (holdings table)
    - Course reserves (table of courses)
      - Course details (table of titles)
    - Full subscription history
      - Detail page for a subscription -> More details -> Full history
    - Most popular
    - Purchase suggestions
    - Self checkouts
    - Tag cloud
    - Your fines
    - Your interlibrary loan requests
    - Your reading history
    - Your search history
    - Your search IDREF for ppn (I don't know how to test this)

The DataTables plugin is removed from "Your routing lists" and Self
check-in because it is unused.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 13 Nick Clemens (kidclamp) 2018-07-02 11:58:08 UTC
Created attachment 76624 [details] [review]
Bug 7547: (QA follow-up) Make button background transparent for consistency

Test plan:
Add some records to cart in opac and show the cart, look at the print button/link
--> without patch it has darker background than other buttons
--> with this patch it has the same background

Note: tested wir firefox 45, firefox 60 and chromium 66

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 14 Nick Clemens (kidclamp) 2018-07-02 11:58:12 UTC
Created attachment 76625 [details] [review]
Bug 7547: (RM follow-up) Compiled css
Comment 15 Nick Clemens (kidclamp) 2018-07-02 13:16:17 UTC
Awesome work all!

Pushed to master for 18.11
Comment 16 Martin Renvoize (ashimema) 2018-07-02 17:11:35 UTC
Enhancement, not porting to 18.05.x series.
Comment 17 Jonathan Druart 2018-08-01 19:53:02 UTC
Since these patches the "Column visibility" button is displayed at the OPAC: https://screenshots.firefox.com/OEOzq6a0aEozv8rU/catalogue.kohadev.org

It should not.
Comment 18 Josef Moravec 2018-08-02 06:49:41 UTC
(In reply to Jonathan Druart from comment #17)
> Since these patches the "Column visibility" button is displayed at the OPAC:
> https://screenshots.firefox.com/OEOzq6a0aEozv8rU/catalogue.kohadev.org
> 
> It should not.

True, I filled a new Bug 21145 for this