1 package C4::Maintainance; #asummes C4/Maintainance
3 #package to deal with marking up output
10 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
12 # set the version for version checking
16 @EXPORT = qw(&listsubjects &updatesub &shiftgroup &deletedbib &undeletebib
18 %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
20 # your exported package globals go here,
21 # as well as any optionally exported functions
23 @EXPORT_OK = qw($Var1 %Hashit);
26 # non-exported package globals go here
27 use vars qw(@more $stuff);
29 # initalize package globals, first exported ones
35 # then the others (which are still accessible as $Some::Module::stuff)
39 # all file-scoped lexicals must be created before
40 # the functions below that use them.
42 # file-private lexicals go here
46 # here's a file-private function as a closure,
47 # callable as &$priv_func; it cannot be prototyped.
52 # make all your functions, whether exported or not;
55 my ($sub,$num,$offset)=@_;
57 my $query="Select * from bibliosubject where subject like '$sub%' group by subject";
59 $query.=" limit $offset,$num";
61 my $sth=$dbh->prepare($query);
66 while (my $data=$sth->fetchrow_hashref){
78 my $query="update bibliosubject set subject='$sub' where subject='$oldsub'";
79 my $sth=$dbh->prepare($query);
88 my $query="update biblioitems set biblionumber=$bib where biblioitemnumber=$bi";
89 my $sth=$dbh->prepare($query);
92 $query="update items set biblionumber=$bib where biblioitemnumber=$bi";
93 $sth=$dbh->prepare($query);
102 my $query="Select * from deletedbiblio where title like '$title%' order by title";
103 my $sth=$dbh->prepare($query);
107 while (my $data=$sth->fetchrow_hashref){
113 return($i,\@results);
119 my $query="select * from deletedbiblio where biblionumber=$bib";
120 my $sth=$dbh->prepare($query);
122 if (my @data=$sth->fetchrow_array){
124 $query="Insert into biblio values (";
125 foreach my $temp (@data){
127 $query=$query."'$temp',";
131 $sth=$dbh->prepare($query);
135 $query="Delete from deletedbiblio where biblionumber=$bib";
136 $sth=$dbh->prepare($query);
145 my $sth=$dbh->prepare("Update biblioitems set itemtype='$type' where biblioitemnumber=$bi");
150 END { } # module clean-up code here (global destructor)