From 53f147a340865642150c44894d5d3ccaa68f81c7 Mon Sep 17 00:00:00 2001 From: rangi Date: Thu, 15 Mar 2001 10:15:51 +0000 Subject: [PATCH] Added functionality to allow invalid itemtype to be fixed --- C4/Maintainance.pm | 12 ++++++++++-- maint/catmaintain.pl | 15 +++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/C4/Maintainance.pm b/C4/Maintainance.pm index de1d23e178..2ab4d63a28 100644 --- a/C4/Maintainance.pm +++ b/C4/Maintainance.pm @@ -13,7 +13,8 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = 0.01; @ISA = qw(Exporter); -@EXPORT = qw(&listsubjects &updatesub &shiftgroup &deletedbib &undeletebib); +@EXPORT = qw(&listsubjects &updatesub &shiftgroup &deletedbib &undeletebib +&updatetype); %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ], # your exported package globals go here, @@ -138,6 +139,13 @@ sub undeletebib{ $dbh->disconnect; } - +sub updatetype{ + my ($bi,$type)=@_; + my $dbh=C4Connect; + my $sth=$dbh->prepare("Update biblioitems set itemtype='$type' where biblioitemnumber=$bi"); + $sth->execute; + $sth->finish; + $dbh->disconnect; +} END { } # module clean-up code here (global destructor) diff --git a/maint/catmaintain.pl b/maint/catmaintain.pl index 2facac2047..9202fc205a 100755 --- a/maint/catmaintain.pl +++ b/maint/catmaintain.pl @@ -57,6 +57,21 @@ if ($type eq 'allsub'){ undeletebib($bib); print "Succesfully undeleted"; print "

Back to Catalogue Maintenance"; +} elsif ($type eq 'fixitemtype'){ + my $bi=$input->param('bi'); + my $item=$input->param('item'); + print "

"; + print ""; + print ""; + print "Itemtype:
\n"; + print ""; + 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 "

"; -- 2.39.5