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