Bug 24860: Skip non-matching item group holds in HoldsQueue
[koha.git] / C4 / Reports.pm
1 package C4::Reports;
2
3 # Copyright 2007 Liblime Ltd
4 #
5 # This file is part of Koha.
6 #
7 # Koha is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # Koha is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with Koha; if not, see <http://www.gnu.org/licenses>.
19
20 use Modern::Perl;
21 use CGI qw ( -utf8 );
22
23 use C4::Context;
24
25 our (@ISA, @EXPORT_OK);
26 BEGIN {
27     require Exporter;
28     @ISA = qw(Exporter);
29     @EXPORT_OK = qw(
30         GetDelimiterChoices
31     );
32 }
33
34 =head1 NAME
35
36 C4::Reports - Module for generating reports 
37
38 =head1 DESCRIPTION
39
40 This module contains functions common to reports.
41
42 =head1 EXPORTED FUNCTIONS
43
44 =head2 GetDelimiterChoices
45
46   my $delims = GetDelimiterChoices;
47
48 This will return a list of all the available delimiters.
49
50 =cut
51
52 sub GetDelimiterChoices {
53     my $dbh = C4::Context->dbh;
54
55     my $sth = $dbh->prepare("
56       SELECT options, value
57       FROM systempreferences
58       WHERE variable = 'CSVDelimiter'
59     ");
60
61     $sth->execute();
62
63     my ($choices, $default) = $sth->fetchrow;
64     my @dels = split /\|/, $choices;
65
66     return {
67         values  => \@dels,
68         default => $default,
69     };
70 }
71
72 1;
73
74 __END__
75
76 =head1 AUTHOR
77
78 Jesse Weaver <jesse.weaver@liblime.com>
79
80 =cut