[% USE To %]
[% USE AuthorisedValues %]
[% USE KohaDates %]
[% USE Price %]
{
"sEcho": [% sEcho %],
"iTotalRecords": [% iTotalRecords %],
"iTotalDisplayRecords": [% iTotalDisplayRecords %],
"aaData": [
[% FOREACH data IN aaData %]
{
[% IF CAN_user_tools_manage_patron_lists %]
"dt_borrowernumber":
"",
[% END %]
"dt_cardnumber":
"[% data.cardnumber | html %]",
"dt_name":
"[% 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 %]
[% INCLUDE escape_address data = data %][% IF data.email %]
Email: [% data.email | html %][% END %]",
"dt_dateofbirth":
"[% data.dateofbirth | $KohaDates %]",
"dt_category":
"[% data.category_description |html %] ([% data.category_type |html %])",
"dt_branch":
"[% data.branchname |html %]",
"dt_dateexpiry":
"[% data.dateexpiry %]",
"dt_od_checkouts":
"[% IF data.overdues %][% data.overdues %][% ELSE %][% data.overdues %][% END %] / [% data.issues %]",
"dt_fines":
"[% IF data.fines < 0 %][% data.fines | $Price %] [% ELSIF data.fines > 0 %] [% data.fines | $Price %] [% ELSE %] [% data.fines | $Price %] [% END %]",
"dt_borrowernotes":
"[% data.borrowernotes.replace('\\\\' , '\\\\') |html |html_line_break |collapse %]",
"dt_action":
" Edit",
"borrowernumber":
"[% data.borrowernumber %]"
}[% UNLESS loop.last %],[% END %]
[% END %]
]
}
[% BLOCK escape_address %]
[%~ SET address = data.streetnumber _ ' ' %]
[%~ IF data.streettype %][% address = address _ AuthorisedValues.GetByCode( 'ROADTYPE', data.streettype ) _ ' ' %][% END %]
[%~ IF data.address %][% address = address _ data.address _ ' ' %][% END %]
[%~ IF data.address2 %][% address = address _ data.address2 _ ' ' %][% END %]
[%~ To.json( address ) ~%]
[% END %]