use C4::Output;
use C4::Print;
use C4::Auth qw/:DEFAULT get_session haspermission/;
-use C4::Branch; # GetBranches
use C4::Koha; # GetPrinter
use C4::Circulation;
use C4::Utils::DataTables::Members;
use CGI::Session;
use C4::Members::Attributes qw(GetBorrowerAttributes);
use Koha::Patron;
-use Koha::Patron::Debarments qw(GetDebarments IsDebarred);
+use Koha::Patron::Debarments qw(GetDebarments);
use Koha::DateUtils;
use Koha::Database;
use Koha::Patron::Messages;
my $barcodes = [];
my $barcode = $query->param('barcode');
# Barcode given by user could be '0'
-if ( $barcode || $barcode eq '0' ) {
+if ( $barcode || ( defined($barcode) && $barcode eq '0' ) ) {
$barcodes = [ $barcode ];
} else {
my $filefh = $query->upload('uploadfile');
}
);
-my $branches = GetBranches();
-
my $force_allow_issue = $query->param('forceallow') || 0;
if (!C4::Auth::haspermission( C4::Context->userenv->{id} , { circulate => 'force_checkout' } )) {
$force_allow_issue = 0;
my $stickyduedate = $query->param('stickyduedate') || $session->param('stickyduedate');
my $duedatespec = $query->param('duedatespec') || $session->param('stickyduedate');
-$duedatespec = eval { output_pref( { dt => dt_from_string( $duedatespec ), dateformat => 'iso' }); }
+$duedatespec = eval { output_pref( { dt => dt_from_string( $duedatespec ), dateformat => 'iso', timeformat => '24hr' }); }
if ( $duedatespec );
-my $restoreduedatespec = $query->param('restoreduedatespec') || $session->param('stickyduedate') || $duedatespec;
-if ($restoreduedatespec eq "highholds_empty") {
+my $restoreduedatespec = $query->param('restoreduedatespec') || $duedatespec || $session->param('stickyduedate');
+if ( $restoreduedatespec && $restoreduedatespec eq "highholds_empty" ) {
undef $restoreduedatespec;
}
my $issueconfirmed = $query->param('issueconfirmed');
$stickyduedate = $query->param('stickyduedate');
$duedatespec = $query->param('duedatespec');
}
- $session->param('auto_renew', $query->param('auto_renew'));
+ $session->param('auto_renew', scalar $query->param('auto_renew'));
}
else {
$session->clear('auto_renew');
finetotal => $fines
);
- if ( IsDebarred($borrowernumber) ) {
+ my $patron = Koha::Patrons->find( $borrowernumber );
+ if ( $patron and $patron->is_debarred ) {
$template->param(
'userdebarred' => $borrower->{debarred},
'debarredcomment' => $borrower->{debarredcomment},
}
unless($confirm_required) {
my $issue = AddIssue( $borrower, $barcode, $datedue, $cancelreserve, undef, undef, { onsite_checkout => $onsite_checkout, auto_renew => $session->param('auto_renew') } );
- $template->param( issue => $issue );
+ $template_params->{issue} = $issue;
$session->clear('auto_renew');
$inprocess = 1;
}
my ( $total, $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
if ( $borrowernumber && $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 $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
+ $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
+ $template->param( 'catcode' => $patron_categories->next ) if $patron_categories->count == 1;
}
my $librarian_messages = Koha::Patron::Messages->search(
$template->param(
librarian_messages => $librarian_messages,
patron_messages => $patron_messages,
- findborrower => $findborrower,
borrower => $borrower,
borrowernumber => $borrowernumber,
categoryname => $borrower->{'description'},
branch => $branch,
- branchname => GetBranchName($borrower->{'branchcode'}),
was_renewed => scalar $query->param('was_renewed') ? 1 : 0,
expiry => $borrower->{'dateexpiry'},
roadtype => $roadtype,
is_child => ($borrowernumber && $borrower->{'category_type'} eq 'C'),
$view => 1,
batch_allowed => $batch_allowed,
+ batch => $batch,
AudioAlerts => C4::Context->preference("AudioAlerts"),
fast_cataloging => $fast_cataloging,
CircAutoPrintQuickSlip => C4::Context->preference("CircAutoPrintQuickSlip"),
my $patron_image = Koha::Patron::Images->find($borrower->{borrowernumber});
$template->param( picture => 1 ) if $patron_image;
-# get authorised values with type of BOR_NOTES
-
-my $canned_notes = GetAuthorisedValues("BOR_NOTES");
-
+my $has_modifications = Koha::Patron::Modifications->search( { borrowernumber => $borrowernumber } )->count;
$template->param(
debt_confirmed => $debt_confirmed,
SpecifyDueDate => $duedatespec_allow,
CircAutocompl => C4::Context->preference("CircAutocompl"),
- canned_bor_notes_loop => $canned_notes,
debarments => GetDebarments({ borrowernumber => $borrowernumber }),
todaysdate => output_pref( { dt => dt_from_string()->set(hour => 23)->set(minute => 59), dateformat => 'sql' } ),
- modifications => Koha::Patron::Modifications->GetModifications({ borrowernumber => $borrowernumber }),
+ has_modifications => $has_modifications,
override_high_holds => $override_high_holds,
+ nopermission => scalar $query->param('nopermission'),
);
output_html_with_http_headers $query, $cookie, $template->output;