Lines 34-40
use Koha::Patrons;
Link Here
|
34 |
|
34 |
|
35 |
my $input = new CGI; |
35 |
my $input = new CGI; |
36 |
|
36 |
|
37 |
my ( $loggedinuser ) = checkauth($input, 0, { borrowers => 'edit_borrowers' }, 'intranet'); |
37 |
my ( $loggedinuserid ) = checkauth($input, 0, { borrowers => 'edit_borrowers' }, 'intranet'); |
38 |
|
38 |
|
39 |
my $destination = $input->param("destination") || ''; |
39 |
my $destination = $input->param("destination") || ''; |
40 |
my $borrowernumber=$input->param('borrowernumber'); |
40 |
my $borrowernumber=$input->param('borrowernumber'); |
Lines 44-56
my $reregistration = $input->param('reregistration') || '';
Link Here
|
44 |
my $dbh = C4::Context->dbh; |
44 |
my $dbh = C4::Context->dbh; |
45 |
my $dateexpiry; |
45 |
my $dateexpiry; |
46 |
|
46 |
|
47 |
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; |
47 |
my $logged_in_user = Koha::Patrons->find( { userid => $loggedinuserid } ) or die "Not logged in"; |
48 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
48 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
49 |
|
49 |
|
50 |
# Ideally we should display a warning on the interface if the logged in user is |
50 |
# Ideally we should display a warning on the interface if the logged in user is |
51 |
# not allowed to modify this patron. |
51 |
# not allowed to modify this patron. |
52 |
# But a librarian is not supposed to hack the system |
52 |
# But a librarian is not supposed to hack the system |
53 |
unless ( $logged_in_user->can_see_patron_infos($patron) ) { |
53 |
if ( $logged_in_user->can_see_patron_infos($patron) ) { |
54 |
if ( $reregistration eq 'y' ) { |
54 |
if ( $reregistration eq 'y' ) { |
55 |
# re-reregistration function to automatic calcul of date expiry |
55 |
# re-reregistration function to automatic calcul of date expiry |
56 |
$dateexpiry = $patron->renew_account; |
56 |
$dateexpiry = $patron->renew_account; |
57 |
- |
|
|