Browse Source

working on requests

master
chris 22 years ago
parent
commit
3cdf005fb0
  1. 26
      C4/Acquisitions.pm
  2. 28
      C4/Reserves2.pm
  3. 8
      modbibitem.pl
  4. 8
      modrequest.pl
  5. 3
      moredetail.pl

26
C4/Acquisitions.pm

@ -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);
&findall &needsmod &delitem &delbibitem);
%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
# your exported package globals go here,
@ -706,6 +706,30 @@ sub delitem{
$dbh->disconnect;
}
sub delbibitem{
my ($itemnum)=@_;
my $dbh=C4Connect;
my $query="select * from biblioitems where biblioitemnumber=$itemnum";
my $sth=$dbh->prepare($query);
$sth->execute;
my @data=$sth->fetchrow_array;
$sth->finish;
$query="Insert into deletedbibitems values (";
foreach my $temp (@data){
$query=$query."'$temp',";
}
$query=~ s/\,$/\)/;
# print $query;
$sth=$dbh->prepare($query);
$sth->execute;
$sth->finish;
$query = "Delete from biblioitems where biblioitemnumber=$itemnum";
$sth=$dbh->prepare($query);
$sth->execute;
$sth->finish;
$dbh->disconnect;
}
END { } # module clean-up code here (global destructor)

28
C4/Reserves2.pm

@ -235,13 +235,33 @@ sub updatereserves{
$query.="set priority='$rank' where
biblionumber=$biblio and borrowernumber=$borrower";
} else {
$query.="set cancellationdate=now() where biblionumber=$biblio
and borrowernumber=$borrower";
$query="Select * from reserves where biblionumber=$biblio and
borrowernumber=$borrower";
my $sth=$dbh->prepare($query);
$sth->execute;
my $data=$sth->fetchrow_hashref;
$sth->finish;
$query="Select * from reserves where biblionumber=$biblio and
priority > $data->{'priority'} and cancellationdate is NULL
order by priority";
my $sth2=$dbh->prepare($query) || die $dbh->errstr;
$sth2->execute || die $sth2->errstr;
while (my $data=$sth2->fetchrow_hashref){
$data->{'priority'}--;
$query="Update reserves set priority=$data->{'priority'} where
biblionumber=$data->{'biblionumber'} and
borrowernumber=$data->{'borrowernumber'}";
my $sth3=$dbh->prepare($query);
$sth3->execute || die $sth3->errstr;
$sth3->finish;
}
$sth2->finish;
$query="update reserves set cancellationdate=now() where biblionumber=$biblio
and borrowernumber=$borrower";
}
my $sth=$dbh->prepare($query);
$sth->execute;
$sth->finish;
$sth->finish;
$dbh->disconnect;
}

8
modbibitem.pl

@ -12,9 +12,15 @@ use CGI;
use C4::Output;
my $input = new CGI;
print $input->header;
#
my $bibitemnum=$input->param('bibitem');
my $data=bibitemdata($bibitemnum);
my $biblio=$input->param('biblio');
my $submit=$input->param('submit.x');
if ($submit eq ''){
print $input->redirect("/cgi-bin/koha/delbibitem.pl?bibitemnum=$bibitemnum&biblio=$biblio");
}
print $input->header;
#my ($count,$subject)=subject($data->{'biblionumber'});
#my ($count2,$subtitle)=subtitle($data->{'biblionumber'});
#my ($count3,$addauthor)=addauthor($data->{'biblionumber'});

8
modrequest.pl

@ -21,12 +21,14 @@ my @biblio=$input->param('biblio');
my @borrower=$input->param('borrower');
my $count=@rank;
my $del=0;
for (my $i=0;$i<$count;$i++){
if ($rank[$i] ne 'del'){
if ($rank[$i] ne 'del' && $del == 0){
updatereserves($rank[$i],$biblio[$i],$borrower[$i],0); #from C4::Reserves2
} else {
} elsif ($rank[$i] eq 'del'){
updatereserves($rank[$i],$biblio[$i],$borrower[$i],1); #from C4::Reserves2
$del=1;
}
}

3
moredetail.pl

@ -55,6 +55,7 @@ print <<printend
<p>
<form action=/cgi-bin/koha/modbibitem.pl>
<input type=hidden name=bibitem value=$bi>
<input type=hidden name=biblio value=$bib>
<!-------------------BIBLIO ITEM------------>
<TABLE CELLSPACING=0 CELLPADDING=5 border=1 align=left>
<TR VALIGN=TOP>
@ -63,7 +64,7 @@ print <<printend
<tr VALIGN=TOP >
<TD width=210 >
<INPUT TYPE="image" name="submit" VALUE="modify" height=42 WIDTH=93 BORDER=0 src="/images/modify-mem.gif">
<INPUT TYPE="image" name="submit" VALUE="delete" height=42 WIDTH=93 BORDER=0 src="/images/delete-mem.gif">
<INPUT TYPE="image" name="delete" VALUE="delete" height=42 WIDTH=93 BORDER=0 src="/images/delete-mem.gif">
<br>
<FONT SIZE=2 face="arial, helvetica">
<b>Biblionumber:</b> $bib<br>

Loading…
Cancel
Save