Lines 134-140
sub export {
Link Here
|
134 |
print MARC::File::XML::footer(); |
134 |
print MARC::File::XML::footer(); |
135 |
print "\n"; |
135 |
print "\n"; |
136 |
} elsif ( $format eq 'csv' ) { |
136 |
} elsif ( $format eq 'csv' ) { |
137 |
$csv_profile_id ||= Koha::CsvProfiles->search({ profile => C4::Context->preference('ExportWithCsvProfile') })->export_format_id; |
137 |
unless ( $csv_profile_id ) { |
|
|
138 |
# FIXME export_format.profile should be a unique key |
139 |
my $csv_profiles = Koha::CsvProfiles->search({ profile => C4::Context->preference('ExportWithCsvProfile') }); |
140 |
die "The ExportWithCsvProfile system preference is not defined or does not match a valid csv profile" unless $csv_profiles->count; |
141 |
$csv_profile_id = $csv_profiles->next->export_format_id; |
142 |
} |
138 |
print marc2csv( $record_ids, $csv_profile_id, $itemnumbers ); |
143 |
print marc2csv( $record_ids, $csv_profile_id, $itemnumbers ); |
139 |
} |
144 |
} |
140 |
|
145 |
|