From 89dea6f3ecdcb1e7c9e3169744dffa98d5502379 Mon Sep 17 00:00:00 2001 From: tipaul Date: Tue, 5 Oct 2004 09:22:16 +0000 Subject: [PATCH] Adding possibility to order the basket by : * publishercode OR * budget then publishercode --- C4/Acquisition.pm | 6 ++++-- acqui/basket.pl | 3 ++- koha-tmpl/intranet-tmpl/default/en/acqui/basket.tmpl | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index a38151a50d..a7dffc3b24 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -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; diff --git a/acqui/basket.pl b/acqui/basket.pl index c2173c047c..22c426f984 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -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 diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui/basket.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui/basket.tmpl index 3c2c526673..1684494e9b 100644 --- a/koha-tmpl/intranet-tmpl/default/en/acqui/basket.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/acqui/basket.tmpl @@ -23,7 +23,7 @@ - + @@ -31,7 +31,7 @@ - + "> -- 2.39.2
OrderPublisherPublisher&order=biblioitems.publishercode">[order] Isbn Title Authorest Qty TotalBook fundFund &order=aqorderbreakdown.bookfundid,biblioitems.publishercode">[order]