|
Lines 39-44
my $destination = $input->param("destination") || '';
Link Here
|
| 39 |
my $borrowernumber = $input->param('borrowernumber'); |
39 |
my $borrowernumber = $input->param('borrowernumber'); |
| 40 |
my $status = $input->param('status'); |
40 |
my $status = $input->param('status'); |
| 41 |
my $reregistration = $input->param('reregistration') || ''; |
41 |
my $reregistration = $input->param('reregistration') || ''; |
|
|
42 |
my $op = $input->param('op'); |
| 42 |
|
43 |
|
| 43 |
my $dbh = C4::Context->dbh; |
44 |
my $dbh = C4::Context->dbh; |
| 44 |
my $dateexpiry; |
45 |
my $dateexpiry; |
|
Lines 47-52
my $logged_in_user = Koha::Patrons->find( { userid => $loggedinuserid } );
Link Here
|
| 47 |
my $patron = Koha::Patrons->find($borrowernumber); |
48 |
my $patron = Koha::Patrons->find($borrowernumber); |
| 48 |
|
49 |
|
| 49 |
my $cannot_renew = '0'; |
50 |
my $cannot_renew = '0'; |
|
|
51 |
my $cannot_reset = '0'; |
| 50 |
|
52 |
|
| 51 |
# Ideally we should display a warning on the interface if the logged in user is |
53 |
# Ideally we should display a warning on the interface if the logged in user is |
| 52 |
# not allowed to modify this patron. |
54 |
# not allowed to modify this patron. |
|
Lines 64-69
if ( $logged_in_user->can_see_patron_infos($patron) ) {
Link Here
|
| 64 |
$_->rethrow(); |
66 |
$_->rethrow(); |
| 65 |
} |
67 |
} |
| 66 |
} |
68 |
} |
|
|
69 |
} elsif ( $op == "cud-reset_login_attempts" ) { |
| 70 |
try { |
| 71 |
$patron->login_attempts(0)->store; |
| 72 |
$dateexpiry = $patron->renew_account; |
| 73 |
} catch { |
| 74 |
if ( ref($_) eq 'Koha::Exceptions::Patron::Relationship::NoGuarantor' ) { |
| 75 |
$cannot_reset = '1'; |
| 76 |
} else { |
| 77 |
$_->rethrow(); |
| 78 |
} |
| 79 |
} |
| 67 |
} else { |
80 |
} else { |
| 68 |
my $sth = $dbh->prepare("UPDATE borrowers SET debarred = ?, debarredcomment = '' WHERE borrowernumber = ?"); |
81 |
my $sth = $dbh->prepare("UPDATE borrowers SET debarred = ?, debarredcomment = '' WHERE borrowernumber = ?"); |
| 69 |
$sth->execute( $status, $borrowernumber ); |
82 |
$sth->execute( $status, $borrowernumber ); |
|
Lines 74-79
if ( $logged_in_user->can_see_patron_infos($patron) ) {
Link Here
|
| 74 |
if ( $destination eq "circ" ) { |
87 |
if ( $destination eq "circ" ) { |
| 75 |
if ($cannot_renew) { |
88 |
if ($cannot_renew) { |
| 76 |
print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&noguarantor=1"); |
89 |
print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&noguarantor=1"); |
|
|
90 |
} elsif ($cannot_reset) { |
| 91 |
print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&noresetnoguarantor=1"); |
| 77 |
} elsif ($dateexpiry) { |
92 |
} elsif ($dateexpiry) { |
| 78 |
print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&was_renewed=1"); |
93 |
print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&was_renewed=1"); |
| 79 |
} else { |
94 |
} else { |
| 80 |
- |
|
|