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 $sub=$dbh->quote($sub);
79 $oldsub=$dbh->quote($oldsub);
80 my $query="update bibliosubject set subject=$sub where subject=$oldsub";
81 my $sth=$dbh->prepare($query);
90 my $query="update biblioitems set biblionumber=$bib where biblioitemnumber=$bi";
91 my $sth=$dbh->prepare($query);
94 $query="update items set biblionumber=$bib where biblioitemnumber=$bi";
95 $sth=$dbh->prepare($query);
104 my $query="Select * from deletedbiblio where title like '$title%' order by title";
105 my $sth=$dbh->prepare($query);
109 while (my $data=$sth->fetchrow_hashref){
115 return($i,\@results);
121 my $query="select * from deletedbiblio where biblionumber=$bib";
122 my $sth=$dbh->prepare($query);
124 if (my @data=$sth->fetchrow_array){
126 $query="Insert into biblio values (";
127 foreach my $temp (@data){
129 $query=$query."'$temp',";
133 $sth=$dbh->prepare($query);
137 $query="Delete from deletedbiblio where biblionumber=$bib";
138 $sth=$dbh->prepare($query);
147 my $sth=$dbh->prepare("Update biblioitems set itemtype='$type' where biblioitemnumber=$bi");
152 END { } # module clean-up code here (global destructor)