Bug 26388

Summary: Renew all and Renew selected buttons should account for items that can't be renewed
Product: Koha Reporter: Nick Clemens <nick>
Component: OPACAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: normal    
Priority: P5 - low CC: aleisha, lucas, martin.renvoize, victor
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25758
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.04, 19.11.10
Attachments: Bug 26388: Do not show 'Renew all' or 'Renew selected' if no renewable items
Bug 26388: Do not show 'Renew all' or 'Renew selected' if no renewable items
Bug 26388: Do not show 'Renew all' or 'Renew selected' if no renewable items
Bug 26388: Do not show 'Renew all' or 'Renew selected' if no renewable items

Description Nick Clemens 2020-09-04 13:18:34 UTC
comment 33 on bug 25758 points out that on the opac you can see renewal options that don't match the status
Comment 1 Nick Clemens 2020-09-04 13:25:34 UTC
Created attachment 109661 [details] [review]
Bug 26388: Do not show 'Renew all' or 'Renew selected' if no renewable items

Additionally, only include renewable items in 'Renew all'

To test:
1 - Check out some items to a patron, ideally:
    Some not renewable because set for auto renewal
    Some not renewable because of holds
    Some renewable
 2 - Confirm 'Renew selected' and 'Renew all' show on the opac
 3 - Click 'Renew all'
 4 - You get errors about the non-renewable items?
 5 - Check in all renewable items
 6 - Confirm you still see renew buttons
 7 - Apply patch
 8 - Refresh and you shoudl not see renew buttons
 9 - Check out a renewable item
10 - Click 'Renew all'
11 - Renewable item is renewed with no error
12 - Try again with 'Renew selected'
13 - Confirm it works as expected
Comment 2 Andrew Fuerste-Henry 2020-09-04 13:38:23 UTC
Created attachment 109662 [details] [review]
Bug 26388: Do not show 'Renew all' or 'Renew selected' if no renewable items

Additionally, only include renewable items in 'Renew all'

To test:
1 - Check out some items to a patron, ideally:
    Some not renewable because set for auto renewal
    Some not renewable because of holds
    Some renewable
 2 - Confirm 'Renew selected' and 'Renew all' show on the opac
 3 - Click 'Renew all'
 4 - You get errors about the non-renewable items?
 5 - Check in all renewable items
 6 - Confirm you still see renew buttons
 7 - Apply patch
 8 - Refresh and you shoudl not see renew buttons
 9 - Check out a renewable item
10 - Click 'Renew all'
11 - Renewable item is renewed with no error
12 - Try again with 'Renew selected'
13 - Confirm it works as expected

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 3 Owen Leonard 2020-09-04 18:26:18 UTC
Created attachment 109682 [details] [review]
Bug 26388: Do not show 'Renew all' or 'Renew selected' if no renewable items

Additionally, only include renewable items in 'Renew all'

To test:
1 - Check out some items to a patron, ideally:
    Some not renewable because set for auto renewal
    Some not renewable because of holds
    Some renewable
 2 - Confirm 'Renew selected' and 'Renew all' show on the opac
 3 - Click 'Renew all'
 4 - You get errors about the non-renewable items?
 5 - Check in all renewable items
 6 - Confirm you still see renew buttons
 7 - Apply patch
 8 - Refresh and you shoudl not see renew buttons
 9 - Check out a renewable item
10 - Click 'Renew all'
11 - Renewable item is renewed with no error
12 - Try again with 'Renew selected'
13 - Confirm it works as expected

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 4 Martin Renvoize 2020-09-07 15:00:24 UTC
Created attachment 109709 [details] [review]
Bug 26388: Do not show 'Renew all' or 'Renew selected' if no renewable items

Additionally, only include renewable items in 'Renew all'

To test:
1 - Check out some items to a patron, ideally:
    Some not renewable because set for auto renewal
    Some not renewable because of holds
    Some renewable
 2 - Confirm 'Renew selected' and 'Renew all' show on the opac
 3 - Click 'Renew all'
 4 - You get errors about the non-renewable items?
 5 - Check in all renewable items
 6 - Confirm you still see renew buttons
 7 - Apply patch
 8 - Refresh and you shoudl not see renew buttons
 9 - Check out a renewable item
10 - Click 'Renew all'
11 - Renewable item is renewed with no error
12 - Try again with 'Renew selected'
13 - Confirm it works as expected

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2020-09-07 15:04:52 UTC
Works as expected, QA scripts pass, code is legible.

Passing QA
Comment 6 Jonathan Druart 2020-09-09 13:40:47 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 7 Lucas Gass 2020-09-14 22:23:16 UTC
backported to 20.05.x for 20.05.04
Comment 8 Aleisha Amohia 2020-09-15 11:54:30 UTC
backported to 19.11.x for 19.11.10
Comment 9 Victor Grousset/tuxayo 2020-09-20 19:26:23 UTC
Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed.