When generating the checkout notice for a patron we only update the section in between the '---' tags For template toolkit purposes it means we cannot affect the content based on more than a single item. For instance, we want to add the total cost of all items checked out.
Created attachment 69482 [details] [review] Bug 19743 - Header and Footer should be updated on each item for checkin / checkout / renewal notices When generating the checkout notice for a patron we only update the section in between the '---' tags For template toolkit purposes it means we cannot affect the content based on more than a single item. For instance, we want to add the total cost of all items checked out. Test Plan: 1) Add "Thank you for visiting <<branches.branchname>>." to the bottom of the checkout notice. Below the second '----'. 2) Check out an item to a patron to generate that notice 3) Note the branch name in the notice 4) Update the branch name in the branches editor, change it to something else 5) Check out a 2nd item to that patron 6) Notice the items list updated, but the branch name did not 7) Apply this patch 8) Check out a 3rd item to that patron 9) Notice the branch name updated this time
Created attachment 69484 [details] [review] Bug 19743 - Unit Tests
Created attachment 70533 [details] [review] Bug 19743 - Header and Footer should be updated on each item for checkin / checkout / renewal notices When generating the checkout notice for a patron we only update the section in between the '---' tags For template toolkit purposes it means we cannot affect the content based on more than a single item. For instance, we want to add the total cost of all items checked out. Test Plan: 1) Add "Thank you for visiting <<branches.branchname>>." to the bottom of the checkout notice. Below the second '----'. 2) Check out an item to a patron to generate that notice 3) Note the branch name in the notice 4) Update the branch name in the branches editor, change it to something else 5) Check out a 2nd item to that patron 6) Notice the items list updated, but the branch name did not 7) Apply this patch 8) Check out a 3rd item to that patron 9) Notice the branch name updated this time Signed-off-by: Te Rauhina Jackson <terauhina.jackson@gmail.com>
Created attachment 70534 [details] [review] Bug 19743 - Unit Tests Signed-off-by: Te Rauhina Jackson <terauhina.jackson@gmail.com>
Patch applied, restart_all, but tests are failing for me: # Failed test 'Bug 19743 - Header and Footer should be updated on each item for checkin / checkout / renewal notices' # at t/db_dependent/Letters/TemplateToolkit.t line 611. # Looks like you planned 7 tests but ran 8. t/db_dependent/Letters/TemplateToolkit.t .. 16/18 # Looks like you failed 1 test of 8 run. # Failed test 'regression tests' # at t/db_dependent/Letters/TemplateToolkit.t line 985. # Looks like you planned 18 tests but ran 17. # Looks like you failed 1 test of 17 run. t/db_dependent/Letters/TemplateToolkit.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 2/18 subtests Test Summary Report ------------------- t/db_dependent/Letters/TemplateToolkit.t (Wstat: 256 Tests: 17 Failed: 1) Failed test: 16 Non-zero exit status: 1 Parse errors: Bad plan. You planned 18 tests but ran 17. Files=1, Tests=17, 6 wallclock secs ( 0.02 usr 0.01 sys + 4.78 cusr 0.29 csys = 5.10 CPU)
Created attachment 77252 [details] [review] Bug 19743 - Header and Footer should be updated on each item for checkin / checkout / renewal notices When generating the checkout notice for a patron we only update the section in between the '---' tags For template toolkit purposes it means we cannot affect the content based on more than a single item. For instance, we want to add the total cost of all items checked out. Test Plan: 1) Add "Thank you for visiting <<branches.branchname>>." to the bottom of the checkout notice. Below the second '----'. 2) Check out an item to a patron to generate that notice 3) Note the branch name in the notice 4) Update the branch name in the branches editor, change it to something else 5) Check out a 2nd item to that patron 6) Notice the items list updated, but the branch name did not 7) Apply this patch 8) Check out a 3rd item to that patron 9) Notice the branch name updated this time Signed-off-by: Te Rauhina Jackson <terauhina.jackson@gmail.com>
Created attachment 77253 [details] [review] Bug 19743 - Unit Tests Signed-off-by: Te Rauhina Jackson <terauhina.jackson@gmail.com>
Created attachment 77357 [details] [review] Bug 19743: Update header and footer on each item for checkin / checkout / renewal notices When generating the checkout notice for a patron we only update the section in between the '---' tags For template toolkit purposes it means we cannot affect the content based on more than a single item. For instance, we want to add the total cost of all items checked out. Test Plan: 1) Add "Thank you for visiting <<branches.branchname>>." to the bottom of the checkout notice. Below the second '----'. 2) Check out an item to a patron to generate that notice 3) Note the branch name in the notice 4) Update the branch name in the branches editor, change it to something else 5) Check out a 2nd item to that patron 6) Notice the items list updated, but the branch name did not 7) Apply this patch 8) Check out a 3rd item to that patron 9) Notice the branch name updated this time Signed-off-by: Te Rauhina Jackson <terauhina.jackson@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 77358 [details] [review] Bug 19743: Unit Tests Signed-off-by: Te Rauhina Jackson <terauhina.jackson@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Awesome work all! Pushed to master for 18.11
Enhancement, won't be backported to 18.05.x series.