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 (-2 / +14 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 8-23 Link Here
8
        [% FOREACH data IN aaData %]
9
        [% FOREACH data IN aaData %]
9
            {
10
            {
10
                "dt_cardnumber":
11
                "dt_cardnumber":
11
                    "[% data.cardnumber %]",
12
                    "[% data.cardnumber |html %]",
12
                "dt_name":
13
                "dt_name":
13
                    "[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames cardnumber = data.cardnumber invert_name = 1%]",
14
                    "[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames cardnumber = data.cardnumber invert_name = 1%]",
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 (-3 / +10 lines)
Lines 1-3 Link Here
1
[% USE To %]
1
[% USE AuthorisedValues %]
2
[% USE AuthorisedValues %]
2
{
3
{
3
    "sEcho": [% sEcho %],
4
    "sEcho": [% sEcho %],
Lines 11-19 Link Here
11
                    "<input type='checkbox' class='selection' name='borrowernumber' value='[% data.borrowernumber %]' />",
12
                    "<input type='checkbox' class='selection' name='borrowernumber' value='[% data.borrowernumber %]' />",
12
                [% END %]
13
                [% END %]
13
                "dt_cardnumber":
14
                "dt_cardnumber":
14
                    "[% data.cardnumber %]",
15
                    "[% data.cardnumber | html %]",
15
                "dt_name":
16
                "dt_name":
16
                    "<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 ) %][% data.streetnumber %] [% END %][% IF ( data.streettype ) %][% AuthorisedValues.GetByCode( 'ROADTYPE', data.streettype ) %] [% END %][% data.address %][% IF ( data.address2 ) %]<br />[% data.address2 %][% END %][% IF ( data.city || data.state || data.zipcode || data.country) %]<br />[% END %][% IF ( data.city ) %][% data.city %][% IF ( data.state ) %],[% END %][% END %][% IF ( data.state ) %] [% data.state %][% END %] [% IF ( data.zipcode ) %] [% data.zipcode %][% END %][% IF ( data.country ) %], [% data.country %][% END %][% IF data.email %]<br/>Email&#58; <a href='mailto&#58;[% data.email %]'>[% 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>",
17
                "dt_category":
18
                "dt_category":
18
                    "[% data.category_description |html %] ([% data.category_type |html %])",
19
                    "[% data.category_description |html %] ([% data.category_type |html %])",
19
                "dt_branch":
20
                "dt_branch":
Lines 34-36 Link Here
34
        [% END %]
35
        [% END %]
35
    ]
36
    ]
36
}
37
}
37
- 
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