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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc (-1 / +1 lines)
Lines 299-305 Link Here
299
                    [%- END -%]
299
                    [%- END -%]
300
                [%- END -%]
300
                [%- END -%]
301
                <td>
301
                <td>
302
                    <a class="cancel-hold" title="Cancel hold" data-borrowernumber="[% hold.borrowernumber | html %]" data-biblionumber="[% hold.biblionumber | html %]" data-id="[% hold.reserve_id | html %]" href="#">
302
                    <a class="cancel-hold" title="Cancel hold" data-borrowernumber="[% hold.borrowernumber | html %]" data-biblionumber="[% hold.biblionumber | html %]" data-id="[% hold.reserve_id | html %]" data-transfer="[% hold.transfer | html %]" href="#">
303
                        <i class="fa fa-trash" aria-label="Cancel hold"></i>
303
                        <i class="fa fa-trash" aria-label="Cancel hold"></i>
304
                    </a>
304
                    </a>
305
                </td>
305
                </td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (+7 lines)
Lines 1406-1411 Link Here
1406
                            </select>
1406
                            </select>
1407
                        [% END %]
1407
                        [% END %]
1408
                    </fieldset>
1408
                    </fieldset>
1409
                    <div id=transfer-cancellation></div>
1409
                </div>
1410
                </div>
1410
1411
1411
                <div class="modal-footer">
1412
                <div class="modal-footer">
Lines 1794-1802 Link Here
1794
                $("#cancel_modal_form #inputs").empty();
1795
                $("#cancel_modal_form #inputs").empty();
1795
                    let reserve_id = cancel_link.data('id');
1796
                    let reserve_id = cancel_link.data('id');
1796
                    let biblionumber = cancel_link.data('biblionumber');
1797
                    let biblionumber = cancel_link.data('biblionumber');
1798
                    let transfer = cancel_link.data('transfer');
1797
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="reserve_id" value="' + reserve_id + '">');
1799
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="reserve_id" value="' + reserve_id + '">');
1798
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="biblionumber" value="' + biblionumber + '">');
1800
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="biblionumber" value="' + biblionumber + '">');
1799
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="op" value="cud-cancel">');
1801
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="op" value="cud-cancel">');
1802
                    if(transfer){
1803
                        $("#transfer-cancellation").empty()
1804
                        $("#transfer-cancellation").append('<label for="transfer-cancel">A transfer related to this hold has been detected, do you want to cancel it ?</label>');
1805
                        $("#transfer-cancellation").append('<input type="checkbox" id="transfer-cancel" name="transfer-cancel"> </input>');
1806
                    }
1800
                $('#cancelModal').modal('show');
1807
                $('#cancelModal').modal('show');
1801
                return false;
1808
                return false;
1802
            });
1809
            });
(-)a/reserve/request.pl (-1 / +7 lines)
Lines 112-118 if ( $op eq 'cud-move' ) { Link Here
112
} elsif ( $op eq 'cud-cancel' ) {
112
} elsif ( $op eq 'cud-cancel' ) {
113
    my $reserve_id          = $input->param('reserve_id');
113
    my $reserve_id          = $input->param('reserve_id');
114
    my $cancellation_reason = $input->param("cancellation-reason");
114
    my $cancellation_reason = $input->param("cancellation-reason");
115
    my $transfer = $input->param("transfer-cancel") ? "1" : "0";
115
    my $hold                = Koha::Holds->find($reserve_id);
116
    my $hold                = Koha::Holds->find($reserve_id);
117
118
    if( $transfer ) {
119
        warn($hold->item()->get_transfer);
120
        $hold->item()->get_transfer->cancel( { reason => 'Manual', 'force' => '1' } );
121
    }
116
    $hold->cancel( { cancellation_reason => $cancellation_reason } ) if $hold;
122
    $hold->cancel( { cancellation_reason => $cancellation_reason } ) if $hold;
117
} elsif ( $op eq 'cud-setLowestPriority' ) {
123
} elsif ( $op eq 'cud-setLowestPriority' ) {
118
    my $reserve_id = $input->param('reserve_id');
124
    my $reserve_id = $input->param('reserve_id');
Lines 641-646 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
641
                    $reserve{'found'}         = $res->is_found();
647
                    $reserve{'found'}         = $res->is_found();
642
                    $reserve{'inprocessing'}  = $res->is_in_processing();
648
                    $reserve{'inprocessing'}  = $res->is_in_processing();
643
                    $reserve{'intransit'}     = $res->is_in_transit();
649
                    $reserve{'intransit'}     = $res->is_in_transit();
650
                    $reserve{'transfer'}      = $res->item()->get_transfer() ? '1' : '0';
644
                } elsif ( $res->priority() > 0 ) {
651
                } elsif ( $res->priority() > 0 ) {
645
                    if ( my $item = $res->item() ) {
652
                    if ( my $item = $res->item() ) {
646
                        $reserve{'itemnumber'}      = $item->id();
653
                        $reserve{'itemnumber'}      = $item->id();
647
- 

Return to bug 34756