[Koha-cvs] CVS: koha/opac opac-renew.pl,NONE,1.1.2.1 opac-user.pl,1.1.2.10,1.1.2.11

Finlay Thompson finlayt at users.sourceforge.net
Fri Nov 29 00:12:36 CET 2002


Update of /cvsroot/koha/koha/opac
In directory sc8-pr-cvs1:/tmp/cvs-serv12323

Modified Files:
      Tag: rel-1-2
	opac-user.pl 
Added Files:
      Tag: rel-1-2
	opac-renew.pl 
Log Message:

added the renew books functionality


--- NEW FILE ---
#!/usr/bin/perl

#written 18/1/2000 by chris at katipo.co.nz
# adapted for use in the hlt opac by finlay at katipo.co.nz 29/11/2002
#script to renew items from the web

use CGI;
use C4::Circulation::Renewals2;

my $query = new CGI;

my $itemnumber = $query->param('item');
my $borrowernumber = $query->param("bornum");



my %env;
my $status = renewstatus(\%env,$borrowernumber,$itemnumber);
if ($status == 1){
    renewbook(\%env,$borrowernumber,$itemnumber);
}

if ($query->param('from') eq 'opac_user') {
    print $query->redirect("/cgi-bin/koha/opac-user.pl");
}

Index: opac-user.pl
===================================================================
RCS file: /cvsroot/koha/koha/opac/opac-user.pl,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -C2 -r1.1.2.10 -r1.1.2.11
*** opac-user.pl	27 Nov 2002 01:46:54 -0000	1.1.2.10
--- opac-user.pl	28 Nov 2002 23:12:34 -0000	1.1.2.11
***************
*** 7,10 ****
--- 7,11 ----
  use C4::Koha;
  use C4::Circulation::Circ2;
+ use C4::Circulation::Renewals2;
  use C4::Reserves2;
  
***************
*** 44,47 ****
--- 45,49 ----
  
  $template->param(BORROWER_INFO => \@bordat);
+ $template->param(borrowernumber => $borrowernumber);
  
  #get issued items ....
***************
*** 55,76 ****
      my $issue = $issues->{$key};
      $issue->{'date_due'}  = slashifyDate($issue->{'date_due'});
! # check for reserves
      my ($restype, $res) = CheckReserves($issue->{'itemnumber'});
      if ($restype) {
! 	$issue->{'status'} .= " Reserved";
      }
      my ($charges, $itemtype) = calc_charges(undef, undef, $issue->{'itemnumber'}, $borrowernumber);
      $issue->{'charges'} = $charges;
  
      my $publictype = $issue->{'publictype'};
      $issue->{$publictype} = 1;
  
  
      if ($issue->{'overdue'}) {
  	push @overdues, $issue;
  	$overdues_count++;
! 	$issue->{'status'} = "<font color='red'>OVERDUE</font>";
      } else {
! 	$issue->{'status'} = "Issued";
      }
      push @issuedat, $issue;
--- 57,86 ----
      my $issue = $issues->{$key};
      $issue->{'date_due'}  = slashifyDate($issue->{'date_due'});
! 
!     # check for reserves
      my ($restype, $res) = CheckReserves($issue->{'itemnumber'});
      if ($restype) {
! 	$issue->{'reserved'} = 1;
      }
      my ($charges, $itemtype) = calc_charges(undef, undef, $issue->{'itemnumber'}, $borrowernumber);
      $issue->{'charges'} = $charges;
  
+     # get publictype for icon
+     
      my $publictype = $issue->{'publictype'};
      $issue->{$publictype} = 1;
  
+     # check if item is renewable
+     my %env;
+     my $status = renewstatus(\%env,$borrowernumber, $issue->{'itemnumber'});
  
+     $issue->{'renewable'} = $status;
+     
      if ($issue->{'overdue'}) {
  	push @overdues, $issue;
  	$overdues_count++;
! 	$issue->{'overdue'} = 1;
      } else {
! 	$issue->{'issued'} = 1;
      }
      push @issuedat, $issue;





More information about the Koha-cvs mailing list