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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-1 / +14 lines)
Lines 951-956 Link Here
951
        var biblionumber = "[% biblionumber | $raw %]";
951
        var biblionumber = "[% biblionumber | $raw %]";
952
        var borrowernumber = "[% patron.borrowernumber | $raw %]";
952
        var borrowernumber = "[% patron.borrowernumber | $raw %]";
953
        var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
953
        var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
954
        var REASON_LABEL = _("Reason: ");
954
        var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
955
        var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
955
        var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %]
956
        var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %]
956
        [% itemloo.itemnumber | html %]: {
957
        [% itemloo.itemnumber | html %]: {
Lines 1237-1243 Link Here
1237
1238
1238
            // Confirm cancelation of hold
1239
            // Confirm cancelation of hold
1239
            $(".cancel-hold").on("click",function(e) {
1240
            $(".cancel-hold").on("click",function(e) {
1240
                return confirmDelete(MSG_CONFIRM_DELETE_HOLD);
1241
                e.preventDefault;
1242
                let msg = MSG_CONFIRM_DELETE_HOLD ;
1243
                if ( $("#cancellation-reason").val() ) {
1244
                    const reason = $("#cancellation-reason option:selected").text();
1245
                    msg += "\n\n" + REASON_LABEL + reason;
1246
                }
1247
                const confirm = confirmDelete(msg);
1248
                if ( confirm ) {
1249
                    let href = $(this).attr('href');
1250
                    href += "&cancellation-reason=" + $("#cancellation-reason").val();
1251
                    window.location = href;
1252
                }
1253
                return false;
1241
            });
1254
            });
1242
1255
1243
            [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems ) %]
1256
            [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems ) %]
(-)a/reserve/request.pl (-2 / +2 lines)
Lines 106-113 if ( $action eq 'move' ) { Link Here
106
  }
106
  }
107
} elsif ( $action eq 'cancel' ) {
107
} elsif ( $action eq 'cancel' ) {
108
  my $reserve_id = $input->param('reserve_id');
108
  my $reserve_id = $input->param('reserve_id');
109
  my $cancellation_reason = $input->param("cancellation-reason");
109
  my $hold = Koha::Holds->find( $reserve_id );
110
  my $hold = Koha::Holds->find( $reserve_id );
110
  $hold->cancel if $hold;
111
  $hold->cancel({ cancellation_reason => $cancellation_reason }) if $hold;
111
} elsif ( $action eq 'setLowestPriority' ) {
112
} elsif ( $action eq 'setLowestPriority' ) {
112
  my $reserve_id = $input->param('reserve_id');
113
  my $reserve_id = $input->param('reserve_id');
113
  ToggleLowestPriority( $reserve_id );
114
  ToggleLowestPriority( $reserve_id );
114
- 

Return to bug 25534