New system preference for setting date format when entering patron birth dates.
[koha.git] / updatebiblio.pl
blob69a25f3ad928d907ac7c2cb36b3f4044636f9293
1 #!/usr/bin/perl
3 use C4::Database;
4 use CGI;
5 use strict;
6 use C4::Acquisitions;
7 use C4::Biblio;
8 use C4::Output;
9 use C4::Auth;
11 my $input= new CGI;
12 #print $input->header;
13 #print $input->dump;
15 my $flagsrequired;
16 $flagsrequired->{editcatalogue}=1;
17 my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
20 my $title=checkinp($input->param('Title'));
21 my $author=checkinp($input->param('Author'));
22 my $bibnum=checkinp($input->param('bibnum'));
23 my $copyright=checkinp($input->param('Copyright'));
24 my $seriestitle=checkinp($input->param('Series'));
25 my $serial=checkinp($input->param('Serial'));
26 my $unititle=checkinp($input->param('Unititle'));
27 my $notes=checkinp($input->param('Notes'));
29 modbiblio($bibnum,$title,$author,$copyright,$seriestitle,$serial,$unititle,$notes);
31 my $subtitle=checkinp($input->param('Subtitle'));
32 modsubtitle($bibnum,$subtitle);
34 my $subject=checkinp($input->param('Subject'));
35 $subject=uc $subject;
36 my @sub=split(/\|/,$subject);
37 #print @sub;
40 my $addauthor=checkinp($input->param('Additional'));
41 modaddauthor($bibnum,$addauthor);
42 my $count1=@sub;
44 for (my $i=0; $i<$count1; $i++){
45 $sub[$i]=~ s/ +$//;
48 #print $input->header;
49 my $force=$input->param('Force');
50 my $error=modsubject($bibnum,$force,@sub);
52 if ($error ne ''){
53 print $input->header;
54 print startpage();
55 print startmenu('catalogue');
56 print $error;
57 my @subs=split('\n',$error);
58 print "<p> Click submit to force the subject";
59 my @names=$input->param;
60 my %data;
61 my $count=@names;
62 for (my $i=0;$i<$count;$i++) {
63 if ($names[$i] ne 'Force') {
64 my $value=$input->param("$names[$i]");
65 $data{$names[$i]}="hidden\t$value\t$i";
66 } # if
67 } # for
68 $data{"Force"}="hidden\t$subs[0]\t$count";
69 print mkform3('updatebiblio.pl',%data);
70 print endmenu();
71 print endpage();
72 } else {
73 print $input->redirect("detail.pl?type=intra&bib=$bibnum");
74 } # else
76 sub checkinp{
77 my ($inp)=@_;
78 $inp=~ s/\'/\\\'/g;
79 $inp=~ s/\"/\\\"/g;
80 return($inp);