View | Details | Raw Unified | Return to bug 11759
Collapse All | Expand All

(-)a/circ/circulation.pl (-7 / +15 lines)
Lines 85-91 if (!C4::Context->userenv && !$branch){ Link Here
85
}
85
}
86
86
87
my $barcodes = [];
87
my $barcodes = [];
88
my $batch = $query->param('batch');
89
if ( my $barcode = $query->param('barcode') ) {
88
if ( my $barcode = $query->param('barcode') ) {
90
    $barcodes = [ $barcode ];
89
    $barcodes = [ $barcode ];
91
} else {
90
} else {
Lines 105-113 if ( my $barcode = $query->param('barcode') ) { Link Here
105
104
106
$barcodes = [ uniq @$barcodes ];
105
$barcodes = [ uniq @$barcodes ];
107
106
108
my $template_name = $batch
107
my $template_name = q|circ/circulation.tt|;
109
    ? q|circ/circulation_batch_checkouts.tt|
108
my $borrowernumber = $query->param('borrowernumber');
110
    : q|circ/circulation.tt|;
109
my $borrower = $borrowernumber ? GetMemberDetails( $borrowernumber, 0 ) : undef;
110
my $batch = $query->param('batch');
111
my $batch_allowed = 0;
112
if ( $batch ) {
113
    $template_name = q|circ/circulation_batch_checkouts.tt|;
114
    my @batch_category_codes = split '\|', C4::Context->preference('batch_checkouts');
115
    if ( grep {/^$borrower->{categorycode}$/} @batch_category_codes ) {
116
        $batch_allowed = 1;
117
    } else {
118
        $barcodes = [];
119
    }
120
}
111
121
112
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
122
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
113
    {
123
    {
Lines 131-137 for (@failedreturns) { $return_failed{$_} = 1; } Link Here
131
141
132
my $findborrower = $query->param('findborrower') || q{};
142
my $findborrower = $query->param('findborrower') || q{};
133
$findborrower =~ s|,| |g;
143
$findborrower =~ s|,| |g;
134
my $borrowernumber = $query->param('borrowernumber');
135
144
136
$branch  = C4::Context->userenv->{'branch'};  
145
$branch  = C4::Context->userenv->{'branch'};  
137
$printer = C4::Context->userenv->{'branchprinter'};
146
$printer = C4::Context->userenv->{'branchprinter'};
Lines 245-253 if ($findborrower) { Link Here
245
}
254
}
246
255
247
# get the borrower information.....
256
# get the borrower information.....
248
my $borrower;
249
if ($borrowernumber) {
257
if ($borrowernumber) {
250
    $borrower = GetMemberDetails( $borrowernumber, 0 );
251
    my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
258
    my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
252
259
253
    # Warningdate is the date that the warning starts appearing
260
    # Warningdate is the date that the warning starts appearing
Lines 777-782 $template->param( Link Here
777
    inprocess         => $inprocess,
784
    inprocess         => $inprocess,
778
    is_child          => ($borrower->{'category_type'} eq 'C'),
785
    is_child          => ($borrower->{'category_type'} eq 'C'),
779
    $view             => 1,
786
    $view             => 1,
787
    batch_allowed     => $batch_allowed,
780
    soundon           => C4::Context->preference("SoundOn"),
788
    soundon           => C4::Context->preference("SoundOn"),
781
    fast_cataloging   => $fast_cataloging,
789
    fast_cataloging   => $fast_cataloging,
782
    CircAutoPrintQuickSlip   => C4::Context->preference("CircAutoPrintQuickSlip"),
790
    CircAutoPrintQuickSlip   => C4::Context->preference("CircAutoPrintQuickSlip"),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc (-1 / +1 lines)
Lines 65-71 Link Here
65
<ul>
65
<ul>
66
    [% IF ( circview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]">Check out</a></li>
66
    [% IF ( circview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]">Check out</a></li>
67
    [% IF Koha.Preference('batch_checkouts').split('\|').grep(categorycode).size > 0 %]
67
    [% IF Koha.Preference('batch_checkouts').split('\|').grep(categorycode).size > 0 %]
68
      [% IF ( batch_checkout_view ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrower.borrowernumber %]&amp;batch=1">Batch check out</a></li>
68
      [% IF ( batch_checkout_view ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]&amp;batch=1">Batch check out</a></li>
69
    [% END %]
69
    [% END %]
70
    [% IF ( CAN_user_borrowers ) %]
70
    [% IF ( CAN_user_borrowers ) %]
71
        [% IF ( detailview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Details</a></li>
71
        [% IF ( detailview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Details</a></li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt (-2 / +3 lines)
Lines 54-60 $(document).ready(function() { Link Here
54
54
55
<div class="yui-g">
55
<div class="yui-g">
56
56
57
[% UNLESS checkout_infos %]
57
[% IF NOT batch_allowed %]
58
  <div class="dialog message">You are not allowed to use batch checkout for this patron</div>
59
[% ELSIF NOT checkout_infos %]
58
  <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/circ/circulation.pl">
60
  <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/circ/circulation.pl">
59
    <fieldset id="circ_circulation_issue">
61
    <fieldset id="circ_circulation_issue">
60
      <label for="barcode">Checking out a batch to [% INCLUDE 'patron-title.inc' %]</label>
62
      <label for="barcode">Checking out a batch to [% INCLUDE 'patron-title.inc' %]</label>
61
- 

Return to bug 11759