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