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 956-961 Link Here
956
        var biblionumber = "[% biblionumber | $raw %]";
956
        var biblionumber = "[% biblionumber | $raw %]";
957
        var borrowernumber = "[% patron.borrowernumber | $raw %]";
957
        var borrowernumber = "[% patron.borrowernumber | $raw %]";
958
        var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
958
        var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
959
        var REASON_LABEL = _("Reason: ");
959
        var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
960
        var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
960
        var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %]
961
        var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %]
961
        [% itemloo.itemnumber | html %]: {
962
        [% itemloo.itemnumber | html %]: {
Lines 1245-1251 Link Here
1245
1246
1246
            // Confirm cancelation of hold
1247
            // Confirm cancelation of hold
1247
            $(".cancel-hold").on("click",function(e) {
1248
            $(".cancel-hold").on("click",function(e) {
1248
                return confirmDelete(MSG_CONFIRM_DELETE_HOLD);
1249
                e.preventDefault;
1250
                let msg = MSG_CONFIRM_DELETE_HOLD ;
1251
                if ( $("#cancellation-reason").val() ) {
1252
                    const reason = $("#cancellation-reason option:selected").text();
1253
                    msg += "\n\n" + REASON_LABEL + reason;
1254
                }
1255
                const confirm = confirmDelete(msg);
1256
                if ( confirm ) {
1257
                    let href = $(this).attr('href');
1258
                    href += "&cancellation-reason=" + $("#cancellation-reason").val();
1259
                    window.location = href;
1260
                }
1261
                return false;
1249
            });
1262
            });
1250
1263
1251
            [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems ) %]
1264
            [% 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