use C4::Output;
use C4::Members;
use C4::Koha;
-use C4::Dates;
+use C4::Dates qw/format_date format_date_in_iso/;
use C4::Input;
use C4::Log;
use C4::Branch; # GetBranches
my $check_categorytype=$input->param('check_categorytype');
# NOTE: Alert for ethnicity and ethnotes fields, they are unvalided in all borrowers form
my $borrower_data;
-my $noUpdateLogin;
+my $NoUpdateLogin;
my $userenv = C4::Context->userenv;
$template->param("uppercasesurnames" => C4::Context->preference('uppercasesurnames'));
$newdata{'dateexpiry'} =format_date_in_iso($newdata{'dateexpiry'} ) if ($newdata{dateexpiry});
$newdata{'dateofbirth'} =format_date_in_iso($newdata{'dateofbirth'} ) if ($newdata{dateofbirth});
# check permission to modify login info.
- if ($borrower_data && ($borrower_data->{'category_type'} eq 'S') && (! C4::Auth::haspermission($dbh,$userenv->{'id'},{'staffaccess'=>1}))) {
- $noUpdateLogin =1;
+ if (ref($borrower_data) && ($borrower_data->{'category_type'} eq 'S') && ! (C4::Auth::haspermission($dbh,$userenv->{'id'},{'staffaccess'=>1})) ) {
+ $NoUpdateLogin =1;
}
}
if ($op eq 'save'){
# test to know if another user have the same password and same login
unless ($nok){
- if($noUpdateLogin) {
+ if($NoUpdateLogin) {
delete $newdata{'password'};
delete $newdata{'userid'};
}
CGIbranch => $CGIbranch,
memberofinstution => $member_of_institution,
CGIorganisations => $CGIorganisations,
- noUpdateLogin => $noUpdateLogin
+ NoUpdateLogin => $NoUpdateLogin
);
output_html_with_http_headers $input, $cookie, $template->output;