1 package C4::Maintainance; #assumes C4/Maintainance
3 #package to deal with marking up output
10 use vars qw($VERSION @ISA @EXPORT);
12 # set the version for version checking
16 @EXPORT = qw(&listsubjects &updatesub &shiftgroup &deletedbib &undeletebib
20 my ($sub,$num,$offset)=@_;
22 my $query="Select * from bibliosubject where subject like '$sub%' group by subject";
24 $query.=" limit $offset,$num";
26 my $sth=$dbh->prepare($query);
31 while (my $data=$sth->fetchrow_hashref){
43 $sub=$dbh->quote($sub);
44 $oldsub=$dbh->quote($oldsub);
45 my $query="update bibliosubject set subject=$sub where subject=$oldsub";
46 my $sth=$dbh->prepare($query);
55 my $query="update biblioitems set biblionumber=$bib where biblioitemnumber=$bi";
56 my $sth=$dbh->prepare($query);
59 $query="update items set biblionumber=$bib where biblioitemnumber=$bi";
60 $sth=$dbh->prepare($query);
69 my $query="Select * from deletedbiblio where title like '$title%' order by title";
70 my $sth=$dbh->prepare($query);
74 while (my $data=$sth->fetchrow_hashref){
86 my $query="select * from deletedbiblio where biblionumber=$bib";
87 my $sth=$dbh->prepare($query);
89 if (my @data=$sth->fetchrow_array){
91 $query="Insert into biblio values (";
92 foreach my $temp (@data){
94 $query=$query."'$temp',";
98 $sth=$dbh->prepare($query);
102 $query="Delete from deletedbiblio where biblionumber=$bib";
103 $sth=$dbh->prepare($query);
112 my $sth=$dbh->prepare("Update biblioitems set itemtype='$type' where biblioitemnumber=$bi");
117 END { } # module clean-up code here (global destructor)