# Copyright 2000-2002 Katipo Communications
# copyright 2010 BibLibre
+# Copyright 2011 PTFS-Europe Ltd.
#
# This file is part of Koha.
#
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use strict;
-#use warnings; FIXME - Bug 2505
+use warnings;
use CGI;
use C4::Output;
use C4::Print;
use C4::Branch; # GetBranches
use C4::Koha; # GetPrinter
use C4::Circulation;
+use C4::Overdues qw/CheckBorrowerDebarred/;
use C4::Members;
use C4::Biblio;
use C4::Reserves;
use C4::Context;
use CGI::Session;
use C4::Members::Attributes qw(GetBorrowerAttributes);
+use Koha::DateUtils;
use Date::Calc qw(
Today
my $branches = GetBranches();
my @failedrenews = $query->param('failedrenew'); # expected to be itemnumbers
-my %renew_failed;
+our %renew_failed;
for (@failedrenews) { $renew_failed{$_} = 1; }
my $findborrower = $query->param('findborrower');
if($duedatespec_allow){
if ($duedatespec) {
if ($duedatespec =~ C4::Dates->regexp('syspref')) {
- my $tempdate = C4::Dates->new($duedatespec);
-# if ($tempdate and $tempdate->output('iso') gt C4::Dates->new()->output('iso')) {
-# # i.e., it has to be later than today/now
- $datedue = $tempdate;
-# } else {
-# $invalidduedate = 1;
-# $template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec);
-# }
+ $datedue = dt_from_string($duedatespec);
+ $datedue->set_hour(23);
+ $datedue->set_minute(59);
} else {
$invalidduedate = 1;
$template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec);
}
}
-my $todaysdate = C4::Dates->new->output('iso');
+our $todaysdate = C4::Dates->new->output('iso');
# check and see if we should print
if ( $barcode eq '' && $print eq 'maybe' ) {
}
if ( $print eq 'yes' && $borrowernumber ne '' ) {
- printslip( $borrowernumber );
+ if ( C4::Context->boolean_preference('printcirculationslips') ) {
+ my $letter = IssueSlip($branch, $borrowernumber, "QUICK");
+ NetworkPrint($letter->{content});
+ }
$query->param( 'borrowernumber', '' );
$borrowernumber = '';
}
issuecount => $issue,
finetotal => $fines
);
+
+ my $debar = CheckBorrowerDebarred($borrowernumber);
+ if ($debar) {
+ $template->param( 'userdebarred' => 1 );
+ $template->param( 'debarredcomment' => $borrower->{debarredcomment} );
+ if ( $debar ne "9999-12-31" ) {
+ $template->param( 'userdebarreddate' => C4::Dates::format_date($debar) );
+ }
+ }
+
}
#
unless($issueconfirmed){
# Get the item title for more information
my $getmessageiteminfo = GetBiblioFromItemNumber(undef,$barcode);
+ $template->{VARS}->{'additional_materials'} = $getmessageiteminfo->{'materials'};
$template->param( itemhomebranch => $getmessageiteminfo->{'homebranch'} );
# pass needsconfirmation to template if issuing is possible and user hasn't yet confirmed.
$getreserv{itemcallnumber} = $getiteminfo->{'itemcallnumber'};
$getreserv{biblionumber} = $getiteminfo->{'biblionumber'};
$getreserv{waitingat} = GetBranchName( $num_res->{'branchcode'} );
+ $getreserv{suspend} = $num_res->{'suspend'};
+ $getreserv{suspend_until} = $num_res->{'suspend_until'};
# check if we have a waiting status for reservations
if ( $num_res->{'found'} eq 'W' ) {
$getreserv{color} = 'reserved';
# make the issued books table.
my $todaysissues = '';
my $previssues = '';
-my @todaysissues;
-my @previousissues;
-my @relissues;
-my @relprevissues;
+our @todaysissues;
+our @previousissues;
+our @relissues;
+our @relprevissues;
my $displayrelissues;
-my $totalprice = 0;
+our $totalprice = 0;
sub build_issue_data {
my $issueslist = shift;
$it->{'borrowernumber'},$it->{'itemnumber'}
);
$it->{"renew_error_${can_renew_error}"} = 1 if defined $can_renew_error;
- my ( $restype, $reserves ) = CheckReserves( $it->{'itemnumber'} );
+ my ( $restype, $reserves, undef ) = CheckReserves( $it->{'itemnumber'} );
$it->{'can_renew'} = $can_renew;
$it->{'can_confirm'} = !$can_renew && !$restype;
$it->{'renew_error'} = $restype;
$totalprice += $it->{'replacementprice'};
$it->{'itemtype'} = $itemtypeinfo->{'description'};
$it->{'itemtype_image'} = $itemtypeinfo->{'imageurl'};
- $it->{'dd'} = format_date($it->{'date_due'});
- $it->{'displaydate'} = format_date($it->{'issuedate'});
- $it->{'od'} = ( $it->{'date_due'} lt $todaysdate ) ? 1 : 0 ;
+ $it->{'dd'} = output_pref($it->{'date_due'});
+ $it->{'displaydate'} = output_pref($it->{'issuedate'});
+ #$it->{'od'} = ( $it->{'date_due'} lt $todaysdate ) ? 1 : 0 ;
+ $it->{'od'} = $it->{'overdue'};
($it->{'author'} eq '') and $it->{'author'} = ' ';
$it->{'renew_failed'} = $renew_failed{$it->{'itemnumber'}};
{
push @values, $_->{'borrowernumber'};
$labels{ $_->{'borrowernumber'} } =
-"$_->{'surname'}, $_->{'firstname'} ... ($_->{'cardnumber'} - $_->{'categorycode'}) ... $_->{'address'} ";
+"$_->{'surname'}, $_->{'firstname'} ... ($_->{'cardnumber'} - $_->{'categorycode'} - $_->{'branchcode'}) ... $_->{'address'} ";
}
$CGIselectborrower = CGI::scrolling_list(
-name => 'borrowernumber',
circview => 1,
soundon => C4::Context->preference("SoundOn"),
fast_cataloging => $fast_cataloging,
+ CircAutoPrintQuickSlip => C4::Context->preference("CircAutoPrintQuickSlip"),
+ activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
);
# save stickyduedate to session
DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
canned_bor_notes_loop => $canned_notes,
);
+
+$template->param( AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds') );
+
output_html_with_http_headers $query, $cookie, $template->output;