Bug 40958

Summary: Move patron_to_html (from js-patron-format.inc) to a standalone JS file
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: Pushed to main --- QA Contact: Nick Clemens (kidclamp) <nick>
Severity: enhancement    
Priority: P5 - low CC: andrew, cj.lynce, nick
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00
Circulation function:
Bug Depends on: 40699, 41003    
Bug Blocks: 32176    
Attachments: Bug 40958: Move patron_to_html to a standalone JS file
Bug 40958: Move patron_to_html to a standalone JS file
Bug 40958: Remove remaining occurrence in course_reserves/course.tt
Bug 40958: Move patron_to_html to a standalone JS file
Bug 40958: Remove remaining occurrence in course_reserves/course.tt
Bug 40958: (follow-up) Fix QA complaint about forbidden pattern

Description Jonathan Druart 2025-10-06 13:45:13 UTC
We have to explicitly include the TT js-patron-format.inc in all the .tt files we are going to format a patron.

It's also hard to use from JS files, which is a bit ridiculous.
Comment 1 Jonathan Druart 2025-10-06 13:48:08 UTC
Created attachment 187476 [details] [review]
Bug 40958: Move patron_to_html to a standalone JS file

It will be easier to reuse patron_to_html

Test plan:
Search for patron and confirm that that patron are formatted correctly.
Global patron search and a couple of other places should be enough.
Comment 2 Andrew Fuerste-Henry 2025-10-07 15:31:29 UTC
Created attachment 187533 [details] [review]
Bug 40958: Move patron_to_html to a standalone JS file

It will be easier to reuse patron_to_html

Test plan:
Search for patron and confirm that that patron are formatted correctly.
Global patron search and a couple of other places should be enough.

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Comment 3 Jonathan Druart 2025-10-09 09:08:13 UTC
Created attachment 187646 [details] [review]
Bug 40958: Remove remaining occurrence in course_reserves/course.tt

From bug 40699
Comment 4 Nick Clemens (kidclamp) 2025-10-31 10:49:50 UTC
Created attachment 188800 [details] [review]
Bug 40958: Move patron_to_html to a standalone JS file

It will be easier to reuse patron_to_html

Test plan:
Search for patron and confirm that that patron are formatted correctly.
Global patron search and a couple of other places should be enough.

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Nick Clemens (kidclamp) 2025-10-31 10:49:52 UTC
Created attachment 188801 [details] [review]
Bug 40958: Remove remaining occurrence in course_reserves/course.tt

From bug 40699

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Nick Clemens (kidclamp) 2025-10-31 10:50:14 UTC
Ignoring this:
[FAIL] koha-tmpl/intranet-tmpl/prog/js/patron-format.js
   FAIL	  forbidden_patterns
		forbidden pattern: Use __("") instead of _("") (line 43)
		forbidden pattern: Use __("") instead of _("") (line 45)

Processing additional checks PASS!
Comment 7 Lucas Gass (lukeg) 2025-10-31 20:50:06 UTC
Created attachment 188866 [details] [review]
Bug 40958: (follow-up) Fix QA complaint about forbidden pattern
Comment 8 Lucas Gass (lukeg) 2025-10-31 21:30:11 UTC
Nice work everyone!

Pushed to main for 25.11