Koha/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt
Katrin Fischer 2dc31f65ae
Bug 14229: Add link from patron search results fine to accounting tab in patron account
This adds a link to the accounting tab from the patron search results by
making the amount in the Fines column clickable.

To test:
- Make sure you have some patrons with fines, credits and 0,00
- Search for your patrons using the patron search, make sure you
  get more than one result for your search
- Check the results table - the amount should always be linked
  and lead to the patron account accounting > transactions tab.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-04-20 13:37:36 +01:00

49 lines
3.2 KiB
Text

[% USE raw %]
[% USE To %]
[% USE AuthorisedValues %]
[% USE KohaDates %]
[% USE Price %]
{
"sEcho": [% sEcho | html %],
"iTotalRecords": [% iTotalRecords | html %],
"iTotalDisplayRecords": [% iTotalDisplayRecords | html %],
"aaData": [
[% FOREACH data IN aaData %]
{
[% IF CAN_user_borrowers_edit_borrowers || CAN_user_tools_manage_patron_lists %]
"dt_borrowernumber":
"<input type='checkbox' class='selection' name='borrowernumber' value='[% data.borrowernumber | html %]' />",
[% END %]
"dt_cardnumber":
"[% data.cardnumber | html | $To %]",
"dt_name":
"<a href=\"/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber | html %]\" class=\"patron_preview\" data-borrowernumber=\"[% data.borrowernumber | html %]\" style='white-space:nowrap'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames invert_name = 1 | $To %]</a><br />[% INCLUDE escape_address data = data %][% IF data.email %]<br/>Email: <a href='mailto:[% data.email | html | $To %]'>[% data.email | html | $To %]</a>[% END %]",
"dt_dateofbirth":
"[% data.dateofbirth | $KohaDates %]",
"dt_category":
"[% data.category_description | html | $To %] ([% data.category_type | html | $To %])",
"dt_branch":
"[% data.branchname | html | $To %]",
"dt_dateexpiry":
"[% data.dateexpiry | html | $To %]",
"dt_od_checkouts":
"[% IF data.overdues %]<span class='overdue'><strong>[% data.overdues | html %]</strong></span>[% ELSE %][% data.overdues | html %][% END %] / [% data.issues | html %]",
"dt_fines":
"<span style='text-align: right; display: block;'><a href=\"/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% data.borrowernumber | html %]\">[% IF data.fines < 0 %] <span class='credit'>[% data.fines | $Price %]</span> [% ELSIF data.fines > 0 %] <span class='debit'><strong>[% data.fines | $Price %]</strong></span> [% ELSE %] [% data.fines | $Price %] [% END %]</a></span>",
"dt_borrowernotes":
"[% data.borrowernotes | html_line_break | collapse | $To %]",
"dt_action":
"<a href='/cgi-bin/koha/members/memberentry.pl?op=modify&amp;destination=circ&amp;borrowernumber=[% data.borrowernumber | html %]' class='btn btn-default btn-xs'><i class='fa fa-pencil'></i> Edit</a>",
"borrowernumber":
"[% data.borrowernumber | html %]"
}[% UNLESS loop.last %],[% END %]
[% END %]
]
}
[% BLOCK escape_address %]
[%~ SET address = data.streetnumber _ ' ' %]
[%~ IF data.streettype %][% SET address = address _ AuthorisedValues.GetByCode( 'ROADTYPE', data.streettype ) _ ' ' %][% END %]
[%~ IF data.address %][% SET address = address _ data.address _ ' ' %][% END %]
[%~ IF data.address2 %][% SET address = address _ data.address2 _ ' ' %][% END %]
[%~ address | html | $To ~%]
[% END %]