[Koha-patches] [PATCH] bug 2523: add columns to holds queue report

Galen Charlton galen.charlton at liblime.com
Fri Aug 15 03:59:52 CEST 2008


* added author, ccode, location, and item enumchron
* sorted by collection, locatoin, call number, author, title

As part of this patch, commented out the JavaScript tablesorter,
which could cause the browerer to lock up if the picklist
contains more than a couple hundred items to pull.
Some sort of pagination is clearly required, but since
it is necessary for customers to be able to print out
the picklist, there still needs to be an option to
see the complete list for a branch.

This patch includes the final component of the fix
for bug 2331.
---
 circ/view_holdsqueue.pl                            |   17 +++++-
 .../prog/en/modules/circ/view_holdsqueue.tmpl      |   55 ++++++++++++--------
 2 files changed, 47 insertions(+), 25 deletions(-)

diff --git a/circ/view_holdsqueue.pl b/circ/view_holdsqueue.pl
index 1b8c09b..739dbe0 100755
--- a/circ/view_holdsqueue.pl
+++ b/circ/view_holdsqueue.pl
@@ -23,6 +23,7 @@ This script displays items in the tmp_holdsqueue table
 =cut
 
 use strict;
+use warnings;
 use CGI;
 use C4::Auth;
 use C4::Output;
@@ -92,10 +93,20 @@ $template->param( branchloop     => \@branchloop,
 sub GetHoldsQueueItems {
 	my ($branchlimit,$itemtypelimit) = @_;
 	my $dbh = C4::Context->dbh;
-	my $query = "SELECT * FROM tmp_holdsqueue";
-	$query.=" WHERE holdingbranch = \"$branchlimit\"" if $branchlimit;
+
+    my @bind_params = ();
+	my $query = q/SELECT tmp_holdsqueue.*, biblio.author, items.ccode, items.location, items.enumchron, items.cn_sort
+                  FROM tmp_holdsqueue
+                  JOIN biblio USING (biblionumber)
+                  LEFT JOIN items USING (itemnumber)
+                /;
+    if ($branchlimit) {
+	    $query .=" WHERE holdingbranch = ?";
+        push @bind_params, $branchlimit;
+    }
+    $query .= " ORDER BY ccode, location, cn_sort, author, title, pickbranch, reservedate";
 	my $sth = $dbh->prepare($query);
-	$sth->execute();
+	$sth->execute(@bind_params);
 	my $items = [];
     while ( my $row = $sth->fetchrow_hashref ){
 		$row->{reservedate} = format_date($row->{reservedate});
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tmpl
index d819121..8a9d4c2 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tmpl
@@ -4,20 +4,20 @@
 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.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() {
-		$.tablesorter.defaults.widgets = ['zebra']; 
-		$("#holdst").tablesorter({<!-- TMPL_IF EXPR="dateformat eq 'metric'" -->
-		dateFormat: 'uk',<!-- /TMPL_IF -->
-		sortList: [[1,0]],
-		headers: { 0: { sorter: 'articles' }}
-		});
-	 });
+//$.tablesorter.addParser({
+//    id: 'articles', 
+//    is: function(s) {return false;  }, 
+//    format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, 
+//    type: 'text' 
+//});
+//	 $(document).ready(function() {
+//		$.tablesorter.defaults.widgets = ['zebra']; 
+//		$("#holdst").tablesorter({<!-- TMPL_IF EXPR="dateformat eq 'metric'" -->
+//		dateFormat: 'uk',<!-- /TMPL_IF -->
+//		sortList: [[1,0]],
+//		headers: { 0: { sorter: 'articles' }}
+//		});
+//	 });
 //]]>
 </script>
 </head>
@@ -50,22 +50,33 @@ $.tablesorter.addParser({
 	<thead>
 	<tr>
         <th>Title</th>
+        <th>Author</th>
+        <th>Collection</th>
+        <th>Shelving Location</th>
         <th>Call Number</th>
-        <th>Patron</th>
-        <th>Phone Number</th>
-        <th>Date</th>
+        <th>Barcode</th>
+        <th>Enumeration</th>
         <th>Send To</th>
+        <th>Date</th>
     </tr>
 	</thead>
      <tbody><!-- TMPL_LOOP NAME="itemsloop"-->
         <tr>
-            <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber"-->"><!-- TMPL_VAR NAME="title"--></a> (<!-- TMPL_VAR NAME="barcode" -->)</td>
+            <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber"-->"><!-- TMPL_VAR NAME="title"--></a></td>
+            <td><!-- TMPL_VAR NAME="author" --></td>
+            <td><!-- TMPL_VAR NAME="ccode" --></td>
+            <td><!-- TMPL_VAR NAME="location" --></td>
             <td><!-- TMPL_VAR NAME="itemcallnumber"--></td>
-            <td><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber"-->"><!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR NAME="firstname" --></a> (<!-- TMPL_VAR NAME="cardnumber"-->)</td>
-
-            <td><!-- TMPL_VAR NAME="phone"--></td>
-            <td><!-- TMPL_VAR NAME="reservedate" --></td>
+            <td>
+                <!-- TMPL_IF NAME="item_level_request" -->
+                    <!-- TMPL_VAR NAME="barcode" -->
+                <!-- TMPL_ELSE -->
+                    <em>Any available copy</em>
+                <!-- /TMPL_IF -->
+            </td>
+            <td><!-- TMPL_VAR NAME="enumchron" --></td>
             <td><!-- TMPL_VAR NAME="pickbranch" --></td>
+            <td><!-- TMPL_VAR NAME="reservedate" --></td>
         </tr>
     <!-- /TMPL_LOOP --></tbody>
     </table>
-- 
1.5.5.GIT




More information about the Koha-patches mailing list