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

(-)a/C4/Reserves.pm (-1 / +2 lines)
Lines 1026-1031 sub ModReserve { Link Here
1026
    my $borrowernumber = $params->{'borrowernumber'};
1026
    my $borrowernumber = $params->{'borrowernumber'};
1027
    my $biblionumber = $params->{'biblionumber'};
1027
    my $biblionumber = $params->{'biblionumber'};
1028
    my $cancellation_reason = $params->{'cancellation_reason'};
1028
    my $cancellation_reason = $params->{'cancellation_reason'};
1029
    my $notify_patron = $params->{'notify_patron'};
1029
1030
1030
    return if $rank eq "W";
1031
    return if $rank eq "W";
1031
    return if $rank eq "n";
1032
    return if $rank eq "n";
Lines 1043-1049 sub ModReserve { Link Here
1043
    $hold ||= Koha::Holds->find($reserve_id);
1044
    $hold ||= Koha::Holds->find($reserve_id);
1044
1045
1045
    if ( $rank eq "del" ) {
1046
    if ( $rank eq "del" ) {
1046
        $hold->cancel({ cancellation_reason => $cancellation_reason });
1047
        $hold->cancel({ cancellation_reason => $cancellation_reason, notify_patron => $notify_patron });
1047
    }
1048
    }
1048
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1049
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1049
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
1050
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
(-)a/Koha/Hold.pm (-1 / +1 lines)
Lines 518-524 sub cancel { Link Here
518
            $self->cancellation_reason( $params->{cancellation_reason} );
518
            $self->cancellation_reason( $params->{cancellation_reason} );
519
            $self->store();
519
            $self->store();
520
520
521
            if ( $params->{cancellation_reason} ) {
521
            if ( $params->{cancellation_reason} && $params->{notify_patron} ) {
522
                my $letter = C4::Letters::GetPreparedLetter(
522
                my $letter = C4::Letters::GetPreparedLetter(
523
                    module                 => 'reserves',
523
                    module                 => 'reserves',
524
                    letter_code            => 'HOLD_CANCELLATION',
524
                    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 887-892 Link Here
887
                                        <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
887
                                        <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
888
                                    [% END %]
888
                                    [% END %]
889
                                </select>
889
                                </select>
890
891
                                <input type="checkbox" name="cancellation-notify-patron" id="cancellation-notify-patron" value="1" checked/>
892
                                <label for="cancellation-notify-patron">Notify patron</label>
890
                            [% END %]
893
                            [% END %]
891
                        </fieldset>
894
                        </fieldset>
892
                        </div>
895
                        </div>
Lines 1037-1042 Link Here
1037
                                    <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1040
                                    <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
1038
                                [% END %]
1041
                                [% END %]
1039
                            </select>
1042
                            </select>
1043
1044
                            <input type="checkbox" name="modal-cancellation-notify-patron" id="modal-cancellation-notify-patron" value="1" checked>
1045
                            <label for="modal-cancellation-notify-patron">Notify patron</label>
1040
                        [% END %]
1046
                        [% END %]
1041
                    </fieldset>
1047
                    </fieldset>
1042
                </div>
1048
                </div>
Lines 1529-1538 Link Here
1529
                let biblionumber = cancel_link.data('biblionumber');
1535
                let biblionumber = cancel_link.data('biblionumber');
1530
                let reserve_id = cancel_link.data('id');
1536
                let reserve_id = cancel_link.data('id');
1531
                let reason = $("#modal-cancellation-reason").val();
1537
                let reason = $("#modal-cancellation-reason").val();
1538
                let notify = $("#modal-cancellation-notify-patron").prop('checked');
1532
                let link = `request.pl?action=cancel&amp;borrowernumber=${ borrowernumber }&amp;biblionumber=${ biblionumber }&amp;reserve_id=${ reserve_id }`;
1539
                let link = `request.pl?action=cancel&amp;borrowernumber=${ borrowernumber }&amp;biblionumber=${ biblionumber }&amp;reserve_id=${ reserve_id }`;
1533
                if ( reason ) {
1540
                if ( reason ) {
1534
                    link += "&amp;cancellation-reason=" + reason
1541
                    link += "&amp;cancellation-reason=" + reason
1535
                }
1542
                }
1543
                if ( notify ) {
1544
                    link += "&amp;cancellation-notify-patron=1";
1545
                }
1536
                window.location.href = link;
1546
                window.location.href = link;
1537
                return false;
1547
                return false;
1538
            });
1548
            });
(-)a/reserve/modrequest.pl (+3 lines)
Lines 70-75 else { Link Here
70
        undef $itemnumber[$i] if !$itemnumber[$i];
70
        undef $itemnumber[$i] if !$itemnumber[$i];
71
        my $suspend_until = $query->param( "suspend_until_" . $reserve_id[$i] );
71
        my $suspend_until = $query->param( "suspend_until_" . $reserve_id[$i] );
72
        my $cancellation_reason = $query->param("cancellation-reason");
72
        my $cancellation_reason = $query->param("cancellation-reason");
73
        my $cancellation_notify_patron = $query->param("cancellation-notify-patron");
74
73
        my $params = {
75
        my $params = {
74
            rank => $rank[$i],
76
            rank => $rank[$i],
75
            reserve_id => $reserve_id[$i],
77
            reserve_id => $reserve_id[$i],
Lines 78-83 else { Link Here
78
            itemnumber => $itemnumber[$i],
80
            itemnumber => $itemnumber[$i],
79
            defined $suspend_until ? ( suspend_until => $suspend_until ) : (),
81
            defined $suspend_until ? ( suspend_until => $suspend_until ) : (),
80
            cancellation_reason => $cancellation_reason,
82
            cancellation_reason => $cancellation_reason,
83
            notify_patron => $cancellation_notify_patron,
81
        };
84
        };
82
        if (C4::Context->preference('AllowHoldDateInFuture')) {
85
        if (C4::Context->preference('AllowHoldDateInFuture')) {
83
            $params->{reservedate} = $reservedates[$i] ? dt_from_string($reservedates[$i]) : undef;
86
            $params->{reservedate} = $reservedates[$i] ? dt_from_string($reservedates[$i]) : undef;
(-)a/reserve/request.pl (-2 / +2 lines)
Lines 106-113 if ( $action eq 'move' ) { Link Here
106
} elsif ( $action eq 'cancel' ) {
106
} elsif ( $action eq 'cancel' ) {
107
  my $reserve_id = $input->param('reserve_id');
107
  my $reserve_id = $input->param('reserve_id');
108
  my $cancellation_reason = $input->param("cancellation-reason");
108
  my $cancellation_reason = $input->param("cancellation-reason");
109
  my $cancellation_notify_patron = $input->param("cancellation-notify-patron");
109
  my $hold = Koha::Holds->find( $reserve_id );
110
  my $hold = Koha::Holds->find( $reserve_id );
110
  $hold->cancel({ cancellation_reason => $cancellation_reason }) if $hold;
111
  $hold->cancel({ cancellation_reason => $cancellation_reason, notify_patron => $cancellation_notify_patron }) 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 26282