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

(-)a/Koha/Hold.pm (-1 / +1 lines)
Lines 354-360 sub cancel { Link Here
354
    my ( $self, $params ) = @_;
354
    my ( $self, $params ) = @_;
355
    $self->_result->result_source->schema->txn_do(
355
    $self->_result->result_source->schema->txn_do(
356
        sub {
356
        sub {
357
            $self->cancellationdate(dt_from_string);
357
            $self->cancellationdate( dt_from_string->strftime( '%Y-%m-%d %H:%M:%S' ) );
358
            $self->priority(0);
358
            $self->priority(0);
359
            $self->_move_to_old;
359
            $self->_move_to_old;
360
            $self->SUPER::delete(); # Do not add a DELETE log
360
            $self->SUPER::delete(); # Do not add a DELETE log
(-)a/Koha/Patron.pm (-2 / +5 lines)
Lines 324-331 sub delete { Link Here
324
    my $deleted;
324
    my $deleted;
325
    $self->_result->result_source->schema->txn_do(
325
    $self->_result->result_source->schema->txn_do(
326
        sub {
326
        sub {
327
            # Delete Patron's holds
327
            # Cancel Patron's holds
328
            $self->holds->delete;
328
            my $holds = $self->holds;
329
            while( my $hold = $holds->next ){
330
                $hold->cancel;
331
            }
329
332
330
            # Delete all lists and all shares of this borrower
333
            # Delete all lists and all shares of this borrower
331
            # Consistent with the approach Koha uses on deleting individual lists
334
            # Consistent with the approach Koha uses on deleting individual lists
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt (+3 lines)
Lines 37-42 Link Here
37
    [% ELSIF op == 'delete_confirm' and patron %]
37
    [% ELSIF op == 'delete_confirm' and patron %]
38
        [%# TODO add "patron does not exist" unless patron %]
38
        [%# TODO add "patron does not exist" unless patron %]
39
        <div class="dialog alert">
39
        <div class="dialog alert">
40
            [% IF ( ItemsOnHold ) %]
41
            <h3>Patron has [% ItemsOnHold %] hold(s). Deleting patron cancels all their holds.</h3></br>
42
            [% END %]
40
            <h3>Are you sure you want to delete the patron [% patron.firstname | html %] [% patron.surname | html %]? This cannot be undone.</h3>
43
            <h3>Are you sure you want to delete the patron [% patron.firstname | html %] [% patron.surname | html %]? This cannot be undone.</h3>
41
            <form action="/cgi-bin/koha/members/deletemem.pl">
44
            <form action="/cgi-bin/koha/members/deletemem.pl">
42
                <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
45
                <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
(-)a/members/deletemem.pl (-2 / +4 lines)
Lines 85-90 if (C4::Context->preference("IndependentBranches")) { Link Here
85
my $op = $input->param('op') || 'delete_confirm';
85
my $op = $input->param('op') || 'delete_confirm';
86
my $dbh = C4::Context->dbh;
86
my $dbh = C4::Context->dbh;
87
my $is_guarantor = $dbh->selectrow_array("SELECT COUNT(*) FROM borrowers WHERE guarantorid=?", undef, $member);
87
my $is_guarantor = $dbh->selectrow_array("SELECT COUNT(*) FROM borrowers WHERE guarantorid=?", undef, $member);
88
my $countholds = $dbh->selectrow_array("SELECT COUNT(*) FROM reserves WHERE borrowernumber=?", undef, $member);
88
if ( $op eq 'delete_confirm' or $countissues > 0 or $charges or $is_guarantor ) {
89
if ( $op eq 'delete_confirm' or $countissues > 0 or $charges or $is_guarantor ) {
89
90
90
    $template->param(
91
    $template->param(
Lines 99-105 if ( $op eq 'delete_confirm' or $countissues > 0 or $charges or $is_guarantor ) Link Here
99
    if ($is_guarantor) {
100
    if ($is_guarantor) {
100
        $template->param(guarantees => 1);
101
        $template->param(guarantees => 1);
101
    }
102
    }
102
103
    if($countholds > 0){
104
        $template->param(ItemsOnHold => $countholds);
105
    }
103
    # This is silly written but reflect the same conditions as above
106
    # This is silly written but reflect the same conditions as above
104
    if ( not $countissues > 0 and not $charges and not $is_guarantor ) {
107
    if ( not $countissues > 0 and not $charges and not $is_guarantor ) {
105
        $template->param(
108
        $template->param(
106
- 

Return to bug 23219