|
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 with this patron</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 && CAN_user_tools_manage_patron_lists %] |
| 94 |
<div class="h4"> |
| 95 |
<span>Add patron to list</span> |
| 96 |
<select name="patron_list_id" id="add_to_patron_list_id_select"> |
| 97 |
<option value=""></option> |
| 98 |
[%- FOREACH l IN available_lists %] |
| 99 |
<option value="[% l.patron_list_id | html %]">[% l.name | html %]</option> |
| 100 |
[%- END %] |
| 101 |
</select> |
| 102 |
<a onclick="addToList()"><i class="fa fa-plus"></i> |
| 103 |
</div> |
| 104 |
[% END %] |
| 105 |
|
| 106 |
<script> |
| 107 |
$("#table_listnopatron, #table_inlists").dataTable($.extend(true, {}, dataTablesDefaults, { |
| 108 |
"columnDefs": [ |
| 109 |
{ 'sortable': false, "bSearchable": false, 'targets': [ 'NoSort' ] } |
| 110 |
], |
| 111 |
"sPaginationType": "full" |
| 112 |
})); |
| 113 |
|
| 114 |
[% IF CAN_user_tools_manage_patron_lists %] |
| 115 |
function addToList() { |
| 116 |
var list_id = $("#add_to_patron_list_id_select").val(); |
| 117 |
$('#pat_lists_panel').text(_("Loading...")); |
| 118 |
$("body").css("cursor", "progress"); |
| 119 |
$('#pat_lists_panel').load('/cgi-bin/koha/patron_lists/patron-lists-tab.pl?borrowernumber=[% borrowernumber | html %]&patron_list_id=' + list_id + '&patrons_to_add=[% cardnumber | html %]', function() { |
| 120 |
$("body").css("cursor", "default"); |
| 121 |
}); |
| 122 |
|
| 123 |
return false; |
| 124 |
} |
| 125 |
|
| 126 |
function removeFromList( list_id, patron_list_patron_id ) { |
| 127 |
$('#pat_lists_panel').text(_("Loading...")); |
| 128 |
$("body").css("cursor", "progress"); |
| 129 |
$('#pat_lists_panel').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() { |
| 130 |
$("body").css("cursor", "default"); |
| 131 |
}); |
| 132 |
|
| 133 |
return false; |
| 134 |
} |
| 135 |
[% END %] |
| 136 |
</script> |