Bug 27263: Link to preferences mentioned in system preference descriptions
[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 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; Set library checkin and transfer policy</div>
16
17 <div class="main container-fluid">
18     <div class="row">
19         <div class="col-sm-10 col-sm-push-2">
20             <main>
21
22 <h1>Library [% branchcode | html %] - [% Branches.GetName( branchcode ) | html %] Checkin and transfer policy</h1>
23     <form method="get" action="/cgi-bin/koha/admin/branch_transfer_limits.pl" id="selectlibrary">
24         <label for="branchselect">Select a library :</label>
25         <select name="branchcode" id="branchselect">
26             [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1 ) %]
27         </select>
28     </form>
29
30 <p class="help">Check the boxes for the libraries you allow your items to be transferred to.</p>
31 <fieldset>[% IF ( limitType == 'ccode' ) %]<strong>For all collection codes: </strong>[% ELSE %]<strong>For all item types: </strong>[% END %]<a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a> | <a id="UncheckAll" href="#"><i class="fa fa-remove"></i> Clear all</a></fieldset>
32
33
34   <div id="transferlimit_tabs" class="toptabs">
35     <ul class="ui-tabs-nav">
36       [% FOREACH codes_loo IN codes_loop %]<li><a href="#[% codes_loo.code | uri %]set">[% codes_loo.code | html %]</a></li>[% END %]
37     </ul>
38
39         <form method="post" action="branch_transfer_limits.pl">
40
41     [% FOREACH codes_loo IN codes_loop %]
42     <div id="[% codes_loo.code | html %]set">
43     <h4>Policy for [% codes_loo.limit_phrase | html %]: [% codes_loo.code | html %]</h4>
44
45     <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>
46
47         <table id="[% codes_loo.code | html %]table" class="sorted">
48             <thead>
49                 <tr>
50                     <th>Library</th>
51                     <th>Allow transfer?</th>
52                 </tr>
53             </thead>
54
55             <tbody>
56                     [% FOREACH to_branch_loo IN codes_loo.to_branch_loop %]
57                         <tr>
58                             <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>
59                             <td>
60                             [% IF ( to_branch_loo.isChecked ) %]
61                                 <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" />
62                             [% ELSE %]
63                                 <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 %]" />
64                             [% END %]
65                             </td>
66                         </tr>
67                     [% END %]
68             </tbody>
69         </table>
70         </div>
71                 [% END %]
72
73         <fieldset class="action">
74             <input type="hidden" name="updateLimits" value="1" />
75             <input type="hidden" name="branchcode" value="[% branchcode | html %]" />
76             <input type="submit" value="Save" />
77             <a class="cancel" href="/cgi-bin/koha/admin/admin-home.pl">Cancel</a>
78         </fieldset>
79         </form>
80         </div>
81
82             </main>
83         </div> <!-- /.col-sm-10.col-sm-push-2 -->
84
85         <div class="col-sm-2 col-sm-pull-10">
86             <aside>
87                 [% INCLUDE 'admin-menu.inc' %]
88             </aside>
89         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
90      </div> <!-- /.row -->
91
92 [% MACRO jsinclude BLOCK %]
93     [% Asset.js("js/admin-menu.js") | $raw %]
94     [% INCLUDE 'datatables.inc' %]
95     <script>
96         $(document).ready(function(){
97             $("#CheckAll").on("click", function(e){
98                 e.preventDefault();
99                 $(".cb").each(function(){
100                     $(this).prop("checked", true);
101                 });
102             });
103
104             $("#UncheckAll").on("click", function(e){
105                 e.preventDefault();
106                 $(".cb").each(function(){
107                     $(this).prop("checked", false);
108                 });
109             });
110             $('#transferlimit_tabs').tabs();
111
112              $('#branchselect').change(function() {
113                 $('#selectlibrary').submit();
114              });
115
116             var checkall = $(".checkall");
117             var uncheckall = $(".uncheckall");
118
119             $(checkall).on("click", function(e){
120                 e.preventDefault();
121                 var tid = $(this).data("cb");
122                 $(".cb" + tid ).each(function(){
123                     $(this).prop("checked", true);
124                 })
125             });
126
127             $(uncheckall).on("click", function(e){
128                 e.preventDefault();
129                 var tid = $(this).data("cb");
130                 $(".cb" + tid ).each(function(){
131                     $(this).prop("checked", false);
132                 })
133             });
134
135             $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
136                 "aoColumnDefs": [
137                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
138                 ],
139                 'bPaginate': false
140             }));
141         });
142     </script>
143 [% END %]
144 [% INCLUDE 'intranet-bottom.inc' %]