From cc83d8e19a72fea5bde06658722e8fe89a257c2f Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Tue, 12 Mar 2024 11:18:18 +0100 Subject: [PATCH] Bug 36298: In patrons search fix road type with authorized value In new patrons search via API, the road type code is displayed in patron address instead of authorized value description. Also road type is missing a space separator in DE and FR format. Test plan : 1) Create two entries in authorized value category "ROADTYPE" : R1 "Road" R2 "Street" 2) Edit a patron (ie Delgado, Floyd) to set road type to "Road" 3) Perform a search on patrons (click on letter D) 4) Check you see in address "Road" and not "R1" 5) Edit authorized value category "ROADTYPE" to delete entry "R1" 6) Perform a search on patrons (click on letter D) 7) Check you see in address "R1" Signed-off-by: David Nind Signed-off-by: Marcel de Rooy Signed-off-by: Katrin Fischer (cherry picked from commit 3c0ac4cb9a4290c770aa8e4837b6d639b49c97e9) Signed-off-by: Fridolin Somers (cherry picked from commit 72e78f72a3e701b574db13f7ad0ff161e00029ef) Signed-off-by: Lucas Gass --- .../prog/en/includes/js-patron-format-address.inc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format-address.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format-address.inc index b561431c0a..daa979717e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format-address.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format-address.inc @@ -7,7 +7,7 @@ const roadtypes = [% To.json(AuthorisedValues.Get('ROADTYPE')) | $raw %]; let roadtypes_map = roadtypes.reduce((map, r) => { - map[r.street_type] = r; + map[r.authorised_value] = r.lib; return map; }, {}); @@ -17,7 +17,7 @@ if ( data.address ) { let roadtype_desc = ''; if ( data.street_type ) { - roadtype_desc = roadtypes_map[data.street_type] ? roadtypes_map[data.street_type].street_type : data.street_type; + roadtype_desc = roadtypes_map[data.street_type] ? roadtypes_map[data.street_type] : data.street_type; } address += include_li ? '
  • ' : ''; address += escape_str(data.street_number) + ' ' + escape_str(data.address) + ' ' + escape_str(roadtype_desc); @@ -59,10 +59,10 @@ if ( data.address ) { let roadtype_desc = ''; if ( data.street_type ) { - roadtype_desc = roadtypes_map[data.street_type] ? roadtypes_map[data.street_type].street_type : data.street_type; + roadtype_desc = roadtypes_map[data.street_type] ? roadtypes_map[data.street_type] : data.street_type; } address += include_li ? '
  • ' : ' '; - address += escape_str(data.address) + ' ' + escape_str(roadtype_desc) + escape_str(data.street_number); + address += escape_str(data.address) + ' ' + escape_str(roadtype_desc) + ' ' + escape_str(data.street_number); address += include_li ? '
  • ' : ''; } } @@ -88,10 +88,10 @@ if ( data.address ) { let roadtype_desc = ''; if ( data.street_type ) { - roadtype_desc = roadtypes_map[data.street_type] ? roadtypes_map[data.street_type].street_type : data.street_type; + roadtype_desc = roadtypes_map[data.street_type] ? roadtypes_map[data.street_type] : data.street_type; } address += include_li ? '
  • ' : ''; - address += escape_str(data.street_number) + ' ' + escape_str(roadtype_desc) + escape_str(data.address); + address += escape_str(data.street_number) + ' ' + escape_str(roadtype_desc) + ' ' + escape_str(data.address); address += include_li ? '
  • ' : ''; } } -- 2.39.5