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

(-)a/C4/Circulation.pm (+6 lines)
Lines 897-902 sub CanBookBeIssued { Link Here
897
        }
897
        }
898
    }
898
    }
899
899
900
    # Additional Materials Check
901
    my $no_of_parts = $item_object->materials;
902
    if ( $no_of_parts > 0 ) {
903
        $needsconfirmation{additional_materials} = $no_of_parts;
904
    }
905
900
    #
906
    #
901
    # CHECK IF BOOK ALREADY ISSUED TO THIS BORROWER
907
    # CHECK IF BOOK ALREADY ISSUED TO THIS BORROWER
902
    #
908
    #
(-)a/circ/returns.pl (-13 / +26 lines)
Lines 271-288 if ($barcode) { Link Here
271
        my $checkout = $item->checkout;
271
        my $checkout = $item->checkout;
272
        my $biblio   = $item->biblio;
272
        my $biblio   = $item->biblio;
273
        $template->param(
273
        $template->param(
274
            title            => $biblio->title,
274
            title                => $biblio->title,
275
            homebranch       => $item->homebranch,
275
            homebranch           => $item->homebranch,
276
            holdingbranch    => $item->holdingbranch,
276
            holdingbranch        => $item->holdingbranch,
277
            returnbranch     => $returnbranch,
277
            returnbranch         => $returnbranch,
278
            author           => $biblio->author,
278
            author               => $biblio->author,
279
            itembarcode      => $item->barcode,
279
            itembarcode          => $item->barcode,
280
            itemtype         => $item->effective_itemtype,
280
            itemtype             => $item->effective_itemtype,
281
            ccode            => $item->ccode,
281
            ccode                => $item->ccode,
282
            itembiblionumber => $biblio->biblionumber,
282
            itembiblionumber     => $biblio->biblionumber,
283
            biblionumber     => $biblio->biblionumber,
283
            biblionumber         => $biblio->biblionumber,
284
            additional_materials => $materials,
284
            additional_materials => $materials,
285
            issue            => $checkout,
285
            issue                => $checkout,
286
        );
286
        );
287
    } # FIXME else we should not call AddReturn but set BadBarcode directly instead
287
    } # FIXME else we should not call AddReturn but set BadBarcode directly instead
288
288
Lines 294-302 if ($barcode) { Link Here
294
294
295
    my $return_date = $dropboxmode ? $dropboxdate : $return_date_override_dt;
295
    my $return_date = $dropboxmode ? $dropboxdate : $return_date_override_dt;
296
296
297
    # Block return if multi-part and confirm has not been received
298
    my $needs_confirm = 0;
299
    if ( C4::Context->preference("CircConfirmParts") ) {
300
        if ( $item->materials > 0 && !$query->param('multiple_confirm') ) {
301
                $needs_confirm = 1;
302
        }
303
    }
304
297
    # do the return
305
    # do the return
298
    ( $returned, $messages, $issue, $borrower ) =
306
    ( $returned, $messages, $issue, $borrower ) =
299
      AddReturn( $barcode, $userenv_branch, $exemptfine, $return_date );
307
      AddReturn( $barcode, $userenv_branch, $exemptfine, $return_date )
308
      unless $needs_confirm;
300
309
301
    if ($returned) {
310
    if ($returned) {
302
        my $time_now = dt_from_string()->truncate( to => 'minute');
311
        my $time_now = dt_from_string()->truncate( to => 'minute');
Lines 337-349 if ($barcode) { Link Here
337
                );
346
                );
338
            }
347
            }
339
        }
348
        }
340
    } elsif ( C4::Context->preference('ShowAllCheckins') and !$messages->{'BadBarcode'} ) {
349
    } elsif ( C4::Context->preference('ShowAllCheckins') and !$messages->{'BadBarcode'} and !$needs_confirm ) {
341
        $input{duedate}   = 0;
350
        $input{duedate}   = 0;
342
        $returneditems{0} = $barcode;
351
        $returneditems{0} = $barcode;
343
        $riduedate{0}     = 0;
352
        $riduedate{0}     = 0;
344
        push( @inputloop, \%input );
353
        push( @inputloop, \%input );
345
    }
