}
my $barcodes = [];
-my $batch = $query->param('batch');
if ( my $barcode = $query->param('barcode') ) {
$barcodes = [ $barcode ];
} else {
$barcodes = [ uniq @$barcodes ];
-my $template_name = $batch
- ? q|circ/circulation_batch_checkouts.tt|
- : q|circ/circulation.tt|;
+my $template_name = q|circ/circulation.tt|;
+my $borrowernumber = $query->param('borrowernumber');
+my $borrower = $borrowernumber ? GetMember( borrowernumber => $borrowernumber ) : undef;
+my $batch = $query->param('batch');
+my $batch_allowed = 0;
+if ( $batch ) {
+ $template_name = q|circ/circulation_batch_checkouts.tt|;
+ my @batch_category_codes = split '\|', C4::Context->preference('batch_checkouts');
+ if ( grep {/^$borrower->{categorycode}$/} @batch_category_codes ) {
+ $batch_allowed = 1;
+ } else {
+ $barcodes = [];
+ }
+}
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
{
my $findborrower = $query->param('findborrower') || q{};
$findborrower =~ s|,| |g;
-my $borrowernumber = $query->param('borrowernumber');
$branch = C4::Context->userenv->{'branch'};
$printer = C4::Context->userenv->{'branchprinter'};
}
# get the borrower information.....
-my $borrower;
if ($borrowernumber) {
$borrower = GetMemberDetails( $borrowernumber, 0 );
my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
inprocess => $inprocess,
is_child => ($borrowernumber && $borrower->{'category_type'} eq 'C'),
$view => 1,
+ batch_allowed => $batch_allowed,
soundon => C4::Context->preference("SoundOn"),
fast_cataloging => $fast_cataloging,
CircAutoPrintQuickSlip => C4::Context->preference("CircAutoPrintQuickSlip"),
<ul>
[% IF ( circview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]">Check out</a></li>
[% IF Koha.Preference('batch_checkouts').split('\|').grep(categorycode).size > 0 %]
- [% IF ( batch_checkout_view ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrower.borrowernumber %]&batch=1">Batch check out</a></li>
+ [% IF ( batch_checkout_view ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]&batch=1">Batch check out</a></li>
[% END %]
[% IF ( CAN_user_borrowers ) %]
[% IF ( detailview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Details</a></li>
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>[% END %]
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
-<script type="text/javascript" src="[% themelang %]/js/pages/circulation.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
<div class="yui-g">
-[% UNLESS checkout_infos %]
+[% IF NOT batch_allowed %]
+ <div class="dialog message">You are not allowed to use batch checkout for this patron</div>
+[% ELSIF NOT checkout_infos %]
<form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/circ/circulation.pl">
<fieldset id="circ_circulation_issue">
<label for="barcode">Checking out a batch to [% INCLUDE 'patron-title.inc' %]</label>
[% IF NOT checkout_info.IMPOSSIBLE && ( CAN_user_circulate_force_checkout or checkout_info.HIGHHOLDS ) %]
[% IF checkout_info.RESERVED || checkout_info.RESERVE_WAITING %] <!-- arbitrary choice, revert the reserve is not possible-->
- <p>The hold will be canceled.</p>
+ <p>This item is on hold for another patron. The hold will be overridden, but not cancelled.</p>
[% END %]
[% END %]
</p>