Bug 27949 - Batch printing of article request slips
Summary: Batch printing of article request slips
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Agustín Moyano
QA Contact: Nick Clemens
URL:
Keywords:
Depends on: 29086
Blocks: 29262 29110
  Show dependency treegraph
 
Reported: 2021-03-12 14:51 UTC by Nick Clemens
Modified: 2023-10-05 14:48 UTC (History)
7 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This developments adds a way to select several article requests and print slips for them in batch.
Version(s) released in:
21.11.00


Attachments
Bug 27949: Allow multiple article requests print slip (4.80 KB, patch)
2021-06-03 21:01 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 27949: Allow multiple article requests print slip (4.90 KB, patch)
2021-09-23 09:39 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 27949: Allow multiple article requests print slip (4.72 KB, patch)
2021-09-24 13:35 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 27949: Allow multiple article requests print slip (4.77 KB, patch)
2021-10-07 13:50 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 27949: (QA follow-up) Remove TODO (1.10 KB, patch)
2021-10-07 13:50 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 27949: Allow multiple article requests print slip (4.80 KB, patch)
2021-10-14 10:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 27949: Allow multiple article requests print slip (4.86 KB, patch)
2021-10-14 10:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 27949: (QA follow-up) Remove TODO (1.10 KB, patch)
2021-10-14 10:12 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2021-03-12 14:51:49 UTC
We propose allowing for staff to select multiple article requests on the screen and have Koha generate them and print in one transaction
through the browser.
Comment 1 Agustín Moyano 2021-06-03 21:01:39 UTC
Created attachment 121608 [details] [review]
Bug 27949: Allow multiple article requests print slip

This bug allows for batch printing of multiple article requests slips

To test:
1. apply this patch
2. restart_all
3. enable ArticleRequests preference
4. create multiple article requests
5. go to circ/article-requests.pl in staff interface
6. print a single slip from a row
CHECK => it works as expected
7. select all rows and print slip from general actions menu (above the table)
SUCCESS => all article requests slips are printed
8. select multiple rows (not all) and print slip from general actions menu (above the table)
SUCCESS => only selected article requests slips are printed
Comment 2 Marcel de Rooy 2021-06-18 07:28:11 UTC Comment hidden (obsolete)
Comment 3 Marcel de Rooy 2021-06-18 09:07:55 UTC
What if I would like to have these notices on a separate page?

I would be inclined to look for a solution with NoticeCSS and a page-break-after. Should this development respect NoticeCSS ?

Please have a look at:
Koha/Patron/Discharge.pm, sub generate_as_pdf
misc/cronjobs/gather_print_notices.pl, sub generate_html
Both are using: koha-tmpl/intranet-tmpl/prog/en/modules/batch/print-notices.tt
Comment 4 Agustín Moyano 2021-08-30 14:49:50 UTC
Hi Marcel, sorry for the delay. For what I've seen, printslip.tt uses SlipCSS stylesheet (if defined) where you may say, for example

