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

(-)a/C4/Reserves.pm (-1 / +2 lines)
Lines 984-989 sub ModReserve { Link Here
984
    my $borrowernumber = $params->{'borrowernumber'};
984
    my $borrowernumber = $params->{'borrowernumber'};
985
    my $biblionumber = $params->{'biblionumber'};
985
    my $biblionumber = $params->{'biblionumber'};
986
    my $cancellation_reason = $params->{'cancellation_reason'};
986
    my $cancellation_reason = $params->{'cancellation_reason'};
987
    my $notify_patron = $params->{'notify_patron'};
987
988
988
    return if $rank eq "W";
989
    return if $rank eq "W";
989
    return if $rank eq "n";
990
    return if $rank eq "n";
Lines 1001-1007 sub ModReserve { Link Here
1001
    $hold ||= Koha::Holds->find($reserve_id);
1002
    $hold ||= Koha::Holds->find($reserve_id);
1002
1003
1003
    if ( $rank eq "del" ) {
1004
    if ( $rank eq "del" ) {
1004
        $hold->cancel({ cancellation_reason => $cancellation_reason });
1005
        $hold->cancel({ cancellation_reason => $cancellation_reason, notify_patron => $notify_patron });
1005
    }
1006
    }
1006
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1007
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1007
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
1008
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
(-)a/Koha/Hold.pm (-1 / +1 lines)
Lines 376-382 sub cancel { Link Here
376
            $self->cancellation_reason( $params->{cancellation_reason} );
376
            $self->cancellation_reason( $params->{cancellation_reason} );
377
            $self->store();
377
            $self->store();
378
378
379
            if ( $params->{cancellation_reason} ) {
379
            if ( $params->{cancellation_reason} && $params->{notify_patron} ) {
380
                my $letter = C4::Letters::GetPreparedLetter(
380
                my $letter = C4::Letters::GetPreparedLetter(
381
                    module                 => 'reserves',
381
                    module                 => 'reserves',
382
                    letter_code            => 'HOLD_CANCELLATION',
382
                    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 162-167 Link Here
162
                                <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
162
                                <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
163
                            [% END %]
163
                            [% END %]
164
                        </select>
164
                        </select>
165
166
                        <input type="checkbox" name="cancellation-notify-patron" id="cancellation-notify-patron" value="1" checked/>
167
                        <label for="cancellation-notify-patron">Notify patron</label>
165
                    </div>
168
                    </div>
166
                [% END %]
169
                [% END %]
167
170
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (+10 lines)
Lines 811-816 Link Here
811
                                        <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
811
                                        <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
812
                                    [% END %]
812
                                    [% END %]
813
                                </select>
813
                                </select>
814
815
                                <input type="checkbox" name="cancellation-notify-patron" id="cancellation-notify-patron" value="1" checked/>
816
                                <label for="cancellation-notify-patron">Notify patron</label>
814
                            [% END %]
817
                            [% END %]
815
                        </fieldset>
818
                        </fieldset>
816
                        </div>
819
                        </div>
Lines 961-966 Link Here
961
                                    <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
964
                                    <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
962
                                [% END %]
965
                                [% END %]
963
                            </select>
966
                            </select>
967
968
                            <input type="checkbox" name="modal-cancellation-notify-patron" id="modal-cancellation-notify-patron" value="1" checked>
969
                            <label for="modal-cancellation-notify-patron">Notify patron</label>
964
                        [% END %]
970
                        [% END %]
965
                    </fieldset>
971
                    </fieldset>
966
                </div>
972
                </div>
Lines 1292-1301 Link Here
1292
                let biblionumber = cancel_link.data('biblionumber');
1298
                let biblionumber = cancel_link.data('biblionumber');
1293
                let reserve_id = cancel_link.data('id');
1299
                let reserve_id = cancel_link.data('id');
1294
                let reason = $("#modal-cancellation-reason").val();
1300
                let reason = $("#modal-cancellation-reason").val();
1301
                let notify = $("#modal-cancellation-notify-patron").prop('checked');
1295
                let link = `request.pl?action=cancel&amp;borrowernumber=${ borrowernumber }&amp;biblionumber=${ biblionumber }&amp;reserve_id=${ reserve_id }`;
1302
                let link = `request.pl?action=cancel&amp;borrowernumber=${ borrowernumber }&amp;biblionumber=${ biblionumber }&amp;reserve_id=${ reserve_id }`;
1296
                if ( reason ) {
1303
                if ( reason ) {
1297
                    link += "&amp;cancellation-reason=" + reason
1304
                    link += "&amp;cancellation-reason=" + reason
1298
                }
1305
                }
1306
                if ( notify ) {
1307
                    link += "&amp;cancellation-notify-patron=1";
1308
                }
1299
                window.location.href = link;
1309
                window.location.href = link;
1300
                return false;
1310
                return false;
1301
            });
1311
            });
(-)a/reserve/modrequest.pl (+3 lines)
Lines 72-77 else { Link Here
72
        undef $itemnumber[$i] if !$itemnumber[$i];
72
        undef $itemnumber[$i] if !$itemnumber[$i];
73
        my $suspend_until = $query->param( "suspend_until_" . $reserve_id[$i] );
73
        my $suspend_until = $query->param( "suspend_until_" . $reserve_id[$i] );
74
        my $cancellation_reason = $query->param("cancellation-reason");
74
        my $cancellation_reason = $query->param("cancellation-reason");
75
        my $cancellation_notify_patron = $query->param("cancellation-notify-patron");
76
75
        my $params = {
77
        my $params = {
76
            rank => $rank[$i],
78
            rank => $rank[$i],
77
            reserve_id => $reserve_id[$i],
79
            reserve_id => $reserve_id[$i],
Lines 80-85 else { Link Here
80
            itemnumber => $itemnumber[$i],
82
            itemnumber => $itemnumber[$i],
81
            defined $suspend_until ? ( suspend_until => $suspend_until ) : (),
83
            defined $suspend_until ? ( suspend_until => $suspend_until ) : (),
82
            cancellation_reason => $cancellation_reason,
84
            cancellation_reason => $cancellation_reason,
85
            notify_patron => $cancellation_notify_patron,
83
        };
86
        };
84
        if (C4::Context->preference('AllowHoldDateInFuture')) {
87
        if (C4::Context->preference('AllowHoldDateInFuture')) {
85
            $params->{reservedate} = $reservedates[$i] ? dt_from_string($reservedates[$i]) : undef;
88
            $params->{reservedate} = $reservedates[$i] ? dt_from_string($reservedates[$i]) : undef;
(-)a/reserve/request.pl (-2 / +2 lines)
Lines 107-114 if ( $action eq 'move' ) { Link Here
107
} elsif ( $action eq 'cancel' ) {
107
} elsif ( $action eq 'cancel' ) {
108
  my $reserve_id = $input->param('reserve_id');
108
  my $reserve_id = $input->param('reserve_id');
109
  my $cancellation_reason = $input->param("cancellation-reason");
109
  my $cancellation_reason = $input->param("cancellation-reason");
110
  my $cancellation_notify_patron = $input->param("cancellation-notify-patron");
110
  my $hold = Koha::Holds->find( $reserve_id );
111
  my $hold = Koha::Holds->find( $reserve_id );
111
  $hold->cancel({ cancellation_reason => $cancellation_reason }) if $hold;
112
  $hold->cancel({ cancellation_reason => $cancellation_reason, notify_patron => $cancellation_notify_patron }) if $hold;
112
} elsif ( $action eq 'setLowestPriority' ) {
113
} elsif ( $action eq 'setLowestPriority' ) {
113
  my $reserve_id = $input->param('reserve_id');
114
  my $reserve_id = $input->param('reserve_id');
114
  ToggleLowestPriority( $reserve_id );
115
  ToggleLowestPriority( $reserve_id );
115
- 

Return to bug 26282