Bug 4368 - Avoid reseting UNIMARC 100 tag when importing biblio records
[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
17 # with Koha; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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
27 BEGIN {
28     # set the version for version checking
29     $VERSION = 0.13;
30     require Exporter;
31     @ISA = qw(Exporter);
32     @EXPORT = qw(
33         GetDelimiterChoices
34     );
35 }
36
37 =head1 NAME
38    
39 C4::Reports - Module for generating reports 
40
41 =head1 DESCRIPTION
42
43 This module contains functions common to reports.
44
45 =head1 EXPORTED FUNCTIONS
46
47 =head2 GetDelimiterChoices
48
49 =over 4
50
51 my $delims = GetDelimiterChoices;
52
53 =back
54
55 This will return a list of all the available delimiters.
56
57 =cut
58
59 sub GetDelimiterChoices {
60     my $dbh = C4::Context->dbh;
61
62     my $sth = $dbh->prepare("
63       SELECT options, value
64       FROM systempreferences
65       WHERE variable = 'delimiter'
66     ");
67
68     $sth->execute();
69
70     my ($choices, $default) = $sth->fetchrow;
71     my @dels = split /\|/, $choices;
72
73     return CGI::scrolling_list(
74                 -name     => 'sep',
75                 -id       => 'sep',
76                 -default  => $default,
77                 -values   => \@dels,
78                 -size     => 1,
79                 -multiple => 0 );
80 }
81
82 1;
83
84 __END__
85
86 =head1 AUTHOR
87
88 Jesse Weaver <jesse.weaver@liblime.com>
89
90 =cut