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

(-)a/C4/Reserves.pm (-1 / +2 lines)
Lines 1032-1037 sub ModReserve { Link Here
1032
    my $biblionumber = $params->{'biblionumber'};
1032
    my $biblionumber = $params->{'biblionumber'};
1033
    my $cancellation_reason = $params->{'cancellation_reason'};
1033
    my $cancellation_reason = $params->{'cancellation_reason'};
1034
    my $date = $params->{expirationdate};
1034
    my $date = $params->{expirationdate};
1035
    my $notify_patron = $params->{'notify_patron'};
1035
1036
1036
    return if defined $rank && $rank eq "n";
1037
    return if defined $rank && $rank eq "n";
1037
1038
Lines 1053-1059 sub ModReserve { Link Here
1053
    my $original = C4::Context->preference('HoldsLog') ? $hold->unblessed : undef;
1054
    my $original = C4::Context->preference('HoldsLog') ? $hold->unblessed : undef;
1054
1055
1055
    if ( $rank eq "del" ) {
1056
    if ( $rank eq "del" ) {
1056
        $hold->cancel({ cancellation_reason => $cancellation_reason });
1057
        $hold->cancel({ cancellation_reason => $cancellation_reason, notify_patron => $notify_patron });
1057
    }
1058
    }
1058
    elsif ($hold->found && $hold->priority eq '0' && $date) {
1059
    elsif ($hold->found && $hold->priority eq '0' && $date) {
1059
1060
(-)a/Koha/Hold.pm (-1 / +1 lines)
Lines 738-744 sub cancel { Link Here
738
                }, undef, $self->id
738
                }, undef, $self->id
739
            );
739
            );
740
740
741
            if ( $params->{cancellation_reason} ) {
741
            if ( $params->{cancellation_reason} && $params->{notify_patron} ) {
742
                my $letter = C4::Letters::GetPreparedLetter(
742
                my $letter = C4::Letters::GetPreparedLetter(
743
                    module                 => 'reserves',
743
                    module                 => 'reserves',
744
                    letter_code            => 'HOLD_CANCELLATION',
744
                    letter_code            => 'HOLD_CANCELLATION',
(-)a/circ/pendingreserves.pl (-1 / +2 lines)
Lines 55-61 if ( $op eq 'cud-cancel_reserve' and $reserve_id ) { Link Here
55
    my $hold = Koha::Holds->find( $reserve_id );
55
    my $hold = Koha::Holds->find( $reserve_id );
56
    if ( $hold ) {
56
    if ( $hold ) {
57
        my $cancellation_reason = $input->param('cancellation-reason');
57
        my $cancellation_reason = $input->param('cancellation-reason');
58
        $hold->cancel({ cancellation_reason => $cancellation_reason });
58
        my $cancellation_notify_patron = $input->param('cancellation-notify-patron');
59
        $hold->cancel({ cancellation_reason => $cancellation_reason, notify_patron => $cancellation_notify_patron });
59
        push @messages, { type => 'message', code => 'hold_cancelled' };
60
        push @messages, { type => 'message', code => 'hold_cancelled' };
60
    }
61
    }
61
} elsif ( $op =~ m|^mark_as_lost| ) {
62
} elsif ( $op =~ m|^mark_as_lost| ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt (+3 lines)
Lines 220-225 Link Here
220
                                <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
220
                                <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
221
                            [% END %]
221
                            [% END %]
222
                        </select>
222
                        </select>
223
224
                        <input type="checkbox" name="cancellation-notify-patron" id="cancellation-notify-patron" value="1" checked/>
225
                        <label for="cancellation-notify-patron">Notify patron</label>
223
                    </div>
226
                    </div>
224
                [% END %]
227
                [% END %]
225
228
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-5 / +11 lines)
Lines 1264-1269 Link Here
1264
                                        <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1264
                                        <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1265
                                    [% END %]
1265
                                    [% END %]
1266
                                </select>
1266
                                </select>
1267
1268
                                <input type="checkbox" name="cancellation-notify-patron" id="cancellation-notify-patron" value="1" checked/>
1269
                                <label for="cancellation-notify-patron">Notify patron</label>
1267
                            [% END %]
1270
                            [% END %]
1268
                        </fieldset>
1271
                        </fieldset>
1269
                        </div>
1272
                        </div>
Lines 1458-1463 Link Here
1458
                                        <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1461
                                        <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1459
                                    [% END %]
1462
                                    [% END %]
1460
                                </select>
1463
                                </select>
1464
1465
                                <input type="checkbox" name="cancellation-notify-patron" id="cancellation-notify-patron" value="1" checked>
1466
                                <label for="cancellation-notify-patron">Notify patron</label>
1461
                            [% END %]
1467
                            [% END %]
1462
                        </fieldset>
1468
                        </fieldset>
1463
                    </div>
1469
                    </div>
Lines 1852-1862 Link Here
1852
                e.preventDefault;
1858
                e.preventDefault;
1853
                cancel_link = $(this);
1859
                cancel_link = $(this);
1854
                $("#cancel_modal_form #inputs").empty();
1860
                $("#cancel_modal_form #inputs").empty();
1855
                    let reserve_id = cancel_link.data('id');
1861
                let reserve_id = cancel_link.data('id');
1856
                    let biblionumber = cancel_link.data('biblionumber');
1862
                let biblionumber = cancel_link.data('biblionumber');
1857
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="reserve_id" value="' + reserve_id + '">');
1863
                $("#cancel_modal_form #inputs").append('<input type="hidden" name="reserve_id" value="' + reserve_id + '">');
1858
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="biblionumber" value="' + biblionumber + '">');
1864
                $("#cancel_modal_form #inputs").append('<input type="hidden" name="biblionumber" value="' + biblionumber + '">');
1859
                    $("#cancel_modal_form #inputs").append('<input type="hidden" name="op" value="cud-cancel">');
1865
                $("#cancel_modal_form #inputs").append('<input type="hidden" name="op" value="cud-cancel">');
1860
                $('#cancelModal').modal('show');
1866
                $('#cancelModal').modal('show');
1861
                return false;
1867
                return false;
1862
            });
1868
            });
(-)a/reserve/modrequest.pl (+3 lines)
Lines 56-61 if( $op eq 'cud-cancelall' || $op eq 'cud-modifyall' ) { Link Here
56
        undef $itemnumber[$i] if !$itemnumber[$i];
56
        undef $itemnumber[$i] if !$itemnumber[$i];
57
        my $suspend_until = $query->param( "suspend_until_" . $reserve_id[$i] );
57
        my $suspend_until = $query->param( "suspend_until_" . $reserve_id[$i] );
58
        my $cancellation_reason = $query->param("cancellation-reason");
58
        my $cancellation_reason = $query->param("cancellation-reason");
59
        my $cancellation_notify_patron = $query->param("cancellation-notify-patron");
60
59
        my $params = {
61
        my $params = {
60
            rank => $rank[$i],
62
            rank => $rank[$i],
61
            reserve_id => $reserve_id[$i],
63
            reserve_id => $reserve_id[$i],
Lines 64-69 if( $op eq 'cud-cancelall' || $op eq 'cud-modifyall' ) { Link Here
64
            itemnumber => $itemnumber[$i],
66
            itemnumber => $itemnumber[$i],
65
            defined $suspend_until ? ( suspend_until => $suspend_until ) : (),
67
            defined $suspend_until ? ( suspend_until => $suspend_until ) : (),
66
            cancellation_reason => $cancellation_reason,
68
            cancellation_reason => $cancellation_reason,
69
            notify_patron => $cancellation_notify_patron,
67
        };
70
        };
68
        if (C4::Context->preference('AllowHoldDateInFuture')) {
71
        if (C4::Context->preference('AllowHoldDateInFuture')) {
69
            $params->{reservedate} = $reservedates[$i] || undef;
72
            $params->{reservedate} = $reservedates[$i] || undef;
(-)a/reserve/request.pl (-2 / +2 lines)
Lines 113-120 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 $cancellation_notify_patron = $input->param("cancellation-notify-patron");
116
    my $hold                = Koha::Holds->find($reserve_id);
117
    my $hold                = Koha::Holds->find($reserve_id);
117
    $hold->cancel( { cancellation_reason => $cancellation_reason } ) if $hold;
118
    $hold->cancel( { cancellation_reason => $cancellation_reason, notify_patron => $cancellation_notify_patron } ) if $hold;
118
}
119
}
119
elsif ( $op eq 'cud-setLowestPriority' ) {
120
elsif ( $op eq 'cud-setLowestPriority' ) {
120
    my $reserve_id = $input->param('reserve_id');
121
    my $reserve_id = $input->param('reserve_id');
121
- 

Return to bug 26282