my $branches = GetBranches();
my @failedrenews = $query->param('failedrenew'); # expected to be itemnumbers
-our %renew_failed;
+our %renew_failed = ();
for (@failedrenews) { $renew_failed{$_} = 1; }
-my $findborrower = $query->param('findborrower');
+my @failedreturns = $query->param('failedreturn');
+our %return_failed = ();
+for (@failedreturns) { $return_failed{$_} = 1; }
+
+my $findborrower = $query->param('findborrower') || q{};
$findborrower =~ s|,| |g;
my $borrowernumber = $query->param('borrowernumber');
$template->param(UseTablesortForCirc => 1);
}
-my $barcode = $query->param('barcode') || '';
+my $barcode = $query->param('barcode') || q{};
$barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
$barcode = barcodedecode($barcode) if( $barcode && C4::Context->preference('itemBarcodeInputFilter'));
my $issueconfirmed = $query->param('issueconfirmed');
my $cancelreserve = $query->param('cancelreserve');
my $organisation = $query->param('organisations');
-my $print = $query->param('print');
+my $print = $query->param('print') || q{};
my $newexpiry = $query->param('dateexpiry');
my $debt_confirmed = $query->param('debt_confirmed') || 0; # Don't show the debt error dialog twice
if ($duedatespec) {
if ($duedatespec =~ C4::Dates->regexp('syspref')) {
$datedue = dt_from_string($duedatespec);
- $datedue->set_hour(23);
- $datedue->set_minute(59);
} else {
$invalidduedate = 1;
$template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec);
my $borrowerslist;
my $message;
if ($findborrower) {
- my $borrowers = Search($findborrower, 'cardnumber');
- my @borrowers = @$borrowers;
+ my $borrowers = Search($findborrower, 'cardnumber') || [];
if (C4::Context->preference("AddPatronLists")) {
$template->param(
"AddPatronLists_".C4::Context->preference("AddPatronLists")=> "1",
$template->param(categories=>$categories);
}
}
- if ( $#borrowers == -1 ) {
+ if ( @$borrowers == 0 ) {
$query->param( 'findborrower', '' );
$message = "'$findborrower'";
}
- elsif ( $#borrowers == 0 ) {
- $query->param( 'borrowernumber', $borrowers[0]->{'borrowernumber'} );
+ elsif ( @$borrowers == 1 ) {
+ $borrowernumber = $borrowers->[0]->{'borrowernumber'};
+ $query->param( 'borrowernumber', $borrowernumber );
$query->param( 'barcode', '' );
- $borrowernumber = $borrowers[0]->{'borrowernumber'};
}
else {
- $borrowerslist = \@borrowers;
+ $borrowerslist = $borrowers;
}
}
$getWaitingReserveInfo{biblionumber} = $getiteminfo->{'biblionumber'};
$getWaitingReserveInfo{itemtype} = $itemtypeinfo->{'description'};
$getWaitingReserveInfo{author} = $getiteminfo->{'author'};
+ $getWaitingReserveInfo{itemcallnumber} = $getiteminfo->{'itemcallnumber'};
$getWaitingReserveInfo{reservedate} = format_date( $num_res->{'reservedate'} );
$getWaitingReserveInfo{waitingat} = GetBranchName( $num_res->{'branchcode'} );
$getWaitingReserveInfo{waitinghere} = 1 if $num_res->{'branchcode'} eq $branch;
# make the issued books table.
my $todaysissues = '';
my $previssues = '';
-our @todaysissues;
-our @previousissues;
-our @relissues;
-our @relprevissues;
+our @todaysissues = ();
+our @previousissues = ();
+our @relissues = ();
+our @relprevissues = ();
my $displayrelissues;
our $totalprice = 0;
$it->{'borrowernumber'},$it->{'itemnumber'}
);
$it->{"renew_error_${can_renew_error}"} = 1 if defined $can_renew_error;
- my ( $restype, $reserves, undef ) = CheckReserves( $it->{'itemnumber'} );
+ my $restype = C4::Reserves::GetReserveStatus( $it->{'itemnumber'} );
$it->{'can_renew'} = $can_renew;
$it->{'can_confirm'} = !$can_renew && !$restype;
- $it->{'renew_error'} = $restype;
+ $it->{'renew_error'} = ( $restype eq "Waiting" or $restype eq "Reserved" ) ? 1 : 0;
$it->{'checkoutdate'} = C4::Dates->new($it->{'issuedate'},'iso')->output('syspref');
$it->{'issuingbranchname'} = GetBranchName($it->{'branchcode'});
$it->{'od'} = $it->{'overdue'};
($it->{'author'} eq '') and $it->{'author'} = ' ';
$it->{'renew_failed'} = $renew_failed{$it->{'itemnumber'}};
+ $it->{'return_failed'} = $return_failed{$it->{'barcode'}};
- if ( $todaysdate eq $it->{'issuedate'} or $todaysdate eq $it->{'lastreneweddate'} ) {
+ if ( $it->{'issuedate'}."" gt $todaysdate or $it->{'lastreneweddate'} gt $todaysdate ) {
(!$relatives) ? push @todaysissues, $it : push @relissues, $it;
} else {
(!$relatives) ? push @previousissues, $it : push @relprevissues, $it;
$flags->{$flag}->{'message'} =~ s#\n#<br />#g;
if ( $flags->{$flag}->{'noissues'} ) {
$template->param(
- flagged => 1,
noissues => 'true',
);
if ( $flag eq 'GNA' ) {
if ( $flag eq 'CHARGES' ) {
$template->param(
charges => 'true',
- flagged => 1,
chargesmsg => $flags->{'CHARGES'}->{'message'},
chargesamount => $flags->{'CHARGES'}->{'amount'},
);
elsif ( $flag eq 'ODUES' ) {
$template->param(
odues => 'true',
- flagged => 1,
oduesmsg => $flags->{'ODUES'}->{'message'}
);
elsif ( $flag eq 'NOTES' ) {
$template->param(
notes => 'true',
- flagged => 1,
notesmsg => $flags->{'NOTES'}->{'message'}
);
}
soundon => C4::Context->preference("SoundOn"),
fast_cataloging => $fast_cataloging,
CircAutoPrintQuickSlip => C4::Context->preference("CircAutoPrintQuickSlip"),
- activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
+ activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
+ SuspendHoldsIntranet => C4::Context->preference('SuspendHoldsIntranet'),
+ AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
);
# save stickyduedate to session
SpecifyDueDate => $duedatespec_allow,
CircAutocompl => C4::Context->preference("CircAutocompl"),
AllowRenewalLimitOverride => C4::Context->preference("AllowRenewalLimitOverride"),
- dateformat => C4::Context->preference("dateformat"),
- DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
+ export_remove_fields => C4::Context->preference("ExportRemoveFields"),
+ export_with_csv_profile => C4::Context->preference("ExportWithCsvProfile"),
canned_bor_notes_loop => $canned_notes,
);
-$template->param( AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds') );
-
output_html_with_http_headers $query, $cookie, $template->output;