[Koha-cvs] CVS: koha/circ returns.pl,1.15,1.16

Finlay Thompson finlayt at users.sourceforge.net
Wed Aug 21 05:54:41 CEST 2002


Update of /cvsroot/koha/koha/circ
In directory usw-pr-cvs1:/tmp/cvs-serv3858/circ

Modified Files:
	returns.pl 
Log Message:

Fixed up some of the messaging stuff.


Index: returns.pl
===================================================================
RCS file: /cvsroot/koha/koha/circ/returns.pl,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** returns.pl	16 Aug 2002 20:46:40 -0000	1.15
--- returns.pl	21 Aug 2002 03:54:39 -0000	1.16
***************
*** 91,94 ****
--- 91,95 ----
      my $borrnum = $query->param('borrowernumber');
      my $resbarcode = $query->param('resbarcode');
+ # set to waiting....
      my $tobranchcd = ReserveWaiting($item, $borrnum);
      my $branchname = $branches->{$tobranchcd}->{'branchname'};
***************
*** 125,140 ****
      $barcode = cuecatbarcodedecode($barcode);
      ($returned, $messages, $iteminformation, $borrower) = returnbook($barcode, $branch);
-     $returneditems{0} = $barcode;
      $ritext.= "<input type=hidden name=ri-0 value=$barcode>\n";
      if ($returned) {
  	$riborrowernumber{0} = $borrower->{'borrowernumber'};
  	$riduedate{0} = $iteminformation->{'date_due'};
  	$ritext.= "<input type=hidden name=dd-0 value=$iteminformation->{'date_due'}>\n";
  	$ritext.= "<input type=hidden name=bn-0 value=$borrower->{'borrowernumber'}>\n";
!     } else {
! 	$riborrowernumber{0} = 0;
  	$riduedate{0} = 0;
  	$ritext.= "<input type=hidden name=dd-0 value=0>\n";
! 	$ritext.= "<input type=hidden name=bn-0 value=0>\n";
      }
  }
--- 126,147 ----
      $barcode = cuecatbarcodedecode($barcode);
      ($returned, $messages, $iteminformation, $borrower) = returnbook($barcode, $branch);
      $ritext.= "<input type=hidden name=ri-0 value=$barcode>\n";
      if ($returned) {
+ 	$returneditems{0} = $barcode;
  	$riborrowernumber{0} = $borrower->{'borrowernumber'};
  	$riduedate{0} = $iteminformation->{'date_due'};
  	$ritext.= "<input type=hidden name=dd-0 value=$iteminformation->{'date_due'}>\n";
  	$ritext.= "<input type=hidden name=bn-0 value=$borrower->{'borrowernumber'}>\n";
!     } elsif (! $messages->{'BadBarcode'}) {
! 	$returneditems{0} = $barcode;
  	$riduedate{0} = 0;
  	$ritext.= "<input type=hidden name=dd-0 value=0>\n";
! 	if ($messages->{'wthdrawn'}) {
! 	    $ritext.= "<input type=hidden name=bn-0 value='Item Cancelled'>\n";
! 	    $riborrowernumber{0} = 'Item Cancelled';
! 	} else {
! 	    $ritext.= "<input type=hidden name=bn-0 value='&nbsp;'>\n";
! 	    $riborrowernumber{0} = '&nbsp;';
! 	}
      }
  }
***************
*** 283,288 ****
  	$messagetext .= "<font color='red' size='+2'> Item was lost, now found. </font> <br>";
      }
!     if ($code eq 'wthdrawm'){
! 	$messagetext .= "<font color='red' size='+2'> Item Cancelled. </font> <br>";
      }
      if (($code eq 'IsPermanent') && (not $messages->{'ResFound'})) {
--- 290,296 ----
  	$messagetext .= "<font color='red' size='+2'> Item was lost, now found. </font> <br>";
      }
!     if ($code eq 'wthdrawn'){
! 	$messagetext = "<font color='red' size='+2'> Item Cancelled. </font> <br>";
! 	last;
      }
      if (($code eq 'IsPermanent') && (not $messages->{'ResFound'})) {
***************
*** 394,397 ****
--- 402,406 ----
  	my $duedate = $riduedate{$_};
  	my $overduetext;
+         my $borrowerinfo;
  	if ($duedate) {
  	    my @tempdate = split ( /-/ , $duedate ) ;
***************
*** 402,415 ****
  	    ($overduetext="<font color=red>$duedate</font>") if ($duedate lt $todaysdate);
  	    ($duedatenz) || ($overduetext = "<img src=/images/blackdot.gif>");
          } else {
!             $overduetext = "Not on loan.";
! 	}
!         my $borrowernumber = $riborrowernumber{$_};
!         my $borrowerinfo;
!         if ($borrowernumber) {
! 	    my ($borrower) = getpatroninformation(\%env,$borrowernumber,0);
!             my $borrowerinfo = "<a href=/cgi-bin/koha/moremember.pl?bornum=$borrower->{'borrowernumber'} onClick=\"openWindow(this,'Member', 480, 640)\">$borrower->{'cardnumber'}</a> $borrower->{'firstname'} $borrower->{'surname'}";
!         } else {
! 	    $borrowerinfo = "Not on loan.";
  	}
  	my ($iteminformation) = getiteminformation(\%env, 0, $barcode);;
--- 411,419 ----
  	    ($overduetext="<font color=red>$duedate</font>") if ($duedate lt $todaysdate);
  	    ($duedatenz) || ($overduetext = "<img src=/images/blackdot.gif>");
+ 	    my ($borrower) = getpatroninformation(\%env, $riborrowernumber{$_}, 0);
+             $borrowerinfo = "<a href=/cgi-bin/koha/moremember.pl?bornum=$borrower->{'borrowernumber'} onClick=\"openWindow(this,'Member', 480, 640)\">$borrower->{'cardnumber'}</a> $borrower->{'firstname'} $borrower->{'surname'}";
          } else {
!             $overduetext = "Not on Issue.";
! 	    $borrowerinfo = $riborrowernumber{$_};
  	}
  	my ($iteminformation) = getiteminformation(\%env, 0, $barcode);;
***************
*** 437,443 ****
--- 441,456 ----
  print startmenu('circulation');
  
+ 
+ #debug
+ #    foreach my $key (keys %$messages) {
+ #	print "$key : $messages->{$key}<br>";
+ #    }
+ 
+ 
  print <<"EOF";
  $links
  $title
+ 
+ 
  <table cellpadding=5 cellspacing=0 width=100%>
  EOF





More information about the Koha-cvs mailing list