Bug 32910: (follow-up) Replace v4 icon names with v6
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / branch_transfer_limits.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Branches %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Library checkin and transfer policy &rsaquo; Administration &rsaquo; Koha</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 <style>td { text-align: center; } .sorted { min-width: 50%; }</style>
9 </head>
10
11 <body id="admin_branch_transfer_limits" class="admin">
12 [% WRAPPER 'header.inc' %]
13     [% INCLUDE 'prefs-admin-search.inc' %]
14 [% END %]
15
16 [% WRAPPER 'sub-header.inc' %]
17     [% WRAPPER breadcrumbs %]
18         [% WRAPPER breadcrumb_item %]
19             <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
20         [% END %]
21         [% WRAPPER breadcrumb_item bc_active= 1 %]
22             <span>Set library checkin and transfer policy</span>
23         [% END %]
24     [% END #/ WRAPPER breadcrumbs %]
25 [% END #/ WRAPPER sub-header.inc %]
26
27 <div class="main container-fluid">
28     <div class="row">
29         <div class="col-sm-10 col-sm-push-2">
30             <main>
31
32 <h1>Library [% branchcode | html %] - [% Branches.GetName( branchcode ) | html %] Checkin and transfer policy</h1>
33     <form method="get" action="/cgi-bin/koha/admin/branch_transfer_limits.pl" id="selectlibrary">
34         <label for="branchselect">Select a library :</label>
35         <select name="branchcode" id="branchselect">
36             [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1 ) %]
37         </select>
38     </form>
39
40 <p class="help">Check the boxes for the libraries you allow your items to be transferred to.</p>
41 <fieldset>
42     [% IF ( limitType == 'ccode' ) %]<strong>For all collection codes: </strong>[% ELSE %]<strong>For all item types: </strong>[% END %]
43     <a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a>
44     |
45     <a id="UncheckAll" href="#"><i class="fa fa-times"></i> Clear all</a>
46     |
47     <a href="/cgi-bin/koha/admin/transfer_limits.pl">Switch to advanced editor</a>
48 </fieldset>
49
50 [% WRAPPER tabs id = "transferlimit_tabs" %]
51     [% WRAPPER tabs_nav %]
52         [% FOREACH codes_loo IN codes_loop %]
53             [% WRAPPER tab_item tabname=codes_loo.code %]
54                 [% codes_loo.code | html %]
55             [% END %]
56         [% END %]
57     [% END %]
58
59     <form method="post" action="branch_transfer_limits.pl">
60         [% WRAPPER tab_panels %]
61             [% FOREACH codes_loo IN codes_loop %]
62                 [% WRAPPER tab_panel tabname=codes_loo.code %]
63                     <h4>Policy for [% codes_loo.limit_phrase | html %]: [% codes_loo.code | html %]</h4>
64
65                     <p><a id="CheckAll[% codes_loo.code | html %]table" data-cb="[% codes_loo.code | html %]" class="checkall" href="#"><i class="fa fa-check"></i> Select all</a> | <a id="UncheckAll[% codes_loo.code | html %]table" data-cb="[% codes_loo.code | html %]" class="uncheckall" href="#"><i class="fa fa-times"></i> Clear all</a></p>
66
67                     <table id="[% codes_loo.code | html %]table" class="sorted">
68                         <thead>
69                             <tr>
70                                 <th>Library</th>
71                                 <th>Allow transfer?</th>
72                             </tr>
73                         </thead>
74
75                         <tbody>
76                                 [% FOREACH to_branch_loo IN codes_loo.to_branch_loop %]
77                                     <tr>
78                                         <td><label style="min-width:400px;" for="[% to_branch_loo.code | html %][% to_branch_loo.toBranch | html %]row">[% to_branch_loo.toBranch | html %] - [% Branches.GetName( to_branch_loo.toBranch ) | html %]</label></td>
79                                         <td>
80                                         [% IF ( to_branch_loo.isChecked ) %]
81                                             <input type="checkbox" class="cb cb[% codes_loo.code | html %]" id="[% to_branch_loo.code | html %][% to_branch_loo.toBranch | html %]row" name="[% to_branch_loo.code | html %]_[% to_branch_loo.toBranch | html %]" checked="checked" />
82                                         [% ELSE %]
83                                             <input type="checkbox" class="cb cb[% codes_loo.code | html %]" id="[% to_branch_loo.code | html %][% to_branch_loo.toBranch | html %]row" name="[% to_branch_loo.code | html %]_[% to_branch_loo.toBranch | html %]" />
84                                         [% END %]
85                                         </td>
86                                     </tr>
87                                 [% END %]
88                         </tbody>
89                     </table>
90                 [% END #/WRAPPER tab_panel %]
91             [% END # /FOREACH codes_loo %]
92         [% END # /WRAPPER tab_panels %]
93
94         <fieldset class="action">
95             <input type="hidden" name="updateLimits" value="1" />
96             <input type="hidden" name="branchcode" value="[% branchcode | html %]" />
97             <input type="submit" class="btn btn-primary" value="Save" />
98             <a class="cancel" href="/cgi-bin/koha/admin/admin-home.pl">Cancel</a>
99         </fieldset>
100     </form>
101 [% END # /WRAPPER tabs %]
102
103             </main>
104         </div> <!-- /.col-sm-10.col-sm-push-2 -->
105
106         <div class="col-sm-2 col-sm-pull-10">
107             <aside>
108                 [% INCLUDE 'admin-menu.inc' %]
109             </aside>
110         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
111      </div> <!-- /.row -->
112
113 [% MACRO jsinclude BLOCK %]
114     [% Asset.js("js/admin-menu.js") | $raw %]
115     [% INCLUDE 'datatables.inc' %]
116     <script>
117         $(document).ready(function(){
118             $("#CheckAll").on("click", function(e){
119                 e.preventDefault();
120                 $(".cb").each(function(){
121                     $(this).prop("checked", true);
122                 });
123             });
124
125             $("#UncheckAll").on("click", function(e){
126                 e.preventDefault();
127                 $(".cb").each(function(){
128                     $(this).prop("checked", false);
129                 });
130             });
131
132             if( $("#transferlimit_tabs .tab-pane.active").length < 1 ){
133                   $("#transferlimit_tabs a:first").tab("show");
134             }
135
136              $('#branchselect').change(function() {
137                 $('#selectlibrary').submit();
138              });
139
140             var checkall = $(".checkall");
141             var uncheckall = $(".uncheckall");
142
143             $(checkall).on("click", function(e){
144                 e.preventDefault();
145                 var tid = $(this).data("cb");
146                 $(".cb" + tid ).each(function(){
147                     $(this).prop("checked", true);
148                 })
149             });
150
151             $(uncheckall).on("click", function(e){
152                 e.preventDefault();
153                 var tid = $(this).data("cb");
154                 $(".cb" + tid ).each(function(){
155                     $(this).prop("checked", false);
156                 })
157             });
158
159             $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
160                 "aoColumnDefs": [
161                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
162                 ],
163                 'bPaginate': false
164             }));
165         });
166     </script>
167 [% END %]
168 [% INCLUDE 'intranet-bottom.inc' %]