[Koha-cvs] koha/circ circulation.pl [rel_3_0]
Antoine Farnault
antoine at koha-fr.org
Thu Dec 14 11:39:35 CET 2006
CVSROOT: /sources/koha
Module name: koha
Branch: rel_3_0
Changes by: Antoine Farnault <toins> 06/12/14 10:39:35
Modified files:
circ : circulation.pl
Log message:
fix a mod_perl specific bugs.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/circ/circulation.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.97.2.14&r2=1.97.2.15
Patches:
Index: circulation.pl
===================================================================
RCS file: /sources/koha/koha/circ/circulation.pl,v
retrieving revision 1.97.2.14
retrieving revision 1.97.2.15
diff -u -b -r1.97.2.14 -r1.97.2.15
--- circulation.pl 6 Dec 2006 17:05:20 -0000 1.97.2.14
+++ circulation.pl 14 Dec 2006 10:39:35 -0000 1.97.2.15
@@ -30,8 +30,8 @@
use C4::Print;
use C4::Auth;
use C4::Interface::CGI::Output;
+#use C4::Branch; # GetBranches
use C4::Koha; # GetBranches
-use HTML::Template;
use Date::Calc qw(
Today
Today_and_Now
@@ -66,11 +66,11 @@
my $findborrower = $query->param('findborrower');
$findborrower =~ s|,| |g;
$findborrower =~ s|'| |g;
-my $borrowernumber = $query->param('borrowernumberber');
+my $borrowernumber = $query->param('borrowernumber');
# new op dev the branch and the printer are now defined by the userenv
my $branch = C4::Context->userenv->{'branch'};
-my $printer = C4::Context->userenv->{'branchprinter'};
+$printer = C4::Context->userenv->{'branchprinter'}; # FIXME, printer is already defined by GetPrinter
# If Autolocated is not activated, we show the Circulation Parameters to chage settings of librarian
if (C4::Context->preference("AutoLocation") ne 1)
@@ -137,7 +137,7 @@
if ( $print eq 'yes' && $borrowernumber ne '' ) {
printslip( \%env, $borrowernumber );
- $query->param( 'borrowernumberber', '' );
+ $query->param( 'borrowernumber', '' );
$borrowernumber = '';
}
@@ -156,7 +156,7 @@
$message = "'$findborrower'";
}
elsif ( $#borrowers == 0 ) {
- $query->param( 'borrowernumberber', $borrowers[0]->{'borrowernumber'} );
+ $query->param( 'borrowernumber', $borrowers[0]->{'borrowernumber'} );
$query->param( 'barcode', '' );
$borrowernumber = $borrowers[0]->{'borrowernumber'};
}
@@ -167,7 +167,6 @@
# get the borrower information.....
my $borrower;
-my $picture;
my @lines;
if ($borrowernumber) {
@@ -384,7 +383,6 @@
# to let perl sort this correctly
$issueslist->{$it}->{'timestamp'} =~ s/(-|\:| )//g;
- # warn "today: $todaysdate issue: $issuedate";
if ( $todaysdate == $issuedate ) {
(
$issueslist->{$it}->{'charge'},
@@ -450,7 +448,6 @@
foreach my $book ( sort { $b->{'timestamp'} <=> $a->{'timestamp'} }
@todaysissues )
{
-
#warn "TIMESTAMP".$book->{'timestamp'};
# ADDED BY JF: NEW ITEMTYPE COUNT DISPLAY
$issued_itemtypes_count->{ $book->{'itemtype'} }++;
@@ -574,7 +571,7 @@
"$_->{'surname'}, $_->{'firstname'} ... ($_->{'cardnumber'} - $_->{'categorycode'}) ... $_->{'address'} ";
}
$CGIselectborrower = CGI::scrolling_list(
- -name => 'borrowernumberber',
+ -name => 'borrowernumber',
-values => \@values,
-labels => \%labels,
-size => 7,
@@ -584,8 +581,83 @@
}
#title
+my $flags = $borrower->{'flags'};
+my $flag;
+
+foreach $flag ( sort keys %$flags ) {
+
+ $flags->{$flag}->{'message'} =~ s/\n/<br>/g;
+ if ( $flags->{$flag}->{'noissues'} ) {
+ $template->param(
+ flagged => 1,
+ noissues => 'true',
+ );
+ if ( $flag eq 'GNA' ) {
+ $template->param( gna => 'true' );
+ }
+ if ( $flag eq 'LOST' ) {
+ $template->param( lost => 'true' );
+ }
+ if ( $flag eq 'DBARRED' ) {
+ $template->param( dbarred => 'true' );
+ }
+ if ( $flag eq 'CHARGES' ) {
+ $template->param(
+ charges => 'true',
+ chargesmsg => $flags->{'CHARGES'}->{'message'}
+ );
+ }
+ if ( $flag eq 'CREDITS' ) {
+ $template->param(
+ credits => 'true',
+ creditsmsg => $flags->{'CREDITS'}->{'message'}
+ );
+ }
+ }
+ else {
+ if ( $flag eq 'CHARGES' ) {
+ $template->param(
+ charges => 'true',
+ flagged => 1,
+ chargesmsg => $flags->{'CHARGES'}->{'message'}
+ );
+ }
+ if ( $flag eq 'CREDITS' ) {
+ $template->param(
+ credits => 'true',
+ creditsmsg => $flags->{'CREDITS'}->{'message'}
+ );
+ }
+ if ( $flag eq 'ODUES' ) {
+ $template->param(
+ odues => 'true',
+ flagged => 1,
+ oduesmsg => $flags->{'ODUES'}->{'message'}
+ );
+
+ my $items = $flags->{$flag}->{'itemlist'};
+ {
+ my @itemswaiting;
+ foreach my $item (@$items) {
+ my ($iteminformation) =
+ getiteminformation( $item->{'itemnumber'}, 0 );
+ push @itemswaiting, $iteminformation;
+ }
+ }
+ if ( $query->param('module') ne 'returns' ) {
+ $template->param( nonreturns => 'true' );
+ }
+ }
+ if ( $flag eq 'NOTES' ) {
+ $template->param(
+ notes => 'true',
+ flagged => 1,
+ notesmsg => $flags->{'NOTES'}->{'message'}
+ );
+ }
+ }
+}
-my ( $patrontable, $flaginfotable ) = patrontable($borrower);
my $amountold = $borrower->{flags}->{'CHARGES'}->{'message'} || 0;
my @temp = split( /\$/, $amountold );
@@ -606,7 +678,6 @@
-name => 'organisations',
-labels => \%org_labels,
-values => \@orgs,
-
);
}
@@ -672,112 +743,6 @@
####################################################################
# Extra subroutines,,,
-sub patrontable {
- my ($borrower) = @_;
- my $flags = $borrower->{'flags'};
- my $flaginfotable = '';
- my $flaginfotext;
-
- #my $flaginfotext='';
- my $flag;
- my $color = '';
- foreach $flag ( sort keys %$flags ) {
-
- # my @itemswaiting='';
- $flags->{$flag}->{'message'} =~ s/\n/<br>/g;
- if ( $flags->{$flag}->{'noissues'} ) {
- $template->param(
- flagged => 1,
- noissues => 'true',
- );
- if ( $flag eq 'GNA' ) {
- $template->param( gna => 'true' );
- }
- if ( $flag eq 'LOST' ) {
- $template->param( lost => 'true' );
- }
- if ( $flag eq 'DBARRED' ) {
- $template->param( dbarred => 'true' );
- }
- if ( $flag eq 'CHARGES' ) {
- $template->param(
- charges => 'true',
- chargesmsg => $flags->{'CHARGES'}->{'message'}
- );
- }
- if ( $flag eq 'CREDITS' ) {
- $template->param(
- credits => 'true',
- creditsmsg => $flags->{'CREDITS'}->{'message'}
- );
- }
- }
- else {
- if ( $flag eq 'CHARGES' ) {
- $template->param(
- charges => 'true',
- flagged => 1,
- chargesmsg => $flags->{'CHARGES'}->{'message'}
- );
- }
- if ( $flag eq 'CREDITS' ) {
- $template->param(
- credits => 'true',
- creditsmsg => $flags->{'CREDITS'}->{'message'}
- );
- }
-
-# FIXME this part can be removed if we keep new display of reserves "reservloop"
-# if ( $flag eq 'WAITING' ) {
-# my $items = $flags->{$flag}->{'itemlist'};
-# my @itemswaiting;
-# foreach my $item (@$items) {
-# my ($iteminformation) =
-# getiteminformation($item->{'itemnumber'}, 0 );
-# $iteminformation->{'branchname'} =
-# $branches->{ $iteminformation->{'holdingbranch'} }
-# ->{'branchname'};
-# push @itemswaiting, $iteminformation;
-# }
-# $template->param(
-# flagged => 1,
-# waiting => 'true',
-# waitingmsg => $flags->{'WAITING'}->{'message'},
-# itemswaiting => \@itemswaiting,
-# );
-# }
- if ( $flag eq 'ODUES' ) {
- $template->param(
- odues => 'true',
- flagged => 1,
- oduesmsg => $flags->{'ODUES'}->{'message'}
- );
-
- my $items = $flags->{$flag}->{'itemlist'};
- {
- my @itemswaiting;
- foreach my $item (@$items) {
- my ($iteminformation) =
- getiteminformation( $item->{'itemnumber'}, 0 );
- push @itemswaiting, $iteminformation;
- }
- }
- if ( $query->param('module') ne 'returns' ) {
- $template->param( nonreturns => 'true' );
- }
- }
- if ( $flag eq 'NOTES' ) {
- $template->param(
- notes => 'true',
- flagged => 1,
- notesmsg => $flags->{'NOTES'}->{'message'}
- );
- }
- }
- }
- return ( $patrontable, $flaginfotext );
-}
-
sub cuecatbarcodedecode {
my ($barcode) = @_;
chomp($barcode);
@@ -790,7 +755,3 @@
return $barcode;
}
}
-
-# Local Variables:
-# tab-width: 8
-# End:
More information about the Koha-cvs
mailing list