Some libraries would like to be able to provide custom information to a patron, while still using traditional slips - we should be able to add custom slips for printing form a patron's account
Created attachment 146750 [details] [review] Bug 32986: Add patron_slip module to letters and allow printing on members account This patch adds a new module to letters 'patron_slip' / Patrons toolbar (slip) This also combines some of the slip printing JS to make things more direct To test: 1 - Apply patch 2 - Confirm you can print slip, summary, quickslip, and checkin slip when viewing a patron's account 3 - Enable DisplayClearScreenButton syspref, and test that it works with both values 4 - Go to Tools->Notices and slips 5 - Define a new notice in the 'Patron toolbar (slip)' module 6 - Enter content like below in the 'Print' transport: Patron has [% borrower.holds.count %] holds List of holds: [% FOREACH hold IN borrower.holds %] =============================== Reserve id: [% hold.reserve_id %] Title [% hold.biblio.title %] [% END %] 7 - Go to patron scree 8 - Note new option under 'Print' 9 - Print the new slip and confirm it works (try with and without placing holds for patron
I cleared a merge error to get this to apply. I'm not sure if the issues I ran into were due to me not clearing the error properly or if they're inherent to the patch. In my testing, with the patch applied, the checkin slip always gives an error of "no template defined" and the clear screen and print buttons aren't in the right place after enabling DisplayClearScreenButton.
Created attachment 148267 [details] [review] Bug 32986: Add patron_slip module to letters and allow printing on members account This patch adds a new module to letters 'patron_slip' / Patrons toolbar (slip) This also combines some of the slip printing JS to make things more direct To test: 1 - Apply patch 2 - Confirm you can print slip, summary, quickslip, and checkin slip when viewing a patron's account 3 - Enable DisplayClearScreenButton syspref, and test that it works with both values 4 - Go to Tools->Notices and slips 5 - Define a new notice in the 'Patron toolbar (slip)' module 6 - Enter content like below in the 'Print' transport: Patron has [% borrower.holds.count %] holds List of holds: [% FOREACH hold IN borrower.holds %] =============================== Reserve id: [% hold.reserve_id %] Title [% hold.biblio.title %] [% END %] 7 - Go to patron scree 8 - Note new option under 'Print' 9 - Print the new slip and confirm it works (try with and without placing holds for patron
(In reply to Andrew Fuerste-Henry from comment #2) > I cleared a merge error to get this to apply. I'm not sure if the issues I > ran into were due to me not clearing the error properly or if they're > inherent to the patch. In my testing, with the patch applied, the checkin > slip always gives an error of "no template defined" and the clear screen and > print buttons aren't in the right place after enabling > DisplayClearScreenButton. Thanks for clearing the merge error! These things are both still true. The Checkin slip always says "No template defined" and the printer icon for DisplayClearScreenButton has jumped to the left side of the checkout box.
Created attachment 148361 [details] [review] Bug 32986: (follow-up) Restore styling for print button To test: Apply yarn build COnfirm display of printer icon is restored
Created attachment 148374 [details] [review] Bug 32986: Add patron_slip module to letters and allow printing on members account This patch adds a new module to letters 'patron_slip' / Patrons toolbar (slip) This also combines some of the slip printing JS to make things more direct To test: 1 - Apply patch 2 - restart_all 3 - yarn build 4 - Confirm you can print slip, summary, quickslip, and checkin slip when viewing a patron's account 5 - Enable DisplayClearScreenButton syspref, and test that it works with both values 6 - Go to Tools->Notices and slips 7 - Define a new notice in the 'Patron toolbar (slip)' module 8 - Enter content like below in the 'Print' transport: Patron has [% borrower.holds.count %] holds List of holds: [% FOREACH hold IN borrower.holds %] =============================== Reserve id: [% hold.reserve_id %] Title [% hold.biblio.title %] [% END %] 9 - Go to patron scree 10 - Note new option under 'Print' 11 - Print the new slip and confirm it works (try with and without placing holds for patron
Created attachment 148376 [details] [review] Bug 32986: Add patron_slip module to letters and allow printing on members account This patch adds a new module to letters 'patron_slip' / Patrons toolbar (slip) This also combines some of the slip printing JS to make things more direct To test: 1 - Apply patch 2 - restart_all 3 - yarn build 4 - Confirm you can print slip, summary, quickslip, and checkin slip when viewing a patron's account 5 - Enable DisplayClearScreenButton syspref, and test that it works with both values 6 - Go to Tools->Notices and slips 7 - Define a new notice in the 'Patron toolbar (slip)' module 8 - Enter content like below in the 'Print' transport: Patron has [% borrower.holds.count %] holds List of holds: [% FOREACH hold IN borrower.holds %] =============================== Reserve id: [% hold.reserve_id %] Title [% hold.biblio.title %] [% END %] 9 - Go to patron scree 10 - Note new option under 'Print' 11 - Print the new slip and confirm it works (try with and without placing holds for patron Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Starting here: 1) QA test tools: Ohoh! FAIL Koha/Template/Plugin/Notices.pm FAIL pod coverage POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666 OK koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss FAIL koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc FAIL filters missing_filter at line 36 ( <li><a class="printslip" data-code="[% notice.code %]" href="#">Print [% notice.name %] slip</a></li>) missing_filter at line 36 ( <li><a class="printslip" data-code="[% notice.code %]" href="#">Print [% notice.name %] slip</a></li>) FAIL forbidden patterns forbidden pattern: tab char (line 35) forbidden pattern: tab char (line 37) OK koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt FAIL koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt FAIL forbidden patterns forbidden pattern: tab char (line 236) OK koha-tmpl/intranet-tmpl/prog/js/members-menu.js FAIL members/printslip.pl FAIL forbidden patterns forbidden pattern: tab char (line 101) forbidden pattern: tab char (line 102) forbidden pattern: tab char (line 103) forbidden pattern: tab char (line 104) forbidden pattern: tab char (line 105) forbidden pattern: tab char (line 106) Not finished with testing yet, but follow-ups welcome :)
Created attachment 149506 [details] [review] Bug 32986: Add patron_slip module to letters and allow printing on members account This patch adds a new module to letters 'patron_slip' / Patrons toolbar (slip) This also combines some of the slip printing JS to make things more direct To test: 1 - Apply patch 2 - restart_all 3 - yarn build 4 - Confirm you can print slip, summary, quickslip, and checkin slip when viewing a patron's account 5 - Enable DisplayClearScreenButton syspref, and test that it works with both values 6 - Go to Tools->Notices and slips 7 - Define a new notice in the 'Patron toolbar (slip)' module 8 - Enter content like below in the 'Print' transport: Patron has [% borrower.holds.count %] holds List of holds: [% FOREACH hold IN borrower.holds %] =============================== Reserve id: [% hold.reserve_id %] Title [% hold.biblio.title %] [% END %] 9 - Go to patron scree 10 - Note new option under 'Print' 11 - Print the new slip and confirm it works (try with and without placing holds for patron Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Created attachment 149507 [details] [review] Bug 32986: (QA follow-up) Fix QA script complaints: tabs and TT filters * Perltidied the section with tabs in printslip.pl * Fixed indentation and tabs in letter.tt * Added missing TT filters to members-toolbar.inc
Still not finished here, but I have fixed the QA script complaints :)
Not sure whats going on, but clicking these Print buttons or options does actually do totally nothing..
(In reply to Marcel de Rooy from comment #12) > Not sure whats going on, but clicking these Print buttons or options does > actually do totally nothing.. All working for me, ensure you hard refresh the browser so that the JS reloads - I saw your issue before I did that
Applying: Bug 32986: (QA follow-up) Fix QA script complaints: tabs and TT filters error: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc). error: could not build fake ancestor
Created attachment 153479 [details] [review] Bug 32986: Add patron_slip module to letters and allow printing on members account This patch adds a new module to letters 'patron_slip' / Patrons toolbar (slip) This also combines some of the slip printing JS to make things more direct To test: 1 - Apply patch 2 - restart_all 3 - yarn build 4 - Confirm you can print slip, summary, quickslip, and checkin slip when viewing a patron's account 5 - Enable DisplayClearScreenButton syspref, and test that it works with both values 6 - Go to Tools->Notices and slips 7 - Define a new notice in the 'Patron toolbar (slip)' module 8 - Enter content like below in the 'Print' transport: Patron has [% borrower.holds.count %] holds List of holds: [% FOREACH hold IN borrower.holds %] =============================== Reserve id: [% hold.reserve_id %] Title [% hold.biblio.title %] [% END %] 9 - Go to patron scree 10 - Note new option under 'Print' 11 - Print the new slip and confirm it works (try with and without placing holds for patron Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Created attachment 153480 [details] [review] Bug 32986: (QA follow-up) Fix QA script complaints: tabs and TT filters * Perltidied the section with tabs in printslip.pl * Fixed indentation and tabs in letter.tt * Added missing TT filters to members-toolbar.inc
Created attachment 153481 [details] [review] Bug 32986: (follow-up) Tidy conditional in letter.pl
Created attachment 153482 [details] [review] Bug 32986: (follow-up) POD
1. 25 use C4::Koha; 26 use C4::Context; in Koha/Template/Plugin/Notices.pm, there are not needed. 2. - [% CASE 'members' %]<span>Patrons</span> + [% CASE 'members' %]<span>Patrons</span> + [% CASE 'patron_slip' %]<span>Patrons toolbar (slip)</span> 3. You removed printx_window but we still have: koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt: return printx_window( '[% CircAutoPrintQuickSlip | html %]' ); 4. Not blocker - changes in tools/letter.pl were not needed. I can follow-up later this week but cannot right now.
*** Bug 23041 has been marked as a duplicate of this bug. ***
*** Bug 21920 has been marked as a duplicate of this bug. ***
Created attachment 156800 [details] [review] Bug 32986: (follow-up) Fix CircAutoPrintQuickSlip and remove unecessary module usage
(In reply to Jonathan Druart from comment #19) > 1. > 25 use C4::Koha; > 26 use C4::Context; > > in Koha/Template/Plugin/Notices.pm, there are not needed. Fixed > > 2. > - [% CASE 'members' > %]<span>Patrons</span> > + [% CASE 'members' > %]<span>Patrons</span> > + [% CASE 'patron_slip' > %]<span>Patrons toolbar (slip)</span> > Already tidied in the patchset > 3. You removed printx_window but we still have: > > koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt: > return printx_window( '[% CircAutoPrintQuickSlip | html %]' ); Fixed > > 4. Not blocker - changes in tools/letter.pl were not needed. I add a condition in the first patch - tidied the whole block for consistency > I can follow-up later this week but cannot right now. Thanks for looking!
Created attachment 158399 [details] [review] Bug 32986: Add patron_slip module to letters and allow printing on members account This patch adds a new module to letters 'patron_slip' / Patrons toolbar (slip) This also combines some of the slip printing JS to make things more direct To test: 1 - Apply patch 2 - restart_all 3 - yarn build 4 - Confirm you can print slip, summary, quickslip, and checkin slip when viewing a patron's account 5 - Enable DisplayClearScreenButton syspref, and test that it works with both values 6 - Go to Tools->Notices and slips 7 - Define a new notice in the 'Patron toolbar (slip)' module 8 - Enter content like below in the 'Print' transport: Patron has [% borrower.holds.count %] holds List of holds: [% FOREACH hold IN borrower.holds %] =============================== Reserve id: [% hold.reserve_id %] Title [% hold.biblio.title %] [% END %] 9 - Go to patron scree 10 - Note new option under 'Print' 11 - Print the new slip and confirm it works (try with and without placing holds for patron Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 158400 [details] [review] Bug 32986: (QA follow-up) Fix QA script complaints: tabs and TT filters * Perltidied the section with tabs in printslip.pl * Fixed indentation and tabs in letter.tt * Added missing TT filters to members-toolbar.inc Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 158401 [details] [review] Bug 32986: (follow-up) Tidy conditional in letter.pl Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 158402 [details] [review] Bug 32986: (follow-up) POD Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 158403 [details] [review] Bug 32986: (follow-up) Fix CircAutoPrintQuickSlip and remove unecessary module usage Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 158404 [details] [review] Bug 32986: (QA follow-up) Rename notices module This renames the notices and slips module from Patrons toolbar (slip) to Patrons (custom slip) Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 158405 [details] [review] Bug 32986: (QA follow-up) Remove 'slip' from print dialog This makes it more flexible and the slip can be added to the notice name easily. For example: In German the slip would usually be part of the word, not separate: Gebührenquittung (slip = quittung) Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
I think this would make a great addition and is low risk, but: we need some unit tests for the new module. I am setting the keyword and adding my sign-off lines - please hurry.
Created attachment 158523 [details] [review] Bug 32986: (follow-up) Unit tests
Pushed to master for 23.11. Nice work everyone, thanks!
Enhancement not pushed to 23.05.x
This is a very cool feature! Thanks everyone.