[Koha-cvs] CVS: koha/circ returns.pl,1.1,1.2
Finlay Thompson
finlayt at users.sourceforge.net
Sat May 18 07:07:28 CEST 2002
Update of /cvsroot/koha/koha/circ
In directory usw-pr-cvs1:/tmp/cvs-serv14965
Modified Files:
returns.pl
Log Message:
improoved layout and branch and printer settings are displayed
Index: returns.pl
===================================================================
RCS file: /cvsroot/koha/koha/circ/returns.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** returns.pl 2 May 2002 00:06:28 -0000 1.1
--- returns.pl 18 May 2002 05:07:26 -0000 1.2
***************
*** 21,24 ****
--- 21,25 ----
my $query=new CGI;
my $branches = getbranches();
+ my $printers = getprinters(\%env);
my $branch = $query->param("branch");
***************
*** 28,31 ****
--- 29,34 ----
($printer) || ($printer=$query->cookie('printer')) ;
+
+
#
# Some code to handle the error if there is no branch or printer setting.....
***************
*** 67,71 ****
# decode cuecat
$barcode = cuecatbarcodedecode($barcode);
! ($returned, $messages, $iteminformation, $borrower) = returnbook2(\%env, $barcode);
if ($returned) {
$returneditems{0} = $barcode;
--- 70,74 ----
# decode cuecat
$barcode = cuecatbarcodedecode($barcode);
! ($returned, $messages, $iteminformation, $borrower) = returnbook($barcode, $branch);
if ($returned) {
$returneditems{0} = $barcode;
***************
*** 82,92 ****
# title....
my $title = <<"EOF";
! <p align=right>
<FONT SIZE=2 face="arial, helvetica">
! <a href=circulationold.pl?module=issues&branch=$branch&printer=$printer&print>Next Borrower</a> ||
! <a href=returns.pl>Returns</a> ||
! <a href=branchtransfers.pl>Transfers</a></font></p>
! <FONT SIZE=6><em>Circulation: Returns</em></FONT>
!
EOF
--- 85,104 ----
# title....
my $title = <<"EOF";
! <p>
! <table border=0 cellpadding=5 width=90%><tr>
! <td align="left"><FONT SIZE=6><em>Circulation: Returns</em></FONT><br>
! <b>Branch:</b> $branches->{$branch}->{'branchname'}  
! <b>Printer:</b> $printers->{$printer}->{'printername'}<br>
! <a href=selectbranchprinter.pl>Change Settings</a>
! </td>
! <td align="right">
<FONT SIZE=2 face="arial, helvetica">
! <a href=circulation.pl>Next Borrower</a> ||
! <a href=returns.pl>Returns</a> ||
! <a href=branchtransfers.pl>Transfers</a></font><p>
! </td></tr></table>
! <input type=hidden name=branch value=$branch>
! <input type=hidden name=printer value=$printer>
! </p>
EOF
***************
*** 112,116 ****
# Barcode entry box, with hidden inputs attached....
! my $barcodeentrytext= << "EOF";
<form method=post action=/cgi-bin/koha/circ/returns.pl>
<table border=1 cellpadding=5 cellspacing=0 align=left>
--- 124,128 ----
# Barcode entry box, with hidden inputs attached....
! my $barcodeentrytext = << "EOF";
<form method=post action=/cgi-bin/koha/circ/returns.pl>
<table border=1 cellpadding=5 cellspacing=0 align=left>
***************
*** 125,149 ****
EOF
# collect the messages and put into message table....
! my $messagetable;
! if ($messages) {
! my $messagetext='';
! foreach (@$messages) {
! $messagetext .= "$_<br>";
}
! $messagetext = substr($messagetext, 0, -4);
! if ($messagetext) {
! $messagetable = << "EOF";
! <table border=1 cellpadding=5 cellspacing=0>
! <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>Messages</font></th></tr>
! <tr><td>
! $messagetext
! </td></tr>
! </table>
! <p>
! EOF
}
}
# patrontable ....
my $borrowertable;
--- 137,186 ----
EOF
+ my $reservefoundtext;
+ if ($messages->{'ResFound'}) {
+ my $resrec = $messages->{'ResFound'};
+ my ($borr) = getpatroninformation(\%env, $resrec->{'borrowernumber'}, 0);
+ my $name = $borr->{'surname'}." ".$borr->{'title'}." ".$borr->{'firstname'};
+ my $number = "<a href=/cgi-bin/koha/moremember.pl?bornum=$borr->{'borrowernumber'} onClick='openWindow(this,'Member', 480, 640)'>$borr->{'cardnumber'}</a>";
+ my $branch = $branches->{$resrec->{'branchcode'}}->{'branchname'};
+ my $reservetext = "<font size='+2' color='red'>RESERVED</font><font size='+2'> for collection by <br>$name ($number) at $branch </font>";
+ $reservefoundtext = <<"EOF";
+ <table border=1 cellpadding=5 cellspacing=0 bgcolor='#dddddd'>
+ <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font>Reserve Found</font></th></tr>
+ <tr><td> $reservetext </td></tr></table>
+ EOF
+ }
+
# collect the messages and put into message table....
! my $messagetext='';
! foreach my $code (keys %$messages) {
! if ($code eq 'BadBarcode'){
! $messagetext .= "<font color='red' size='+2'> No Item with barcode: $messages->{'BadBarcode'} </font> <br>";
}
! if ($code eq 'NotIssued'){
! my $braname = $branches->{$messages->{'IsPermanent'}}->{'branchname'};
! $messagetext .= "<font color='red' size='+2'> Item is not Issued, cannot be returned. </font> <br>";
! }
! if ($code eq 'WasLost'){
! $messagetext .= "<font color='red' size='+2'> Item was lost, now found. </font> <br>";
}
+ if (($code eq 'IsPermanent') && (not $messages->{'ResFound'})) {
+ if ($messages->{'IsPermanent'} ne $branch) {
+ $messagetext .= "<font color='red' size='+2'> Item is part of permanent collection, please return to $branches->{$messages->{'IsPermanent'}}->{'branchname'} </font> <br>";
+ }
+ }
+ }
+ $messagetext = substr($messagetext, 0, -4);
+
+ my $messagetable;
+ if ($messagetext) {
+ $messagetable = << "EOF";
+ <table border=1 cellpadding=5 cellspacing=0 bgcolor='#dddddd'>
+ <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font>Messages</font></th></tr>
+ <tr><td> $messagetext </td></tr></table>
+ EOF
}
+
# patrontable ....
my $borrowertable;
***************
*** 277,282 ****
# actually print the page!
-
-
print $query->header();
print startpage();
--- 314,317 ----
***************
*** 285,296 ****
print $title;
! # my $flags = $borrower->{'flags'};
! # foreach my $key (keys %$flags) {
! # print "$key : $flags->{$key} <br> ";
! # }
print $barcodeentrytext;
print $messagetable;
if ($returned) {
--- 320,329 ----
print $title;
! print $reservefoundtext;
print $barcodeentrytext;
print $messagetable;
+
if ($returned) {
More information about the Koha-cvs
mailing list