From 9cad748de79f6b11026e3a112c2dd3dbc6c0cfc8 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 10 Jul 2017 11:54:05 -0300 Subject: [PATCH] Bug 17829: (followup) Fix small rebasing errors Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- members/files.pl | 7 ++-- members/member-flags.pl | 75 +++++++++++++++++++++-------------------- opac/opac-passwd.pl | 10 +++--- 3 files changed, 49 insertions(+), 43 deletions(-) diff --git a/members/files.pl b/members/files.pl index ddb99f7628..0070fcf071 100755 --- a/members/files.pl +++ b/members/files.pl @@ -64,6 +64,7 @@ if ( $op eq 'download' ) { } else { my $patron = Koha::Patrons->find( $borrowernumber ); + my $patron_category = $patron->category; $template->param(%{ $patron->unblessed}); my %errors; @@ -102,7 +103,7 @@ else { } $template->param( - categoryname => $patron->category->description, + categoryname => $patron_category->description, RoutingSerials => C4::Context->preference('RoutingSerials'), ); @@ -116,7 +117,9 @@ else { $template->param( picture => 1 ) if $patron->image; - $template->param( adultborrower => 1 ) if ( $data->{category_type} eq 'A' || $data->{category_type} eq 'I' ); + $template->param( adultborrower => 1 ) + if ( $patron_category->category_type eq 'A' || $patron_category->category_type eq 'I' ); + $template->param( files => Koha::Patron::Files->new( borrowernumber => $borrowernumber ) ->GetFilesInfo(), diff --git a/members/member-flags.pl b/members/member-flags.pl index 2b872624e4..e7c24e9e04 100755 --- a/members/member-flags.pl +++ b/members/member-flags.pl @@ -30,7 +30,7 @@ my $patron = Koha::Patrons->find( $member ); my $category_type = $patron->category->category_type; my $bor = $patron->unblessed; if( $category_type eq 'S' ) { - $flagsrequired->{'staffaccess'} = 1; + $flagsrequired->{'staffaccess'} = 1; } my ($template, $loggedinuser, $cookie) = get_template_and_user({ template_name => "members/member-flags.tt", @@ -117,14 +117,14 @@ if ($input->param('newflags')) { my @loop; while (my ($bit, $flag) = $sth->fetchrow) { - my $checked=''; - if ($accessflags->{$flag}) { - $checked= 1; - } - - my %row = ( bit => $bit, - flag => $flag, - checked => $checked, + my $checked=''; + if ($accessflags->{$flag}) { + $checked= 1; + } + + my %row = ( bit => $bit, + flag => $flag, + checked => $checked, ); my @sub_perm_loop = (); @@ -170,7 +170,7 @@ if ($input->param('newflags')) { if ($#sub_perm_loop > -1) { $row{sub_perm_loop} = \@sub_perm_loop; } - push @loop, \%row; + push @loop, \%row; } if ( $category_type eq 'C') { @@ -178,7 +178,7 @@ if ($input->param('newflags')) { $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; $template->param( 'catcode' => $patron_categories->next ) if $patron_categories->count == 1; } - + $template->param( adultborrower => 1 ) if ( $category_type =~ /^(A|I)$/ ); $template->param( picture => 1 ) if $patron->image; @@ -191,32 +191,33 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { } $template->param( - borrowernumber => $bor->{'borrowernumber'}, - cardnumber => $bor->{'cardnumber'}, - surname => $bor->{'surname'}, - firstname => $bor->{'firstname'}, - othernames => $bor->{'othernames'}, - categorycode => $bor->{'categorycode'}, - category_type => $category_type, - categoryname => $bor->{'description'}, - address => $bor->{address}, - address2 => $bor->{'address2'}, - streettype => $bor->{streettype}, - city => $bor->{'city'}, - state => $bor->{'state'}, - zipcode => $bor->{'zipcode'}, - country => $bor->{'country'}, - phone => $bor->{'phone'}, - phonepro => $bor->{'phonepro'}, - mobile => $bor->{'mobile'}, - email => $bor->{'email'}, - emailpro => $bor->{'emailpro'}, - branchcode => $bor->{'branchcode'}, - loop => \@loop, - is_child => ($category_type eq 'C'), - RoutingSerials => C4::Context->preference('RoutingSerials'), - csrf_token => Koha::Token->new->generate_csrf( { session_id => scalar $input->cookie('CGISESSID'), } ), - ); + borrowernumber => $bor->{'borrowernumber'}, + cardnumber => $bor->{'cardnumber'}, + surname => $bor->{'surname'}, + firstname => $bor->{'firstname'}, + othernames => $bor->{'othernames'}, + categorycode => $bor->{'categorycode'}, + category_type => $category_type, + categoryname => $bor->{'description'}, + address => $bor->{address}, + address2 => $bor->{'address2'}, + streettype => $bor->{streettype}, + city => $bor->{'city'}, + state => $bor->{'state'}, + zipcode => $bor->{'zipcode'}, + country => $bor->{'country'}, + phone => $bor->{'phone'}, + phonepro => $bor->{'phonepro'}, + mobile => $bor->{'mobile'}, + email => $bor->{'email'}, + emailpro => $bor->{'emailpro'}, + branchcode => $bor->{'branchcode'}, + loop => \@loop, + is_child => ( $category_type eq 'C' ), + RoutingSerials => C4::Context->preference('RoutingSerials'), + csrf_token => + Koha::Token->new->generate_csrf( { session_id => scalar $input->cookie('CGISESSID'), } ), +); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/opac/opac-passwd.pl b/opac/opac-passwd.pl index db63cd3ae5..c21e124e60 100755 --- a/opac/opac-passwd.pl +++ b/opac/opac-passwd.pl @@ -104,12 +104,14 @@ if ( C4::Context->preference("OpacPasswordChange") ) { } } } -$template->param(firstname => $patron->firstname, - surname => $patron->surname, - minpasslen => $minpasslen, - passwdview => 1, +$template->param( + firstname => $patron->firstname, + surname => $patron->surname, + minpasslen => $minpasslen, + passwdview => 1 ); + output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; sub goodkey { -- 2.39.5