All support for auth_subfield_tables is removed. All search is now with zebra authori...
[koha.git] / maint / shiftbib.pl
1 #!/usr/bin/perl
2
3 #script to do some serious catalogue maintainance
4 #written 22/11/00
5 # by chris@katipo.co.nz
6
7
8 # Copyright 2000-2002 Katipo Communications
9 #
10 # This file is part of Koha.
11 #
12 # Koha is free software; you can redistribute it and/or modify it under the
13 # terms of the GNU General Public License as published by the Free Software
14 # Foundation; either version 2 of the License, or (at your option) any later
15 # version.
16 #
17 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
18 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
19 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License along with
22 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
23 # Suite 330, Boston, MA  02111-1307 USA
24
25 use strict;
26 use CGI;
27 use C4::Context;
28 use C4::Output;
29 use C4::Maintainance;
30
31 my $input = new CGI;
32 print $input->header;
33 my $type=$input->param('type');
34 my $bi=$input->param('bi');
35 my $bib=$input->param('bib');
36 my $type=$input->param('type'); # FIXME - Redundant
37 print startpage();
38 print startmenu('catalog');
39
40 if ($type eq 'change'){
41   my $biblionumber=$input->param('biblionumber');
42   my $dbh = C4::Context->dbh;
43   my $sth=$dbh->prepare("Select * from biblio where biblionumber=?");
44   $sth->execute($biblionumber);
45   my $data=$sth->fetchrow_hashref;
46   print "Shifting group $bi to biblio $biblionumber<br>
47   Title:$data->{'title'}<br>
48   Author:$data->{'author'}<p>
49   Are you sure?
50   <p>
51   ";
52   print "<a href=/cgi-bin/koha/maint/shiftbib.pl?type=update&bi=$bi&bib=$biblionumber>Yes</a>";
53 } elsif ($type eq 'update'){
54   shiftgroup($bib,$bi);
55   print "Shifted";
56 } else {
57   print "Shifting Group $bi from biblio $bib to <p>";
58   print "<form action=/cgi-bin/koha/maint/shiftbib.pl method=post>";
59   print "<input  name=bi type=hidden value=$bi>";
60   print "<input type=hidden name=type value=change>";
61   print "<input type=text name=biblionumber><br>";
62   print "<input type=submit value=change></form>";
63 }
64 print endmenu('catalog');
65 print endpage();