Lines 37-42
use Template;
Link Here
|
37 |
use Text::CSV::Encoded; #marc2csv |
37 |
use Text::CSV::Encoded; #marc2csv |
38 |
use Koha::SimpleMARC qw(read_field); |
38 |
use Koha::SimpleMARC qw(read_field); |
39 |
use Koha::XSLT_Handler; |
39 |
use Koha::XSLT_Handler; |
|
|
40 |
use Koha::CsvProfiles; |
40 |
use Carp; |
41 |
use Carp; |
41 |
|
42 |
|
42 |
use vars qw(@ISA @EXPORT); |
43 |
use vars qw(@ISA @EXPORT); |
Lines 475-488
sub marcrecord2csv {
Link Here
|
475 |
my $frameworkcode = GetFrameworkCode($biblio); |
476 |
my $frameworkcode = GetFrameworkCode($biblio); |
476 |
|
477 |
|
477 |
# Getting information about the csv profile |
478 |
# Getting information about the csv profile |
478 |
my $profile = GetCsvProfile($id); |
479 |
my $profile = Koha::CsvProfiles->find($id); |
479 |
|
480 |
|
480 |
# Getting output encoding |
481 |
# Getting output encoding |
481 |
my $encoding = $profile->{encoding} || 'utf8'; |
482 |
my $encoding = $profile->encoding || 'utf8'; |
482 |
# Getting separators |
483 |
# Getting separators |
483 |
my $csvseparator = $profile->{csv_separator} || ','; |
484 |
my $csvseparator = $profile->csv_separator || ','; |
484 |
my $fieldseparator = $profile->{field_separator} || '#'; |
485 |
my $fieldseparator = $profile->field_separator || '#'; |
485 |
my $subfieldseparator = $profile->{subfield_separator} || '|'; |
486 |
my $subfieldseparator = $profile->subfield_separator || '|'; |
486 |
|
487 |
|
487 |
# TODO: Be more generic (in case we have to handle other protected chars or more separators) |
488 |
# TODO: Be more generic (in case we have to handle other protected chars or more separators) |
488 |
if ($csvseparator eq '\t') { $csvseparator = "\t" } |
489 |
if ($csvseparator eq '\t') { $csvseparator = "\t" } |
Lines 496-502
sub marcrecord2csv {
Link Here
|
496 |
$csv->sep_char($csvseparator); |
497 |
$csv->sep_char($csvseparator); |
497 |
|
498 |
|
498 |
# Getting the marcfields |
499 |
# Getting the marcfields |
499 |
my $marcfieldslist = $profile->{content}; |
500 |
my $marcfieldslist = $profile->content; |
500 |
|
501 |
|
501 |
# Getting the marcfields as an array |
502 |
# Getting the marcfields as an array |
502 |
my @marcfieldsarray = split('\|', $marcfieldslist); |
503 |
my @marcfieldsarray = split('\|', $marcfieldslist); |