bug 2958: fix search results navigation for CCL, CQL, and PQF queries
[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 under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 2 of the License, or (at your option) any later
10 # version.
11 #
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License along with
17 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
18 # Suite 330, Boston, MA  02111-1307 USA
19
20 use strict;
21 use CGI;
22
23 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
24 use C4::Context;
25 use C4::Debug;
26 # use Smart::Comments;
27 # use Data::Dumper;
28
29 BEGIN {
30     # set the version for version checking
31     $VERSION = 0.13;
32     require Exporter;
33     @ISA = qw(Exporter);
34     @EXPORT = qw(
35         GetDelimiterChoices
36     );
37 }
38
39 =head1 NAME
40    
41 C4::Reports - Module for generating reports 
42
43 =head1 DESCRIPTION
44
45 This module contains functions common to reports.
46
47 =head1 EXPORTED FUNCTIONS
48
49 =head2 GetDelimiterChoices
50
51 =over 4
52
53 my $delims = GetDelimiterChoices;
54
55 =back
56
57 This will return a list of all the available delimiters.
58
59 =cut
60
61 sub GetDelimiterChoices {
62     my $dbh = C4::Context->dbh;
63
64     my $sth = $dbh->prepare("
65       SELECT options, value
66       FROM systempreferences
67       WHERE variable = 'delimiter'
68     ");
69
70     $sth->execute();
71
72     my ($choices, $default) = $sth->fetchrow;
73     my @dels = split /\|/, $choices;
74
75     return CGI::scrolling_list(
76                 -name     => 'sep',
77                 -id       => 'sep',
78                 -default  => $default,
79                 -values   => \@dels,
80                 -size     => 1,
81                 -multiple => 0 );
82 }
83
84 1;
85
86 __END__
87
88 =head1 AUTHOR
89
90 Jesse Weaver <jesse.weaver@liblime.com>
91
92 =cut