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