Bug 38842

Summary: Refactor modal logic in returns.tt / returns.pl
Product: Koha Reporter: Emily Lamancusa (emlam) <emily.lamancusa>
Component: TemplatesAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 38588, 38789, 38793    
Bug Blocks:    

Description Emily Lamancusa (emlam) 2025-01-07 17:21:49 UTC
The logic for displaying modals on the checkin page is badly in need of refactoring. There are 10 separate modals coded in returns.tt, plus an additional 2 modal include files. There is also at least one parameter (found) that is duplicated for completely different meanings in different contexts, and several other similar-sounding parameters in different contexts whose meaning is no longer clear without code tracing how the value was assigned.

All of this leads to a lot of code duplication and error-prone code, and makes it very confusing to follow the template/controller logic when developing or debugging. We should refactor down to one modal with clear logic for filling in its contents.

See also comments on bug 38588