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

(-)a/C4/Reserves.pm (-1 / +2 lines)
Lines 1002-1007 sub ModReserve { Link Here
1002
    my $borrowernumber = $params->{'borrowernumber'};
1002
    my $borrowernumber = $params->{'borrowernumber'};
1003
    my $biblionumber = $params->{'biblionumber'};
1003
    my $biblionumber = $params->{'biblionumber'};
1004
    my $cancellation_reason = $params->{'cancellation_reason'};
1004
    my $cancellation_reason = $params->{'cancellation_reason'};
1005
    my $notify_patron = $params->{'notify_patron'};
1005
1006
1006
    return if $rank eq "W";
1007
    return if $rank eq "W";
1007
    return if $rank eq "n";
1008
    return if $rank eq "n";
Lines 1019-1025 sub ModReserve { Link Here
1019
    $hold ||= Koha::Holds->find($reserve_id);
1020
    $hold ||= Koha::Holds->find($reserve_id);
1020
1021
1021
    if ( $rank eq "del" ) {
1022
    if ( $rank eq "del" ) {
1022
        $hold->cancel({ cancellation_reason => $cancellation_reason });
1023
        $hold->cancel({ cancellation_reason => $cancellation_reason, notify_patron => $notify_patron });
1023
    }
1024
    }
1024
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1025
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1025
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
1026
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
(-)a/Koha/Hold.pm (-1 / +1 lines)
Lines 447-453 sub cancel { Link Here
447
            $self->cancellation_reason( $params->{cancellation_reason} );
447
            $self->cancellation_reason( $params->{cancellation_reason} );
448
            $self->store();
448
            $self->store();
449
449
450
            if ( $params->{cancellation_reason} ) {
450
            if ( $params->{cancellation_reason} && $params->{notify_patron} ) {
451
                my $letter = C4::Letters::GetPreparedLetter(
451
                my $letter = C4::Letters::GetPreparedLetter(
452
                    module                 => 'reserves',
452
                    module                 => 'reserves',
453
                    letter_code            => 'HOLD_CANCELLATION',
453
                    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 817-822 Link Here
817
                                        <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
817
                                        <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
818
                                    [% END %]
818
                                    [% END %]
819
                                </select>
819
                                </select>
820
821
                                <input type="checkbox" name="cancellation-notify-patron" id="cancellation-notify-patron" value="1" checked/>
822
                                <label for="cancellation-notify-patron">Notify patron</label>
820
                            [% END %]
823
                            [% END %]
821
                        </fieldset>
824
                        </fieldset>
822
                        </div>
825
                        </div>
Lines 967-972 Link Here
967
                                    <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
970
                                    <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
968
                                [% END %]
971
                                [% END %]
969
                            </select>
972
                            </select>
973
974
                            <input type="checkbox" name="modal-cancellation-notify-patron" id="modal-cancellation-notify-patron" value="1" checked>
975
                            <label for="modal-cancellation-notify-patron">Notify patron</label>
970
                        [% END %]
976
                        [% END %]
971
                    </fieldset>
977
                    </fieldset>
972
                </div>
978
                </div>
Lines 1299-1308 Link Here
1299
                let biblionumber = cancel_link.data('biblionumber');
1305
                let biblionumber = cancel_link.data('biblionumber');
1300
                let reserve_id = cancel_link.data('id');
1306
                let reserve_id = cancel_link.data('id');
1301
                let reason = $("#modal-cancellation-reason").val();
1307
                let reason = $("#modal-cancellation-reason").val();
1308
                let notify = $("#modal-cancellation-notify-patron").prop('checked');
1302
                let link = `request.pl?action=cancel&amp;borrowernumber=${ borrowernumber }&amp;biblionumber=${ biblionumber }&amp;reserve_id=${ reserve_id }`;
1309
                let link = `request.pl?action=cancel&amp;borrowernumber=${ borrowernumber }&amp;biblionumber=${ biblionumber }&amp;reserve_id=${ reserve_id }`;
1303
                if ( reason ) {
1310
                if ( reason ) {
1304
                    link += "&amp;cancellation-reason=" + reason
1311
                    link += "&amp;cancellation-reason=" + reason
1305
                }
1312
                }
1313
                if ( notify ) {
1314
                    link += "&amp;cancellation-notify-patron=1";
1315
                }
1306
                window.location.href = link;
1316
                window.location.href = link;
1307
                return false;
1317
                return false;
1308
            });
1318
            });
(-)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