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 685-690 Link Here
685
685
686
                                                <div class="modal-footer">
686
                                                <div class="modal-footer">
687
                                                    <input type="hidden" name="cancel_reserve" value="0" />
687
                                                    <input type="hidden" name="cancel_reserve" value="0" />
688
                                                    <input type="hidden" name="cancel_reason" value="" />
688
                                                    <input id="confirm-hold-barcode" type="hidden" name="barcode" value="[% barcode | html %]" />
689
                                                    <input id="confirm-hold-barcode" type="hidden" name="barcode" value="[% barcode | html %]" />
689
690
690
                                                    <button type="submit" class="btn btn-default approve" data-dismiss="modal" accesskey="y">
691
                                                    <button type="submit" class="btn btn-default approve" data-dismiss="modal" accesskey="y">
Lines 699-707 Link Here
699
                                                        <i class="fa fa-times"></i> Ignore (I)
700
                                                        <i class="fa fa-times"></i> Ignore (I)
700
                                                    </button>
701
                                                    </button>
701
702
702
                                                    <button type="button" class="btn btn-default deny cancel-hold" accesskey="X">
703
                                                    <fieldset class="action">
703
                                                        <i class="fa fa-trash-can"></i> Cancel hold (X)
704
                                                        [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
704
                                                    </button>
705
                                                        [% IF hold_cancellation.count %]
706
                                                            <select name="cancellation-reason" id="cancellation-reason">
707
                                                                <option value="NULL">No reason given</option>
708
                                                                [% FOREACH reason IN hold_cancellation %]
709
                                                                    <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
710
                                                                [% END %]
711
                                                            </select>
712
                                                        [% END %]
713
                                                        <button type="button" class="btn btn-default deny cancel-hold" accesskey="X">
714
                                                            <i class="fa fa-trash-can"></i> Cancel hold (X)
715
                                                        </button>
716
                                                    </fieldset>
717
705
                                                </div> <!-- /.modal-footer -->
718
                                                </div> <!-- /.modal-footer -->
706
                                            </form> <!-- /.confirm -->
719
                                            </form> <!-- /.confirm -->
707
                                        </div> <!-- /.modal-content -->
720
                                        </div> <!-- /.modal-content -->
Lines 1547-1553 Link Here
1547
                this.form.submit();
1560
                this.form.submit();
1548
            });
1561
            });
1549
            $('.cancel-hold').on("click",function(e){
1562
            $('.cancel-hold').on("click",function(e){
1563
                let cancel_reason = document.getElementById('cancellation-reason').value;
1550
                this.form.cancel_reserve.value = 1;
1564
                this.form.cancel_reserve.value = 1;
1565
                this.form.cancel_reason.value = cancel_reason;
1551
                this.form.submit();
1566
                this.form.submit();
1552
            });
1567
            });
1553
1568
1554
- 

Return to bug 29007