Merge commit 'kc/master'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / item_circulation_alerts.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Administration &rsaquo; Item Circulation Alerts</title>
3 <!-- TMPL_INCLUDE NAME="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 = "<!-- TMPL_VAR NAME="branch" -->";
42 $(function(){
43     $('#alerttabs > ul').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>
89 <!-- TMPL_INCLUDE NAME="header.inc" -->
90 <!-- TMPL_INCLUDE NAME="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 <!-- TMPL_LOOP NAME="branches" -->
107 <!-- TMPL_IF NAME="selected" -->
108 <option value="<!-- TMPL_VAR NAME="branchcode" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
109 <!-- TMPL_ELSE -->
110 <option value="<!-- TMPL_VAR NAME="branchcode" -->"><!-- TMPL_VAR NAME="branchname" --></option>
111 <!-- /TMPL_IF -->
112 <!-- /TMPL_LOOP -->
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 <!-- TMPL_VAR NAME="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   <!-- TMPL_LOOP NAME="item_types" -->
160   <th><!-- TMPL_VAR NAME="br_description" --></th>
161   <!-- /TMPL_LOOP -->
162 </tr>
163 </thead>
164 <tbody>
165 <!-- TMPL_LOOP NAME="grid_checkout" -->
166 <tr>
167   <th><!-- TMPL_VAR NAME="description" --></th>
168   <!-- TMPL_LOOP NAME="items" -->
169   <td class="<!-- TMPL_VAR NAME="class" -->" id="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="text" --></td>
170   <!-- /TMPL_LOOP -->
171 </tr>
172 <!-- /TMPL_LOOP -->
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   <!-- TMPL_LOOP NAME="item_types" -->
184   <th><!-- TMPL_VAR NAME="br_description" --></th>
185   <!-- /TMPL_LOOP -->
186 </tr>
187 </thead>
188 <tbody>
189 <!-- TMPL_LOOP NAME="grid_checkin" -->
190 <tr>
191   <th><!-- TMPL_VAR NAME="description" --></th>
192   <!-- TMPL_LOOP NAME="items" -->
193   <td class="<!-- TMPL_VAR NAME="class" -->" id="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="text" --></td>
194   <!-- /TMPL_LOOP -->
195 </tr>
196 <!-- /TMPL_LOOP -->
197 </tbody>
198 </table>
199 </div>
200 </div>
201
202 </div>
203 </div>
204
205 <div class="yui-b">
206 <!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
207 </div>
208 </div>
209 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->