Adding possibility to order the basket by :
authortipaul <tipaul>
Tue, 5 Oct 2004 09:22:16 +0000 (09:22 +0000)
committertipaul <tipaul>
Tue, 5 Oct 2004 09:22:16 +0000 (09:22 +0000)
* publishercode
OR
* budget then publishercode

C4/Acquisition.pm
acqui/basket.pl
koha-tmpl/intranet-tmpl/default/en/acqui/basket.tmpl

index a38151a..a7dffc3 100644 (file)
@@ -102,7 +102,7 @@ number of elements in C<@orders>.
 =cut
 #'
 sub getbasketcontent {
-       my ($basketno,$supplier)=@_;
+       my ($basketno,$supplier,$orderby)=@_;
        my $dbh = C4::Context->dbh;
        my $query="Select *,biblio.title from aqorders,biblio,biblioitems
        left join aqorderbreakdown on aqorderbreakdown.ordernumber=aqorders.ordernumber
@@ -114,7 +114,9 @@ sub getbasketcontent {
        if ($supplier ne ''){
                $query.=" and aqorders.booksellerid='$supplier'";
        }
-       $query.=" order by biblioitems.publishercode";
+       
+       $orderby="biblioitems.publishercode" unless $orderby;
+       $query.=" order by $orderby";
        my $sth=$dbh->prepare($query);
        $sth->execute;
        my @results;
index c2173c0..22c426f 100755 (executable)
@@ -37,6 +37,7 @@ use C4::Date;
 my $query =new CGI;
 my $basketno = $query ->param('basket');
 my $booksellerid = $query->param('supplierid');
+my $order = $query->param('order');
 my ($template, $loggedinuser, $cookie)
     = get_template_and_user({template_name => "acqui/basket.tmpl",
                             query => $query,
@@ -57,7 +58,7 @@ my ($count2,@booksellers)=bookseller($booksellerid);
 # if new basket, pre-fill infos
 $basket->{creationdate} = "" unless ($basket->{creationdate});
 $basket->{authorisedby} = $loggedinuser unless ($basket->{authorisedby});
-($count,@results)=getbasketcontent($basketno);
+($count,@results)=getbasketcontent($basketno,'',$order);
 
 my $line_total; # total of each line
 my $sub_total; # total of line totals
index 3c2c526..1684494 100644 (file)
@@ -23,7 +23,7 @@
                <table>
                        <tr valign="top" bgcolor="#ffdf61">
                                <th class="acquisition">Order</th>
-                               <th class="acquisition">Publisher</th>
+                               <th class="acquisition">Publisher<a href="basket.pl?basket=<!-- TMPL_VAR name="basketno" -->&order=biblioitems.publishercode">[order]</a></th>
                                <th class="acquisition">Isbn</th>
                                <th class="acquisition">Title</th>
                                <th class="acquisition">Author</th>
@@ -31,7 +31,7 @@
                                <th class="acquisition">est</th>
                                <th class="acquisition">Qty</th>
                                <th class="acquisition">Total</th>
-                               <th class="acquisition">Book fund</th>
+                               <th class="acquisition">Fund <a href="basket.pl?basket=<!-- TMPL_VAR name="basketno" -->&order=aqorderbreakdown.bookfundid,biblioitems.publishercode">[order]</a></th>
                        </tr>
                        <!-- TMPL_LOOP NAME="books_loop" -->
                                <tr valign="top" bgcolor="<!-- TMPL_VAR NAME="color" -->">