Removing useless scripts : the MARC=OFF scripts are in acqui.simple for instance...
[koha.git] / updatewebsite.pl
1 #!/usr/bin/perl
2
3 # $Id$
4
5 # Copyright 2000-2002 Katipo Communications
6 #
7 # This file is part of Koha.
8 #
9 # Koha is free software; you can redistribute it and/or modify it under the
10 # terms of the GNU General Public License as published by the Free Software
11 # Foundation; either version 2 of the License, or (at your option) any later
12 # version.
13 #
14 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License along with
19 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
20 # Suite 330, Boston, MA  02111-1307 USA
21
22 use strict;
23 use C4::Catalogue;
24 use CGI;
25
26 my $input = new CGI;
27 my $biblionumber  = $input->param('biblionumber');
28 my $websitenumber = $input->param('websitenumber');
29 my $website       = {
30     biblionumber  => $biblionumber,
31     websitenumber => $websitenumber,
32     title         => $input->param('title')?$input->param('title'):"",
33     description   => $input->param('description')?$input->param('description'):"",
34     url           => $input->param('url')?$input->param('url'):""
35 }; # my $website
36
37
38 if ($input->param('delete')) {
39     print $input->redirect("deletewebsite.pl?biblionumber=$biblionumber&websitenumber=$websitenumber");
40
41 } elsif (! $biblionumber) {
42     print $input->redirect("/catalogue/");
43
44 } elsif (! $websitenumber) {
45     print $input->redirect("modwebsites.pl?biblionumber=$biblionumber");
46
47 } else {
48     &updatewebsite($website);
49
50     print $input->redirect("modwebsites.pl?biblionumber=$biblionumber");
51 } # else