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