View | Details | Raw Unified | Return to bug 8044
Collapse All | Expand All

(-)a/C4/Acquisition.pm (-7 / +18 lines)
Lines 17-23 package C4::Acquisition; Link Here
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
19
20
21
use strict;
20
use strict;
22
use warnings;
21
use warnings;
23
use Carp;
22
use Carp;
Lines 32-37 use C4::SQLHelper qw(InsertInTable); Link Here
32
31
33
use Time::localtime;
32
use Time::localtime;
34
use HTML::Entities;
33
use HTML::Entities;
34
use Text::CSV::Encoded;
35
35
36
use vars qw($VERSION @ISA @EXPORT);
36
use vars qw($VERSION @ISA @EXPORT);
37
37
Lines 230-247 Export a basket as CSV Link Here
230
=cut
230
=cut
231
231
232
sub GetBasketAsCSV {
232
sub GetBasketAsCSV {
233
    my ($basketno) = @_;
233
    my ($basketno, $lh) = @_;
234
    my $basket = GetBasket($basketno);
234
    my $basket = GetBasket($basketno);
235
    my @orders = GetOrders($basketno);
235
    my @orders = GetOrders($basketno);
236
    my $contract = GetContract($basket->{'contractnumber'});
236
    my $contract = GetContract($basket->{'contractnumber'});
237
    my $csv = Text::CSV->new();
237
    my $csv = Text::CSV::Encoded->new();
238
    my $output; 
238
    my $output; 
239
239
240
    # TODO: Translate headers
240
    my @headers = (
241
    my @headers = qw(contractname ordernumber entrydate isbn author title publishercode collectiontitle notes quantity rrp);
241
        $lh->maketext('Contract name'),
242
        $lh->maketext('Order number'),
243
        $lh->maketext('Entry date'),
244
        $lh->maketext('ISBN'),
245
        $lh->maketext('Author'),
246
        $lh->maketext('Title'),
247
        $lh->maketext('Publisher code'),
248
        $lh->maketext('Collection title'),
249
        $lh->maketext('Notes'),
250
        $lh->maketext('Quantity'),
251
        $lh->maketext('RRP'),
252
    );
242
253
243
    $csv->combine(@headers);                                                                                                        
254
    $csv->combine(@headers);
244
    $output = $csv->string() . "\n";	
255
    $output = $csv->string() . "\n";
245
256
246
    my @rows;
257
    my @rows;
247
    foreach my $order (@orders) {
258
    foreach my $order (@orders) {
(-)a/acqui/basket.pl (-2 / +3 lines)
Lines 35-40 use C4::Members qw/GetMember/; #needed for permissions checking for changing ba Link Here
35
use C4::Items;
35
use C4::Items;
36
use C4::Suggestions;
36
use C4::Suggestions;
37
use Date::Calc qw/Add_Delta_Days/;
37
use Date::Calc qw/Add_Delta_Days/;
38
use Koha::I18N;
38
39
39
=head1 NAME
40
=head1 NAME
40
41
Lines 142-152 if ( $op eq 'delete_confirm' ) { Link Here
142
      print $query->redirect('/cgi-bin/koha/acqui/basketgroup.pl?basketno=' . $basket->{'basketno'} . '&op=attachbasket&booksellerid=' . $booksellerid);
143
      print $query->redirect('/cgi-bin/koha/acqui/basketgroup.pl?basketno=' . $basket->{'basketno'} . '&op=attachbasket&booksellerid=' . $booksellerid);
143
    # check if we have to "close" a basket before building page
144
    # check if we have to "close" a basket before building page
144
} elsif ($op eq 'export') {
145
} elsif ($op eq 'export') {
146
    my $lh = Koha::I18N->get_handle_from_context($query, 'intranet');
145
    print $query->header(
147
    print $query->header(
146
        -type       => 'text/csv',
148
        -type       => 'text/csv',
147
        -attachment => 'basket' . $basket->{'basketno'} . '.csv',
149
        -attachment => 'basket' . $basket->{'basketno'} . '.csv',
148
    );
150
    );
149
    print GetBasketAsCSV($query->param('basketno'));
151
    print GetBasketAsCSV($query->param('basketno'), $lh);
150
    exit;
152
    exit;
151
} elsif ($op eq 'close') {
153
} elsif ($op eq 'close') {
152
    my $confirm = $query->param('confirm') || $confirm_pref eq '2';
154
    my $confirm = $query->param('confirm') || $confirm_pref eq '2';
153
- 

Return to bug 8044