#!/usr/bin/perl
#script to do some serious catalogue maintainance
#written 22/11/00
# by chris@katipo.co.nz
# Copyright 2000-2002 Katipo Communications
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use CGI;
use C4::Output;
use C4::Maintainance;
my $input = new CGI;
print $input->header;
my $type=$input->param('type');
print startpage();
print startmenu('catalog');
my $blah;
my $num=0;
my $offset=0;
if ($type eq 'allsub'){
my $sub=$input->param('sub');
my ($count,$results)=listsubjects($sub,$num,$offset);
for (my $i=0;$i<$count;$i++){
my $sub2=$results->[$i]->{'subject'};
$sub2=~ s/ /%20/g;
$sub2=~ s/\'/%27/g;
print "\"$results->[$i]->{'subject'}\"
\n";
}
} elsif ($type eq 'modsub'){
my $sub=$input->param('sub');
print "
This will change the subject headings on all the biblios this subject is applied to" } elsif ($type eq 'upsub'){ my $sub=$input->param('sub'); my $oldsub=$input->param('oldsub'); updatesub($sub,$oldsub); print "Successfully modified $oldsub is now $sub"; print "
Back to catalogue maintenance
";
print "Close this window";
} elsif ($type eq 'undel'){
my $title=$input->param('title');
my ($count,$results)=deletedbib($title);
print "
Title | Author | Undelete |
$results->[$i]->{'title'} | $results->[$i]->{'author'} | [$i]->{'biblionumber'}>Undelete | \n"; } print "
Back to Catalogue Maintenance"; } elsif ($type eq 'fixitemtype'){ my $bi=$input->param('bi'); my $item=$input->param('item'); print "
"; } elsif ($type eq 'updatetype'){ my $bi=$input->param('bi'); my $itemtype=$input->param('itemtype'); updatetype($bi,$itemtype); print "Updated successfully"; print "Back to Catalogue Maintenance";
} else {
print "Subject Maintenance
";
print "
"; print "Group Maintenance"; print "
"; print ""; print "Undelete Biblio"; print "
"; } print endmenu('catalog'); print endpage();