https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24005
--- Comment #1 from Andrew Lau <[email protected]> --- No Executing opening the discharge.pm at the destination folder, the following is obtained: --------------------------------------------------------------------------- GNU nano 2.9.3 /usr/share/koha/lib/Koha/Patron/Discharge.pm Modified my $cond = { 'me.needed' => { '!=', undef }, 'me.validated' => undef, ( defined $borrowernumber ? ( 'me.borrower' => $borrowernumber ) : () ), ( defined $branchcode ? ( 'borrower.branchcode' => $branchcode ) : () ), }; return search_limited( $cond ); } sub get_validated { my ($params) = @_; my $branchcode = $params->{branchcode}; my $borrowernumber = $params->{borrowernumber}; my $cond = { 'me.validated' => { '!=', undef }, ( defined $borrowernumber ? ( 'me.borrower' => $borrowernumber ) : () ), ( defined $branchcode ? ( 'borrower.branchcode' => $branchcode ) : () ), }; return search_limited( $cond ); } # TODO This module should be based on Koha::Object[s] sub search_limited { my ( $params, $attributes ) = @_; my $userenv = C4::Context->userenv; my @restricted_branchcodes; if ( $userenv and $userenv->{number} ) { my $logged_in_user = Koha::Patrons->find( $userenv->{number} ); @restricted_branchcodes = $logged_in_user->libraries_where_can_see_patrons; } $params->{'borrower.branchcode'} = { -in => \@restricted_branchcodes } if @restricted_branchcodes; $attributes->{join} = 'borrower'; my $rs = Koha::Database->new->schema->resultset('Discharge'); return $rs->search( $params, { join => 'borrower' } ); } 1; ------------------------------------------------------------------------ -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
