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 (+8 lines)
Lines 1457-1462 Link Here
1457
                                [% END %]
1457
                                [% END %]
1458
                            </select>
1458
                            </select>
1459
                        [% END %]
1459
                        [% END %]
1460
                        <div id="transfer-cancellation"> </div>
1461
1460
                    </fieldset>
1462
                    </fieldset>
1461
                </div>
1463
                </div>
1462
1464
Lines 1852-1860 Link Here
1852
                $("#cancel_modal_form #inputs").empty();
1854
                $("#cancel_modal_form #inputs").empty();
1853
                    let reserve_id = cancel_link.data('id');
1855
                    let reserve_id = cancel_link.data('id');
1854
                    let biblionumber = cancel_link.data('biblionumber');
1856
                    let biblionumber = cancel_link.data('biblionumber');
1857
                    let transfer = cancel_link.data('transfer');
1855
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="reserve_id" value="' + reserve_id + '">');
1858
                    $("#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 + '">');
1859
                    $("#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">');
1860
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="op" value="cud-cancel">');
1861
                if(transfer){
1862
                    $("#transfer-cancellation").empty()
1863
                    $("#transfer-cancellation").append('<label for="transfer-cancel">A transfer related to this hold has been detected, do you want to cancel it ?</label>');
1864
                    $("#transfer-cancellation").append('<input type="checkbox" id="transfer-cancel" name="transfer-cancel"> </input>');
1865
                }
1858
                $('#cancelModal').modal();
1866
                $('#cancelModal').modal();
1859
                return false;
1867
                return false;
1860
            });
1868
            });
(-)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 627-632 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
627
                    $reserve{'found'}     = $res->is_found();
633
                    $reserve{'found'}     = $res->is_found();
628
                    $reserve{'inprocessing'} = $res->is_in_processing();
634
                    $reserve{'inprocessing'} = $res->is_in_processing();
629
                    $reserve{'intransit'} = $res->is_in_transit();
635
                    $reserve{'intransit'} = $res->is_in_transit();
636
                    $reserve{'transfer'}       = $res->item()->get_transfer() ? '1' : '0';
630
                }
637
                }
631
                elsif ( $res->priority() > 0 ) {
638
                elsif ( $res->priority() > 0 ) {
632
                    if ( my $item = $res->item() )  {
639
                    if ( my $item = $res->item() )  {
633
- 

Return to bug 34756