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

(-)a/C4/Context.pm (-3 / +3 lines)
Lines 483-490 sub delete_preference { Link Here
483
483
484
    $delimiter = C4::Context->csv_delimiter;
484
    $delimiter = C4::Context->csv_delimiter;
485
485
486
    Returns prefered CSV delimiter, using system preference 'CSVDelimiter'.
486
    Returns preferred CSV delimiter, using system preference 'CSVDelimiter'.
487
    If this preference is missing or empty semicolon will be returned.
487
    If this preference is missing or empty, comma will be returned.
488
    This method is needed because of special behavior for tabulation.
488
    This method is needed because of special behavior for tabulation.
489
489
490
    You can, optionally, pass a value parameter to this routine
490
    You can, optionally, pass a value parameter to this routine
Lines 494-500 sub delete_preference { Link Here
494
494
495
sub csv_delimiter {
495
sub csv_delimiter {
496
    my ( $self, $value ) = @_;
496
    my ( $self, $value ) = @_;
497
    my $delimiter = $value || $self->preference('CSVDelimiter') || ';';
497
    my $delimiter = $value || $self->preference('CSVDelimiter') || ',';
498
    $delimiter = "\t" if $delimiter eq 'tabulation';
498
    $delimiter = "\t" if $delimiter eq 'tabulation';
499
    return $delimiter;
499
    return $delimiter;
500
}
500
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 177-183 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
177
('DefaultToLoggedInLibraryCircRules',  '0', NULL ,  'If enabled, circ rules editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.',  'YesNo'),
177
('DefaultToLoggedInLibraryCircRules',  '0', NULL ,  'If enabled, circ rules editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.',  'YesNo'),
178
('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'),
178
('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'),
179
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
179
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
180
('CSVDelimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
180
('CSVDelimiter',',',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
181
('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'),
181
('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'),
182
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
182
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
183
('displayFacetCount','0',NULL,NULL,'YesNo'),
183
('displayFacetCount','0',NULL,NULL,'YesNo'),
(-)a/t/Context.t (-5 / +4 lines)
Lines 68-80 subtest 'csv_delimiter() tests' => sub { Link Here
68
    plan tests => 4;
68
    plan tests => 4;
69
69
70
    t::lib::Mocks::mock_preference( 'CSVDelimiter', undef );
70
    t::lib::Mocks::mock_preference( 'CSVDelimiter', undef );
71
    is( C4::Context->csv_delimiter, ';', "csv_delimiter returns semicolon if system preference CSVDelimiter is undefined" );
71
    is( C4::Context->csv_delimiter, ',', "csv_delimiter returns comma if system preference CSVDelimiter is undefined" );
72
72
73
    t::lib::Mocks::mock_preference( 'CSVDelimiter', '' );
73
    t::lib::Mocks::mock_preference( 'CSVDelimiter', '' );
74
    is( C4::Context->csv_delimiter, ';', "csv_delimiter returns semicolon if system preference CSVDelimiter is empty string" );
74
    is( C4::Context->csv_delimiter, ',', "csv_delimiter returns comma if system preference CSVDelimiter is empty string" );
75
75
76
    t::lib::Mocks::mock_preference( 'CSVDelimiter', ',' );
76
    t::lib::Mocks::mock_preference( 'CSVDelimiter', ';' );
77
    is( C4::Context->csv_delimiter, ',', "csv_delimiter returns comma if system preference CSVDelimiter is comma" );
77
    is( C4::Context->csv_delimiter, ';', "csv_delimiter returns semicolon if system preference CSVDelimiter is semicolon" );
78
78
79
    t::lib::Mocks::mock_preference( 'CSVDelimiter', 'tabulation' );
79
    t::lib::Mocks::mock_preference( 'CSVDelimiter', 'tabulation' );
80
    is( C4::Context->csv_delimiter, "\t", "csv_delimiter returns '\t' if system preference CSVDelimiter is tabulation" );
80
    is( C4::Context->csv_delimiter, "\t", "csv_delimiter returns '\t' if system preference CSVDelimiter is tabulation" );
81
- 

Return to bug 28327