Bug 19743

Summary: Header and Footer should be updated on each item for checkin / checkout / renewal notices
Product: Koha Reporter: Nick Clemens <nick>
Component: NoticesAssignee: Kyle M Hall <kyle>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: katrin.fischer, martin.renvoize, nick, terauhina.jackson
Version: MainKeywords: Academy
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 19743 - Header and Footer should be updated on each item for checkin / checkout / renewal notices
Bug 19743 - Unit Tests
Bug 19743 - Header and Footer should be updated on each item for checkin / checkout / renewal notices
Bug 19743 - Unit Tests
Bug 19743 - Header and Footer should be updated on each item for checkin / checkout / renewal notices
Bug 19743 - Unit Tests
Bug 19743: Update header and footer on each item for checkin / checkout / renewal notices
Bug 19743: Unit Tests

Description Nick Clemens 2017-12-04 16:08:51 UTC
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.
Comment 1 Kyle M Hall 2017-12-04 16:24:26 UTC
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
Comment 2 Kyle M Hall 2017-12-04 17:56:41 UTC
Created attachment 69484 [details] [review]
Bug 19743 - Unit Tests
Comment 3 Te Rauhina Jackson 2018-01-16 02:05:16 UTC
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>
Comment 4 Te Rauhina Jackson 2018-01-16 02:05:19 UTC
Created attachment 70534 [details] [review]
Bug 19743 - Unit Tests

Signed-off-by: Te Rauhina Jackson <terauhina.jackson@gmail.com>
Comment 5 Katrin Fischer 2018-03-25 19:06:18 UTC
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)
Comment 6 Kyle M Hall 2018-07-25 11:41:41 UTC
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>
Comment 7 Kyle M Hall 2018-07-25 11:41:55 UTC
Created attachment 77253 [details] [review]
Bug 19743 - Unit Tests

Signed-off-by: Te Rauhina Jackson <terauhina.jackson@gmail.com>
Comment 8 Jonathan Druart 2018-07-31 20:12:47 UTC
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>
Comment 9 Jonathan Druart 2018-07-31 20:12:51 UTC
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>
Comment 10 Nick Clemens 2018-08-14 12:54:21 UTC
Awesome work all!

Pushed to master for 18.11
Comment 11 Martin Renvoize 2018-08-16 10:35:09 UTC
Enhancement, won't be backported to 18.05.x series.