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 <galen.charlton@liblime.com>
my $branch = $query->param('branch');
if ($branch){
# update our session so the userenv is updated
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);
my $sessionID = $query->cookie("CGISESSID") ;
my $session = get_session($sessionID);
$session->param('branch',$branch);
my $printer = $query->param('printer');
if ($printer){
# update our session so the userenv is updated
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);
my $sessionID = $query->cookie("CGISESSID") ;
my $session = get_session($sessionID);
$session->param('branchprinter',$printer);
);
my $branches = GetBranches();
);
my $branches = GetBranches();
my $printers = GetPrinters();
my @failedrenews = $query->param('failedrenew');
my $printers = GetPrinters();
my @failedrenews = $query->param('failedrenew');
$getreserv{waiting} = 1;
# genarate information displaying only waiting reserves
$getWaitingReserveInfo{title} = $getiteminfo->{'title'};
$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; }
}
$getWaitingReserveInfo{waitingat} = GetBranchName( $num_res->{'branchcode'} );
if($num_res->{'branchcode'} eq $branch){ $getWaitingReserveInfo{waitinghere} = 1; }
}
else {
@previousissues = sort { $b->{'date_due'} cmp $a->{'date_due'} } @previousissues;
}
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
}
#### ADDED BY JF FOR COUNTS BY ITEMTYPE RULES
my $CGIselectborrower;
if ($borrowerslist) {
foreach (
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'})
my $amountold = $borrower->{flags}->{'CHARGES'}->{'message'} || 0;
my @temp = split( /\$/, $amountold );
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;
my $CGIorganisations;
my $member_of_institution;
$template->param(
issued_itemtypes_count_loop => $issued_itemtypes_loop,
findborrower => $findborrower,
$template->param(
issued_itemtypes_count_loop => $issued_itemtypes_loop,
findborrower => $findborrower,
emailpro => $borrower->{'emailpro'},
borrowernotes => $borrower->{'borrowernotes'},
city => $borrower->{'city'},
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,
phone => $borrower->{'phone'} || $borrower->{'mobile'},
cardnumber => $borrower->{'cardnumber'},
amountold => $amountold,
inprocess => $inprocess,
memberofinstution => $member_of_institution,
CGIorganisations => $CGIorganisations,
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
);
# set return date if stickyduedate
<tbody>
<!-- TMPL_LOOP NAME="todayissues" -->
<tbody>
<!-- TMPL_LOOP NAME="todayissues" -->
- <!-- TMPL_IF NAME="togglecolor" -->
+ <!-- TMPL_IF NAME="__odd__" -->
<tr>
<!-- TMPL_ELSE -->
<tr class="highlight">
<tr>
<!-- TMPL_ELSE -->
<tr class="highlight">
<tbody>
<!-- /TMPL_IF -->
<!-- TMPL_LOOP NAME="previssues" -->
<tbody>
<!-- /TMPL_IF -->
<!-- TMPL_LOOP NAME="previssues" -->
- <!-- TMPL_IF NAME="togglecolor" -->
+ <!-- TMPL_IF NAME="__odd__" -->
<tr>
<!-- TMPL_ELSE -->
<tr class="highlight">
<tr>
<!-- TMPL_ELSE -->
<tr class="highlight">