+[% USE Asset %]
+[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Tools › Patron lists</title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'greybox.inc' %]
-<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
-[% INCLUDE 'datatables.inc' %]
-
-<script type="text/javascript">
-//<![CDATA[
- $(document).ready(function() {
- var patronExportModal = $("#patronExportModal");
- var patronExportModalBody = $("#patronExportModal .modal-body")
-
- $('#patron-lists-table').dataTable($.extend(true, {}, dataTablesDefaults, {
- "autoWidth": false,
- "aoColumnDefs": [
- { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }
- ],
- "sPaginationType": "four_button"
- } ));
- $(".delete_patron").on("click", function(){
- $(".dropdown").removeClass("open");
- var list = $(this).data("list-name");
- return confirmDelete( _("Are you sure you want to delete the list %s?").format(list) );
- });
-
- $(".print_cards").on("click", function(e){
- e.preventDefault();
- var page = $(this).attr("href");
- patronExportModalBody.load(page + " #exportingf");
- patronExportModal.modal("show");
- });
-
- patronExportModal.on("hidden", function(){
- patronExportModalBody.html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
- });
-
- patronExportModal.on("submit", "#exportingf", function(e){
- e.preventDefault();
- modal_body = patronExportModalBody;
- modal_body.html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
- target_url = $(this).attr("action");
- params = $( this ).serialize();
- modal_body.load( target_url + "?" + params + " #custom-doc");
- });
-
- patronExportModal.on("click",".closebtn,.gb-close",function(e){
- e.preventDefault();
- patronExportModal.modal("hide");
- });
-
- });
-//]]>
-</script>
-
+[% Asset.css("css/datatables.css") %]
</head>
<body id="patlist_lists" class="pat patlist">
<tr>
<th>Name</th>
<th>Patrons in list</th>
+ <th>Shared</th>
<th class="NoSort"> </th>
</tr>
</thead>
<tbody>
[% FOREACH l IN lists %]
+ [% SET shared_by_other = l.owner.id != logged_in_user.id %]
<tr>
<td><a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id %]">[% l.name |html%]</a></td>
<td>[% l.patron_list_patrons_rs.count || 0 %]</td>
+ <td>
+ [% IF l.shared %]
+ [% IF shared_by_other %]
+ by <a href=/cgi-bin/koha/members/moremember.pl?borrowernumber=[% l.owner.id %]">[% INCLUDE 'patron-title.inc' patron=l.owner %]</a>
+ [% ELSE %]
+ by you
+ [% END %]
+ [% END %]
+ </td>
<td>
<div class="dropdown">
<a class="btn btn-default btn-xs dropdown-toggle" id="listactions[% l.patron_list_id %]" role="button" data-toggle="dropdown" href="#">
</a>
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="listactions[% l.patron_list_id %]">
<li><a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id %]"><i class="fa fa-user"></i> Add patrons</a></li>
- <li><a href="/cgi-bin/koha/patron_lists/add-modify.pl?patron_list_id=[% l.patron_list_id %]"><i class="fa fa-pencil"></i> Edit list</a></li>
- <li><a class="delete_patron" href="/cgi-bin/koha/patron_lists/delete.pl?patron_list_id=[% l.patron_list_id %]" data-list-name="[% l.name %]"><i class="fa fa-trash"></i> Delete list</a></li>
+ [% UNLESS shared_by_other %]
+ <li><a href="/cgi-bin/koha/patron_lists/add-modify.pl?patron_list_id=[% l.patron_list_id %]"><i class="fa fa-pencil"></i> Edit list</a></li>
+ <li><a class="delete_patron" href="/cgi-bin/koha/patron_lists/delete.pl?patron_list_id=[% l.patron_list_id %]" data-list-name="[% l.name %]"><i class="fa fa-trash"></i> Delete list</a></li>
+ [% END %]
[% IF ( l.patron_list_patrons_rs.count ) %]
<li class="divider"></li>
<li>
[% INCLUDE 'tools-menu.inc' %]
</div>
</div>
+
+[% MACRO jsinclude BLOCK %]
+ [% Asset.js("js/tools-menu.js") %]
+ [% INCLUDE 'datatables.inc' %]
+
+ <script type="text/javascript">
+ $(document).ready(function() {
+ var patronExportModal = $("#patronExportModal");
+ var patronExportModalBody = $("#patronExportModal .modal-body")
+
+ $('#patron-lists-table').dataTable($.extend(true, {}, dataTablesDefaults, {
+ "autoWidth": false,
+ "aoColumnDefs": [
+ { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }
+ ],
+ "sPaginationType": "four_button"
+ } ));
+ $(".delete_patron").on("click", function(){
+ $(".dropdown").removeClass("open");
+ var list = $(this).data("list-name");
+ return confirmDelete( _("Are you sure you want to delete the list %s?").format(list) );
+ });
+
+ $(".print_cards").on("click", function(e){
+ e.preventDefault();
+ var page = $(this).attr("href");
+ patronExportModalBody.load(page + " #exportingf");
+ patronExportModal.modal("show");
+ });
+
+ patronExportModal.on("hidden", function(){
+ patronExportModalBody.html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
+ });
+
+ patronExportModal.on("submit", "#exportingf", function(e){
+ e.preventDefault();
+ modal_body = patronExportModalBody;
+ modal_body.html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
+ target_url = $(this).attr("action");
+ params = $( this ).serialize();
+ modal_body.load( target_url + "?" + params + " #custom-doc");
+ });
+
+ patronExportModal.on("click",".closebtn,.gb-close",function(e){
+ e.preventDefault();
+ patronExportModal.modal("hide");
+ });
+
+ });
+ </script>
+[% END %]
+
[% INCLUDE 'intranet-bottom.inc' %]