hr {
    display: none;
    page-break-after: always;
}
Comment 5 Marcel de Rooy 2021-08-31 11:32:10 UTC
(In reply to Agustín Moyano from comment #4)
> Hi Marcel, sorry for the delay. For what I've seen, printslip.tt uses
> SlipCSS stylesheet (if defined) where you may say, for example
> 
> hr {
>     display: none;
>     page-break-after: always;
> }

Did you test this yourself?

I already did some testing with page-break-after but couldnt get it to work. I now inserted the exact lines above in a stylesheet for SlipCSS but it does not work either.
Comment 6 Marcel de Rooy 2021-09-17 09:30:54 UTC
The issue raised on comment3 (tomorrow exactly three months ago) is imo legitimate, but has not been answered sufficiently.
Changing status to emphasize the need for feedback in all appreciation.
Comment 7 Agustín Moyano 2021-09-17 13:53:30 UTC
(In reply to Marcel de Rooy from comment #5)
> (In reply to Agustín Moyano from comment #4)
> > Hi Marcel, sorry for the delay. For what I've seen, printslip.tt uses
> > SlipCSS stylesheet (if defined) where you may say, for example
> > 
> > hr {
> >     display: none;
> >     page-break-after: always;
> > }
> 
> Did you test this yourself?
> 
> I already did some testing with page-break-after but couldnt get it to work.
> I now inserted the exact lines above in a stylesheet for SlipCSS but it does
> not work either.

Hi Marcel, I did not test it, but my point was that printslip.tt includes a css, just as print-notices.tt where you can define page breaking conditions.

Let me play around a bit, and I'll post a working example
Comment 8 Agustín Moyano 2021-09-17 15:13:06 UTC
Hi Marcel, the following code worked for me

hr {
    page-break-after: always;
    border: 0px solid black !important;
}

First times did not work, but I believe it was browser's cache or memcached

Could you try again, please?
Comment 9 Marcel de Rooy 2021-09-23 09:33:14 UTC
(In reply to Agustín Moyano from comment #8)
> Hi Marcel, the following code worked for me
> 
> hr {
>     page-break-after: always;
>     border: 0px solid black !important;
> }
> 
> First times did not work, but I believe it was browser's cache or memcached
> 
> Could you try again, please?

It works for me now. Not sure what changed. Anyway, thanks!
Comment 10 Marcel de Rooy 2021-09-23 09:39:12 UTC
Created attachment 125183 [details] [review]
Bug 27949: Allow multiple article requests print slip

This bug allows for batch printing of multiple article requests slips

To test:
1. apply this patch
2. restart_all
3. enable ArticleRequests preference
4. create multiple article requests
5. go to circ/article-requests.pl in staff interface
6. print a single slip from a row
CHECK => it works as expected
7. select all rows and print slip from general actions menu (above the table)
SUCCESS => all article requests slips are printed
8. select multiple rows (not all) and print slip from general actions menu (above the table)
SUCCESS => only selected article requests slips are printed

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 11 Tomás Cohen Arazi 2021-09-24 13:30:11 UTC
Adding a dependency to organize things. It doesn't apply.
Comment 12 Tomás Cohen Arazi 2021-09-24 13:35:23 UTC
Created attachment 125248 [details] [review]
Bug 27949: Allow multiple article requests print slip

This bug allows for batch printing of multiple article requests slips

To test:
1. apply this patch
2. restart_all
3. enable ArticleRequests preference
4. create multiple article requests
5. go to circ/article-requests.pl in staff interface
6. print a single slip from a row
CHECK => it works as expected
7. select all rows and print slip from general actions menu (above the table)
SUCCESS => all article requests slips are printed
8. select multiple rows (not all) and print slip from general actions menu (above the table)
SUCCESS => only selected article requests slips are printed

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 13 Nick Clemens 2021-10-07 13:50:06 UTC
Created attachment 125882 [details] [review]
Bug 27949: Allow multiple article requests print slip

This bug allows for batch printing of multiple article requests slips

To test:
1. apply this patch
2. restart_all
3. enable ArticleRequests preference
4. create multiple article requests
5. go to circ/article-requests.pl in staff interface
6. print a single slip from a row
CHECK => it works as expected
7. select all rows and print slip from general actions menu (above the table)
SUCCESS => all article requests slips are printed
8. select multiple rows (not all) and print slip from general actions menu (above the table)
SUCCESS => only selected article requests slips are printed

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 14 Nick Clemens 2021-10-07 13:50:10 UTC
Created attachment 125883 [details] [review]
Bug 27949: (QA follow-up) Remove TODO

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 15 Jonathan Druart 2021-10-14 10:09:29 UTC
+        $slipContent .= "<hr/>";

+    $slipContent .= $slip->{is_html}?$slip->{content}:'<pre>'.$slip->{content}.'</pre>';

This is arbitrary, not configurable, and add html code in controller. That smells.

I don't have a good suggestion right now however.
Comment 16 Jonathan Druart 2021-10-14 10:10:02 UTC
Created attachment 126263 [details] [review]
Bug 27949: Allow multiple article requests print slip

This bug allows for batch printing of multiple article requests slips

To test:
1. apply this patch
2. restart_all
3. enable ArticleRequests preference
4. create multiple article requests
5. go to circ/article-requests.pl in staff interface
6. print a single slip from a row
CHECK => it works as expected
7. select all rows and print slip from general actions menu (above the table)
SUCCESS => all article requests slips are printed
8. select multiple rows (not all) and print slip from general actions menu (above the table)
SUCCESS => only selected article requests slips are printed

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

JD amended patch: Perltidy!
Comment 17 Jonathan Druart 2021-10-14 10:11:08 UTC
Created attachment 126264 [details] [review]
Bug 27949: Allow multiple article requests print slip

This bug allows for batch printing of multiple article requests slips

To test:
1. apply this patch
2. restart_all
3. enable ArticleRequests preference
4. create multiple article requests
5. go to circ/article-requests.pl in staff interface
6. print a single slip from a row
CHECK => it works as expected
7. select all rows and print slip from general actions menu (above the table)
SUCCESS => all article requests slips are printed
8. select multiple rows (not all) and print slip from general actions menu (above the table)
SUCCESS => only selected article requests slips are printed

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

JD amended patch: Perltidy!
Comment 18 Jonathan Druart 2021-10-14 10:12:06 UTC
Created attachment 126265 [details] [review]
Bug 27949: (QA follow-up) Remove TODO

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 19 Jonathan Druart 2021-10-18 09:33:44 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 20 Jonathan Druart 2021-10-18 09:40:14 UTC
(In reply to Jonathan Druart from comment #15)
> +        $slipContent .= "<hr/>";
> 
> +    $slipContent .=
> $slip->{is_html}?$slip->{content}:'<pre>'.$slip->{content}.'</pre>';
> 
> This is arbitrary, not configurable, and add html code in controller. That
> smells.
> 
> I don't have a good suggestion right now however.

Do we open a follow-up bug report for that?
Comment 21 Marcel de Rooy 2021-10-18 09:47:29 UTC
(In reply to Jonathan Druart from comment #20)
> (In reply to Jonathan Druart from comment #15)
> > +        $slipContent .= "<hr/>";
> > 
> > +    $slipContent .=
> > $slip->{is_html}?$slip->{content}:'<pre>'.$slip->{content}.'</pre>';
> > 
> > This is arbitrary, not configurable, and add html code in controller. That
> > smells.
> > 
> > I don't have a good suggestion right now however.
> 
> Do we open a follow-up bug report for that?

How about the title of bug 29262 ?