Merge branch 'bug_9341' into 3.12-master
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / item_circulation_alerts.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; Item circulation alerts</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <style type="text/css">
5 table.grid thead th {
6   vertical-align: bottom;
7 }
8
9 table.grid tbody th {
10   text-align: right;
11 }
12
13 table.grid tbody td {
14   font-size: xx-small;
15 }
16
17 table.grid tbody td.info {
18   background: #fff;
19 }
20
21 table.grid.active tbody td {
22   width: 10%;
23   cursor: pointer;
24 }
25
26 table.grid tbody td {
27   background: #cfc;
28   color: #111;
29 }
30
31 table.grid td.disabled {
32   background: #fcc;
33 }
34
35 table.grid td.default {
36   background: #f88;
37 }
38 </style>
39
40 <script type="text/javascript">//<![CDATA[
41 var $branch = "[% branch %]";
42 $(function(){
43     $('#alerttabs').tabs();
44
45     var blocked            = _("Blocked!");
46     var saving             = _("Saving...");
47     var disabledForAll     = _("Disabled for all");
48     var disabledForCurrent = _("Disabled for") + ' ' + $branch;
49
50     $('#branch_selector input:submit').hide();
51     $('#branch').change(function(){
52         $('#branch_selector').submit();
53     });
54
55     $('table.grid.active tbody td').click(function(ev){
56         var id = this.id;
57         var td = $(this);
58         if (td.hasClass('default') && $branch != '*') {
59             td.html(blocked);
60             window.setTimeout(
61               function(){ td.html(disabledForAll) },
62               3000
63             );
64         } else {
65             td.html(saving);
66             $.ajax({
67                 url      : '/cgi-bin/koha/admin/item_circulation_alerts.pl',
68                 type     : 'POST',
69                 dataType : 'json',
70                 data     : { action: 'toggle', id: id, branch: $branch },
71                 success  : function(response){
72                     if ($branch == '*' && response.classes.match(/default/)) {
73                         td.html(disabledForAll);
74                     } else if (response.classes.match(/disabled/)) {
75                         td.html(disabledForCurrent);
76                     } else {
77                         td.html(' ');
78                     }
79                     td.attr('class', response.classes);
80                 }
81             });
82         }
83     });
84
85 }); //]]>
86 </script>
87 </head>
88 <body id="admin_item_circulation_alerts" class="admin">
89 [% INCLUDE 'header.inc' %]
90 [% INCLUDE 'cat-search.inc' %]
91 <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; Item circulation alerts </div>
92
93 <div id="doc3" class="yui-t1">
94
95 <div id="bd">
96
97 <div id="yui-main" class="circulation-alert">
98 <div class="yui-b">
99
100 <div class="yui-g">
101 <div class="yui-u first">
102 <h1>Item circulation alerts</h1>
103 <h2>Select a library:</h2>
104 <form id="branch_selector" method="get" action="/cgi-bin/koha/admin/item_circulation_alerts.pl">
105 <select id="branch" name="branch">
106 [% FOREACH branche IN branches %]
107 [% IF ( branche.selected ) %]
108 <option value="[% branche.branchcode %]" selected="selected">[% branche.branchname %]</option>
109 [% ELSE %]
110 <option value="[% branche.branchcode %]">[% branche.branchname %]</option>
111 [% END %]
112 [% END %]
113 </select>
114 <input type="submit" name="pick" value="Pick" />
115 </form>
116 </div>
117 <div class="yui-u">
118 <table class="grid">
119 <caption>Legend</caption>
120 <thead>
121 <tr>
122   <th>Color</th>
123   <th>Meaning</th>
124 </tr>
125 </thead>
126 <tbody>
127   <tr>
128     <td width="100" class="default">&nbsp;</td>
129     <td class="info">These are disabled for ALL libraries.  To change these settings, choose the "Default" library.</td>
130   </tr>
131   <tr>
132     <td class="disabled">&nbsp;</td>
133     <td class="info">These are disabled for the current library.</td>
134   </tr>
135   <tr>
136     <td>&nbsp;</td>
137     <td class="info">These are enabled.</td>
138   </tr>
139 </tbody>
140 </table>
141 </div>
142 </div>
143
144 <h2>Circulation alerts for [% branch_name %]</h2>
145 <p>Click on the grid to toggle the settings.</p>
146
147 <div id="alerttabs" class="toptabs">
148 <ul>
149 <li><a href="#checkout">Checkout</a></li>
150 <li><a href="#checkin">Check-in</a></li>
151 </ul>
152
153 <div id="checkout">
154 <h3>Checkout</h3>
155 <table class="grid active" width="100%">
156 <thead>
157 <tr>
158   <th>&nbsp;</th>
159   [% FOREACH item_type IN item_types %]
160   <th>[% item_type.br_description %]</th>
161   [% END %]
162 </tr>
163 </thead>
164 <tbody>
165 [% FOREACH grid_checkou IN grid_checkout %]
166 <tr>
167   <th>[% grid_checkou.description %]</th>
168   [% FOREACH item IN grid_checkou.items %]
169   <td class="[% item.class %]" id="[% item.id %]">[% item.text %]</td>
170   [% END %]
171 </tr>
172 [% END %]
173 </tbody>
174 </table>
175 </div>
176
177 <div id="checkin">
178 <h3>Check-in</h3>
179 <table class="grid active" width="100%">
180 <thead>
181 <tr>
182   <th>&nbsp;</th>
183   [% FOREACH item_type IN item_types %]
184   <th>[% item_type.br_description %]</th>
185   [% END %]
186 </tr>
187 </thead>
188 <tbody>
189 [% FOREACH grid_checki IN grid_checkin %]
190 <tr>
191   <th>[% grid_checki.description %]</th>
192   [% FOREACH item IN grid_checki.items %]
193   <td class="[% item.class %]" id="[% item.id %]">[% item.text %]</td>
194   [% END %]
195 </tr>
196 [% END %]
197 </tbody>
198 </table>
199 </div>
200 </div>
201
202 </div>
203 </div>
204
205 <div class="yui-b">
206 [% INCLUDE 'admin-menu.inc' %]
207 </div>
208 </div>
209 [% INCLUDE 'intranet-bottom.inc' %]