1 package C4::Numberpattern;
3 # Copyright 2000-2002 Biblibre SARL
5 # This file is part of Koha.
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
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.
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.
21 #use warnings; FIXME - Bug 2505
23 use C4::SQLHelper qw<:all>;
26 use vars qw($VERSION @ISA @EXPORT);
29 # set the version for version checking
46 # -------------------------------------------------------------------
48 my ($class, $opts) = @_;
49 bless $opts => $class;
53 sub AddNumberpattern {
54 my ($class,$numberpattern) = @_;
55 return InsertInTable("subscription_numberpattern",$numberpattern);
58 # -------------------------------------------------------------------
59 sub ModNumberpattern {
60 my ($class,$numberpattern) = @_;
61 return UpdateInTable("subscription_numberpattern",$numberpattern);
64 # -------------------------------------------------------------------
65 sub DelNumberpattern {
66 my ($class,$numberpattern) = @_;
67 return DeleteInTable("subscription_numberpattern",$numberpattern);
72 my $dbh = C4::Context->dbh;
73 return map { $class->new($_) } @{$dbh->selectall_arrayref(
74 # The subscription_numberpattern table is small enough for
75 # `SELECT *` to be harmless.
76 "SELECT * FROM subscription_numberpattern ORDER BY description",
81 =head3 GetNumberpattern
85 &GetNumberpattern($freq_id);
87 gets numberpattern where $freq_id is the identifier
93 # -------------------------------------------------------------------
94 sub GetNumberpattern {
95 my ($numpattern_id) = @_;
96 return undef unless $num_patternid;
97 my $results= SearchInTable("subscription_numberpattern",{numberpattern_id=>$freq_id}, undef, undef,undef, undef, "wide");
98 return undef unless ($results);
102 =head3 GetFrequencies
106 &GetFrequencies($filter, $order_by);
108 gets frequencies restricted on filters
114 # -------------------------------------------------------------------
115 sub GetNumberPatterns {
116 my ($filters,$orderby) = @_;
117 return SearchInTable("subscription_numberpattern",$filters, $orderby, undef,undef, undef, "wide");
120 END { } # module clean-up code here (global destructor)
127 Koha Development Team <http://koha-community.org/>