diff --git a/Koha/Exporter/Record.pm b/Koha/Exporter/Record.pm
index aa805e2825..193f87e988 100644
--- a/Koha/Exporter/Record.pm
+++ b/Koha/Exporter/Record.pm
@@ -143,12 +143,8 @@ sub export {
print MARC::File::XML::footer();
print "\n";
} elsif ( $format eq 'csv' ) {
- unless ( $csv_profile_id ) {
- # FIXME export_format.profile should be a unique key
- my $csv_profiles = Koha::CsvProfiles->search({ profile => C4::Context->preference('ExportWithCsvProfile') });
- die "The ExportWithCsvProfile system preference is not defined or does not match a valid csv profile" unless $csv_profiles->count;
- $csv_profile_id = $csv_profiles->next->export_format_id;
- }
+ die 'There is no valid csv profile defined for this export'
+ unless Koha::CsvProfiles->find( $csv_profile_id );
print marc2csv( $record_ids, $csv_profile_id, $itemnumbers );
}
@@ -208,7 +204,7 @@ It will displays on STDOUT the generated file.
=item csv_profile_id
- If the format is csv, a csv_profile_id can be provide to overwrite the default value (syspref ExportWithCsvProfile).
+ If the format is csv, you have to define a csv_profile_id.
=cut
diff --git a/circ/circulation.pl b/circ/circulation.pl
index 5db1001c2a..75580f63d2 100755
--- a/circ/circulation.pl
+++ b/circ/circulation.pl
@@ -43,6 +43,7 @@ use C4::Context;
use CGI::Session;
use C4::Members::Attributes qw(GetBorrowerAttributes);
use Koha::AuthorisedValues;
+use Koha::CsvProfiles;
use Koha::Patron;
use Koha::Patron::Debarments qw(GetDebarments);
use Koha::DateUtils;
@@ -646,6 +647,10 @@ $template->param(
my $patron_image = Koha::Patron::Images->find($borrower->{borrowernumber});
$template->param( picture => 1 ) if $patron_image;
+if ( C4::Context->preference("ExportCircHistory") ) {
+ $template->param(csv_profiles => [ Koha::CsvProfiles->search ]);
+}
+
my $has_modifications = Koha::Patron::Modifications->search( { borrowernumber => $borrowernumber } )->count;
$template->param(
debt_confirmed => $debt_confirmed,
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc
index 1d103a04be..b34089d3c7 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc
@@ -49,17 +49,24 @@
[% END %]
- [% IF ( exports_enabled ) %]
+ [% IF Koha.Preference('ExportCircHistory') %]