quick fix to throw away searches with less than 3 characters in the search
[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 use C4::Auth;
15
16 my $input = new CGI;
17 #print $input->header;
18 my $flagsrequired;
19 $flagsrequired->{editcatalogue}=1;
20 my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
21
22
23 my $biblio=$input->param('biblio');
24 #print $input->header;
25 #check no items attached
26 my $count=C4::Acquisitions::itemcount($biblio);
27
28
29 #print $count;
30 if ($count > 0){
31   print $input->header(-cookie => $cookie);
32   print "This biblio has $count items attached, please delete them before deleting this biblio<p>
33   ";
34 } else {
35         delbiblio($biblio);
36         print $input->redirect("/catalogue/");
37 }