@@ -, +, @@
history
DELETE FROM systempreferences WHERE variable='ExportCircHistory';
INSERT INTO systempreferences (variable, value) VALUES
('ExportWithCsvProfile', 'something');
---
Koha/Exporter/Record.pm | 10 +++-------
circ/circulation.pl | 6 +++++-
koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc | 11 +++++++++--
koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 10 ++++++++++
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 5 +----
.../intranet-tmpl/prog/en/modules/help/circ/circulation.tt | 2 +-
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt | 5 +----
members/moremember.pl | 5 +++++
misc/export_records.pl | 9 +++------
tools/export.pl | 6 ------
10 files changed, 38 insertions(+), 31 deletions(-)
--- a/Koha/Exporter/Record.pm
+++ a/Koha/Exporter/Record.pm
@@ -134,12 +134,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 );
}
@@ -199,7 +195,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
--- a/circ/circulation.pl
+++ a/circ/circulation.pl
@@ -49,6 +49,7 @@ use Koha::DateUtils;
use Koha::Database;
use Koha::Patron::Messages;
use Koha::Patron::Images;
+use Koha::CsvProfiles;
use Date::Calc qw(
Today
@@ -649,8 +650,11 @@ $template->param(
my $patron_image = Koha::Patron::Images->find($borrower->{borrowernumber});
$template->param( picture => 1 ) if $patron_image;
-# get authorised values with type of BOR_NOTES
+if ( C4::Context->preference("ExportCircHistory") ) {
+ $template->param(csv_profiles => [ Koha::CsvProfiles->search ]);
+}
+# get authorised values with type of BOR_NOTES
my $canned_notes = GetAuthorisedValues("BOR_NOTES");
$template->param(
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc
@@ -48,17 +48,24 @@
[% END %]
- [% IF ( exports_enabled ) %]
+ [% IF Koha.Preference('ExportCircHistory') %]