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 237-243 Link Here
237
            [%- END -%]
237
            [%- END -%]
238
                [%- END -%]
238
                [%- END -%]
239
                <td>
239
                <td>
240
                    <a class="cancel-hold" title="Cancel hold" data-borrowernumber="[% hold.borrowernumber | html %]" data-biblionumber="[% hold.biblionumber | html %]" data-id="[% hold.reserve_id | html %]" href="request.pl?op=cancel&amp;borrowernumber=[% hold.borrowernumber | html %]&amp;biblionumber=[% hold.biblionumber | html %]&amp;reserve_id=[% hold.reserve_id | html %]&amp;date=[% hold.date | html %]">
240
                    <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="request.pl?op=cancel&amp;borrowernumber=[% hold.borrowernumber | html %]&amp;biblionumber=[% hold.biblionumber | html %]&amp;reserve_id=[% hold.reserve_id | html %]&amp;date=[% hold.date | html %]&amp;transfer=[% hold.transfer %]">
241
                        <i class="fa fa-trash" aria-label="Cancel hold"></i>
241
                        <i class="fa fa-trash" aria-label="Cancel hold"></i>
242
                    </a>
242
                    </a>
243
                </td>
243
                </td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (+7 lines)
Lines 1460-1465 Link Here
1460
                                </select>
1460
                                </select>
1461
                            [% END %]
1461
                            [% END %]
1462
                        </fieldset>
1462
                        </fieldset>
1463
                        <div id="transfer-cancellation"> </div>
1463
                    </div>
1464
                    </div>
1464
1465
1465
                    <div class="modal-footer">
1466
                    <div class="modal-footer">
Lines 1852-1860 Link Here
1852
                $("#cancel_modal_form #inputs").empty();
1853
                $("#cancel_modal_form #inputs").empty();
1853
                    let reserve_id = cancel_link.data('id');
1854
                    let reserve_id = cancel_link.data('id');
1854
                    let biblionumber = cancel_link.data('biblionumber');
1855
                    let biblionumber = cancel_link.data('biblionumber');
1856
                    let transfer = cancel_link.data('transfer');
1855
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="reserve_id" value="' + reserve_id + '">');
1857
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="reserve_id" value="' + reserve_id + '">');
1856
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="biblionumber" value="' + biblionumber + '">');
1858
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="biblionumber" value="' + biblionumber + '">');
1857
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="op" value="cud-cancel">');
1859
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="op" value="cud-cancel">');
1860
                if(transfer){
1861
                    $("#transfer-cancellation").empty()
1862
                    $("#transfer-cancellation").append('<label for="transfer-cancel">A transfer related to this hold has been detected, do you want to cancel it ?</label>');
1863
                    $("#transfer-cancellation").append('<input type="checkbox" id="transfer-cancel" name="transfer-cancel"> </input>');
1864
                }
1858
                $('#cancelModal').modal('show');
1865
                $('#cancelModal').modal('show');
1859
                return false;
1866
                return false;
1860
            });
1867
            });
(-)a/reserve/request.pl (-1 / +7 lines)
Lines 113-119 if ( $op eq 'cud-move' ) { Link Here
113
elsif ( $op eq 'cud-cancel' ) {
113
elsif ( $op eq 'cud-cancel' ) {
114
    my $reserve_id          = $input->param('reserve_id');
114
    my $reserve_id          = $input->param('reserve_id');
115
    my $cancellation_reason = $input->param("cancellation-reason");
115
    my $cancellation_reason = $input->param("cancellation-reason");
116
    my $transfer = $input->param("transfer-cancel") ? "1" : "0";
116
    my $hold                = Koha::Holds->find($reserve_id);
117
    my $hold                = Koha::Holds->find($reserve_id);
118
119
    if( $transfer ) {
120
        warn($hold->item()->get_transfer);
121
        $hold->item()->get_transfer->cancel( { reason => 'Manual', 'force' => '1' } );
122
    }
117
    $hold->cancel( { cancellation_reason => $cancellation_reason } ) if $hold;
123
    $hold->cancel( { cancellation_reason => $cancellation_reason } ) if $hold;
118
}
124
}
119
elsif ( $op eq 'cud-setLowestPriority' ) {
125
elsif ( $op eq 'cud-setLowestPriority' ) {
Lines 632-637 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
632
                    $reserve{'found'}     = $res->is_found();
638
                    $reserve{'found'}     = $res->is_found();
633
                    $reserve{'inprocessing'} = $res->is_in_processing();
639
                    $reserve{'inprocessing'} = $res->is_in_processing();
634
                    $reserve{'intransit'} = $res->is_in_transit();
640
                    $reserve{'intransit'} = $res->is_in_transit();
641
                    $reserve{'transfer'}       = $res->item()->get_transfer() ? '1' : '0';
635
                }
642
                }
636
                elsif ( $res->priority() > 0 ) {
643
                elsif ( $res->priority() > 0 ) {
637
                    if ( my $item = $res->item() )  {
644
                    if ( my $item = $res->item() )  {
638
- 

Return to bug 34756