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 with
17 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
18 # Suite 330, Boston, MA 02111-1307 USA
22 use C4
::SQLHelper qw
<:all
>;
25 use vars
qw($VERSION @ISA @EXPORT);
28 # set the version for version checking
45 # -------------------------------------------------------------------
47 my ($class, $opts) = @_;
48 bless $opts => $class;
52 sub AddNumberpattern
{
53 my ($class,$numberpattern) = @_;
54 return InsertInTable
("subscription_numberpattern",$numberpattern);
57 # -------------------------------------------------------------------
58 sub ModNumberpattern
{
59 my ($class,$numberpattern) = @_;
60 return UpdateInTable
("subscription_numberpattern",$numberpattern);
63 # -------------------------------------------------------------------
64 sub DelNumberpattern
{
65 my ($class,$numberpattern) = @_;
66 return DeleteInTable
("subscription_numberpattern",$numberpattern);
71 my $dbh = C4
::Context
->dbh;
72 return map { $class->new($_) } @
{$dbh->selectall_arrayref(
73 # The subscription_numberpattern table is small enough for
74 # `SELECT *` to be harmless.
75 "SELECT * FROM subscription_numberpattern ORDER BY description",
80 =head3 GetNumberpattern
84 &GetNumberpattern($freq_id);
86 gets numberpattern where $freq_id is the identifier
92 # -------------------------------------------------------------------
93 sub GetNumberpattern
{
94 my ($numpattern_id) = @_;
95 return undef unless $num_patternid;
96 my $results= SearchInTable
("subscription_numberpattern",{numberpattern_id
=>$freq_id}, undef, undef,undef, undef, "wide");
97 return undef unless ($results);
101 =head3 GetFrequencies
105 &GetFrequencies($filter, $order_by);
107 gets frequencies restricted on filters
113 # -------------------------------------------------------------------
114 sub GetNumberPatterns
{
115 my ($filters,$orderby) = @_;
116 return SearchInTable
("subscription_numberpattern",$filters, $orderby, undef,undef, undef, "wide");
119 END { } # module clean-up code here (global destructor)
126 Koha Developement team <info@koha.org>