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

(-)a/C4/Reserves.pm (-1 / +2 lines)
Lines 1098-1103 sub ModReserve { Link Here
1098
    my $biblionumber = $params->{'biblionumber'};
1098
    my $biblionumber = $params->{'biblionumber'};
1099
    my $cancellation_reason = $params->{'cancellation_reason'};
1099
    my $cancellation_reason = $params->{'cancellation_reason'};
1100
    my $date = $params->{expirationdate};
1100
    my $date = $params->{expirationdate};
1101
    my $notify_patron = $params->{'notify_patron'};
1101
1102
1102
    return if defined $rank && $rank eq "n";
1103
    return if defined $rank && $rank eq "n";
1103
1104
Lines 1117-1123 sub ModReserve { Link Here
1117
    Koha::Exceptions::ObjectNotFound->throw( 'No hold with id ' . $reserve_id ) unless $hold;
1118
    Koha::Exceptions::ObjectNotFound->throw( 'No hold with id ' . $reserve_id ) unless $hold;
1118
1119
1119
    if ( $rank eq "del" ) {
1120
    if ( $rank eq "del" ) {
1120
        $hold->cancel({ cancellation_reason => $cancellation_reason });
1121
        $hold->cancel({ cancellation_reason => $cancellation_reason, notify_patron => $notify_patron });
1121
    }
1122
    }
1122
    elsif ($hold->found && $hold->priority eq '0' && $date) {
1123
    elsif ($hold->found && $hold->priority eq '0' && $date) {
1123
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold )
1124
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold )
(-)a/Koha/Hold.pm (-1 / +1 lines)
Lines 649-655 sub cancel { Link Here
649
            $self->cancellation_reason( $params->{cancellation_reason} );
649
            $self->cancellation_reason( $params->{cancellation_reason} );
650
            $self->store();
650
            $self->store();
651
651
652
            if ( $params->{cancellation_reason} ) {
652
            if ( $params->{cancellation_reason} && $params->{notify_patron} ) {
653
                my $letter = C4::Letters::GetPreparedLetter(
653
                my $letter = C4::Letters::GetPreparedLetter(
654
                    module                 => 'reserves',
654
                    module                 => 'reserves',
655
                    letter_code            => 'HOLD_CANCELLATION',
655
                    letter_code            => 'HOLD_CANCELLATION',
(-)a/circ/pendingreserves.pl (-1 / +2 lines)
Lines 57-63 if ( $op eq 'cancel_reserve' and $reserve_id ) { Link Here
57
    my $hold = Koha::Holds->find( $reserve_id );
57
    my $hold = Koha::Holds->find( $reserve_id );
58
    if ( $hold ) {
58
    if ( $hold ) {
59
        my $cancellation_reason = $input->param('cancellation-reason');
59
        my $cancellation_reason = $input->param('cancellation-reason');
60
        $hold->cancel({ cancellation_reason => $cancellation_reason });
60
        my $cancellation_notify_patron = $input->param('cancellation-notify-patron');
61
        $hold->cancel({ cancellation_reason => $cancellation_reason, notify_patron => $cancellation_notify_patron });
61
        push @messages, { type => 'message', code => 'hold_cancelled' };
62
        push @messages, { type => 'message', code => 'hold_cancelled' };
62
    }
63
    }
63
} elsif ( $op =~ m|^mark_as_lost| ) {
64
} elsif ( $op =~ m|^mark_as_lost| ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt (+3 lines)
Lines 198-203 Link Here
198
                                <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
198
                                <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
199
                            [% END %]
199
                            [% END %]
200
                        </select>
200
                        </select>
201
202
                        <input type="checkbox" name="cancellation-notify-patron" id="cancellation-notify-patron" value="1" checked/>
203
                        <label for="cancellation-notify-patron">Notify patron</label>
201
                    </div>
204
                    </div>
202
                [% END %]
205
                [% END %]
203
206
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (+10 lines)
Lines 1023-1028 Link Here
1023
                                        <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1023
                                        <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1024
                                    [% END %]
1024
                                    [% END %]
1025
                                </select>
1025
                                </select>
1026
1027
                                <input type="checkbox" name="cancellation-notify-patron" id="cancellation-notify-patron" value="1" checked/>
1028
                                <label for="cancellation-notify-patron">Notify patron</label>
1026
                            [% END %]
1029
                            [% END %]
1027
                        </fieldset>
1030
                        </fieldset>
1028
                        </div>
1031
                        </div>
Lines 1209-1214 Link Here
1209
                                    <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1212
                                    <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1210
                                [% END %]
1213
                                [% END %]
1211
                            </select>
1214
                            </select>
1215
1216
                            <input type="checkbox" name="modal-cancellation-notify-patron" id="modal-cancellation-notify-patron" value="1" checked>
1217
                            <label for="modal-cancellation-notify-patron">Notify patron</label>
1212
                        [% END %]
1218
                        [% END %]
1213
                    </fieldset>
1219
                    </fieldset>
1214
                </div>
1220
                </div>
Lines 1585-1593 Link Here
1585
                    link = `request.pl?action=cancel&amp;borrowernumber=${ borrowernumber }&amp;biblionumber=${ biblionumber }&amp;reserve_id=${ reserve_id }`;
1591
                    link = `request.pl?action=cancel&amp;borrowernumber=${ borrowernumber }&amp;biblionumber=${ biblionumber }&amp;reserve_id=${ reserve_id }`;
1586
                }
1592
                }
1587
                let reason = $("#modal-cancellation-reason").val();
1593
                let reason = $("#modal-cancellation-reason").val();
1594
                let notify = $("#modal-cancellation-notify-patron").prop('checked');
1588
                if ( reason ) {
1595
                if ( reason ) {
1589
                    link += "&amp;cancellation-reason=" + reason
1596
                    link += "&amp;cancellation-reason=" + reason
1590
                }
1597
                }
1598
                if ( notify ) {
1599
                    link += "&amp;cancellation-notify-patron=1";
1600
                }
1591
                window.location.href = link;
1601
                window.location.href = link;
1592
                return false;
1602
                return false;
1593
            });
1603
            });
(-)a/reserve/modrequest.pl (+3 lines)
Lines 74-79 else { Link Here
74
        undef $itemnumber[$i] if !$itemnumber[$i];
74
        undef $itemnumber[$i] if !$itemnumber[$i];
75
        my $suspend_until = $query->param( "suspend_until_" . $reserve_id[$i] );
75
        my $suspend_until = $query->param( "suspend_until_" . $reserve_id[$i] );
76
        my $cancellation_reason = $query->param("cancellation-reason");
76
        my $cancellation_reason = $query->param("cancellation-reason");
77
        my $cancellation_notify_patron = $query->param("cancellation-notify-patron");
78
77
        my $params = {
79
        my $params = {
78
            rank => $rank[$i],
80
            rank => $rank[$i],
79
            reserve_id => $reserve_id[$i],
81
            reserve_id => $reserve_id[$i],
Lines 82-87 else { Link Here
82
            itemnumber => $itemnumber[$i],
84
            itemnumber => $itemnumber[$i],
83
            defined $suspend_until ? ( suspend_until => $suspend_until ) : (),
85
            defined $suspend_until ? ( suspend_until => $suspend_until ) : (),
84
            cancellation_reason => $cancellation_reason,
86
            cancellation_reason => $cancellation_reason,
87
            notify_patron => $cancellation_notify_patron,
85
        };
88
        };
86
        if (C4::Context->preference('AllowHoldDateInFuture')) {
89
        if (C4::Context->preference('AllowHoldDateInFuture')) {
87
            $params->{reservedate} = $reservedates[$i] ? dt_from_string($reservedates[$i]) : undef;
90
            $params->{reservedate} = $reservedates[$i] ? dt_from_string($reservedates[$i]) : undef;
(-)a/reserve/request.pl (-2 / +2 lines)
Lines 115-122 if ( $action eq 'move' ) { Link Here
115
elsif ( $action eq 'cancel' ) {
115
elsif ( $action eq 'cancel' ) {
116
    my $reserve_id          = $input->param('reserve_id');
116
    my $reserve_id          = $input->param('reserve_id');
117
    my $cancellation_reason = $input->param("cancellation-reason");
117
    my $cancellation_reason = $input->param("cancellation-reason");
118
    my $cancellation_notify_patron = $input->param("cancellation-notify-patron");
118
    my $hold                = Koha::Holds->find($reserve_id);
119
    my $hold                = Koha::Holds->find($reserve_id);
119
    $hold->cancel( { cancellation_reason => $cancellation_reason } ) if $hold;
120
    $hold->cancel( { cancellation_reason => $cancellation_reason, notify_patron => $cancellation_notify_patron } ) if $hold;
120
}
121
}
121
elsif ( $action eq 'setLowestPriority' ) {
122
elsif ( $action eq 'setLowestPriority' ) {
122
    my $reserve_id = $input->param('reserve_id');
123
    my $reserve_id = $input->param('reserve_id');
123
- 

Return to bug 26282