Bug 38428

Summary: Simplify listing of items on stock rotation page
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: ToolsAssignee: Nick Clemens (kidclamp) <nick>
Status: RESOLVED FIXED QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: normal    
Priority: P5 - low CC: lucas, martin.renvoize
Version: MainKeywords: rel_24_05_candidate
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:
Attachments: Bug 38428: Use links for stock rotation action buttons
Bug 38428: Use links for stock rotation action buttons
Bug 38428: (QA follow-up) Squash QA script warning

Description Nick Clemens (kidclamp) 2024-11-12 18:32:27 UTC
The action buttons on the stock rotation items list are all currently forms, so there is a certain amount of repetition in the html, we also fetch the transfer for the item twice.
Comment 1 Nick Clemens (kidclamp) 2024-11-12 18:38:09 UTC
Created attachment 174436 [details] [review]
Bug 38428: Use links for stock rotation action buttons

This patch converts the action buttons on the stock rotation rota
manage items page to be links to avoid repeating form values (CSRF tokens, etc)

It moves the confirmation for removal from a rota to be a confirm and not a full page reload.

It also moves the fetch of a transfer into a shared variable.

Lastly, there is some chomping added to remove extra whitespace.

To test:
1 - Enable SotckRotation
2 - Create a rota
3 - Add some stages
4 - Add items to the rota
5 - Test the buttons to advance stage, add 'in demand' and remove
6 - Apply patch
7 - Confirm all buttons continue to function
8 - Sign off
Comment 2 Martin Renvoize (ashimema) 2024-11-13 08:16:35 UTC
Created attachment 174447 [details] [review]
Bug 38428: Use links for stock rotation action buttons

This patch converts the action buttons on the stock rotation rota
manage items page to be links to avoid repeating form values (CSRF tokens, etc)

It moves the confirmation for removal from a rota to be a confirm and not a full page reload.

It also moves the fetch of a transfer into a shared variable.

Lastly, there is some chomping added to remove extra whitespace.

To test:
1 - Enable SotckRotation
2 - Create a rota
3 - Add some stages
4 - Add items to the rota
5 - Test the buttons to advance stage, add 'in demand' and remove
6 - Apply patch
7 - Confirm all buttons continue to function
8 - Sign off

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize (ashimema) 2024-11-13 08:16:37 UTC
Created attachment 174448 [details] [review]
Bug 38428: (QA follow-up) Squash QA script warning

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize (ashimema) 2024-11-13 08:17:57 UTC
Wow.. thanks for this Nick.. of course prior to the CSRF stuff most of these were already just simple links.

This is quit an improvement and I'd go so far as to say it's an important regression fix.

Passing QA straight.. it's a simple change that works seamlessly.
Comment 5 Katrin Fischer 2024-11-18 16:16:09 UTC
Nice one:
 1 file changed, 38 insertions(+), 67 deletions(-)
Comment 6 Katrin Fischer 2024-11-18 16:46:04 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 7 Lucas Gass (lukeg) 2024-12-05 23:10:05 UTC
Needs rebase for 24.05.x, no backport. Rebase if needed.