View | Details | Raw Unified | Return to bug 27486
Collapse All | Expand All

(-)a/C4/Reports.pm (-1 / +1 lines)
Lines 56-62 sub GetDelimiterChoices { Link Here
56
    my $sth = $dbh->prepare("
56
    my $sth = $dbh->prepare("
57
      SELECT options, value
57
      SELECT options, value
58
      FROM systempreferences
58
      FROM systempreferences
59
      WHERE variable = 'delimiter'
59
      WHERE variable = 'CSVDelimiter'
60
    ");
60
    ");
61
61
62
    $sth->execute();
62
    $sth->execute();
(-)a/installer/data/mysql/atomicupdate/bug_27486-replace-delimiter-with-CSVDelimiter.perl (+8 lines)
Line 0 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    # you can use $dbh here like:
4
    $dbh->do(q{UPDATE systempreferences set variable="CSVDelimiter" WHERE variable="delimiter"});
5
 
6
    # Always end with this (adjust the bug info)
7
    NewVersion( $DBversion, 27486, "Renaming 'delimiter' syspref to 'CSVDelimiter'");
8
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 162-168 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
162
('DefaultToLoggedInLibraryCircRules',  '0', NULL ,  'If enabled, circ rules editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.',  'YesNo'),
162
('DefaultToLoggedInLibraryCircRules',  '0', NULL ,  'If enabled, circ rules editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.',  'YesNo'),
163
('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'),
163
('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'),
164
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
164
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
165
('delimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
165
('CSVDelimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
166
('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'),
166
('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'),
167
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
167
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
168
('displayFacetCount','0',NULL,NULL,'YesNo'),
168
('displayFacetCount','0',NULL,NULL,'YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc (-1 / +1 lines)
Lines 5-11 Link Here
5
[%- USE AuthorisedValues -%]
5
[%- USE AuthorisedValues -%]
6
[%- SET biblio = item.biblio -%]
6
[%- SET biblio = item.biblio -%]
7
[%- SET biblioitem = item.biblioitem -%]
7
[%- SET biblioitem = item.biblioitem -%]
8
[%- SET delimiter = Koha.Preference( 'delimiter' ) || ',' -%]
8
[%- SET delimiter = Koha.Preference( 'CSVDelimiter' ) || ',' -%]
9
"[% biblio.title | replace('"', '""') | $raw %] [% IF ( Koha.Preference( 'marcflavour' ) == 'UNIMARC' && biblio.author ) %]by [% END %][% biblio.author | replace('"', '""') | $raw %]"
9
"[% biblio.title | replace('"', '""') | $raw %] [% IF ( Koha.Preference( 'marcflavour' ) == 'UNIMARC' && biblio.author ) %]by [% END %][% biblio.author | replace('"', '""') | $raw %]"
10
[%- delimiter | $raw -%]
10
[%- delimiter | $raw -%]
11
"[% (biblioitem.publicationyear || biblio.copyrightdate) | replace('"', '""') | $raw %]"
11
"[% (biblioitem.publicationyear || biblio.copyrightdate) | replace('"', '""') | $raw %]"
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/acqui/basket.tt (-1 / +1 lines)
Lines 1-4 Link Here
1
[%- USE Koha -%]
1
[%- USE Koha -%]
2
[%- SET delimiter = Koha.Preference( 'delimiter' ) || ',' -%]
2
[%- SET delimiter = Koha.Preference( 'CSVDelimiter' ) || ',' -%]
3
3
4
[%- 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 -%]
4
[%- 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 -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/acqui/basketgroup.tt (-1 / +1 lines)
Lines 1-4 Link Here
1
[%- USE Koha -%]
1
[%- USE Koha -%]
2
[%- SET delimiter = Koha.Preference( 'delimiter' ) || ',' -%]
2
[%- SET delimiter = Koha.Preference( 'CSVDelimiter' ) || ',' -%]
3
3
4
[%- 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 -%]
4
[%- 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 -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/acqui/lateorders.tt (-1 / +1 lines)
Lines 1-4 Link Here
1
[%- USE Koha -%]
1
[%- USE Koha -%]
2
[%- SET delimiter = Koha.Preference( 'delimiter' ) || ',' -%]
2
[%- SET delimiter = Koha.Preference('CSVDelimiter') || ',' -%]
3
3
4
[%- 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 -%]
4
[%- 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 -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/catalogue/itemsearch.tt (-1 / +1 lines)
Lines 1-6 Link Here
1
[%- USE raw -%]
1
[%- USE raw -%]
2
[%- USE Koha -%]
2
[%- USE Koha -%]
3
[%- SET delimiter = Koha.Preference( 'delimiter' ) || ',' -%]
3
[%- SET delimiter = Koha.Preference('CSVDelimiter') || ',' -%]
4
[%- BLOCK -%]
4
[%- BLOCK -%]
5
"Title"
5
"Title"
6
[%- delimiter | $raw -%]
6
[%- delimiter | $raw -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/delimiter_text.inc (-1 / +1 lines)
Lines 1-4 Link Here
1
[% SWITCH Koha.Preference('delimiter') %]
1
[% SWITCH Koha.Preference('CSVDelimiter') %]
2
    [% CASE '#' %]<span>Pound (#) separated text (.csv)</span>
2
    [% CASE '#' %]<span>Pound (#) separated text (.csv)</span>
3
    [% CASE ',' %]<span>Comma separated text (.csv)</span>
3
    [% CASE ',' %]<span>Comma separated text (.csv)</span>
4
    [% CASE '/' %]<span>Slash separated text (.csv)</span>
4
    [% CASE '/' %]<span>Slash separated text (.csv)</span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/basket.tt (-1 / +1 lines)
Lines 1-5 Link Here
1
[%- USE Koha -%]
1
[%- USE Koha -%]
2
[%- SET delimiter = Koha.Preference( 'delimiter' ) || ',' -%]
2
[%- SET delimiter = Koha.Preference( 'CSVDelimiter' ) || ',' -%]
3
3
4
[%- INCLUDE csv_headers/acqui/basket.tt -%]
4
[%- INCLUDE csv_headers/acqui/basket.tt -%]
5
[%- INCLUDE empty_line.inc -%]
5
[%- INCLUDE empty_line.inc -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/basketgroup.tt (-1 / +1 lines)
Lines 1-5 Link Here
1
[%- USE Koha -%]
1
[%- USE Koha -%]
2
[%- SET delimiter = Koha.Preference( 'delimiter' ) || ',' -%]
2
[%- SET delimiter = Koha.Preference( 'CSVDelimiter' ) || ',' -%]
3
3
4
[%- USE Price -%]
4
[%- USE Price -%]
5
[%- INCLUDE csv_headers/acqui/basketgroup.tt -%]
5
[%- INCLUDE csv_headers/acqui/basketgroup.tt -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/lateorders.tt (-1 / +1 lines)
Lines 1-5 Link Here
1
[%- USE Koha -%]
1
[%- USE Koha -%]
2
[%- SET delimiter = Koha.Preference( 'delimiter' ) || ',' -%]
2
[%- SET delimiter = Koha.Preference( 'CSVDelimiter' ) || ',' -%]
3
3
4
[%- USE KohaDates -%]
4
[%- USE KohaDates -%]
5
[%- INCLUDE csv_headers/acqui/lateorders.tt -%]
5
[%- INCLUDE csv_headers/acqui/lateorders.tt -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref (-1 / +1 lines)
Lines 43-49 Administration: Link Here
43
                  no: "Yes"
43
                  no: "Yes"
44
        -
44
        -
45
            - "Default separator for columns in an exported CSV file: "
45
            - "Default separator for columns in an exported CSV file: "
46
            - pref: delimiter
46
            - pref: CSVDelimiter
47
              default: ","
47
              default: ","
48
              choices:
48
              choices:
49
                  ';': semicolons
49
                  ';': semicolons
(-)a/misc/cronjobs/fines.pl (-1 / +1 lines)
Lines 99-105 my @other_fields = qw(days_overdue fine); Link Here
99
my $libname      = C4::Context->preference('LibraryName');
99
my $libname      = C4::Context->preference('LibraryName');
100
my $control      = C4::Context->preference('CircControl');
100
my $control      = C4::Context->preference('CircControl');
101
my $mode         = C4::Context->preference('finesMode');
101
my $mode         = C4::Context->preference('finesMode');
102
my $delim = "\t";    # ?  C4::Context->preference('delimiter') || "\t";
102
my $delim = "\t";    # ?  C4::Context->preference('CSVDelimiter') || "\t";
103
103
104
my %is_holiday;
104
my %is_holiday;
105
my $today = dt_from_string();
105
my $today = dt_from_string();
(-)a/misc/cronjobs/overdue_notices.pl (-2 / +2 lines)
Lines 412-418 binmode( STDOUT, ':encoding(UTF-8)' ); Link Here
412
our $csv;       # the Text::CSV_XS object
412
our $csv;       # the Text::CSV_XS object
413
our $csv_fh;    # the filehandle to the CSV file.
413
our $csv_fh;    # the filehandle to the CSV file.
414
if ( defined $csvfilename ) {
414
if ( defined $csvfilename ) {
415
    my $sep_char = C4::Context->preference('delimiter') || ';';
415
    my $sep_char = C4::Context->preference('CSVDelimiter') || ';';
416
    $sep_char = "\t" if ($sep_char eq 'tabulation');
416
    $sep_char = "\t" if ($sep_char eq 'tabulation');
417
    $csv = Text::CSV_XS->new( { binary => 1 , sep_char => $sep_char } );
417
    $csv = Text::CSV_XS->new( { binary => 1 , sep_char => $sep_char } );
418
    if ( $csvfilename eq '' ) {
418
    if ( $csvfilename eq '' ) {
Lines 826-832 END_SQL Link Here
826
        # Generate the content of the csv with headers
826
        # Generate the content of the csv with headers
827
        my $content;
827
        my $content;
828
        if ( defined $csvfilename ) {
828
        if ( defined $csvfilename ) {
829
            my $delimiter = C4::Context->preference('delimiter') || ';';
829
            my $delimiter = C4::Context->preference('CSVDelimiter') || ';';
830
            $content = join($delimiter, qw(title name surname address1 address2 zipcode city country email itemcount itemsinfo due_date issue_date)) . "\n";
830
            $content = join($delimiter, qw(title name surname address1 address2 zipcode city country email itemcount itemsinfo due_date issue_date)) . "\n";
831
        }
831
        }
832
        else {
832
        else {
(-)a/misc/export_borrowers.pl (-2 / +2 lines)
Lines 48-54 $0 -h Link Here
48
    -s, --separator=CHAR    This character will be used to separate fields.
48
    -s, --separator=CHAR    This character will be used to separate fields.
49
                            Some characters like | or ; will need to be escaped
49
                            Some characters like | or ; will need to be escaped
50
                            in the parameter setting, like -s=\\| or -s=\\;
50
                            in the parameter setting, like -s=\\| or -s=\\;
51
                            If no separator is specified, the delimiter pref
51
                            If no separator is specified, the CSVDelimiter pref
52
                            will be used (or a comma, if the pref is empty)
52
                            will be used (or a comma, if the pref is empty)
53
    -H, --show-header       Print field names on first row
53
    -H, --show-header       Print field names on first row
54
    -w, --where=CONDITION   Condition to filter borrowers to export
54
    -w, --where=CONDITION   Condition to filter borrowers to export
Lines 91-97 my $sth = $dbh->prepare($query); Link Here
91
$sth->execute;
91
$sth->execute;
92
92
93
unless ( $separator ) {
93
unless ( $separator ) {
94
    $separator = C4::Context->preference('delimiter') || ',';
94
    $separator = C4::Context->preference('CSVDelimiter') || ',';
95
    $separator = "\t" if ($separator eq 'tabulation');
95
    $separator = "\t" if ($separator eq 'tabulation');
96
}
96
}
97
97
(-)a/reports/bor_issues_top.pl (-1 / +1 lines)
Lines 61-67 my ($template, $borrowernumber, $cookie) Link Here
61
                flagsrequired => {reports => '*'},
61
                flagsrequired => {reports => '*'},
62
                debug => 1,
62
                debug => 1,
63
                });
63
                });
64
our $sep     = $input->param("sep") || C4::Context->preference('delimiter') || ',';
64
our $sep     = $input->param("sep") || C4::Context->preference('CSVDelimiter') || ',';
65
$sep = "\t" if ($sep eq 'tabulation');
65
$sep = "\t" if ($sep eq 'tabulation');
66
$template->param(do_it => $do_it,
66
$template->param(do_it => $do_it,
67
        );
67
        );
(-)a/reports/cash_register_stats.pl (-1 / +1 lines)
Lines 157-163 if ($do_it) { Link Here
157
        my $format = 'csv';
157
        my $format = 'csv';
158
        my $reportname = $input->param('basename');
158
        my $reportname = $input->param('basename');
159
        my $reportfilename = $reportname ? "$reportname.$format" : "reportresults.$format" ;
159
        my $reportfilename = $reportname ? "$reportname.$format" : "reportresults.$format" ;
160
        my $delimiter = C4::Context->preference('delimiter') || ',';
160
        my $delimiter = C4::Context->preference('CSVDelimiter') || ',';
161
            my @rows;
161
            my @rows;
162
            foreach my $row (@loopresult) {
162
            foreach my $row (@loopresult) {
163
                my @rowValues;
163
                my @rowValues;
(-)a/reports/guided_reports.pl (-1 / +1 lines)
Lines 904-910 elsif ($phase eq 'Export'){ Link Here
904
                $content .= join("\t", map { $_ // '' } @$row) . "\n";
904
                $content .= join("\t", map { $_ // '' } @$row) . "\n";
905
            }
905
            }
906
        } else {
906
        } else {
907
            my $delimiter = C4::Context->preference('delimiter') || ',';
907
            my $delimiter = C4::Context->preference('CSVDelimiter') || ',';
908
            if ( $format eq 'csv' ) {
908
            if ( $format eq 'csv' ) {
909
                $delimiter = "\t" if $delimiter eq 'tabulation';
909
                $delimiter = "\t" if $delimiter eq 'tabulation';
910
                $type = 'application/csv';
910
                $type = 'application/csv';
(-)a/reports/orders_by_fund.pl (-1 / +1 lines)
Lines 209-215 else { Link Here
209
    $template->param(   budgetsloop   => \@{$budgetloop},
209
    $template->param(   budgetsloop   => \@{$budgetloop},
210
        outputFormatloop => \@outputFormats,
210
        outputFormatloop => \@outputFormats,
211
        delimiterloop => \@CSVdelimiters,
211
        delimiterloop => \@CSVdelimiters,
212
        delimiterPreference => C4::Context->preference('delimiter')
212
        delimiterPreference => C4::Context->preference('CSVDelimiter')
213
    );
213
    );
214
}
214
}
215
215
(-)a/t/db_dependent/Acquisition/GetBasketAsCSV.t (-1 / +1 lines)
Lines 74-80 is($basket_csv1, 'autor,title,quantity Link Here
74
', 'CSV should be generated with user profile');
74
', 'CSV should be generated with user profile');
75
75
76
# Use default template
76
# Use default template
77
t::lib::Mocks::mock_preference('delimiter', ',');
77
t::lib::Mocks::mock_preference('CSVDelimiter', ',');
78
my $basket_csv2 = C4::Acquisition::GetBasketAsCSV($basketno, $query);
78
my $basket_csv2 = C4::Acquisition::GetBasketAsCSV($basketno, $query);
79
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
79
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
80
"",' . $order->ordernumber  . ',2016-01-02,,"King, Stephen","Test Record",,"","","",3,,"",""
80
"",' . $order->ordernumber  . ',2016-01-02,,"King, Stephen","Test Record",,"","","",3,,"",""
(-)a/tools/viewlog.pl (-2 / +1 lines)
Lines 216-222 if ($do_it) { Link Here
216
216
217
        # Printing to a csv file
217
        # Printing to a csv file
218
        my $content = q{};
218
        my $content = q{};
219
        my $delimiter = C4::Context->preference('delimiter') || ',';
219
        my $delimiter = C4::Context->preference('CSVDelimiter') || ',';
220
        if (@data) {
220
        if (@data) {
221
            my $csv = Text::CSV::Encoded->new( { encoding_out => 'utf8', sep_char => $delimiter } );
221
            my $csv = Text::CSV::Encoded->new( { encoding_out => 'utf8', sep_char => $delimiter } );
222
            $csv or die "Text::CSV::Encoded->new FAILED: " . Text::CSV::Encoded->error_diag();
222
            $csv or die "Text::CSV::Encoded->new FAILED: " . Text::CSV::Encoded->error_diag();
223
- 

Return to bug 27486