Line 0
Link Here
|
|
|
1 |
[% USE KohaDates %] |
2 |
|
3 |
[% IF no_access_to_patron %] |
4 |
<span class="blocker">Patron not in your library group</span> |
5 |
[% END %] |
6 |
|
7 |
[% IF in_lists %] |
8 |
<div class="patroninfo-section"> |
9 |
<h4>Patron Lists currently in</h4> |
10 |
|
11 |
<table id="table_inlists"> |
12 |
<thead> |
13 |
<tr> |
14 |
<th>Name</th> |
15 |
<th>Patrons in list</th> |
16 |
<th>Shared</th> |
17 |
[% IF CAN_user_tools_manage_patron_lists %] |
18 |
<th class="NoSort">Actions</th> |
19 |
[% END %] |
20 |
</tr> |
21 |
</thead> |
22 |
|
23 |
<tbody> |
24 |
[% FOREACH l IN in_lists %] |
25 |
[% SET shared_by_other = l.owner.id != logged_in_user.id %] |
26 |
<tr> |
27 |
<td> |
28 |
[% IF CAN_user_tools_manage_patron_lists %] |
29 |
<a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id | uri %]">[% l.name | html %]</a> |
30 |
[% ELSE %] |
31 |
[% l.name | html %] |
32 |
[% END %] |
33 |
</td> |
34 |
<td>[% l.patron_list_patrons_rs.count || 0 | html %]</td> |
35 |
<td> |
36 |
[% IF l.shared %] |
37 |
[% IF shared_by_other %] |
38 |
by <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% l.owner.id | uri %]">[% INCLUDE 'patron-title.inc' patron=l.owner %]</a> |
39 |
[% ELSE %] |
40 |
by you |
41 |
[% END %] |
42 |
[% END %] |
43 |
</td> |
44 |
[% IF CAN_user_tools_manage_patron_lists %] |
45 |
<td> |
46 |
<div class="btn-group dropup"> |
47 |
<a class="btn btn-default btn-xs dropdown-toggle" id="listactions[% l.patron_list_id | html %]" role="button" data-toggle="dropdown" href="#"> |
48 |
Actions <b class="caret"></b> |
49 |
</a> |
50 |
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="listactions[% l.patron_list_id | html %]"> |
51 |
<li><a onclick="removeFromList('[% l.patron_list_id | html %]','[% list_id_lookup.${l.patron_list_id} | html %]')"><i class="fa fa-remove"></i> Remove patron from list</a></li> |
52 |
<li class="divider"></li> |
53 |
<li><a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id | uri %]"><i class="fa fa-user"></i> Add patrons</a></li> |
54 |
[% UNLESS shared_by_other %] |
55 |
<li><a href="/cgi-bin/koha/patron_lists/add-modify.pl?patron_list_id=[% l.patron_list_id | uri %]"><i class="fa fa-pencil"></i> Edit list</a></li> |
56 |
<li><a class="delete_patron" href="/cgi-bin/koha/patron_lists/delete.pl?patron_list_id=[% l.patron_list_id | html %]" data-list-name="[% l.name | html %]"><i class="fa fa-trash"></i> Delete list</a></li> |
57 |
[% END %] |
58 |
[% IF ( l.patron_list_patrons_rs.count ) %] |
59 |
<li class="divider"></li> |
60 |
<li> |
61 |
<a class="print_cards" href="/cgi-bin/koha/patroncards/print.pl?patronlist_id=[% l.patron_list_id | html %]" data-patron_list_id="[% l.patron_list_id | html %]"><i class="fa fa-print"></i> Print patron cards</a> |
62 |
</li> |
63 |
[% IF CAN_user_tools_edit_patrons %] |
64 |
<li> |
65 |
<a href="/cgi-bin/koha/tools/modborrowers.pl?patron_list_id=[% l.patron_list_id | uri %]&op=show"> |
66 |
<i class="fa fa-pencil"></i> Batch edit patrons |
67 |
</a> |
68 |
</li> |
69 |
[% END %] |
70 |
[% IF CAN_user_tools_delete_anonymize_patrons %] |
71 |
<li> |
72 |
<a href="/cgi-bin/koha/tools/cleanborrowers.pl?step=2&patron_list_id=[% l.patron_list_id | uri %]&checkbox=borrower"> |
73 |
<i class="fa fa-trash"></i> Batch delete patrons |
74 |
</a> |
75 |
</li> |
76 |
[% END %] |
77 |
[% END %] |
78 |
</ul> |
79 |
</div> |
80 |
</td> |
81 |
[% END %] |
82 |
</tr> |
83 |
[% END %] |
84 |
</tbody> |
85 |
</table> |
86 |
</div> |
87 |
|
88 |
[% IF available_lists %] |
89 |
<hr> |
90 |
[% END %] |
91 |
[% END %] |
92 |
|
93 |
[% IF available_lists %] |
94 |
<div class="patroninfo-section"> |
95 |
<h4>Patron lists not in</h4> |
96 |
|
97 |
<table id="table_listnopatron"> |
98 |
<thead> |
99 |
<tr> |
100 |
<th>Name</th> |
101 |
<th>Patrons in list</th> |
102 |
<th>Shared</th> |
103 |
[% IF CAN_user_tools_manage_patron_lists %] |
104 |
<th class="NoSort">Actions</th> |
105 |
[% END %] |
106 |
</tr> |
107 |
</thead> |
108 |
|
109 |
<tbody> |
110 |
[% FOREACH l IN available_lists %] |
111 |
[% SET shared_by_other = l.owner.id != logged_in_user.id %] |
112 |
<tr> |
113 |
<td> |
114 |
[% IF CAN_user_tools_manage_patron_lists %] |
115 |
<a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id | uri %]">[% l.name | html %]</a> |
116 |
[% ELSE %] |
117 |
[% l.name | html %] |
118 |
[% END %] |
119 |
</td> |
120 |
<td>[% l.patron_list_patrons_rs.count || 0 | html %]</td> |
121 |
<td> |
122 |
[% IF l.shared %] |
123 |
[% IF shared_by_other %] |
124 |
by <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% l.owner.id | uri %]">[% INCLUDE 'patron-title.inc' patron=l.owner %]</a> |
125 |
[% ELSE %] |
126 |
by you |
127 |
[% END %] |
128 |
[% END %] |
129 |
</td> |
130 |
[% IF CAN_user_tools_manage_patron_lists %] |
131 |
<td> |
132 |
<div class="btn-group dropup"> |
133 |
<a class="btn btn-default btn-xs dropdown-toggle" id="listactions[% l.patron_list_id | html %]" role="button" data-toggle="dropdown" href="#"> |
134 |
Actions <b class="caret"></b> |
135 |
</a> |
136 |
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="listactions[% l.patron_list_id | html %]"> |
137 |
<li><a onclick="addToList('[% l.patron_list_id | html %]','[% cardnumber | html %]')"><i class="fa fa-plus"></i> Add patron to list</a></li> |
138 |
<li class="divider"></li> |
139 |
<li><a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id | uri %]"><i class="fa fa-user"></i> Add patrons</a></li> |
140 |
[% UNLESS shared_by_other %] |
141 |
<li><a href="/cgi-bin/koha/patron_lists/add-modify.pl?patron_list_id=[% l.patron_list_id | uri %]"><i class="fa fa-pencil"></i> Edit list</a></li> |
142 |
<li><a class="delete_patron" href="/cgi-bin/koha/patron_lists/delete.pl?patron_list_id=[% l.patron_list_id | html %]" data-list-name="[% l.name | html %]"><i class="fa fa-trash"></i> Delete list</a></li> |
143 |
[% END %] |
144 |
[% IF ( l.patron_list_patrons_rs.count ) %] |
145 |
<li class="divider"></li> |
146 |
<li> |
147 |
<a class="print_cards" href="/cgi-bin/koha/patroncards/print.pl?patronlist_id=[% l.patron_list_id | html %]" data-patron_list_id="[% l.patron_list_id | html %]"><i class="fa fa-print"></i> Print patron cards</a> |
148 |
</li> |
149 |
[% IF CAN_user_tools_edit_patrons %] |
150 |
<li> |
151 |
<a href="/cgi-bin/koha/tools/modborrowers.pl?patron_list_id=[% l.patron_list_id | uri %]&op=show"> |
152 |
<i class="fa fa-pencil"></i> Batch edit patrons |
153 |
</a> |
154 |
</li> |
155 |
[% END %] |
156 |
[% IF CAN_user_tools_delete_anonymize_patrons %] |
157 |
<li> |
158 |
<a href="/cgi-bin/koha/tools/cleanborrowers.pl?step=2&patron_list_id=[% l.patron_list_id | uri %]&checkbox=borrower"> |
159 |
<i class="fa fa-trash"></i> Batch delete patrons |
160 |
</a> |
161 |
</li> |
162 |
[% END %] |
163 |
[% END %] |
164 |
</ul> |
165 |
</div> |
166 |
</td> |
167 |
[% END %] |
168 |
</tr> |
169 |
[% END %] |
170 |
</tbody> |
171 |
</table> |
172 |
</div> |
173 |
[% END %] |
174 |
|
175 |
<script> |
176 |
$("#table_listnopatron, #table_inlists").dataTable($.extend(true, {}, dataTablesDefaults, { |
177 |
"columnDefs": [ |
178 |
{ 'sortable': false, 'targets': [ 'NoSort' ] } |
179 |
], |
180 |
paginate: true |
181 |
})); |
182 |
|
183 |
[% IF CAN_user_tools_manage_patron_lists %] |
184 |
function addToList( list_id, cardnumber ) { |
185 |
$('#pat_lists-tab').text(_("Loading...")); |
186 |
$("body").css("cursor", "progress"); |
187 |
$('#pat_lists-tab').load('/cgi-bin/koha/patron_lists/patron-lists-tab.pl?borrowernumber=[% borrowernumber | html %]&patron_list_id=' + list_id + '&patrons_to_add=' + cardnumber, function() { |
188 |
$("body").css("cursor", "default"); |
189 |
}); |
190 |
|
191 |
return false; |
192 |
} |
193 |
|
194 |
function removeFromList( list_id, patron_list_patron_id ) { |
195 |
$('#pat_lists-tab').text(_("Loading...")); |
196 |
$("body").css("cursor", "progress"); |
197 |
$('#pat_lists-tab').load('/cgi-bin/koha/patron_lists/patron-lists-tab.pl?borrowernumber=[% borrowernumber | html %]&patron_list_id=' + list_id + '&patrons_to_remove=' + patron_list_patron_id, function() { |
198 |
$("body").css("cursor", "default"); |
199 |
}); |
200 |
|
201 |
return false; |
202 |
} |
203 |
[% END %] |
204 |
</script> |