Bug 15722: Escape patron infos for JSON in patron searches
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / tables / members_results.tt
blob51828922a7831d8f23906992fa668032cb3d946e
1 [% USE To %]
2 [% USE AuthorisedValues %]
4     "sEcho": [% sEcho %],
5     "iTotalRecords": [% iTotalRecords %],
6     "iTotalDisplayRecords": [% iTotalDisplayRecords %],
7     "aaData": [
8         [% FOREACH data IN aaData %]
9             {
10                 [% IF CAN_user_tools_manage_patron_lists %]
11                 "dt_borrowernumber":
12                     "<input type='checkbox' class='selection' name='borrowernumber' value='[% data.borrowernumber %]' />",
13                 [% END %]
14                 "dt_cardnumber":
15                     "[% data.cardnumber | html %]",
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 = To.json(data.firstname) surname = To.json(data.surname) othernames = To.json(data.othernames) invert_name = 1 %]</a><br />[% INCLUDE escape_address data = data %]</span>",
18                 "dt_category":
19                     "[% data.category_description |html %] ([% data.category_type |html %])",
20                 "dt_branch":
21                     "[% data.branchname |html %]",
22                 "dt_dateexpiry":
23                     "[% data.dateexpiry %]",
24                 "dt_od_checkouts":
25                     "[% IF data.overdues %]<span class='overdue'><strong>[% data.overdues %]</strong></span>[% ELSE %][% data.overdues %][% END %] / [% data.issues %]",
26                 "dt_fines":
27                     "<span style='text-align: right; display: block;'>[% IF data.fines < 0 %]<span class='credit'>[% data.fines |html %]</span> [% ELSIF data.fines > 0 %] <span class='debit'><strong>[% data.fines |html %]</strong></span> [% ELSE %] [% data.fines |html%] [% END %]</span>",
28                 "dt_borrowernotes":
29                     "[% data.borrowernotes.replace('\\\\' , '\\\\') |html |html_line_break |collapse %]",
30                 "dt_action":
31                     "<a href='/cgi-bin/koha/members/memberentry.pl?op=modify&amp;destination=circ&amp;borrowernumber=[% data.borrowernumber %]'>Edit</a>",
32                 "borrowernumber":
33                     "[% data.borrowernumber %]"
34             }[% UNLESS loop.last %],[% END %]
35         [% END %]
36     ]
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 ) ~%]
44 [% END %]