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