Added functionality to allow invalid itemtype to be fixed
authorrangi <rangi>
Thu, 15 Mar 2001 10:15:51 +0000 (10:15 +0000)
committerrangi <rangi>
Thu, 15 Mar 2001 10:15:51 +0000 (10:15 +0000)
C4/Maintainance.pm
maint/catmaintain.pl

index de1d23e..2ab4d63 100644 (file)
@@ -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)
     
index 2facac2..9202fc2 100755 (executable)
@@ -57,6 +57,21 @@ if ($type eq 'allsub'){
   undeletebib($bib);
   print "Succesfully undeleted";
   print "<p><a href=/cgi-bin/koha/maint/catmaintain.pl>Back to Catalogue Maintenance</a>";
+} elsif ($type eq 'fixitemtype'){
+  my $bi=$input->param('bi');
+  my $item=$input->param('item');
+  print "<form method=post action=/cgi-bin/koha/maint/catmaintain.pl>";
+  print "<input type=hidden name=bi value=$bi>";
+  print "<input type=hidden name=type value=updatetype>";
+  print "Itemtype:<input type=text name=itemtype value=$item><br>\n";
+  print "<input type=submit value=Change>";
+  print "</form>";
+} elsif ($type eq 'updatetype'){
+  my $bi=$input->param('bi');
+  my $itemtype=$input->param('itemtype');
+  updatetype($bi,$itemtype);
+  print "Updated successfully";
+  print "<p><a href=/cgi-bin/koha/maint/catmaintain.pl>Back to Catalogue Maintenance</a>";
 } else {
   print "<B>Subject Maintenance</b><br>";
   print "<form action=/cgi-bin/koha/maint/catmaintain.pl method=post>";