View | Details | Raw Unified | Return to bug 36298
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format-address.inc (-7 / +6 lines)
Lines 7-13 Link Here
7
7
8
        const roadtypes = [% To.json(AuthorisedValues.Get('ROADTYPE')) | $raw %];
8
        const roadtypes = [% To.json(AuthorisedValues.Get('ROADTYPE')) | $raw %];
9
        let roadtypes_map = roadtypes.reduce((map, r) => {
9
        let roadtypes_map = roadtypes.reduce((map, r) => {
10
            map[r.street_type] = r;
10
            map[r.authorised_value] = r.lib;
11
            return map;
11
            return map;
12
        }, {});
12
        }, {});
13
13
Lines 17-23 Link Here
17
                if ( data.address ) {
17
                if ( data.address ) {
18
                    let roadtype_desc = '';
18
                    let roadtype_desc = '';
19
                    if ( data.street_type ) {
19
                    if ( data.street_type ) {
20
                        roadtype_desc = roadtypes_map[data.street_type] ? roadtypes_map[data.street_type].street_type : data.street_type;
20
                        roadtype_desc = roadtypes_map[data.street_type] ? roadtypes_map[data.street_type] : data.street_type;
21
                    }
21
                    }
22
                    address += include_li ? '<li class="patronaddress1">' : '';
22
                    address += include_li ? '<li class="patronaddress1">' : '';
23
                    address += escape_str(data.street_number) + ' ' + escape_str(data.address) + ' ' + escape_str(roadtype_desc);
23
                    address += escape_str(data.street_number) + ' ' + escape_str(data.address) + ' ' + escape_str(roadtype_desc);
Lines 59-68 Link Here
59
                if ( data.address ) {
59
                if ( data.address ) {
60
                    let roadtype_desc = '';
60
                    let roadtype_desc = '';
61
                    if ( data.street_type ) {
61
                    if ( data.street_type ) {
62
                        roadtype_desc = roadtypes_map[data.street_type] ? roadtypes_map[data.street_type].street_type : data.street_type;
62
                        roadtype_desc = roadtypes_map[data.street_type] ? roadtypes_map[data.street_type] : data.street_type;
63
                    }
63
                    }
64
                    address += include_li ? '<li class="patronaddress1">' : ' ';
64
                    address += include_li ? '<li class="patronaddress1">' : ' ';
65
                    address += escape_str(data.address) + ' ' + escape_str(roadtype_desc) + escape_str(data.street_number);
65
                    address += escape_str(data.address) + ' ' + escape_str(roadtype_desc) + ' ' + escape_str(data.street_number);
66
                    address += include_li ? '</li>' : '';
66
                    address += include_li ? '</li>' : '';
67
                }
67
                }
68
            }
68
            }
Lines 88-97 Link Here
88
                if ( data.address ) {
88
                if ( data.address ) {
89
                    let roadtype_desc = '';
89
                    let roadtype_desc = '';
90
                    if ( data.street_type ) {
90
                    if ( data.street_type ) {
91
                        roadtype_desc = roadtypes_map[data.street_type] ? roadtypes_map[data.street_type].street_type : data.street_type;
91
                        roadtype_desc = roadtypes_map[data.street_type] ? roadtypes_map[data.street_type] : data.street_type;
92
                    }
92
                    }
93
                    address += include_li ? '<li class="patronaddress1">' : '';
93
                    address += include_li ? '<li class="patronaddress1">' : '';
94
                    address += escape_str(data.street_number) + ' ' + escape_str(roadtype_desc) + escape_str(data.address);
94
                    address += escape_str(data.street_number) + ' ' + escape_str(roadtype_desc) + ' ' + escape_str(data.address);
95
                    address += include_li ? '</li>' : '';
95
                    address += include_li ? '</li>' : '';
96
                }
96
                }
97
            }
97
            }
98
- 

Return to bug 36298