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

(-)a/Koha/Template/Plugin/To.pm (-1 / +3 lines)
Lines 27-33 sub json { Link Here
27
    my ( $self, $value ) = @_;
27
    my ( $self, $value ) = @_;
28
28
29
    my $json = JSON->new->allow_nonref(1);
29
    my $json = JSON->new->allow_nonref(1);
30
    return $json->encode( $value );
30
    $json = $json->encode($value);
31
    $json =~ s/^"|"$//g; # Remove quotes around the strings
32
    return $json;
31
}
33
}
32
34
33
1;
35
1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/guarantor_search.tt (-1 / +13 lines)
Lines 1-4 Link Here
1
[% USE To %]
1
[% USE To %]
2
[% USE Branches %]
2
[% USE KohaDates %]
3
[% USE KohaDates %]
3
{
4
{
4
    "sEcho": [% sEcho %],
5
    "sEcho": [% sEcho %],
Lines 14-23 Link Here
14
                "dt_dateofbirth":
15
                "dt_dateofbirth":
15
                    "[% data.dateofbirth | $KohaDates %]",
16
                    "[% data.dateofbirth | $KohaDates %]",
16
                "dt_address":
17
                "dt_address":
17
                    "[% data.streetnumber %] [% data.address | html %] [% data.address2 | html %] [% data.city | html %] [% data.state | html %] [% data.zipcode | html %] [% data.country | html %] [% data.branchcode %]",
18
                    "[% INCLUDE escape_address data=data %]",
18
                "dt_action":
19
                "dt_action":
19
                    "<a style='cursor:pointer' onclick='select_user(\"[% data.borrowernumber %]\", [% To.json(data) | html %] );'>Select</a>"
20
                    "<a style='cursor:pointer' onclick='select_user(\"[% data.borrowernumber %]\", [% To.json(data) | html %] );'>Select</a>"
20
            }[% UNLESS loop.last %],[% END %]
21
            }[% UNLESS loop.last %],[% END %]
21
        [% END %]
22
        [% END %]
22
    ]
23
    ]
23
}
24
}
25
[% BLOCK escape_address %]
26
[%~ SET address = data.streetnumber _ ' ' %]
27
[%~ IF data.address %][% SET address = address _ data.address _ ' ' %][% END %]
28
[%~ IF data.address2 %][% SET address = address _ data.address2 _ ' ' %][% END %]
29
[%~ IF data.city %][% SET address = address _ data.city _ ' ' %][% END %]
30
[%~ IF data.state %][% SET address = address _ data.state _ ' ' %][% END %]
31
[%~ IF data.zipcode %][% SET address = address _ data.zipcode _ ' ' %][% END %]
32
[%~ IF data.country %][% SET address = address _ data.country _ ' ' %][% END %]
33
[%~ SET address = address _ Branches.GetName( data.branchcode ) %]
34
[%~ To.json( address ) | html ~%]
35
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt (-2 / +8 lines)
Lines 14-20 Link Here
14
                "dt_cardnumber":
14
                "dt_cardnumber":
15
                    "[% data.cardnumber | html %]",
15
                    "[% data.cardnumber | html %]",
16
                "dt_name":
16
                "dt_name":
17
                    "<span style='white-space:nowrap'><a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber %]'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames invert_name = 1 %]</a><br />[% IF ( data.streetnumber ) %][% To.json( data.streetnumber ) | html %] [% END %][% IF ( data.streettype ) %][% To.json( AuthorisedValues.GetByCode( 'ROADTYPE', data.streettype ) ) | html %] [% END %][% To.json( data.address ) | html %][% IF ( data.address2 ) %]<br />[% To.json( data.address2 ) | html %][% END %][% IF ( data.city || data.state || data.zipcode || data.country) %]<br />[% END %][% IF ( data.city ) %][% To.json( data.city ) | html %][% IF ( data.state ) %],[% END %][% END %][% IF ( data.state ) %] [% To.json( data.state ) | html %][% END %] [% IF ( data.zipcode ) %] [% To.json( data.zipcode ) | html %][% END %][% IF ( data.country ) %], [% To.json( data.country ) | html %][% END %][% IF data.email %]<br/>Email&#58; <a href='mailto&#58;[% To.json( data.email ) | html %]'>[% data.email %]</a>[% END %]</span>",
17
                    "<span style='white-space:nowrap'><a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber %]'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames invert_name = 1 %]</a><br />[% INCLUDE escape_address data = data %]</span>",
18
                "dt_category":
18
                "dt_category":
19
                    "[% data.category_description |html %] ([% data.category_type |html %])",
19
                    "[% data.category_description |html %] ([% data.category_type |html %])",
20
                "dt_branch":
20
                "dt_branch":
Lines 35-37 Link Here
35
        [% END %]
35
        [% END %]
36
    ]
36
    ]
37
}
37
}
38
- 
38
[% BLOCK escape_address %]
39
[%~ SET address = data.streetnumber _ ' ' %]
40
[%~ IF data.streettype %][% address = address _ AuthorisedValues.GetByCode( 'ROADTYPE', data.streettype ) _ ' ' %][% END %]
41
[%~ IF data.address %][% address = address _ data.address _ ' ' %][% END %]
42
[%~ IF data.address2 %][% address = address _ data.address2 _ ' ' %][% END %]
43
[%~ To.json( address ) | html ~%]
44
[% END %]

Return to bug 14044