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

(-)a/circ/circulation.pl (-7 / +16 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 $borrower;
110
    : q|circ/circulation.tt|;
109
my $borrowernumber = $query->param('borrowernumber');
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
    $borrower = GetMemberDetails( $borrowernumber, 0 );
116
    if ( grep {/^$borrower->{categorycode}$/} @batch_category_codes ) {
117
        $batch_allowed = 1;
118
    } else {
119
        $barcodes = [];
120
    }
121
}
111
122
112
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
123
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
113
    {
124
    {
Lines 131-137 for (@failedreturns) { $return_failed{$_} = 1; } Link Here
131
142
132
my $findborrower = $query->param('findborrower') || q{};
143
my $findborrower = $query->param('findborrower') || q{};
133
$findborrower =~ s|,| |g;
144
$findborrower =~ s|,| |g;
134
my $borrowernumber = $query->param('borrowernumber');
135
145
136
$branch  = C4::Context->userenv->{'branch'};  
146
$branch  = C4::Context->userenv->{'branch'};  
137
$printer = C4::Context->userenv->{'branchprinter'};
147
$printer = C4::Context->userenv->{'branchprinter'};
Lines 246-254 if ($findborrower) { Link Here
246
}
256
}
247
257
248
# get the borrower information.....
258
# get the borrower information.....
249
my $borrower;
250
if ($borrowernumber) {
259
if ($borrowernumber) {
251
    $borrower = GetMemberDetails( $borrowernumber, 0 );
252
    my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
260
    my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
253
261
254
    # Warningdate is the date that the warning starts appearing
262
    # Warningdate is the date that the warning starts appearing
Lines 799-804 $template->param( Link Here
799
    CGIorganisations  => $CGIorganisations,
807
    CGIorganisations  => $CGIorganisations,
800
    is_child          => ($borrower->{'category_type'} eq 'C'),
808
    is_child          => ($borrower->{'category_type'} eq 'C'),
801
    $view             => 1,
809
    $view             => 1,
810
    batch_allowed     => $batch_allowed,
802
    soundon           => C4::Context->preference("SoundOn"),
811
    soundon           => C4::Context->preference("SoundOn"),
803
    fast_cataloging   => $fast_cataloging,
812
    fast_cataloging   => $fast_cataloging,
804
    CircAutoPrintQuickSlip   => C4::Context->preference("CircAutoPrintQuickSlip"),
813
    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