Bug 27486: Rename system preference delimiter to CSVDelimiter
Test Plan: 1. Go to Administration 2. Go to System Preferences 3. Find 'delimiter' (note the name) 4. Apply patch 5. Repeat step 1 and 2 6. Find 'CSVDelimiter' (note the name) Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
72346502d9
commit
71c1aa44a9
22 changed files with 31 additions and 23 deletions
|
@ -56,7 +56,7 @@ sub GetDelimiterChoices {
|
|||
my $sth = $dbh->prepare("
|
||||
SELECT options, value
|
||||
FROM systempreferences
|
||||
WHERE variable = 'delimiter'
|
||||
WHERE variable = 'CSVDelimiter'
|
||||
");
|
||||
|
||||
$sth->execute();
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
$DBversion = 'XXX'; # will be replaced by the RM
|
||||
if( CheckVersion( $DBversion ) ) {
|
||||
# you can use $dbh here like:
|
||||
$dbh->do(q{UPDATE systempreferences set variable="CSVDelimiter" WHERE variable="delimiter"});
|
||||
|
||||
# Always end with this (adjust the bug info)
|
||||
NewVersion( $DBversion, 27486, "Renaming 'delimiter' syspref to 'CSVDelimiter'");
|
||||
}
|
|
@ -162,7 +162,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
|
|||
('DefaultToLoggedInLibraryCircRules', '0', NULL , 'If enabled, circ rules editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.', 'YesNo'),
|
||||
('DefaultToLoggedInLibraryNoticesSlips', '0', NULL , 'If enabled,slips and notices editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.', 'YesNo'),
|
||||
('DefaultToLoggedInLibraryOverdueTriggers', '0', NULL , 'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.', 'YesNo'),
|
||||
('delimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
|
||||
('CSVDelimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
|
||||
('Display856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding staff interface XSLT option must be on','Choice'),
|
||||
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
|
||||
('displayFacetCount','0',NULL,NULL,'YesNo'),
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
[%- USE AuthorisedValues -%]
|
||||
[%- SET biblio = item.biblio -%]
|
||||
[%- SET biblioitem = item.biblioitem -%]
|
||||
[%- SET delimiter = Koha.Preference( 'delimiter' ) || ',' -%]
|
||||
[%- SET delimiter = Koha.Preference( 'CSVDelimiter' ) || ',' -%]
|
||||
"[% biblio.title | replace('"', '""') | $raw %] [% IF ( Koha.Preference( 'marcflavour' ) == 'UNIMARC' && biblio.author ) %]by [% END %][% biblio.author | replace('"', '""') | $raw %]"
|
||||
[%- delimiter | $raw -%]
|
||||
"[% (biblioitem.publicationyear || biblio.copyrightdate) | replace('"', '""') | $raw %]"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[%- USE Koha -%]
|
||||
[%- SET delimiter = Koha.Preference( 'delimiter' ) || ',' -%]
|
||||
[%- SET delimiter = Koha.Preference( 'CSVDelimiter' ) || ',' -%]
|
||||
|
||||
[%- BLOCK -%]Contract name[% delimiter | html %]Order number[% delimiter | html %]Entry date[% delimiter | html %]ISBN[% delimiter | html %]Author[% delimiter | html %]Title[% delimiter | html %]Publication year[% delimiter | html %]Publisher[% delimiter | html %]Collection title[% delimiter | html %]Note for vendor[% delimiter | html %]Quantity[% delimiter | html %]RRP[% delimiter | html %]Delivery place[% delimiter | html %]Billing place[%- END -%]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[%- USE Koha -%]
|
||||
[%- SET delimiter = Koha.Preference( 'delimiter' ) || ',' -%]
|
||||
[%- SET delimiter = Koha.Preference( 'CSVDelimiter' ) || ',' -%]
|
||||
|
||||
[%- BLOCK -%]Account number[% delimiter | html %]Basket name[% delimiter | html %]Order number[% delimiter | html %]Author[% delimiter | html %]Title[% delimiter | html %]Publisher[% delimiter | html %]Publication year[% delimiter | html %]Collection title[% delimiter | html %]ISBN[% delimiter | html %]Quantity[% delimiter | html %]RRP tax included[% delimiter | html %]RRP tax excluded[% delimiter | html %]Discount[% delimiter | html %]Estimated cost tax included[% delimiter | html %]Estimated cost tax excluded[% delimiter | html %]Note for vendor[% delimiter | html %]Entry date[% delimiter | html %]Bookseller name[% delimiter | html %]Bookseller physical address[% delimiter | html %]Bookseller postal address[% delimiter | html %]Contract number[% delimiter | html %]Contract name[% delimiter | html %]Basket group delivery place[% delimiter | html %]Basket group billing place[% delimiter | html %]Basket delivery place[% delimiter | html %]Basket billing place[%- END -%]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[%- USE Koha -%]
|
||||
[%- SET delimiter = Koha.Preference( 'delimiter' ) || ',' -%]
|
||||
[%- SET delimiter = Koha.Preference('CSVDelimiter') || ',' -%]
|
||||
|
||||
[%- BLOCK -%]ORDER DATE[%- delimiter | html -%]ESTIMATED DELIVERY DATE[%- delimiter | html -%]VENDOR[%- delimiter | html -%]INFORMATION[%- delimiter | html -%]TOTAL COST[%- delimiter | html -%]BASKET[%- delimiter | html -%]CLAIMS COUNT[%- delimiter | html -%]CLAIMED DATE[%- delimiter | html -%]INTERNAL NOTE[%- delimiter | html -%]VENDOR NOTE[%- delimiter | html -%]ISBN[%- END -%]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[%- USE raw -%]
|
||||
[%- USE Koha -%]
|
||||
[%- SET delimiter = Koha.Preference( 'delimiter' ) || ',' -%]
|
||||
[%- SET delimiter = Koha.Preference('CSVDelimiter') || ',' -%]
|
||||
[%- BLOCK -%]
|
||||
"Title"
|
||||
[%- delimiter | $raw -%]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[% SWITCH Koha.Preference('delimiter') %]
|
||||
[% SWITCH Koha.Preference('CSVDelimiter') %]
|
||||
[% CASE '#' %]<span>Pound (#) separated text (.csv)</span>
|
||||
[% CASE ',' %]<span>Comma separated text (.csv)</span>
|
||||
[% CASE '/' %]<span>Slash separated text (.csv)</span>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[%- USE Koha -%]
|
||||
[%- SET delimiter = Koha.Preference( 'delimiter' ) || ',' -%]
|
||||
[%- SET delimiter = Koha.Preference( 'CSVDelimiter' ) || ',' -%]
|
||||
|
||||
[%- INCLUDE csv_headers/acqui/basket.tt -%]
|
||||
[%- INCLUDE empty_line.inc -%]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[%- USE Koha -%]
|
||||
[%- SET delimiter = Koha.Preference( 'delimiter' ) || ',' -%]
|
||||
[%- SET delimiter = Koha.Preference( 'CSVDelimiter' ) || ',' -%]
|
||||
|
||||
[%- USE Price -%]
|
||||
[%- INCLUDE csv_headers/acqui/basketgroup.tt -%]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[%- USE Koha -%]
|
||||
[%- SET delimiter = Koha.Preference( 'delimiter' ) || ',' -%]
|
||||
[%- SET delimiter = Koha.Preference( 'CSVDelimiter' ) || ',' -%]
|
||||
|
||||
[%- USE KohaDates -%]
|
||||
[%- INCLUDE csv_headers/acqui/lateorders.tt -%]
|
||||
|
|
|
@ -43,7 +43,7 @@ Administration:
|
|||
no: "Yes"
|
||||
-
|
||||
- "Default separator for columns in an exported CSV file: "
|
||||
- pref: delimiter
|
||||
- pref: CSVDelimiter
|
||||
default: ","
|
||||
choices:
|
||||
';': semicolons
|
||||
|
|
|
@ -99,7 +99,7 @@ my @other_fields = qw(days_overdue fine);
|
|||
my $libname = C4::Context->preference('LibraryName');
|
||||
my $control = C4::Context->preference('CircControl');
|
||||
my $mode = C4::Context->preference('finesMode');
|
||||
my $delim = "\t"; # ? C4::Context->preference('delimiter') || "\t";
|
||||
my $delim = "\t"; # ? C4::Context->preference('CSVDelimiter') || "\t";
|
||||
|
||||
my $today = dt_from_string();
|
||||
my $filename;
|
||||
|
|
|
@ -412,7 +412,7 @@ binmode( STDOUT, ':encoding(UTF-8)' );
|
|||
our $csv; # the Text::CSV_XS object
|
||||
our $csv_fh; # the filehandle to the CSV file.
|
||||
if ( defined $csvfilename ) {
|
||||
my $sep_char = C4::Context->preference('delimiter') || ';';
|
||||
my $sep_char = C4::Context->preference('CSVDelimiter') || ';';
|
||||
$sep_char = "\t" if ($sep_char eq 'tabulation');
|
||||
$csv = Text::CSV_XS->new( { binary => 1 , sep_char => $sep_char } );
|
||||
if ( $csvfilename eq '' ) {
|
||||
|
@ -826,7 +826,7 @@ END_SQL
|
|||
# Generate the content of the csv with headers
|
||||
my $content;
|
||||
if ( defined $csvfilename ) {
|
||||
my $delimiter = C4::Context->preference('delimiter') || ';';
|
||||
my $delimiter = C4::Context->preference('CSVDelimiter') || ';';
|
||||
$content = join($delimiter, qw(title name surname address1 address2 zipcode city country email itemcount itemsinfo due_date issue_date)) . "\n";
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -48,7 +48,7 @@ $0 -h
|
|||
-s, --separator=CHAR This character will be used to separate fields.
|
||||
Some characters like | or ; will need to be escaped
|
||||
in the parameter setting, like -s=\\| or -s=\\;
|
||||
If no separator is specified, the delimiter pref
|
||||
If no separator is specified, the CSVDelimiter pref
|
||||
will be used (or a comma, if the pref is empty)
|
||||
-H, --show-header Print field names on first row
|
||||
-w, --where=CONDITION Condition to filter borrowers to export
|
||||
|
@ -91,7 +91,7 @@ my $sth = $dbh->prepare($query);
|
|||
$sth->execute;
|
||||
|
||||
unless ( $separator ) {
|
||||
$separator = C4::Context->preference('delimiter') || ',';
|
||||
$separator = C4::Context->preference('CSVDelimiter') || ',';
|
||||
$separator = "\t" if ($separator eq 'tabulation');
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ my ($template, $borrowernumber, $cookie)
|
|||
flagsrequired => {reports => '*'},
|
||||
debug => 1,
|
||||
});
|
||||
our $sep = $input->param("sep") || C4::Context->preference('delimiter') || ',';
|
||||
our $sep = $input->param("sep") || C4::Context->preference('CSVDelimiter') || ',';
|
||||
$sep = "\t" if ($sep eq 'tabulation');
|
||||
$template->param(do_it => $do_it,
|
||||
);
|
||||
|
|
|
@ -157,7 +157,7 @@ if ($do_it) {
|
|||
my $format = 'csv';
|
||||
my $reportname = $input->param('basename');
|
||||
my $reportfilename = $reportname ? "$reportname.$format" : "reportresults.$format" ;
|
||||
my $delimiter = C4::Context->preference('delimiter') || ',';
|
||||
my $delimiter = C4::Context->preference('CSVDelimiter') || ',';
|
||||
my @rows;
|
||||
foreach my $row (@loopresult) {
|
||||
my @rowValues;
|
||||
|
|
|
@ -904,7 +904,7 @@ elsif ($phase eq 'Export'){
|
|||
$content .= join("\t", map { $_ // '' } @$row) . "\n";
|
||||
}
|
||||
} else {
|
||||
my $delimiter = C4::Context->preference('delimiter') || ',';
|
||||
my $delimiter = C4::Context->preference('CSVDelimiter') || ',';
|
||||
if ( $format eq 'csv' ) {
|
||||
$delimiter = "\t" if $delimiter eq 'tabulation';
|
||||
$type = 'application/csv';
|
||||
|
|
|
@ -209,7 +209,7 @@ else {
|
|||
$template->param( budgetsloop => \@{$budgetloop},
|
||||
outputFormatloop => \@outputFormats,
|
||||
delimiterloop => \@CSVdelimiters,
|
||||
delimiterPreference => C4::Context->preference('delimiter')
|
||||
delimiterPreference => C4::Context->preference('CSVDelimiter')
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ is($basket_csv1, 'autor,title,quantity
|
|||
', 'CSV should be generated with user profile');
|
||||
|
||||
# Use default template
|
||||
t::lib::Mocks::mock_preference('delimiter', ',');
|
||||
t::lib::Mocks::mock_preference('CSVDelimiter', ',');
|
||||
my $basket_csv2 = C4::Acquisition::GetBasketAsCSV($basketno, $query);
|
||||
is($basket_csv2, 'Contract name,Order number,Entry date,ISBN,Author,Title,Publication year,Publisher,Collection title,Note for vendor,Quantity,RRP,Delivery place,Billing place
|
||||
"",' . $order->ordernumber . ',2016-01-02,,"King, Stephen","Test Record",,"","","",3,,"",""
|
||||
|
|
|
@ -216,7 +216,7 @@ if ($do_it) {
|
|||
|
||||
# Printing to a csv file
|
||||
my $content = q{};
|
||||
my $delimiter = C4::Context->preference('delimiter') || ',';
|
||||
my $delimiter = C4::Context->preference('CSVDelimiter') || ',';
|
||||
if (@data) {
|
||||
my $csv = Text::CSV::Encoded->new( { encoding_out => 'utf8', sep_char => $delimiter } );
|
||||
$csv or die "Text::CSV::Encoded->new FAILED: " . Text::CSV::Encoded->error_diag();
|
||||
|
|
Loading…
Reference in a new issue