Merged with rel-1-2 copy
[koha.git] / delbiblio.pl
1 #!/usr/bin/perl
2
3 #script to delete biblios
4 #written 2/5/00
5 #by chris@katipo.co.nz
6
7 use strict;
8
9 use C4::Search;
10 use CGI;
11 use C4::Output;
12 use C4::Acquisitions;
13 use C4::Biblio;
14
15 my $input = new CGI;
16 #print $input->header;
17
18
19 my $biblio=$input->param('biblio');
20 #print $input->header;
21 #check no items attached
22 my $count=C4::Acquisitions::itemcount($biblio);
23
24
25 #print $count;
26 if ($count > 0){
27   print $input->header;
28   print "This biblio has $count items attached, please delete them before deleting this biblio<p>
29   ";
30 } else {
31         delbiblio($biblio);
32         print $input->redirect("/catalogue/");
33 }