Bug 27846: admin folder
[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>Koha &rsaquo; Administration &rsaquo; Library checkin and transfer policy</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 [% INCLUDE 'header.inc' %]
13 [% INCLUDE 'prefs-admin-search.inc' %]
14
15 <nav aria-label="Breadcrumb" class="breadcrumb">
16     <ol>
17         <li>
18             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
19         </li>
20         <li>
21             <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
22         </li>
23         <li>
24             <a href="#" aria-current="page">
25                 Set library checkin and transfer policy
26             </a>
27         </li>
28     </ol>
29 </nav>
30
31 <div class="main container-fluid">
32     <div class="row">
33         <div class="col-sm-10 col-sm-push-2">
34             <main>
35
36 <h1>Library [% branchcode | html %] - [% Branches.GetName( branchcode ) | html %] Checkin and transfer policy</h1>
37     <form method="get" action="/cgi-bin/koha/admin/branch_transfer_limits.pl" id="selectlibrary">
38         <label for="branchselect">Select a library :</label>
39         <select name="branchcode" id="branchselect">
40             [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1 ) %]
41         </select>
42     </form>
43
44 <p class="help">Check the boxes for the libraries you allow your items to be transferred to.</p>
45 <fieldset>
46     [% IF ( limitType == 'ccode' ) %]<strong>For all collection codes: </strong>[% ELSE %]<strong>For all item types: </strong>[% END %]
47     <a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a>
48     |
49     <a id="UncheckAll" href="#"><i class="fa fa-remove"></i> Clear all</a>
50     |
51     <a href="/cgi-bin/koha/admin/transfer_limits.pl">Switch to advanced editor</a>
52 </fieldset>
53
54
55   <div id="transferlimit_tabs" class="toptabs">
56     <ul class="ui-tabs-nav">
57       [% FOREACH codes_loo IN codes_loop %]<li><a href="#[% codes_loo.code | uri %]set">[% codes_loo.code | html %]</a></li>[% END %]
58     </ul>
59
60         <form method="post" action="branch_transfer_limits.pl">
61
62     [% FOREACH codes_loo IN codes_loop %]
63     <div id="[% codes_loo.code | html %]set">
64     <h4>Policy for [% codes_loo.limit_phrase | html %]: [% codes_loo.code | html %]</h4>
65
66     <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-remove"></i> Clear all</a></p>
67
68         <table id="[% codes_loo.code | html %]table" class="sorted">
69             <thead>
70                 <tr>
71                     <th>Library</th>
72                     <th>Allow transfer?</th>
73                 </tr>
74             </thead>
75
76             <tbody>
77                     [% FOREACH to_branch_loo IN codes_loo.to_branch_loop %]
78                         <tr>
79                             <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>
80                             <td>
81                             [% IF ( to_branch_loo.isChecked ) %]
82                                 <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" />
83                             [% ELSE %]
84                                 <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 %]" />
85                             [% END %]
86                             </td>
87                         </tr>
88                     [% END %]
89             </tbody>
90         </table>
91         </div>
92                 [% END %]
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" value="Save" />
98             <a class="cancel" href="/cgi-bin/koha/admin/admin-home.pl">Cancel</a>
99         </fieldset>
100         </form>
101         </div>
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             $('#transferlimit_tabs').tabs();
132
133              $('#branchselect').change(function() {
134                 $('#selectlibrary').submit();
135              });
136
137             var checkall = $(".checkall");
138             var uncheckall = $(".uncheckall");
139
140             $(checkall).on("click", function(e){
141                 e.preventDefault();
142                 var tid = $(this).data("cb");
143                 $(".cb" + tid ).each(function(){
144                     $(this).prop("checked", true);
145                 })
146             });
147
148             $(uncheckall).on("click", function(e){
149                 e.preventDefault();
150                 var tid = $(this).data("cb");
151                 $(".cb" + tid ).each(function(){
152                     $(this).prop("checked", false);
153                 })
154             });
155
156             $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
157                 "aoColumnDefs": [
158                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
159                 ],
160                 'bPaginate': false
161             }));
162         });
163     </script>
164 [% END %]
165 [% INCLUDE 'intranet-bottom.inc' %]