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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc (-1 / +13 lines)
Lines 186-191 Link Here
186
                        [%- IF ( hold.atdestination ) -%]
186
                        [%- IF ( hold.atdestination ) -%]
187
                            Item waiting at <strong> [% hold.wbrname | html %]</strong>[% IF hold.desk_name %], [% hold.desk_name | html %],[% END %] since [% hold.waiting_date | $KohaDates %]
187
                            Item waiting at <strong> [% hold.wbrname | html %]</strong>[% IF hold.desk_name %], [% hold.desk_name | html %],[% END %] since [% hold.waiting_date | $KohaDates %]
188
                        [%- ELSIF (hold.intransit) -%]
188
                        [%- ELSIF (hold.intransit) -%]
189
                            <input type="hidden" name="transfer-destination" value="[% hold.wbrname | html %]" />
189
                            Item being transferred to <strong> [% hold.wbrname | html %]</strong>
190
                            Item being transferred to <strong> [% hold.wbrname | html %]</strong>
190
                        [%- ELSIF (hold.inprocessing) -%]
191
                        [%- ELSIF (hold.inprocessing) -%]
191
                            Item being processed at <strong> [% hold.wbrname | html %]</strong>
192
                            Item being processed at <strong> [% hold.wbrname | html %]</strong>
Lines 299-305 Link Here
299
                    [%- END -%]
300
                    [%- END -%]
300
                [%- END -%]
301
                [%- END -%]
301
                <td>
302
                <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 %]" data-transfer="[% hold.transfer | html %]" href="#">
303
                    <a
304
                        class="cancel-hold"
305
                        title="Cancel hold"
306
                        data-borrowernumber="[% hold.borrowernumber | html %]"
307
                        data-biblionumber="[% hold.biblionumber | html %]"
308
                        data-id="[% hold.reserve_id | html %]"
309
                        data-transfer="[% hold.transfer | html %]"
310
                        data-transfer-date="[% hold.transferdate %]"
311
                        data-transfer-from="[% Branches.GetName( hold.transferfrom) %]"
312
                        data-transfer-to="[% Branches.GetName(hold.transferto) %]"
313
                        href="#"
314
                    >
303
                        <i class="fa fa-trash" aria-label="Cancel hold"></i>
315
                        <i class="fa fa-trash" aria-label="Cancel hold"></i>
304
                    </a>
316
                    </a>
305
                </td>
317
                </td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-4 / +14 lines)
Lines 1406-1412 Link Here
1406
                            </select>
1406
                            </select>
1407
                        [% END %]
1407
                        [% END %]
1408
                    </fieldset>
1408
                    </fieldset>
1409
                    <div id=transfer-cancellation></div>
1409
                    <br />
1410
                    <div id="transfer-cancellation"></div>
1410
                </div>
1411
                </div>
1411
1412
1412
                <div class="modal-footer">
1413
                <div class="modal-footer">
Lines 1796-1808 Link Here
1796
                    let reserve_id = cancel_link.data('id');
1797
                    let reserve_id = cancel_link.data('id');
1797
                    let biblionumber = cancel_link.data('biblionumber');
1798
                    let biblionumber = cancel_link.data('biblionumber');
1798
                    let transfer = cancel_link.data('transfer');
1799
                    let transfer = cancel_link.data('transfer');
1800
                    let transferTo = cancel_link.data('transfer-to');
1801
                    let transferFrom = cancel_link.data('transfer-from');
1802
                    let transferDate = cancel_link.data('transfer-date');
1799
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="reserve_id" value="' + reserve_id + '">');
1803
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="reserve_id" value="' + reserve_id + '">');
1800
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="biblionumber" value="' + biblionumber + '">');
1804
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="biblionumber" value="' + biblionumber + '">');
1801
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="op" value="cud-cancel">');
1805
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="op" value="cud-cancel">');
1802
                    if(transfer){
1806
                    if(transfer){
1803
                        $("#transfer-cancellation").empty()
1807
                        let transferElement = $("#transfer-cancellation");
1804
                        $("#transfer-cancellation").append('<label for="transfer-cancel">A transfer related to this hold has been detected, do you want to cancel it ?</label>');
1808
                        transferElement.empty();
1805
                        $("#transfer-cancellation").append('<input type="checkbox" id="transfer-cancel" name="transfer-cancel"> </input>');
1809
                        transferElement[0].classList.add("alert", "alert-warning", "audio-alert-warning");
1810
                        transferElement.append('<h3>A transfer related to this hold has been detected</h3>');
1811
                        transferElement.append('<b> Date: </b>' + transferDate + '<br />');
1812
                        transferElement.append('<b>From: </b>' + transferFrom + '<br />');
1813
                        transferElement.append('<b>To: </b>' + transferTo + '<br />');
1814
                                transferElement.append('<label for="transfer-cancel"><b>Delete this transfer: </b></label>');
1815
                        transferElement.append('<input type="checkbox" id="transfer-cancel" name="transfer-cancel"> </input>');
1806
                    }
1816
                    }
1807
                $('#cancelModal').modal('show');
1817
                $('#cancelModal').modal('show');
1808
                return false;
1818
                return false;
(-)a/reserve/request.pl (-4 / +9 lines)
Lines 112-122 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 $transfer_cancel     = $input->param("transfer-cancel") ? "1" : "0";
116
    my $hold                = Koha::Holds->find($reserve_id);
116
    my $hold                = Koha::Holds->find($reserve_id);
117
117
118
    if( $transfer ) {
118
    if ($transfer_cancel) {
119
        warn($hold->item()->get_transfer);
120
        $hold->item()->get_transfer->cancel( { reason => 'Manual', 'force' => '1' } );
119
        $hold->item()->get_transfer->cancel( { reason => 'Manual', 'force' => '1' } );
121
    }
120
    }
122
    $hold->cancel( { cancellation_reason => $cancellation_reason } ) if $hold;
121
    $hold->cancel( { cancellation_reason => $cancellation_reason } ) if $hold;
Lines 648-653 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
648
                    $reserve{'inprocessing'}  = $res->is_in_processing();
647
                    $reserve{'inprocessing'}  = $res->is_in_processing();
649
                    $reserve{'intransit'}     = $res->is_in_transit();
648
                    $reserve{'intransit'}     = $res->is_in_transit();
650
                    $reserve{'transfer'}      = $res->item()->get_transfer() ? '1' : '0';
649
                    $reserve{'transfer'}      = $res->item()->get_transfer() ? '1' : '0';
650
                    my $transfer = $res->item()->get_transfer();
651
652
                    if ($transfer) {
653
                        $reserve{'transferdate'} = $transfer->datesent;
654
                        $reserve{'transferfrom'} = $transfer->frombranch;
655
                        $reserve{'transferto'}   = $transfer->tobranch;
656
                    }
651
                } elsif ( $res->priority() > 0 ) {
657
                } elsif ( $res->priority() > 0 ) {
652
                    if ( my $item = $res->item() ) {
658
                    if ( my $item = $res->item() ) {
653
                        $reserve{'itemnumber'}      = $item->id();
659
                        $reserve{'itemnumber'}      = $item->id();
654
- 

Return to bug 34756