Bugzilla – Attachment 58076 Details for
Bug 8612
CSV export profile to have custom fields in export csv basket
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8612 - Followup - use Koha::CsvProfile[s] module (see bug 15451)
Bug-8612---Followup---use-KohaCsvProfiles-module-s.patch (text/plain), 2.79 KB, created by
Josef Moravec
on 2016-12-09 13:28:57 UTC
(
hide
)
Description:
Bug 8612 - Followup - use Koha::CsvProfile[s] module (see bug 15451)
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2016-12-09 13:28:57 UTC
Size:
2.79 KB
patch
obsolete
>From 0a99f466a9f2f573f356e1a452328fb9b9df0f5f Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Wed, 12 Oct 2016 08:36:22 +0200 >Subject: [PATCH] Bug 8612 - Followup - use Koha::CsvProfile[s] module (see bug > 15451) > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > C4/Acquisition.pm | 9 +++++---- > acqui/basket.pl | 4 ++-- > 2 files changed, 7 insertions(+), 6 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index aec8425..0ed9b54 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -32,6 +32,7 @@ use Koha::Acquisition::Order; > use Koha::Acquisition::Bookseller; > use Koha::Number::Price; > use Koha::Libraries; >+use Koha::CsvProfiles; > > use C4::Koha; > >@@ -286,11 +287,11 @@ sub GetBasketAsCSV { > my $template = C4::Templates::gettemplate("acqui/csv/basket.tt", "intranet", $cgi); > my @rows; > if ($csv_profile_id) { >- my $csv_profile = C4::Csv::GetCsvProfile( $csv_profile_id ); >+ my $csv_profile = Koha::CsvProfiles->find( $csv_profile_id ); > die "There is no valid csv profile given" unless $csv_profile; > >- my $csv = Text::CSV_XS->new({'quote_char'=>'"','escape_char'=>'"','sep_char'=>$csv_profile->{csv_separator},'binary'=>1}); >- my $csv_profile_content = $csv_profile->{content}; >+ my $csv = Text::CSV_XS->new({'quote_char'=>'"','escape_char'=>'"','sep_char'=>$csv_profile->csv_separator,'binary'=>1}); >+ my $csv_profile_content = $csv_profile->content; > my ( @headers, @fields ); > while ( $csv_profile_content =~ / > ([^=]+) # header >@@ -321,7 +322,7 @@ sub GetBasketAsCSV { > } > push @rows, \@row; > } >- my $content = join( $csv_profile->{csv_separator}, @headers ) . "\n"; >+ my $content = join( $csv_profile->csv_separator, @headers ) . "\n"; > for my $row ( @rows ) { > $csv->combine(@$row); > my $string = $csv->string; >diff --git a/acqui/basket.pl b/acqui/basket.pl >index f5739e2..2bbf42d 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -33,12 +33,12 @@ use C4::Biblio; > use C4::Members qw/GetMember/; #needed for permissions checking for changing basketgroup of a basket > use C4::Items; > use C4::Suggestions; >-use C4::Csv; > use Koha::Libraries; > use C4::Letters qw/SendAlerts/; > use Date::Calc qw/Add_Delta_Days/; > use Koha::Database; > use Koha::EDI qw( create_edi_order get_edifact_ean ); >+use Koha::CsvProfiles; > > =head1 NAME > >@@ -424,7 +424,7 @@ if ( $op eq 'list' ) { > unclosable => @orders ? $basket->{is_standing} : 1, > has_budgets => $has_budgets, > duplinbatch => $duplinbatch, >- csv_profiles => C4::Csv::GetCsvProfiles( "sql" ), >+ csv_profiles => [ Koha::CsvProfiles->search({ type => 'sql' }) ], > ); > } > >-- >2.1.4
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 8612
:
11514
|
36860
|
37289
|
37293
|
41224
|
41225
|
41226
|
41227
|
42532
|
42533
|
42534
|
47591
|
47592
|
47593
|
56222
|
56223
|
56224
|
56225
|
57012
|
57013
|
57024
|
57025
|
57026
|
57027
|
57028
|
57029
|
57079
|
58073
|
58074
|
58075
|
58076
|
58077
|
58078
|
58079
|
58985
|
58986
|
58987
|
58988
|
58989
|
58990
|
58991
|
58992
|
59757
|
60480
|
61264
|
61265
|
61266
|
61267
|
61405
|
61520
|
63048
|
63049
|
63050
|
63051
|
63052
|
63053
|
63054
|
63055
|
63056
|
63104
|
63158
|
63279
|
63910
|
63911
|
63912
|
63913
|
63914
|
63915
|
63964
|
63966