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

(-)a/C4/Reserves.pm (-1 / +2 lines)
Lines 1017-1022 sub ModReserve { Link Here
1017
    my $borrowernumber = $params->{'borrowernumber'};
1017
    my $borrowernumber = $params->{'borrowernumber'};
1018
    my $biblionumber = $params->{'biblionumber'};
1018
    my $biblionumber = $params->{'biblionumber'};
1019
    my $cancellation_reason = $params->{'cancellation_reason'};
1019
    my $cancellation_reason = $params->{'cancellation_reason'};
1020
    my $notify_patron = $params->{'notify_patron'};
1020
1021
1021
    return if $rank eq "W";
1022
    return if $rank eq "W";
1022
    return if $rank eq "n";
1023
    return if $rank eq "n";
Lines 1034-1040 sub ModReserve { Link Here
1034
    $hold ||= Koha::Holds->find($reserve_id);
1035
    $hold ||= Koha::Holds->find($reserve_id);
1035
1036
1036
    if ( $rank eq "del" ) {
1037
    if ( $rank eq "del" ) {
1037
        $hold->cancel({ cancellation_reason => $cancellation_reason });
1038
        $hold->cancel({ cancellation_reason => $cancellation_reason, notify_patron => $notify_patron });
1038
    }
1039
    }
1039
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1040
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1040
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
1041
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
(-)a/Koha/Hold.pm (-1 / +1 lines)
Lines 504-510 sub cancel { Link Here
504
            $self->cancellation_reason( $params->{cancellation_reason} );
504
            $self->cancellation_reason( $params->{cancellation_reason} );
505
            $self->store();
505
            $self->store();
506
506
507
            if ( $params->{cancellation_reason} ) {
507
            if ( $params->{cancellation_reason} && $params->{notify_patron} ) {
508
                my $letter = C4::Letters::GetPreparedLetter(
508
                my $letter = C4::Letters::GetPreparedLetter(
509
                    module                 => 'reserves',
509
                    module                 => 'reserves',
510
                    letter_code            => 'HOLD_CANCELLATION',
510
                    letter_code            => 'HOLD_CANCELLATION',
(-)a/circ/pendingreserves.pl (-1 / +2 lines)
Lines 56-62 if ( $op eq 'cancel_reserve' and $reserve_id ) { Link Here
56
    my $hold = Koha::Holds->find( $reserve_id );
56
    my $hold = Koha::Holds->find( $reserve_id );
57
    if ( $hold ) {
57
    if ( $hold ) {
58
        my $cancellation_reason = $input->param('cancellation-reason');
58
        my $cancellation_reason = $input->param('cancellation-reason');
59
        $hold->cancel({ cancellation_reason => $cancellation_reason });
59
        my $cancellation_notify_patron = $input->param('cancellation-notify-patron');
60
        $hold->cancel({ cancellation_reason => $cancellation_reason, notify_patron => $cancellation_notify_patron });
60
        push @messages, { type => 'message', code => 'hold_cancelled' };
61
        push @messages, { type => 'message', code => 'hold_cancelled' };
61
    }
62
    }
62
} elsif ( $op =~ m|^mark_as_lost| ) {
63
} elsif ( $op =~ m|^mark_as_lost| ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt (+3 lines)
Lines 167-172 Link Here
167
                                <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
167
                                <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
168
                            [% END %]
168
                            [% END %]
169
                        </select>
169
                        </select>
170
171
                        <input type="checkbox" name="cancellation-notify-patron" id="cancellation-notify-patron" value="1" checked/>
172
                        <label for="cancellation-notify-patron">Notify patron</label>
170
                    </div>
173
                    </div>
171
                [% END %]
174
                [% END %]
172
175
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (+10 lines)
Lines 821-826 Link Here
821
                                        <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
821
                                        <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
822
                                    [% END %]
822
                                    [% END %]
823
                                </select>
823
                                </select>
824
825
                                <input type="checkbox" name="cancellation-notify-patron" id="cancellation-notify-patron" value="1" checked/>
826
                                <label for="cancellation-notify-patron">Notify patron</label>
824
                            [% END %]
827
                            [% END %]
825
                        </fieldset>
828
                        </fieldset>
826
                        </div>
829
                        </div>
Lines 971-976 Link Here
971
                                    <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
974
                                    <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
972
                                [% END %]
975
                                [% END %]
973
                            </select>
976
                            </select>
977
978
                            <input type="checkbox" name="modal-cancellation-notify-patron" id="modal-cancellation-notify-patron" value="1" checked>
979
                            <label for="modal-cancellation-notify-patron">Notify patron</label>
974
                        [% END %]
980
                        [% END %]
975
                    </fieldset>
981
                    </fieldset>
976
                </div>
982
                </div>
Lines 1335-1344 Link Here
1335
                let biblionumber = cancel_link.data('biblionumber');
1341
                let biblionumber = cancel_link.data('biblionumber');
1336
                let reserve_id = cancel_link.data('id');
1342
                let reserve_id = cancel_link.data('id');
1337
                let reason = $("#modal-cancellation-reason").val();
1343
                let reason = $("#modal-cancellation-reason").val();
1344
                let notify = $("#modal-cancellation-notify-patron").prop('checked');
1338
                let link = `request.pl?action=cancel&amp;borrowernumber=${ borrowernumber }&amp;biblionumber=${ biblionumber }&amp;reserve_id=${ reserve_id }`;
1345
                let link = `request.pl?action=cancel&amp;borrowernumber=${ borrowernumber }&amp;biblionumber=${ biblionumber }&amp;reserve_id=${ reserve_id }`;
1339
                if ( reason ) {
1346
                if ( reason ) {
1340
                    link += "&amp;cancellation-reason=" + reason
1347
                    link += "&amp;cancellation-reason=" + reason
1341
                }
1348
                }
1349
                if ( notify ) {
1350
                    link += "&amp;cancellation-notify-patron=1";
1351
                }
1342
                window.location.href = link;
1352
                window.location.href = link;
1343
                return false;
1353
                return false;
1344
            });
1354
            });
(-)a/reserve/modrequest.pl (+3 lines)
Lines 71-76 else { Link Here
71
        undef $itemnumber[$i] if !$itemnumber[$i];
71
        undef $itemnumber[$i] if !$itemnumber[$i];
72
        my $suspend_until = $query->param( "suspend_until_" . $reserve_id[$i] );
72
        my $suspend_until = $query->param( "suspend_until_" . $reserve_id[$i] );
73
        my $cancellation_reason = $query->param("cancellation-reason");
73
        my $cancellation_reason = $query->param("cancellation-reason");
74
        my $cancellation_notify_patron = $query->param("cancellation-notify-patron");
75
74
        my $params = {
76
        my $params = {
75
            rank => $rank[$i],
77
            rank => $rank[$i],
76
            reserve_id => $reserve_id[$i],
78
            reserve_id => $reserve_id[$i],
Lines 79-84 else { Link Here
79
            itemnumber => $itemnumber[$i],
81
            itemnumber => $itemnumber[$i],
80
            defined $suspend_until ? ( suspend_until => $suspend_until ) : (),
82
            defined $suspend_until ? ( suspend_until => $suspend_until ) : (),
81
            cancellation_reason => $cancellation_reason,
83
            cancellation_reason => $cancellation_reason,
84
            notify_patron => $cancellation_notify_patron,
82
        };
85
        };
83
        if (C4::Context->preference('AllowHoldDateInFuture')) {
86
        if (C4::Context->preference('AllowHoldDateInFuture')) {
84
            $params->{reservedate} = $reservedates[$i] ? dt_from_string($reservedates[$i]) : undef;
87
            $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