354
    }
346
    $template->param( privacy => $borrower->{privacy} );
355
    $template->param( privacy => $borrower->{privacy} );
356
357
    if ( $needs_confirm ) {
358
        $template->param( needs_confirm => $needs_confirm );
359
    }
347
}
360
}
348
$template->param( inputloop => \@inputloop );
361
$template->param( inputloop => \@inputloop );
349
362
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-1 / +8 lines)
Lines 82-88 Link Here
82
82
83
                    [% IF ( NEEDSCONFIRMATION ) %]
83
                    [% IF ( NEEDSCONFIRMATION ) %]
84
                        <div id="circ_needsconfirmation" class="dialog alert audio-alert-action">
84
                        <div id="circ_needsconfirmation" class="dialog alert audio-alert-action">
85
                            [% IF CAN_user_circulate_force_checkout %]
85
                            [% IF CAN_user_circulate_force_checkout or additional_materials %]
86
                                <h3>Please confirm checkout</h3>
86
                                <h3>Please confirm checkout</h3>
87
                            [% ELSE %]
87
                            [% ELSE %]
88
                              <h3>Cannot check out</h3>
88
                              <h3>Cannot check out</h3>
Lines 98-103 Link Here
98
                                    </li>
98
                                    </li>
99
                                [% END %]
99
                                [% END %]
100
100
101
101
                                [% IF ( DEBT ) %]
102
                                [% IF ( DEBT ) %]
102
                                    <li>The patron has a debt of [% DEBT | $Price %].</li>
103
                                    <li>The patron has a debt of [% DEBT | $Price %].</li>
103
                                [% END %]
104
                                [% END %]
Lines 196-201 Link Here
196
                                        [% END %]
197
                                        [% END %]
197
                                    </li>
198
                                    </li>
198
                                [% END %]
199
                                [% END %]
200
201
                                [% IF additional_materials %]
202
                                    <li>
203
                                        Please confirm that the accompanying materials are present: [% additional_materials | html %]
204
                                    </li>
205
                                [% END %]
199
                            </ul>
206
                            </ul>
200
207
201
                            [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
208
                            [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-5 / +31 lines)
Lines 118-128 Link Here
118
                                </div>
118
                                </div>
119
                            [% END %]
119
                            [% END %]
120
120
121
                            [% IF additional_materials %]
121
                            [% IF needs_confirm %]
122
                                <div class="dialog message" id="materials">
122
                                <div id="circ_needsconfirmation" class="dialog alert audio-alert-action">
123
                                    Note about the accompanying materials: <br />
123
                                    <h3>Please confirm checkin</h3>
124
                                    [% additional_materials | html %]
124
                                    <ul>
125
                                        [% IF additional_materials %]
126
                                        <li>
127
                                        Please confirm that the accompanying materials are present: [% additional_materials | html %]
128
                                        </li>
129
                                        [% END %]
130
                                    </ul>
131
132
                                    <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
133
                                        <input type="hidden" name="barcode" value="[% itembarcode | html %]" />
134
135
                                        [% IF additional_materials %]
136
                                        <input type="hidden" name="multiple_confirm" value="1" />
137
                                        [% END %]
138
139
                                        <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, checkin (Y)</button>
140
                                        <button type="submit" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't checkin (N)</button>
141
                                    </form>
142
                                </div>
143
                            [% ELSE %]
144
                                [% IF additional_materials %]
145
                                <div class="dialog alert">
146
                                    <ul>
147
                                        <li>
148
                                        Note about the accompanying materials: [% additional_materials | html %]
149
                                        </li>
150
                                    </ul>
125
                                </div>
151
                                </div>
152
                                [% END %]
126
                            [% END %]
153
                            [% END %]
127
154
128
                            [% IF ( collectionItemNeedsTransferred ) %]
155
                            [% IF ( collectionItemNeedsTransferred ) %]
129
- 

Return to bug 25261