Bug 22580: Remove deprecated delete_expired_opac_registrations.pl cronjob
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / item_circulation_alerts.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Branches %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Administration &rsaquo; Item circulation alerts</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 <style>
9 table.grid thead th {
10   vertical-align: bottom;
11 }
12
13 table.grid tbody th {
14   text-align: right;
15 }
16
17 table.grid tbody td {
18   font-size: xx-small;
19 }
20
21 table.grid tbody td.info {
22   background: #fff;
23 }
24
25 table.grid.active tbody td {
26   width: 10%;
27   cursor: pointer;
28 }
29
30 table.grid tbody td {
31   background: #cfc;
32   color: #111;
33 }
34
35 table.grid td.disabled {
36   background: #fcc;
37 }
38
39 table.grid td.default {
40   background: #f88;
41 }
42 </style>
43 </head>
44
45 <body id="admin_item_circulation_alerts" class="admin">
46 [% INCLUDE 'header.inc' %]
47 [% INCLUDE 'prefs-admin-search.inc' %]
48 <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>
49
50 <div class="main container-fluid">
51     <div class="row">
52         <div class="col-sm-10 col-sm-push-2">
53             <main>
54                 <div class="row">
55                     <div class="col-sm-6">
56 <h1>Item circulation alerts</h1>
57 <h2>Select a library:</h2>
58 <form id="branch_selector" method="get" action="/cgi-bin/koha/admin/item_circulation_alerts.pl">
59 <select id="branch" name="branch">
60     <option value="*">Default</option>
61     [% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %]
62 </select>
63 <input type="submit" name="pick" value="Pick" />
64 </form>
65 </div>
66                     <div class="col-sm-6">
67 <table class="grid">
68 <caption>Legend</caption>
69 <thead>
70 <tr>
71   <th>Color</th>
72   <th>Meaning</th>
73 </tr>
74 </thead>
75 <tbody>
76   <tr>
77     <td width="100" class="default">&nbsp;</td>
78     <td class="info">These are disabled for ALL libraries.  To change these settings, choose the "Default" library.</td>
79   </tr>
80   <tr>
81     <td class="disabled">&nbsp;</td>
82     <td class="info">These are disabled for the current library.</td>
83   </tr>
84   <tr>
85     <td>&nbsp;</td>
86     <td class="info">These are enabled.</td>
87   </tr>
88 </tbody>
89 </table>
90                     </div> <!-- /.col-sm-6 -->
91                 </div> <!-- /.row -->
92
93 <h2>Circulation alerts for [% Branches.GetName( branch ) || 'Default' | html %]</h2>
94 <p>Click on the grid to toggle the settings.</p>
95
96 <div id="alerttabs" class="toptabs">
97 <ul>
98 <li><a href="#checkout">Checkout</a></li>
99 <li><a href="#checkin">Check-in</a></li>
100 </ul>
101
102 <div id="checkout">
103 <h3>Checkout</h3>
104 <table class="grid active" width="100%">
105 <thead>
106 <tr>
107   <th>&nbsp;</th>
108   [% FOREACH item_type IN item_types %]
109   <th>[% item_type.description | html %]</th>
110   [% END %]
111 </tr>
112 </thead>
113 <tbody>
114 [% FOREACH grid_checkou IN grid_checkout %]
115 <tr>
116   <th>[% grid_checkou.description | html %]</th>
117   [% FOREACH item IN grid_checkou.items %]
118   <td class="[% item.class | html %]" id="[% item.id | html %]">[% item.text | html %]</td>
119   [% END %]
120 </tr>
121 [% END %]
122 </tbody>
123 </table>
124 </div>
125
126 <div id="checkin">
127 <h3>Check-in</h3>
128 <table class="grid active" width="100%">
129 <thead>
130 <tr>
131   <th>&nbsp;</th>
132   [% FOREACH item_type IN item_types %]
133   <th>[% item_type.description | html %]</th>
134   [% END %]
135 </tr>
136 </thead>
137 <tbody>
138 [% FOREACH grid_checki IN grid_checkin %]
139 <tr>
140   <th>[% grid_checki.description | html %]</th>
141   [% FOREACH item IN grid_checki.items %]
142   <td class="[% item.class | html %]" id="[% item.id | html %]">[% item.text | html %]</td>
143   [% END %]
144 </tr>
145 [% END %]
146 </tbody>
147 </table>
148 </div>
149 </div>
150
151             </main>
152         </div> <!-- /.col-sm-10.col-sm-push-2 -->
153
154         <div class="col-sm-2 col-sm-pull-10">
155             <aside>
156                 [% INCLUDE 'admin-menu.inc' %]
157             </aside>
158         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
159      </div> <!-- /.row -->
160
161 [% MACRO jsinclude BLOCK %]
162     [% Asset.js("js/admin-menu.js") | $raw %]
163     <script>
164         var $branch = "[% branch | html %]";
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' %]