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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt (+5 lines)
Lines 205-210 Link Here
205
                        <div class="alert alert-info">
205
                        <div class="alert alert-info">
206
                            <p>Item renewed</p>
206
                            <p>Item renewed</p>
207
                        </div>
207
                        </div>
208
                    [% ELSIF ( renewed == 0) %]
209
                        <span class="sco-alert-warning renew"></span>
210
                        <div class="alert alert-info">
211
                            <p>Item not renewed</p>
212
                        </div>
208
                    [% ELSIF ( returned == 0 ) %]
213
                    [% ELSIF ( returned == 0 ) %]
209
                        <span class="sco-alert-warning return"></span>
214
                        <span class="sco-alert-warning return"></span>
210
                        <div class="alert alert-info">
215
                        <div class="alert alert-info">
(-)a/opac/sco/sco-main.pl (-12 / +25 lines)
Lines 139-157 my $confirm_required = 0; Link Here
139
my $return_only = 0;
139
my $return_only = 0;
140
140
141
if ( $patron && $op eq "returnbook" && $allowselfcheckreturns ) {
141
if ( $patron && $op eq "returnbook" && $allowselfcheckreturns ) {
142
    my $success        = 0;
142
    my $success = 1;
143
    my $human_required = 0;
143
144
144
    my $item = Koha::Items->find( { barcode => $barcode } );
145
    my $item = Koha::Items->find( { barcode => $barcode } );
145
    if ( C4::Context->preference("CircConfirmItemParts") ) {
146
    if ( $success && C4::Context->preference("CircConfirmItemParts") ) {
146
        if ( defined($item)
147
        if ( defined($item)
147
            && $item->materials )
148
            && $item->materials )
148
        {
149
        {
149
            $human_required = 1;
150
            $success = 0;
150
        }
151
        }
151
    }
152
    }
152
153
153
    ($success) = AddReturn( $barcode, $branch )
154
    if ($success) {
154
      unless $human_required;
155
        # Patron cannot checkin an item they don't own
156
        $success = 0
157
          unless $patron->checkouts->find( { itemnumber => $item->itemnumber } );
158
    }
159
160
    if ( $success ) {
161
        ($success) = AddReturn( $barcode, $branch )
162
    }
163
155
    $template->param( returned => $success );
164
    $template->param( returned => $success );
156
}
165
}
157
elsif ( $patron && ( $op eq 'checkout' ) ) {
166
elsif ( $patron && ( $op eq 'checkout' ) ) {
Lines 267-277 elsif ( $patron && ( $op eq 'checkout' ) ) { Link Here
267
276
268
if ( $patron && ( $op eq 'renew' ) ) {
277
if ( $patron && ( $op eq 'renew' ) ) {
269
    my $item = Koha::Items->find({ barcode => $barcode });
278
    my $item = Koha::Items->find({ barcode => $barcode });
270
    my ($status,$renewerror) = CanBookBeRenewed( $patron->borrowernumber, $item->itemnumber );
279
271
    if ($status) {
280
    if ( $patron->checkouts->find( { itemnumber => $item->itemnumber } ) ) {
272
        AddRenewal( $patron->borrowernumber, $item->itemnumber, undef, undef, undef, undef, 1 );
281
        my ($status,$renewerror) = CanBookBeRenewed( $patron->borrowernumber, $item->itemnumber );
273
        push @newissueslist, $barcode;
282
        if ($status) {
274
        $template->param( renewed => 1 );
283
            AddRenewal( $patron->borrowernumber, $item->itemnumber, undef, undef, undef, undef, 1 );
284
            push @newissueslist, $barcode;
285
            $template->param( renewed => 1 );
286
        }
287
    } else {
288
        $template->param( renewed => 0 );
275
    }
289
    }
276
}
290
}
277
291
278
- 

Return to bug 29543