Bug 9573: Lost items report - Add a new itemlost_on column
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / item_circulation_alerts.tt
index a652bc4..0c26a0f 100644 (file)
@@ -1,5 +1,7 @@
+[% USE Branches %]
+[% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Administration &rsaquo; Item Circulation Alerts</title>
+<title>Koha &rsaquo; Administration &rsaquo; Item circulation alerts</title>
 [% INCLUDE 'doc-head-close.inc' %]
 <style type="text/css">
 table.grid thead th {
@@ -36,59 +38,12 @@ table.grid td.default {
   background: #f88;
 }
 </style>
-
-<script type="text/javascript">//<![CDATA[
-var $branch = "[% branch %]";
-$(function(){
-    $('#alerttabs > ul').tabs();
-
-    var blocked            = _('Blocked!');
-    var saving             = _('Saving...');
-    var disabledForAll     = _('Disabled for all');
-    var disabledForCurrent = _('Disabled for') + ' ' + $branch;
-
-    $('#branch_selector input:submit').hide();
-    $('#branch').change(function(){
-        $('#branch_selector').submit();
-    });
-
-    $('table.grid.active tbody td').click(function(ev){
-        var id = this.id;
-        var td = $(this);
-        if (td.hasClass('default') && $branch != '*') {
-            td.html(blocked);
-            window.setTimeout(
-              function(){ td.html(disabledForAll) },
-              3000
-            );
-        } else {
-            td.html(saving);
-            $.ajax({
-                url      : '/cgi-bin/koha/admin/item_circulation_alerts.pl',
-                type     : 'POST',
-                dataType : 'json',
-                data     : { action: 'toggle', id: id, branch: $branch },
-                success  : function(response){
-                    if ($branch == '*' && response.classes.match(/default/)) {
-                        td.html(disabledForAll);
-                    } else if (response.classes.match(/disabled/)) {
-                        td.html(disabledForCurrent);
-                    } else {
-                        td.html(' ');
-                    }
-                    td.attr('class', response.classes);
-                }
-            });
-        }
-    });
-
-}); //]]>
-</script>
 </head>
+
 <body id="admin_item_circulation_alerts" class="admin">
 [% INCLUDE 'header.inc' %]
-[% INCLUDE 'cat-search.inc' %]
-<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>
+[% INCLUDE 'prefs-admin-search.inc' %]
+<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>
 
 <div id="doc3" class="yui-t1">
 
@@ -99,17 +54,12 @@ $(function(){
 
 <div class="yui-g">
 <div class="yui-u first">
-<h1>Item Circulation Alerts</h1>
+<h1>Item circulation alerts</h1>
 <h2>Select a library:</h2>
 <form id="branch_selector" method="get" action="/cgi-bin/koha/admin/item_circulation_alerts.pl">
 <select id="branch" name="branch">
-[% FOREACH branche IN branches %]
-[% IF ( branche.selected ) %]
-<option value="[% branche.branchcode %]" selected="selected">[% branche.branchname %]</option>
-[% ELSE %]
-<option value="[% branche.branchcode %]">[% branche.branchname %]</option>
-[% END %]
-[% END %]
+    <option value="*">Default</option>
+    [% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %]
 </select>
 <input type="submit" name="pick" value="Pick" />
 </form>
@@ -141,7 +91,7 @@ $(function(){
 </div>
 </div>
 
-<h2>Circulation Alerts for [% branch_name %]</h2>
+<h2>Circulation alerts for [% Branches.GetName( branch ) || 'Default' %]</h2>
 <p>Click on the grid to toggle the settings.</p>
 
 <div id="alerttabs" class="toptabs">
@@ -157,7 +107,7 @@ $(function(){
 <tr>
   <th>&nbsp;</th>
   [% FOREACH item_type IN item_types %]
-  <th>[% item_type.br_description %]</th>
+  <th>[% item_type.description %]</th>
   [% END %]
 </tr>
 </thead>
@@ -181,7 +131,7 @@ $(function(){
 <tr>
   <th>&nbsp;</th>
   [% FOREACH item_type IN item_types %]
-  <th>[% item_type.br_description %]</th>
+  <th>[% item_type.description %]</th>
   [% END %]
 </tr>
 </thead>
@@ -206,4 +156,55 @@ $(function(){
 [% INCLUDE 'admin-menu.inc' %]
 </div>
 </div>
+
+[% MACRO jsinclude BLOCK %]
+    <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu_[% KOHA_VERSION %].js"></script>
+    <script type="text/javascript">
+        var $branch = "[% branch %]";
+        $(function(){
+            $('#alerttabs').tabs();
+
+            var blocked            = _("Blocked!");
+            var saving             = _("Saving...");
+            var disabledForAll     = _("Disabled for all");
+            var disabledForCurrent = _("Disabled for %s").format($branch);
+
+            $('#branch_selector input:submit').hide();
+            $('#branch').change(function(){
+                $('#branch_selector').submit();
+            });
+
+            $('table.grid.active tbody td').click(function(ev){
+                var id = this.id;
+                var td = $(this);
+                if (td.hasClass('default') && $branch != '*') {
+                    td.html(blocked);
+                    window.setTimeout(
+                      function(){ td.html(disabledForAll) },
+                      3000
+                    );
+                } else {
+                    td.html(saving);
+                    $.ajax({
+                        url      : '/cgi-bin/koha/admin/item_circulation_alerts.pl',
+                        type     : 'POST',
+                        dataType : 'json',
+                        data     : { action: 'toggle', id: id, branch: $branch },
+                        success  : function(response){
+                            if ($branch == '*' && response.classes.match(/default/)) {
+                                td.html(disabledForAll);
+                            } else if (response.classes.match(/disabled/)) {
+                                td.html(disabledForCurrent);
+                            } else {
+                                td.html(' ');
+                            }
+                            td.attr('class', response.classes);
+                        }
+                    });
+                }
+            });
+
+        });
+    </script>
+[% END %]
 [% INCLUDE 'intranet-bottom.inc' %]