1 package C4::Maintainance; #assumes C4/Maintainance
3 #package to deal with marking up output
6 # Copyright 2000-2002 Katipo Communications
8 # This file is part of Koha.
10 # Koha is free software; you can redistribute it and/or modify it under the
11 # terms of the GNU General Public License as published by the Free Software
12 # Foundation; either version 2 of the License, or (at your option) any later
15 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
17 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License along with
20 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
21 # Suite 330, Boston, MA 02111-1307 USA
28 use vars qw($VERSION @ISA @EXPORT);
30 # set the version for version checking
34 @EXPORT = qw(&listsubjects &updatesub &shiftgroup &deletedbib &undeletebib
38 my ($sub,$num,$offset)=@_;
40 my $query="Select * from bibliosubject where subject like '$sub%' group by subject";
42 $query.=" limit $offset,$num";
44 my $sth=$dbh->prepare($query);
49 while (my $data=$sth->fetchrow_hashref){
61 $sub=$dbh->quote($sub);
62 $oldsub=$dbh->quote($oldsub);
63 my $query="update bibliosubject set subject=$sub where subject=$oldsub";
64 my $sth=$dbh->prepare($query);
73 my $query="update biblioitems set biblionumber=$bib where biblioitemnumber=$bi";
74 my $sth=$dbh->prepare($query);
77 $query="update items set biblionumber=$bib where biblioitemnumber=$bi";
78 $sth=$dbh->prepare($query);
87 my $query="Select * from deletedbiblio where title like '$title%' order by title";
88 my $sth=$dbh->prepare($query);
92 while (my $data=$sth->fetchrow_hashref){
104 my $query="select * from deletedbiblio where biblionumber=$bib";
105 my $sth=$dbh->prepare($query);
107 if (my @data=$sth->fetchrow_array){
109 $query="Insert into biblio values (";
110 foreach my $temp (@data){
112 $query=$query."'$temp',";
116 $sth=$dbh->prepare($query);
120 $query="Delete from deletedbiblio where biblionumber=$bib";
121 $sth=$dbh->prepare($query);
130 my $sth=$dbh->prepare("Update biblioitems set itemtype='$type' where biblioitemnumber=$bi");
135 END { } # module clean-up code here (global destructor)