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

(-)a/C4/Circulation.pm (+6 lines)
Lines 843-848 sub CanBookBeIssued { Link Here
843
        }
843
        }
844
    }
844
    }
845
845
846
    # Additional Materials Check
847
    my $no_of_parts = $item_object->materials;
848
    if ( $no_of_parts > 0 ) {
849
        $needsconfirmation{additional_materials} = $no_of_parts;
850
    }
851
846
    #
852
    #
847
    # CHECK IF BOOK ALREADY ISSUED TO THIS BORROWER
853
    # CHECK IF BOOK ALREADY ISSUED TO THIS BORROWER
848
    #
854
    #
(-)a/circ/returns.pl (-13 / +26 lines)
Lines 274-291 if ($barcode) { Link Here
274
        my $checkout = $item->checkout;
274
        my $checkout = $item->checkout;
275
        my $biblio   = $item->biblio;
275
        my $biblio   = $item->biblio;
276
        $template->param(
276
        $template->param(
277
            title            => $biblio->title,
277
            title                => $biblio->title,
278
            homebranch       => $item->homebranch,
278
            homebranch           => $item->homebranch,
279
            holdingbranch    => $item->holdingbranch,
279
            holdingbranch        => $item->holdingbranch,
280
            returnbranch     => $returnbranch,
280
            returnbranch         => $returnbranch,
281
            author           => $biblio->author,
281
            author               => $biblio->author,
282
            itembarcode      => $item->barcode,
282
            itembarcode          => $item->barcode,
283
            itemtype         => $item->effective_itemtype,
283
            itemtype             => $item->effective_itemtype,
284
            ccode            => $item->ccode,
284
            ccode                => $item->ccode,
285
            itembiblionumber => $biblio->biblionumber,
285
            itembiblionumber     => $biblio->biblionumber,
286
            biblionumber     => $biblio->biblionumber,
286
            biblionumber         => $biblio->biblionumber,
287
            additional_materials => $materials,
287
            additional_materials => $materials,
288
            issue            => $checkout,
288
            issue                => $checkout,
289
        );
289
        );
290
    } # FIXME else we should not call AddReturn but set BadBarcode directly instead
290
    } # FIXME else we should not call AddReturn but set BadBarcode directly instead
291
291
Lines 297-305 if ($barcode) { Link Here
297
297
298
    my $return_date = $dropboxmode ? $dropboxdate : $return_date_override_dt;
298
    my $return_date = $dropboxmode ? $dropboxdate : $return_date_override_dt;
299
299
300
    # Block return if multi-part and confirm has not been recieved
301
    my $needs_confirm = 0;
302
    if ( C4::Context->preference("CircConfirmParts") ) {
303
        if ( $item->materials > 0 && !$query->param('multiple_confirm') ) {
304
                $needs_confirm = 1;
305
        }
306
    }
307
300
    # do the return
308
    # do the return
301
    ( $returned, $messages, $issue, $borrower ) =
309
    ( $returned, $messages, $issue, $borrower ) =
302
      AddReturn( $barcode, $userenv_branch, $exemptfine, $return_date );
310
      AddReturn( $barcode, $userenv_branch, $exemptfine, $return_date )
311
      unless $needs_confirm;
303
312
304
    if ($returned) {
313
    if ($returned) {
305
        my $time_now = dt_from_string()->truncate( to => 'minute');
314
        my $time_now = dt_from_string()->truncate( to => 'minute');
Lines 340-352 if ($barcode) { Link Here
340
                );
349
                );
341
            }
350
            }
342
        }
351
        }
343
    } elsif ( C4::Context->preference('ShowAllCheckins') and !$messages->{'BadBarcode'} ) {
352
    } elsif ( C4::Context->preference('ShowAllCheckins') and !$messages->{'BadBarcode'} and !$needs_confirm ) {
344
        $input{duedate}   = 0;
353
        $input{duedate}   = 0;
345
        $returneditems{0} = $barcode;
354
        $returneditems{0} = $barcode;
346
        $riduedate{0}     = 0;
355
        $riduedate{0}     = 0;
347
        push( @inputloop, \%input );
356
        push( @inputloop, \%input );
348
    }
357
    }
349
    $template->param( privacy => $borrower->{privacy} );
358
    $template->param( privacy => $borrower->{privacy} );
359
360
    if ( $needs_confirm ) {
361
        $template->param( needs_confirm => $needs_confirm );
362
    }
350
}
363
}
351
$template->param( inputloop => \@inputloop );
364
$template->param( inputloop => \@inputloop );
352
365
(-)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 %]
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 121-131 Link Here
121
                                </div>
121
                                </div>
122
                            [% END %]
122
                            [% END %]
123
123
124
                            [% IF additional_materials %]
124
                            [% IF needs_confirm %]
125
                                <div class="dialog message" id="materials">
125
                                <div id="circ_needsconfirmation" class="dialog alert audio-alert-action">
126
                                    Note about the accompanying materials: <br />
126
                                    <h3>Please confirm checkin</h3>
127
                                    [% additional_materials | html %]
127
                                    <ul>
128
                                        [% IF additional_materials %]
129
                                        <li>
130
                                        Please confirm that the accompanying materials are present: [% additional_materials | html %]
131
                                        </li>
132
                                        [% END %]
133
                                    </ul>
134
135
                                    <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
136
                                        <input type="hidden" name="barcode" value="[% itembarcode | html %]" />
137
138
                                        [% IF additional_materials %]
139
                                        <input type="hidden" name="multiple_confirm" value="1" />
140
                                        [% END %]
141
142
                                        <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, checkin (Y)</button>
143
                                        <button type="submit" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't checkin (N)</button>
144
                                    </form>
145
                                </div>
146
                            [% ELSE %]
147
                                [% IF additional_materials %]
148
                                <div class="dialog alert">
149
                                    <ul>
150
                                        <li>
151
                                        Note about the accompanying materials: [% additional_materials | html %]
152
                                        </li>
153
                                    </ul>
128
                                </div>
154
                                </div>
155
                                [% END %]
129
                            [% END %]
156
                            [% END %]
130
157
131
                            [% IF ( collectionItemNeedsTransferred ) %]
158
                            [% IF ( collectionItemNeedsTransferred ) %]
132
- 

Return to bug 25261