Lines 38-44
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preferen
Link Here
|
38 |
|
38 |
|
39 |
my $input = new CGI; |
39 |
my $input = new CGI; |
40 |
|
40 |
|
41 |
my ($template, $borrowernumber, $cookie) |
41 |
my ($template, $loggedinuser, $cookie) |
42 |
= get_template_and_user({template_name => "members/deletemem.tt", |
42 |
= get_template_and_user({template_name => "members/deletemem.tt", |
43 |
query => $input, |
43 |
query => $input, |
44 |
type => "intranet", |
44 |
type => "intranet", |
Lines 51-61
my ($template, $borrowernumber, $cookie)
Link Here
|
51 |
my $member = $input->param('member'); |
51 |
my $member = $input->param('member'); |
52 |
|
52 |
|
53 |
#Do not delete yourself... |
53 |
#Do not delete yourself... |
54 |
if ($borrowernumber == $member ) { |
54 |
if ( $loggedinuser == $member ) { |
55 |
print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$member&error=CANT_DELETE_YOURSELF"); |
55 |
print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$member&error=CANT_DELETE_YOURSELF"); |
56 |
exit 0; # Exit without error |
56 |
exit 0; # Exit without error |
57 |
} |
57 |
} |
58 |
|
58 |
|
|
|
59 |
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; |
60 |
my $patron = Koha::Patrons->find( $member ); |
61 |
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); |
62 |
|
59 |
# Handle deletion from the Norwegian national patron database, if it is enabled |
63 |
# Handle deletion from the Norwegian national patron database, if it is enabled |
60 |
# If the "deletelocal" parameter is set to "false", the regular deletion will be |
64 |
# If the "deletelocal" parameter is set to "false", the regular deletion will be |
61 |
# short circuited, and only a deletion from the national database can be carried |
65 |
# short circuited, and only a deletion from the national database can be carried |
Lines 73-83
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preferen
Link Here
|
73 |
my $issues = GetPendingIssues($member); # FIXME: wasteful call when really, we only want the count |
77 |
my $issues = GetPendingIssues($member); # FIXME: wasteful call when really, we only want the count |
74 |
my $countissues = scalar(@$issues); |
78 |
my $countissues = scalar(@$issues); |
75 |
|
79 |
|
76 |
my $patron = Koha::Patrons->find( $member ); |
|
|
77 |
unless ( $patron ) { |
78 |
print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$member"); |
79 |
exit; |
80 |
} |
81 |
my $flags = C4::Members::patronflags( $patron->unblessed ); |
80 |
my $flags = C4::Members::patronflags( $patron->unblessed ); |
82 |
my $userenv = C4::Context->userenv; |
81 |
my $userenv = C4::Context->userenv; |
83 |
|
82 |
|