Lines 1-35
Link Here
|
|
|
1 |
[%- USE Koha -%] |
2 |
[%- USE Branches -%] |
3 |
[%- SET data = {} -%] |
4 |
[%- IF patron -%] |
5 |
[%- SET data.category_type = patron.category.category_type -%] |
6 |
[%- SET data.surname = patron.surname -%] |
7 |
[%- SET data.othernames = patron.othernames -%] |
8 |
[%- SET data.firstname = patron.firstname -%] |
9 |
[%- SET data.cardnumber = patron.cardnumber -%] |
10 |
[%- SET data.borrowernumber = patron.borrowernumber -%] |
11 |
[%- SET data.title = patron.title -%] |
12 |
[%- ELSIF ( borrower.borrowernumber ) -%] |
13 |
[%- SET data.category_type = borrower.category_type -%] |
14 |
[%- SET data.surname = borrower.surname -%] |
15 |
[%- SET data.othernames = borrower.othernames -%] |
16 |
[%- SET data.firstname = borrower.firstname -%] |
17 |
[%- SET data.cardnumber = borrower.cardnumber -%] |
18 |
[%- SET data.borrowernumber = borrower.borrowernumber -%] |
19 |
[%- SET data.title = borrower.title -%] |
20 |
[%- ELSIF ( borrowernumber ) -%] |
21 |
[%- SET data.category_type = category_type -%] |
22 |
[%- SET data.surname = surname -%] |
23 |
[%- SET data.othernames = othernames -%] |
24 |
[%- SET data.firstname = firstname -%] |
25 |
[%- SET data.cardnumber = cardnumber -%] |
26 |
[%- SET data.borrowernumber = borrowernumber -%] |
27 |
[%- SET data.title = title -%] |
28 |
[%- END -%] |
1 |
[%# Parameter no_html - if 1, the html tags are NOT generated %] |
29 |
[%# Parameter no_html - if 1, the html tags are NOT generated %] |
2 |
[%- IF no_html %] |
30 |
[% IF data.title %] |
3 |
[%- span_start = '' %] |
31 |
[%- IF no_html %] |
4 |
[%- span_end = '' %] |
32 |
[%- span_start = '' %] |
5 |
[%- ELSE %] |
33 |
[%- span_end = '' %] |
6 |
[%- span_start = '<span class="patron-title">' %] |
|
|
7 |
[%- span_end = '</span>' %] |
8 |
[%- END %] |
9 |
[%- IF ( borrower.borrowernumber ) %] |
10 |
[%- IF borrower.category_type == 'I' %] |
11 |
[%- borrower.surname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %] |
12 |
[%- ELSE %] |
34 |
[%- ELSE %] |
13 |
[%- IF invert_name %] |
35 |
[%- span_start = '<span class="patron-title">' %] |
14 |
[%- IF borrower.title %][% span_start %][%- borrower.title | html %][% span_end %] [% END %][%- borrower.surname | html %], [% borrower.firstname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %] |
36 |
[%- span_end = '</span>' %] |
15 |
[%- ELSE %] |
|
|
16 |
[%- IF borrower.title %][% span_start %][%- borrower.title | html %][% span_end %] [% END %][%- borrower.firstname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %] [% borrower.surname | html %] |
17 |
[%- END -%] |
18 |
[%- END -%] |
19 |
[%- IF ( borrower.cardnumber ) -%] |
20 |
([% borrower.cardnumber | html %]) |
21 |
[%- END %] |
37 |
[%- END %] |
22 |
[%- ELSIF ( borrowernumber ) %] |
38 |
[%- SET data.title = span_start _ data.title _ span_end _ ' ' -%] |
23 |
[%- IF category_type == 'I' %] |
39 |
[%- END -%] |
24 |
[%- surname | html %] [% IF othernames %] ([% othernames | html %]) [% END %] |
40 |
[%- SET display_patron_name = 1 -%] |
25 |
[%- ELSE %] |
41 |
[%- SET display_cardnumber = 1 -%] |
26 |
[%- IF invert_name %] |
42 |
[%- IF hide_patron_infos_if_needed %] [%# Should only be set if patron is set -%] |
27 |
[%- IF title %][% span_start %][%- title | html %][% span_end %] [% END %][%- surname | html %], [% firstname | html %] [% IF othernames %] ([% othernames | html %]) [% END %] |
43 |
[%- SET can_see_patron_infos = logged_in_user.can_see_patron_infos( patron ) -%] |
28 |
[%- ELSE %] |
44 |
[%- UNLESS can_see_patron_infos -%] |
29 |
[%- IF title %][% span_start %][%- title | html %][% span_end %] [% END %][%- firstname | html %] [% IF othernames %] ([% othernames | html %]) [% END %] [% surname | html %] |
45 |
[%- SET display_patron_name = 0 -%] |
30 |
[%- END %] |
46 |
[%- SET display_cardnumber = 0 -%] |
|
|
47 |
[%- ELSIF Koha.Preference('HidePatronName') -%] |
48 |
[%- SET display_patron_name = 0 -%] |
31 |
[%- END -%] |
49 |
[%- END -%] |
32 |
[%- IF ( cardnumber ) -%] |
50 |
[%- END -%] |
33 |
([% cardnumber | html %]) |
51 |
[%- IF hide_patron_infos_if_needed AND ( display_patron_name OR display_cardnumber ) -%] |
34 |
[%- END %] |
52 |
[%- IF link_to == 'circulation_reserves' %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% data.borrowernumber %]#reserves"> |
|
|
53 |
[%- ELSE %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber %]"> |
54 |
[%- END -%] |
55 |
[%- END -%] |
56 |
[%- IF data.category_type == 'I' -%] |
57 |
[%- UNLESS display_patron_name %][%- data.surname | html %] [% IF data.othernames %] [% END %]([% data.othernames | html %]) [% END -%] |
58 |
[%- ELSIF display_patron_name -%] |
59 |
[%- IF invert_name -%] |
60 |
[% data.title%][%- data.surname | html %], [% data.firstname | html %] [% IF data.othernames %] ([% data.othernames | html %]) [% END -%] |
61 |
[%- ELSE -%] |
62 |
[% data.title %][%- data.firstname | html %] [% IF data.othernames %] ([% data.othernames | html %]) [% END %] [% data.surname | html -%] |
63 |
[%- END -%] |
64 |
[%- IF display_cardnumber AND data.cardnumber %]([% data.cardnumber | html %])[% END -%] |
65 |
[%- ELSIF display_cardnumber -%] |
66 |
[%- IF data.cardnumber -%][%# FIXME Cardnumber should always be defined, right? -%] |
67 |
[%- data.cardnumber | html -%] |
68 |
[%- END -%] |
69 |
[%- ELSE -%] |
70 |
A patron from library [% Branches.GetName( patron.branchcode ) -%] |
71 |
[%- END -%] |
72 |
|
73 |
[%- IF hide_patron_infos_if_needed AND ( display_patron_name OR display_cardnumber ) -%] |
74 |
</a> |
35 |
[%- END -%] |
75 |
[%- END -%] |