From 558546fc33fe333c02f8416a345c02b5c00a00f9 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Thu, 30 Oct 2008 00:14:25 -0500 Subject: [PATCH] Circ cleanup. Removed unused $dbh variables, converted to loop_context_var instead of togglecolor. Prevented double comparison in sort. The rest is whitespace cleanup. Signed-off-by: Galen Charlton --- circ/circulation.pl | 41 +++++++------------ .../prog/en/modules/circ/circulation.tmpl | 4 +- 2 files changed, 16 insertions(+), 29 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 28d0685a72..d07b0a6a0a 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -56,7 +56,6 @@ my $query = new CGI; my $branch = $query->param('branch'); if ($branch){ # update our session so the userenv is updated - my $dbh=C4::Context->dbh; my $sessionID = $query->cookie("CGISESSID") ; my $session = get_session($sessionID); $session->param('branch',$branch); @@ -67,7 +66,6 @@ if ($branch){ my $printer = $query->param('printer'); if ($printer){ # update our session so the userenv is updated - my $dbh=C4::Context->dbh; my $sessionID = $query->cookie("CGISESSID") ; my $session = get_session($sessionID); $session->param('branchprinter',$printer); @@ -94,7 +92,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( ); my $branches = GetBranches(); - my $printers = GetPrinters(); my @failedrenews = $query->param('failedrenew'); @@ -358,10 +355,10 @@ if ($borrowernumber) { $getreserv{waiting} = 1; # genarate information displaying only waiting reserves $getWaitingReserveInfo{title} = $getiteminfo->{'title'}; - $getWaitingReserveInfo{biblionumber} = $getiteminfo->{'biblionumber'}; - $getWaitingReserveInfo{itemtype} = $itemtypeinfo->{'description'}; - $getWaitingReserveInfo{author} = $getiteminfo->{'author'}; - $getWaitingReserveInfo{reservedate} = format_date( $num_res->{'reservedate'} ); + $getWaitingReserveInfo{biblionumber} = $getiteminfo->{'biblionumber'}; + $getWaitingReserveInfo{itemtype} = $itemtypeinfo->{'description'}; + $getWaitingReserveInfo{author} = $getiteminfo->{'author'}; + $getWaitingReserveInfo{reservedate} = format_date( $num_res->{'reservedate'} ); $getWaitingReserveInfo{waitingat} = GetBranchName( $num_res->{'branchcode'} ); if($num_res->{'branchcode'} eq $branch){ $getWaitingReserveInfo{waitinghere} = 1; } } @@ -471,14 +468,6 @@ if ($borrower) { else { @previousissues = sort { $b->{'date_due'} cmp $a->{'date_due'} } @previousissues; } - my $i = 1; - foreach my $book ( @todaysissues ) { - $book->{'togglecolor'} = ( ++$i % 2 ) ? 0 : 1 ; - } - $i = 1; - foreach my $book ( @previousissues ) { - $book->{'togglecolor'} = ( ++$i % 2 ) ? 0 : 1 ; - } } #### ADDED BY JF FOR COUNTS BY ITEMTYPE RULES @@ -523,7 +512,7 @@ my %labels; my $CGIselectborrower; if ($borrowerslist) { foreach ( - sort {(lc $a->{'surname'} cmp lc $b->{'surname'} ?lc $a->{'surname'} cmp lc $b->{'surname'}:lc $a->{'firstname'} cmp lc $b->{'firstname'}) + sort {(lc $a->{'surname'} cmp lc $b->{'surname'} || lc $a->{'firstname'} cmp lc $b->{'firstname'}) } @$borrowerslist ) { @@ -628,12 +617,12 @@ foreach $flag ( sort keys %$flags ) { my $amountold = $borrower->{flags}->{'CHARGES'}->{'message'} || 0; my @temp = split( /\$/, $amountold ); - if ( $borrower->{'category_type'} eq 'C') { - my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); - my $cnt = scalar(@$catcodes); - $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1; - $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1; - } +if ( $borrower->{'category_type'} eq 'C') { + my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); + my $cnt = scalar(@$catcodes); + $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1; + $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1; +} my $CGIorganisations; my $member_of_institution; @@ -657,7 +646,6 @@ if ( C4::Context->preference("memberofinstitution") ) { $amountold = $temp[1]; - $template->param( issued_itemtypes_count_loop => $issued_itemtypes_loop, findborrower => $findborrower, @@ -679,7 +667,7 @@ $template->param( emailpro => $borrower->{'emailpro'}, borrowernotes => $borrower->{'borrowernotes'}, city => $borrower->{'city'}, - zipcode => $borrower->{'zipcode'}, + zipcode => $borrower->{'zipcode'}, phone => $borrower->{'phone'} || $borrower->{'mobile'}, cardnumber => $borrower->{'cardnumber'}, amountold => $amountold, @@ -692,9 +680,8 @@ $template->param( inprocess => $inprocess, memberofinstution => $member_of_institution, CGIorganisations => $CGIorganisations, - is_child => ($borrower->{'category_type'} eq 'C'), - circview => 1, - + is_child => ($borrower->{'category_type'} eq 'C'), + circview => 1, ); # set return date if stickyduedate diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl index 04685a83c8..e2df2026c6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -419,7 +419,7 @@ No patron matched - + @@ -464,7 +464,7 @@ No patron matched - + -- 2.39.5