Bugzilla – Attachment 4680 Details for
Bug 6613
csv basket export columns misaligned
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
bug6613.patch (text/plain), 2.89 KB, created by
Nicole C. Engard
on 2011-07-20 17:15:26 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Nicole C. Engard
Created:
2011-07-20 17:15:26 UTC
Size:
2.89 KB
patch
obsolete
>From 863413371b9916f46df36062004e0b16a10336e1 Mon Sep 17 00:00:00 2001 >From: Ian Walls <ian.walls@bywatersolutions.com> >Date: Wed, 20 Jul 2011 11:41:12 -0400 >Subject: [PATCH] Bug 6613: CSV basket export columns misaligned > >Removes 'line' heading, since it does not correspond to any existing field name, and it pushes the fields >over by one ('ordernumber' is used to denote the ordernumber). > >This patch also optimizes the GetBasketAsCSV subroutine a bit; it removes an unnecessary call to GetBiblioData, >since the order information retrieved from GetOrders already contains every field in koha.biblio and koha.biblioitems > >This patch also removes the explicit sort done by publishercode, since the information returned by GetOrders is >already ORDER BY'ed, first by publishercode, then by title (there was a FIXME note in GetBasketAsCSV to do this, but >it's already done, so... :) ) > >To Test: >1. Create a basket with at least three orders: one from one publishercode, and two from another >2. Be sure to leave out any "\n" in your Order Notes, lest you fall prey to bug 6614! >3. Export the basket >4. You should see the orders sorted first by publishercode, then by title >5. Columns should line up correct all the way through >--- > C4/Acquisition.pm | 15 +++++---------- > 1 files changed, 5 insertions(+), 10 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index cd1e670..09cb39c 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -233,7 +233,7 @@ sub GetBasketAsCSV { > my $output; > > # TODO: Translate headers >- my @headers = qw(contractname ordernumber line entrydate isbn author title publishercode collectiontitle notes quantity rrp); >+ my @headers = qw(contractname ordernumber entrydate isbn author title publishercode collectiontitle notes quantity rrp); > > $csv->combine(@headers); > $output = $csv->string() . "\n"; >@@ -241,16 +241,15 @@ sub GetBasketAsCSV { > my @rows; > foreach my $order (@orders) { > my @cols; >- my $bd = GetBiblioData($order->{'biblionumber'}); > push(@cols, > $contract->{'contractname'}, > $order->{'ordernumber'}, > $order->{'entrydate'}, > $order->{'isbn'}, >- $bd->{'author'}, >- $bd->{'title'}, >- $bd->{'publishercode'}, >- $bd->{'collectiontitle'}, >+ $order->{'author'}, >+ $order->{'title'}, >+ $order->{'publishercode'}, >+ $order->{'collectiontitle'}, > $order->{'notes'}, > $order->{'quantity'}, > $order->{'rrp'}, >@@ -258,10 +257,6 @@ sub GetBasketAsCSV { > push (@rows, \@cols); > } > >- # Sort by publishercode >- # TODO: Sort by publishercode then by title >- @rows = sort { @$a[7] cmp @$b[7] } @rows; >- > foreach my $row (@rows) { > $csv->combine(@$row); > $output .= $csv->string() . "\n"; >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6613
:
4676
| 4680