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