Bug 7758 - Koha allowing LOST items to check out without alert
[koha_gimpoz] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / pendingreserves.tt
index 75fcb52..426f06d 100644 (file)
@@ -1,5 +1,5 @@
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Circulation &rsaquo; Holds to Pull</title>
+<title>Koha &rsaquo; Circulation &rsaquo; Holds to pull</title>
 [% INCLUDE 'doc-head-close.inc' %]
 <!-- Additions to enable Calendar system -->
 <link rel="stylesheet" type="text/css" href="[% themelang %]/lib/calendar/calendar-system.css" />
@@ -7,42 +7,59 @@
 <script type="text/javascript" src="[% themelang %]/lib/calendar/calendar.js"></script>
 <script type="text/javascript" src="[% themelang %]/lib/calendar/calendar-en.js"></script>
 <script type="text/javascript" src="[% themelang %]/lib/calendar/calendar-setup.js"></script>
-<!-- End of additions -->
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+<!-- Plugin datatables -->
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
 <script type="text/JavaScript" language="JavaScript">
 //<![CDATA[
-$.tablesorter.addParser({
-    id: 'articles', 
-    is: function(s) {return false;  }, 
-    format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, 
-    type: 'text' 
+$(document).ready(function() {
+  var holdst = $("#holdst").dataTable($.extend(true, {}, dataTablesDefaults, {
+  }));
+  holdst.fnAddFilters("filter");
+  function createSelect( data ) {
+      var r='<select style="width:99%"><option value="">None</option>', i, len=data.length;
+      for ( i=0 ; i<len ; i++ ) {
+          r += '<option value="'+data[i]+'">'+data[i]+'</option>';
+      }
+      return r+'</select>';
+  }
+  $("#homebranchfilter").each( function () {
+      $(this).html( createSelect( holdst.fnGetColumnData(4) ) );
+      $('select', this).change( function () {
+          holdst.fnFilter( $(this).val(), 4 );
+      } );
+  } );
+  $("#itypefilter").each( function () {
+      $(this).html( createSelect( holdst.fnGetColumnData(8) ) );
+      $('select', this).change( function () {
+          holdst.fnFilter( $(this).val(), 8 );
+      } );
+  } );
+  $("#locationfilter").each( function () {
+      $(this).html( createSelect( holdst.fnGetColumnData(9) ) );
+      $('select', this).change( function () {
+          holdst.fnFilter( $(this).val(), 9 );
+      } );
+  } );
 });
-        $(document).ready(function() {
-               $("th a").hide();
-               $.tablesorter.defaults.widgets = ['zebra'];
-               $("#holdst").tablesorter({[% IF ( dateformat == 'metric' ) %]
-               dateFormat: 'uk',[% END %]
-                       sortList: [[3,0]],
-                       headers: { 0:{sorter:false},1:{sorter:false},3: { sorter: 'articles' },7:{sorter:false}}
-               }); 
-        });
 //]]>
 </script>
 </head>
-<body>
+<body id="circ_pendingreserves" class="circ">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'circ-search.inc' %]
 
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo; Holds to Pull</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo; Holds to pull</div>
 
 <div id="doc3" class="yui-t2">
-   
+
    <div id="bd">
-       <div id="yui-main">
-       <div class="yui-b">
+    <div id="yui-main">
+    <div class="yui-b">
 
-<h2>Holds to Pull[% IF ( run_report ) %] placed between [% from %] and [% to %][% END %]</h2>
+<h2>Holds to pull[% IF ( run_report ) %] placed between [% from %] and [% to %][% END %]</h2>
 [% IF ( run_report ) %]
 <h3>Reported on [% todaysdate %]</h3>
 <p>The following holds have not been filled. Please retrieve them and check them in.</p>
@@ -50,122 +67,69 @@ $.tablesorter.addParser({
     [% IF ( reserveloop ) %]
     <table id="holdst">
     <thead>
-    <tr>
-        <th>
-                               Pull This Many Items
-        </th>        
-        <th>
-                               Items Available
-        </th>
-        <th>
-                               Patrons with Holds
-        </th>
-        <th>Title
-        <a href="/cgi-bin/koha/circ/pendingreserves.pl?order=biblio&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
-        </th>
-        <th>
-            Libraries
-                               <a href="/cgi-bin/koha/circ/pendingreserves.pl?order=library&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
-        </th>
-        <th>
-            Available Call Numbers
-                               <a href="/cgi-bin/koha/circ/pendingreserves.pl?order=call&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
-        </th>
-        <th>
-            Available Itypes
-                               <a href="/cgi-bin/koha/circ/pendingreserves.pl?order=itype&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
-        </th>
-        <th>
-            Available Locations
-                               <a href="/cgi-bin/koha/circ/pendingreserves.pl?order=location&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
-        </th>
-        <th >Earliest Hold Date
-            <a href="/cgi-bin/koha/circ/pendingreserves.pl?order=date&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
-        </th>
-    </tr>
-    </thead>
-    <tbody>
-        [% IF ( next_or_previous ) %]
         <tr>
-            <td colspan="3" align="left">
-            [% IF ( prev_results ) %]
-                <form action="/cgi-bin/koha/circ/pendingreserves.pl" method="POST">
-                    <input type="hidden" name="from" value="[% from %]">
-                    <input type="hidden" name="to" value="[% to %]">
-                    <input type="hidden" name="report_page" value="[% prev_results %]">
-                    <input type="submit" name="run_report" value="&lt; Prev">
-                </form>
-            [% END %]
-            </td>
-            <td colspan="3"></td>
-            <td colspan="3" align="right">
-            [% IF ( next_results ) %]
-                <form action="/cgi-bin/koha/circ/pendingreserves.pl" method="POST">
-                    <input type="hidden" name="from" value="[% from %]">
-                    <input type="hidden" name="to" value="[% to %]">
-                    <input type="hidden" name="report_page" value="[% next_results %]">
-                    <input type="submit" name="run_report" value="Next &gt;">
-                </form>
-            [% END %]
-            </td>
+        <th>Pull this many items</th>
+        <th>Items available</th>
+        <th>Patrons with holds</th>
+        <th>Title</th>
+        <th>Libraries</th>
+        <th>Available call numbers</th>
+        <th>Available copy No</th>
+        <th>Available enumeration</th>
+        <th>Available itypes</th>
+        <th>Available locations</th>
+        <th>Earliest hold date</th>
         </tr>
-        [% END %]
+    </thead>
+    <tbody>
         [% FOREACH reserveloo IN reserveloop %]
         <tr>
-            [% IF ( reserveloo.borrowernumber ) %]
-                <td><p><b>[% reserveloo.pullcount %]</b></p></td>
-                <td>[% reserveloo.count %]</td>  
-                <td>[% reserveloo.rcount %]</td> 
-                <td>
-                    <p>
-            [% INCLUDE 'biblio-default-view.inc' %]
-                                [% reserveloo.title |html %] [% reserveloo.subtitle %]
-                            </a>
-                    </p>
-                </td>
-            [% ELSE %]
-                <td colspan="3">
-                    &nbsp;
-                </td>
-                <td>"</td>
-            [% END %]
-            <td><p>[% reserveloo.holdingbranch %]</p></td>
-            <td><p>[% reserveloo.itemcallnumber %]</p></td>
-                               <td><p>[% reserveloo.itype %]</p></td> 
-                               <td><p>[% reserveloo.location %]</p></td>
-            <td width="15%">
-                <p>[% reserveloo.reservedate %]</p>
-                <p>in [% reserveloo.branch %]</p>
-                [% IF ( reserveloo.statusw ) %]<p>Waiting</p>[% END %][% IF ( reserveloo.statusf ) %]<p>Fullfilled</p>[% END %]
+        [% IF ( reserveloo.borrowernumber ) %]
+            <td><p><b>[% reserveloo.pullcount %]</b></p></td>
+            <td>[% reserveloo.count %]</td>
+            <td>[% reserveloo.rcount %]</td>
+            <td>
+            <p>
+        [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %]
+                    [% reserveloo.title |html %]
+                </a> [% IF ( reserveloo.author ) %]<p> by [% reserveloo.author %]</p>[% END %]
+            </p>
             </td>
-        </tr>
+        [% ELSE %]
+            <td>"</td>
+            <td>"</td>
+            <td>"</td>
+            <td>"</td>
         [% END %]
-        [% IF ( next_or_previous ) %]
-        <tr>
-            <td colspan="3" align="left">
-            [% IF ( prev_results ) %]
-                <form action="/cgi-bin/koha/circ/pendingreserves.pl" method="POST">
-                    <input type="hidden" name="from" value="[% from %]">
-                    <input type="hidden" name="to" value="[% to %]">
-                    <input type="hidden" name="report_page" value="[% prev_results %]">
-                    <input type="submit" name="run_report" value="&lt; Prev">
-                </form>
-            [% END %]
-            </td>
-            <td colspan="3"></td>
-            <td colspan="3" align="right">
-            [% IF ( next_results ) %]
-                <form action="/cgi-bin/koha/circ/pendingreserves.pl" method="POST">
-                    <input type="hidden" name="from" value="[% from %]">
-                    <input type="hidden" name="to" value="[% to %]">
-                    <input type="hidden" name="report_page" value="[% next_results %]">
-                    <input type="submit" name="run_report" value="Next &gt;">
-                </form>
-            [% END %]
-            </td>
+        <td>[% reserveloo.holdingbranch %]</td>
+        <td><p>[% reserveloo.itemcallnumber %]</p></td>
+        <td><p>[% reserveloo.copyno %]</p></td>
+        <td><p>[% reserveloo.enumchron %]</p></td>
+        <td>[% reserveloo.itype %]</td>
+        <td>[% reserveloo.location %]</td>
+        <td width="15%">
+            <p>[% reserveloo.reservedate %]</p>
+            <p>in [% reserveloo.branch %]</p>
+            [% IF ( reserveloo.statusw ) %]<p>Waiting</p>[% END %][% IF ( reserveloo.statusf ) %]<p>Fullfilled</p>[% END %]
+        </td>
         </tr>
         [% END %]
     </tbody>
+    <tfoot>
+        <tr>
+        <td><input type="text" class="filter" data-column_num="0" placeholder="Pull this many items" style="width:95%"/></td>
+        <td><input type="text" class="filter" data-column_num="1" placeholder="Items available" style="width:95%"/></td>
+        <td><input type="text" class="filter" data-column_num="2" placeholder="Patron holds" style="width:95%"/></td>
+        <td><input type="text" class="filter" data-column_num="3" placeholder="Title" style="width:95%"/></td>
+        <td id="homebranchfilter"></td>
+        <td><input type="text" class="filter" data-column_num="5" placeholder="Call number" style="width:95%"/></td>
+        <td><input type="text" class="filter" data-column_num="6" placeholder="Available copy" style="width:95%"/></td>
+        <td><input type="text" class="filter" data-column_num="7" placeholder="Available enumeration" style="width:95%"/></td>
+        <td id="itypefilter"></td>
+        <td id="locationfilter"></td>
+        <td></td>
+        </tr>
+    </tfoot>
     </table>
     [% ELSE %]
         <b>No items found.</b>