Browse Source

getting biblio numbers

master
chris 21 years ago
parent
commit
d8e9261223
4 changed files with 57 additions and 3 deletions
  1. +28
    -1
      C4/Acquisitions.pm
  2. +21
    -0
      delbiblio.pl
  3. +2
    -1
      detail.pl
  4. +6
    -1
      modbib.pl

+ 28
- 1
C4/Acquisitions.pm View File

@@ -15,7 +15,7 @@ $VERSION = 0.01;
&newordernum &modbiblio &modorder &getsingleorder &invoice &receiveorder
&bookfundbreakdown &curconvert &updatesup &insertsup &makeitems &modbibitem
&getcurrencies &modsubtitle &modsubject &modaddauthor &moditem &countitems
&findall &needsmod &delitem &delbibitem &delorder &branches);
&findall &needsmod &delitem &delbibitem &delbiblio &delorder &branches);
%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],

# your exported package globals go here,
@@ -766,6 +766,33 @@ sub delbibitem{
$dbh->disconnect;
}

sub delbiblio{
my ($biblio)=@_;
my $dbh=C4Connect;
my $query="select * from biblio where biblionumber=$biblio";
my $sth=$dbh->prepare($query);
$sth->execute;
if (my @data=$sth->fetchrow_array){
$sth->finish;
$query="Insert into deletedbiblio values (";
foreach my $temp (@data){
$temp=~ s/\'/\\\'/g;
$query=$query."'$temp',";
}
$query=~ s/\,$/\)/;
# print $query;
$sth=$dbh->prepare($query);
$sth->execute;
$sth->finish;
$query = "Delete from biblio where biblionumber=$biblio";
$sth=$dbh->prepare($query);
$sth->execute;
$sth->finish;
}
$sth->finish;
$dbh->disconnect;
}

END { } # module clean-up code here (global destructor)

+ 21
- 0
delbiblio.pl View File

@@ -0,0 +1,21 @@
#!/usr/bin/perl

#script to delete biblios
#written 2/5/00
#by chris@katipo.co.nz

use strict;

use C4::Search;
use CGI;
use C4::Output;
use C4::Acquisitions;

my $input = new CGI;
#print $input->header;


my $biblio=$input->param('biblio');

delbiblio($biblio);
print $input->redirect("/catalogue/");

+ 2
- 1
detail.pl View File

@@ -80,7 +80,8 @@ print <<printend
printend
;
if ($type ne 'opac'){
print "<INPUT TYPE=\"image\" name=\"submit\" VALUE=\"modify\" height=42 WIDTH=93 BORDER=0 src=\"/images/modify-mem.gif\">";
print "<INPUT TYPE=\"image\" name=\"submit\" VALUE=\"modify\" height=42 WIDTH=93 BORDER=0 src=\"/images/modify-mem.gif\">
<INPUT TYPE=\"image\" name=\"delete\" VALUE=\"delete\" height=42 WIDTH=93 BORDER=0 src=\"/images/delete-mem.gif\">";
}
print <<printend
<br>


+ 6
- 1
modbib.pl View File

@@ -11,13 +11,18 @@ use CGI;
use C4::Output;

my $input = new CGI;
print $input->header;
my $bibnum=$input->param('bibnum');
my $data=bibdata($bibnum);
my ($count,$subject)=subject($data->{'biblionumber'});
my ($count2,$subtitle)=subtitle($data->{'biblionumber'});
my ($count3,$addauthor)=addauthor($data->{'biblionumber'});
my $submit=$input->param('submit.x');
if ($submit eq ''){
print $input->redirect("/cgi-bin/koha/delbiblio.pl?biblio=$bibnum");
}

print $input->header;
#my ($analytictitle)=analytic($biblionumber,'t');
#my ($analyticauthor)=analytic($biblionumber,'a');
print startpage();


Loading…
Cancel
Save