Bug 19623: (follow-up) Correct footer include in pop-up windows
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / patron_lists / list.tt
1 [% USE KohaDates %]
2 [% SET footerjs = 1 %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Tools &rsaquo; Patron lists &rsaquo; [% list.name %] &rsaquo; Add patrons</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6
7 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
8 </head>
9
10 <body id="patlist_list" class="pat patlist">
11 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'cat-search.inc' %]
13 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="lists.pl">Patron lists</a> &rsaquo; <a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% list.id %]">[% list.name |html %]</a> &rsaquo; Add patrons</div>
14
15 <div id="doc3" class="yui-t2">
16    <div id="bd">
17     <div id="yui-main">
18         <div class="yui-b">
19         <h1>[% list.name |html %]</h1>
20
21         <form action="list.pl" id="add_patrons" method="post">
22             <fieldset>
23                 <legend>Add patrons</legend>
24
25                     <label for="find_patron">Patron search: </label>
26                     <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
27                     <div id="find_patron_container"></div>
28
29                 <fieldset id="patrons_to_add_fieldset">
30                     <legend>Patrons to be added</legend>
31                     <div id="patrons_to_add"></div>
32
33                     <fieldset class="action">
34                         <input type="hidden" name="patron_list_id" value="[% list.patron_list_id %]" />
35                         <input type="submit" value="Add patrons" />
36                         <a href="lists.pl" class="cancel">Cancel</a>
37                     </fieldset>
38                 </fieldset>
39
40             </fieldset>
41         </form>
42
43         <form action="list.pl" id="remove_patrons" method="post">
44
45             <div id="searchheader">
46                 <span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> |
47                 <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span> |
48                 <div class="btn-group">
49                     <button class="btn btn-default btn-xs list-remove" type="submit"><i class="fa fa-trash"></i> Remove selected</button>
50                 </div>
51             </div>
52
53             <table id="patron-list-table">
54                 <thead>
55                     <tr>
56                         <th>&nbsp;</th>
57                         <th>Card</th>
58                         <th>First name</th>
59                         <th>Surname</th>
60                         <th>Address</th>
61                         <th>Category</th>
62                         <th>Library</th>
63                         <th>Expires on</th>
64                         <th>Circ notes</th>
65                     </tr>
66                 </thead>
67
68                 <tbody>
69                     [% FOREACH p IN list.patron_list_patrons %]
70                         <tr>
71                             <td><input type="checkbox" name="patrons_to_remove" value="[% p.patron_list_patron_id %]" /></td>
72                             <td>
73                                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% p.borrowernumber.borrowernumber %]">
74                                     [% p.borrowernumber.cardnumber %]
75                                 </a>
76                             </td>
77                             <td>[% p.borrowernumber.firstname %]</td>
78                             <td>[% p.borrowernumber.surname %]</td>
79                             <td>
80                                 [% p.borrowernumber.address %]
81                                 [% p.borrowernumber.address2 %]
82                                 [% p.borrowernumber.city %]
83                                 [% p.borrowernumber.state %]
84                                 [% p.borrowernumber.country %]
85                             </td>
86                             <td>[% p.borrowernumber.categorycode.description %] ([% p.borrowernumber.categorycode.categorycode %])</td>
87                             <td>[% p.borrowernumber.branchcode.branchname %]</td>
88                             <td><span title="[% p.borrowernumber.dateexpiry %]">[% p.borrowernumber.dateexpiry | $KohaDates %]</span></td>
89                             <td>[% p.borrowernumber.borrowernotes %]</td>
90                         </tr>
91                     [% END %]
92                 </tbody>
93             </table>
94
95             <input type="hidden" name="patron_list_id" value="[% list.patron_list_id %]" />
96             <button type="submit" class="btn btn-default btn-sm"><i class="fa fa-trash" aria-hidden="true"></i> Remove selected patrons</button>
97         </form>
98
99             </div>
100         </div>
101         <div class="yui-b noprint">
102             [% INCLUDE 'tools-menu.inc' %]
103         </div>
104     </div>
105
106 [% MACRO jsinclude BLOCK %]
107     <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script>
108     [% INCLUDE 'datatables.inc' %]
109
110     <script type="text/javascript" src="[% interface %]/js/autocomplete/patrons.js"></script>
111     <script type="text/javascript">
112         var MSG_REMOVE_PATRON = _("Remove");
113         $(document).ready(function() {
114             $('#patrons_to_add_fieldset').hide();
115
116                 $('#patron-list-table').dataTable($.extend(true, {}, dataTablesDefaults, {
117                     "order": [[ 3, "asc" ]],
118                     "aoColumns": [
119                         null,null,null,null,null,null,null,{ "sType": "title-string" },null
120                     ],
121                     "aoColumnDefs": [
122                         { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
123                     ],
124                     "sPaginationType": "four_button"
125                 } ));
126
127             patron_autocomplete({
128                 patron_container: $("#patrons_to_add"),
129                 input_autocomplete: $("#find_patron"),
130                 patron_input_name: 'patrons_to_add'
131             });
132
133             var checkBoxes = $("input[type='checkbox']","#patron-list-table");
134
135             $("#CheckAll").click(function(e){
136                 e.preventDefault();
137                 checkBoxes.each(function(){
138                     $(this).prop("checked",1);
139                 });
140             });
141             $("#CheckNone").click(function(e){
142                 e.preventDefault();
143                 checkBoxes.each(function(){
144                     $(this).prop("checked",0);
145                 });
146             });
147
148             $("#remove_patrons").submit(function(){
149                 var checkedItems = $("input:checked");
150                 if ($(checkedItems).size() == 0) {
151                     alert(_("You must select one or more patrons to remove"));
152                     return false;
153                 }
154                 $(checkedItems).parents('tr').addClass("warn");
155                 if( confirm(_("Are you sure you want to remove the selected patrons?")) ) {
156                     return true;
157                 } else {
158                     $(checkedItems).parents('tr').removeClass("warn");
159                     return false;
160                 }
161             });
162         });
163     </script>
164 [% END %]
165
166 [% INCLUDE 'intranet-bottom.inc' %]