Bug 6807 - Add ISBN filter to advanced order search.
authorAmit Gupta <amit.gupta@osslabs.biz>
Tue, 30 Aug 2011 06:53:54 +0000 (12:23 +0530)
committerChris Cormack <chrisc@catalyst.net.nz>
Thu, 13 Oct 2011 21:57:30 +0000 (10:57 +1300)
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
C4/Acquisition.pm
acqui/histsearch.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt

index f682256..cfc261f 100644 (file)
@@ -1530,6 +1530,7 @@ sub GetHistory {
     my %params = @_;
     my $title = $params{title};
     my $author = $params{author};
+    my $isbn   = $params{isbn};
     my $name = $params{name};
     my $from_placed_on = $params{from_placed_on};
     my $to_placed_on = $params{to_placed_on};
@@ -1546,6 +1547,7 @@ sub GetHistory {
         SELECT
             biblio.title,
             biblio.author,
+           biblioitems.isbn,
             aqorders.basketno,
     aqbasket.basketname,
     aqbasket.basketgroupid,
@@ -1564,6 +1566,7 @@ sub GetHistory {
         LEFT JOIN aqbasket ON aqorders.basketno=aqbasket.basketno
     LEFT JOIN aqbasketgroups ON aqbasket.basketgroupid=aqbasketgroups.id
         LEFT JOIN aqbooksellers ON aqbasket.booksellerid=aqbooksellers.id
+       LEFT JOIN biblioitems ON biblioitems.biblionumber=aqorders.biblionumber
         LEFT JOIN biblio ON biblio.biblionumber=aqorders.biblionumber";
 
     $query .= " LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber"
@@ -1584,6 +1587,11 @@ sub GetHistory {
         push @query_params, "%$author%";
     }
 
+    if ( defined $isbn ) {
+        $query .= " AND biblioitems.isbn LIKE ? ";
+        push @query_params, "%$isbn%";
+    }
+
     if ( defined $name ) {
         $query .= " AND aqbooksellers.name LIKE ? ";
         push @query_params, "%$name%";
index 82ba04f..ff68599 100755 (executable)
@@ -61,6 +61,7 @@ use C4::Debug;
 my $input = new CGI;
 my $title                   = $input->param( 'title');
 my $author                  = $input->param('author');
+my $isbn                   = $input->param('isbn');
 my $name                    = $input->param( 'name' );
 my $basket                  = $input->param( 'basket' );
 my $booksellerinvoicenumber = $input->param( 'booksellerinvoicenumber' );
@@ -91,12 +92,13 @@ if ( $d = $input->param('iso') ) {
 
 my ( $order_loop, $total_qty, $total_price, $total_qtyreceived );
 # If we're supplied any value then we do a search. Otherwise we don't.
-my $do_search = $title || $author || $name || $basket || $booksellerinvoicenumber ||
+my $do_search = $title || $author || $isbn || $name || $basket || $booksellerinvoicenumber ||
     $from_placed_on || $to_placed_on;
 if ($do_search) {
     ( $order_loop, $total_qty, $total_price, $total_qtyreceived ) = GetHistory(
         title => $title,
         author => $author,
+       isbn   => $isbn,
         name => $name,
         from_placed_on => $from_iso,
         to_placed_on => $to_iso,
@@ -116,6 +118,7 @@ $template->param(
     numresults              => $order_loop ? scalar(@$order_loop) : undef,
     title                   => $title,
     author                  => $author,
+    isbn                   => $isbn,
     name                    => $name,
     basket                  => $basket,
     booksellerinvoicenumber => $booksellerinvoicenumber,
index 495f313..9321cf9 100644 (file)
@@ -21,6 +21,7 @@
                <ol>
                <li><label for="title">Title: </label> <input type="text" name="title" id="title" value="[% title %]" /></li>
                <li><label for="author">Author: </label> <input type="text" name="author" id="author" value="[% author %]" /></li>
+               <li><label for="isbn">ISBN: </label> <input type="isbn" name="isbn" id="isbn" value="[% isbn %]" /></li>
                <li><label for="name">Vendor: </label> <input type="text" name="name" id="name" value="[% name %]" /></li>
                <li><label for="basket">Basket: </label> <input type="text" name="basket" id="basket" value="[% basket %]" /></li>
                <li><label for="booksellerinvoicenumber ">Bookseller Invoice No: </label> <input type="text" name="booksellerinvoicenumber" id="booksellerinvoicenumber" value="[% booksellerinvoicenumber %]" /></li>
@@ -83,7 +84,7 @@
                                            [% END %]
                                        </td>
                                        <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% suggestions_loo.biblionumber %]">[% suggestions_loo.title |html %]</a>
-                        <br />[% suggestions_loo.author %]</td>
+                        <br />[% suggestions_loo.author %] <br /> [% suggestions_loo.isbn %]</td>
                                        <td><a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=[% suggestions_loo.id %]">[% suggestions_loo.name %]</a></td>
                                        <td>[% suggestions_loo.creationdate %]</td>
                                        <td>[% suggestions_loo.datereceived %]</td>