Merge remote-tracking branch 'kc/master' into merged_5549
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / branch_transfer_limits.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; Library Checkin and Transfer Policy</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
5 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
6 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
7 <script type="text/javascript">
8 //<![CDATA[
9         $(document).ready(function(){
10                 $("#CheckAll").click(function(){ $("#transferlimit_tabs").checkCheckboxes();});
11                 $("#UncheckAll").click(function(){ $("#transferlimit_tabs").unCheckCheckboxes();});
12                 $("#SwapAll").click(function(){ $("#transferlimit_tabs").toggleCheckboxes();});
13             $('#transferlimit_tabs > ul').tabs();
14
15                  $('#branchselect').change(function() {
16                     $('#selectlibrary').submit();
17                  });
18
19
20                 var checkcolumn = $(".checkcolumn");
21                 var checkrow = $(".checkrow");
22                 var checkall = $(".checkall");
23                 var uncheckall = $(".uncheckall");
24
25                 $(checkcolumn).click(function(){
26                         if(this.checked){ status = "checked" } else { status = "" }
27                         var tableid = $(this).parent().parent().parent().parent().attr("id");
28                         var columncontext = $(this).parent();
29                         var tdindex = columncontext.parent().children().index(columncontext);
30                         $("#"+tableid+" tr td:nth-child("+(tdindex+2)+") input[type='checkbox']").attr("checked",status);
31                 });
32
33                 $(checkrow).click(function(){
34                         if(this.checked){ status = "checked" } else { status = "" }
35                         $(this).parent().siblings().each(function(){
36                                 $(this).find("input[type='checkbox']").attr("checked",status);
37                         })
38                 });
39
40                 $(checkall).click(function(){
41                         var tid = $(this).attr("id");
42                         tid = tid.replace("CheckAll","");
43                         $("#"+tid).checkCheckboxes();
44                         return false;
45                 });
46
47                 $(uncheckall).click(function(){
48                         var tid = $(this).attr("id");
49                         tid = tid.replace("UncheckAll","");
50                         $("#"+tid).unCheckCheckboxes();
51                         return false;
52                 });
53                 $(".sorted").tablesorter({
54                         sortList: [[0,0]],
55                         headers: { 1: { sorter: false}}
56                 }).tablesorterPager({container: $(".pager"),positionFixed: false,size: 10});
57         });
58 //]]>
59 </script>
60 <style type="text/css">td { text-align: center; }</style>
61 </head>
62 <body>
63 [% INCLUDE 'header.inc' %]
64 [% INCLUDE 'cat-search.inc' %]
65
66 <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>
67
68 <div id="doc3" class="yui-t1">
69
70 <div id="bd">
71      <div id="yui-main">
72     <div class="yui-b">
73
74 <h1>Library [% branchcode %] - [% branchname %] Checkin and Transfer Policy</h1>
75     <form method="get" action="/cgi-bin/koha/admin/branch_transfer_limits.pl" id="selectlibrary">
76         <label for="branchselect">Select a library :</label>
77             <select name="branchcode" id="branchselect">
78                 [% FOREACH branch_loo IN branch_loop %]
79                         [% IF ( branch_loo.selected ) %]
80                 <option value="[% branch_loo.value %]" selected="selected">[% branch_loo.branchname %]</option>
81             [% ELSE %]
82                 <option value="[% branch_loo.value %]">[% branch_loo.branchname %]</option>
83             [% END %]
84                 [% END %]
85             </select>
86             <input type="submit" value="Choose" />          
87     </form>
88
89 <p class="help">Check the boxes for the libraries you accept to checkin items from.</p>
90 <fieldset>For <strong>all</strong> [% limit_phrase %]s: <a id="CheckAll" href="#">Check All</a> | <a id="UncheckAll" href="#">Uncheck All</a></fieldset>
91
92
93   <div id="transferlimit_tabs" class="toptabs">
94         <ul class="ui-tabs-nav">
95       [% FOREACH codes_loo IN codes_loop %]<li><a href="#[% codes_loo.code %]set">[% codes_loo.code %]</a></li>[% END %]
96         </ul>
97
98                 <form method="post" action="branch_transfer_limits.pl">
99
100         [% FOREACH codes_loo IN codes_loop %]
101         <div id="[% codes_loo.code %]set">
102                 <h4>Policy for [% codes_loo.limit_phrase %]: [% codes_loo.code %]</h4>
103         <p><a id="CheckAll[% codes_loo.code %]table" class="checkall" href="#">Check All</a> | <a id="UncheckAll[% codes_loo.code %]table" class="uncheckall" href="#">Uncheck All</a></p>
104         
105         <div id="pager[% codes_loo.code %]table">
106         [% INCLUDE 'table-pager.inc' perpage='20' %]
107         </div>
108                 <table id="[% codes_loo.code %]table" class="sorted">
109                         <thead>
110                                 <tr>
111                                     <th>Library</th>
112                                     <th>Allow transfer?</th>
113                                 </tr>
114                         </thead>
115
116                         <tbody>
117                                         [% FOREACH to_branch_loo IN codes_loo.to_branch_loop %]
118                                                 [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
119                                                         <td><label style="min-width:400px;" for="[% to_branch_loo.code %][% to_branch_loo.toBranch %]row">[% to_branch_loo.toBranch %] - [% to_branch_loo.toBranchname %]</label></td>
120                                                         <td>
121                                                         [% IF ( to_branch_loo.isChecked ) %]
122                                                                 <input type="checkbox" id="[% to_branch_loo.code %][% to_branch_loo.toBranch %]row" name="[% to_branch_loo.code %]_[% to_branch_loo.toBranch %]" checked="checked" />
123                                                         [% ELSE %]
124                                                                 <input type="checkbox" id="[% to_branch_loo.code %][% to_branch_loo.toBranch %]row" name="[% to_branch_loo.code %]_[% to_branch_loo.toBranch %]" />
125                                                         [% END %]
126                                                         </td>
127                                                 </tr>
128                                         [% END %]
129                         </tbody>
130                 </table>
131                 </div>
132                                 [% END %]
133                 
134                 <fieldset class="action">
135                     <input type="hidden" name="updateLimits" value="1" />
136                     <input type="hidden" name="branchcode" value="[% branchcode %]" />
137                     <input type="submit" value="Save" /> 
138                     <a class="cancel" href="/cgi-bin/koha/admin/admin-home.pl">Cancel</a>
139                 </fieldset>
140                 </form>
141                 </div>
142   </div>
143 </div>
144 <div class="yui-b">
145   [% INCLUDE 'admin-menu.inc' %]
146 </div>
147 </div>
148 [% INCLUDE 'intranet-bottom.inc' %]