use Koha::Cities;
use Koha::DateUtils;
use Koha::Libraries;
+use Koha::Patrons;
use Koha::Patron::Categories;
use Koha::Patron::HouseboundRole;
use Koha::Patron::HouseboundRoles;
$template->param( "quickadd" => 1 ) if ( $quickadd );
$template->param( "duplicate" => 1 ) if ( $op eq 'duplicate' );
$template->param( "checked" => 1 ) if ( defined($nodouble) && $nodouble eq 1 );
-( $borrower_data = GetMember( 'borrowernumber' => $borrowernumber ) ) if ( $op eq 'modify' or $op eq 'save' or $op eq 'duplicate' );
+if ( $op eq 'modify' or $op eq 'save' or $op eq 'duplicate' ) {
+ my $patron = Koha::Patrons->find( $borrowernumber );
+ $borrower_data = $patron->unblessed;
+ $borrower_data->{category_type} = $patron->category->category_type;
+}
my $categorycode = $input->param('categorycode') || $borrower_data->{'categorycode'};
my $category_type = $input->param('category_type') || '';
unless ($category_type or !($categorycode)){
#recover all data from guarantor address phone ,fax...
if ( $guarantorid ) {
- if (my $guarantordata=GetMember(borrowernumber => $guarantorid)) {
+ if (my $guarantor = Koha::Patrons->find( $guarantorid )) {
+ my $guarantordata = $guarantor->unblessed;
$category_type = $guarantordata->{categorycode} eq 'I' ? 'P' : 'C';
$guarantorinfo=$guarantordata->{'surname'}." , ".$guarantordata->{'firstname'};
$newdata{'contactfirstname'}= $guarantordata->{'firstname'};
$newdata{'zipcode'} = $input->param('zipcode') if defined($input->param('zipcode'));
$newdata{'country'} = $input->param('country') if defined($input->param('country'));
+$newdata{'lang'} = $input->param('lang') if defined($input->param('lang'));
+
# builds default userid
# userid input text may be empty or missing because of syspref BorrowerUnwantedField
if ( ( defined $newdata{'userid'} && $newdata{'userid'} eq '' ) || $check_BorrowerUnwantedField =~ /userid/ ) {
my $dateofbirth;
if ($op eq 'save' && $step == 3) {
- my $borrower = C4::Members::GetMember(borrowernumber => $borrowernumber);
- $dateofbirth = $borrower->{dateofbirth};
+ my $patron = Koha::Patrons->find( $borrowernumber );
+ $dateofbirth = $patron->dateofbirth;
}
else {
$dateofbirth = $newdata{dateofbirth};
# HouseboundModule data
$template->param(
- housebound_role => Koha::Patron::HouseboundRoles->find($borrowernumber),
+ housebound_role => scalar Koha::Patron::HouseboundRoles->find($borrowernumber),
);
if(defined($data{'flags'})){
);
}
+if ( C4::Context->preference('TranslateNotices') ) {
+ my $translated_languages = C4::Languages::getTranslatedLanguages( 'opac', C4::Context->preference('template') );
+ $template->param( languages => $translated_languages );
+}
+
output_html_with_http_headers $input, $cookie, $template->output;
sub parse_extended_patron_attributes {