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

(-)a/circ/returns.pl (-1 / +3 lines)
Lines 147-152 if ( $query->param('reserve_id') ) { Link Here
147
    my $reserve_id     = $query->param('reserve_id');
147
    my $reserve_id     = $query->param('reserve_id');
148
    my $diffBranchReturned = $query->param('diffBranch');
148
    my $diffBranchReturned = $query->param('diffBranch');
149
    my $cancel_reserve = $query->param('cancel_reserve');
149
    my $cancel_reserve = $query->param('cancel_reserve');
150
    my $cancel_reason = $query->param('cancel_reason');
151
150
    # fix up item type for display
152
    # fix up item type for display
151
    my $item = Koha::Items->find( $itemnumber );
153
    my $item = Koha::Items->find( $itemnumber );
152
    my $biblio = $item->biblio;
154
    my $biblio = $item->biblio;
Lines 154-160 if ( $query->param('reserve_id') ) { Link Here
154
    if ( $cancel_reserve ) {
156
    if ( $cancel_reserve ) {
155
        my $hold = Koha::Holds->find( $reserve_id );
157
        my $hold = Koha::Holds->find( $reserve_id );
156
        if ( $hold ) {
158
        if ( $hold ) {
157
            $hold->cancel( { charge_cancel_fee => !$forgivemanualholdsexpire } );
159
            $hold->cancel( { charge_cancel_fee => !$forgivemanualholdsexpire, cancellation_reason => $cancel_reason} );
158
        } # FIXME else?
160
        } # FIXME else?
159
    } else {
161
    } else {
160
        my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef;
162
        my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-4 / +18 lines)
Lines 686-691 Link Here
686
686
687
                                                <div class="modal-footer">
687
                                                <div class="modal-footer">
688
                                                    <input type="hidden" name="cancel_reserve" value="0" />
688
                                                    <input type="hidden" name="cancel_reserve" value="0" />
689
                                                    <input type="hidden" name="cancel_reason" value="" />
689
                                                    <input id="confirm-hold-barcode" type="hidden" name="barcode" value="[% barcode | html %]" />
690
                                                    <input id="confirm-hold-barcode" type="hidden" name="barcode" value="[% barcode | html %]" />
690
691
691
                                                    <button type="submit" class="btn btn-default approve" data-dismiss="modal" accesskey="y">
692
                                                    <button type="submit" class="btn btn-default approve" data-dismiss="modal" accesskey="y">
Lines 700-708 Link Here
700
                                                        <i class="fa fa-times"></i> Ignore (I)
701
                                                        <i class="fa fa-times"></i> Ignore (I)
701
                                                    </button>
702
                                                    </button>
702
703
703
                                                    <button type="button" class="btn btn-default deny cancel-hold" accesskey="X">
704
                                                    <fieldset class="action">
704
                                                        <i class="fa fa-trash-can"></i> Cancel hold (X)
705
                                                        [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
705
                                                    </button>
706
                                                        [% IF hold_cancellation.count %]
707
                                                            <select name="cancellation-reason" id="cancellation-reason">
708
                                                                <option value="NULL">No reason given</option>
709
                                                                [% FOREACH reason IN hold_cancellation %]
710
                                                                    <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
711
                                                                [% END %]
712
                                                            </select>
713
                                                        [% END %]
714
                                                        <button type="button" class="btn btn-default deny cancel-hold" accesskey="X">
715
                                                            <i class="fa fa-trash-can"></i> Cancel hold (X)
716
                                                        </button>
717
                                                    </fieldset>
718
706
                                                </div> <!-- /.modal-footer -->
719
                                                </div> <!-- /.modal-footer -->
707
                                            </form> <!-- /.confirm -->
720
                                            </form> <!-- /.confirm -->
708
                                        </div> <!-- /.modal-content -->
721
                                        </div> <!-- /.modal-content -->
Lines 1549-1555 Link Here
1549
                this.form.submit();
1562
                this.form.submit();
1550
            });
1563
            });
1551
            $('.cancel-hold').on("click",function(e){
1564
            $('.cancel-hold').on("click",function(e){
1565
                let cancel_reason = document.getElementById('cancellation-reason').value;
1552
                this.form.cancel_reserve.value = 1;
1566
                this.form.cancel_reserve.value = 1;
1567
                this.form.cancel_reason.value = cancel_reason;
1553
                this.form.submit();
1568
                this.form.submit();
1554
            });
1569
            });
1555
1570
1556
- 

Return to bug 29007