X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=members%2Fupdate-child.pl;h=765687f128c98d2d6351c673f81af410793ac8c9;hb=574bbe85765223697e7a81da19c9733368423cd2;hp=42cfe27d80eaa47850b3aeba0832b3a3af589486;hpb=eaee34f47a138dfcb9fd2caf59a6fc3befc37932;p=koha-ffzg.git diff --git a/members/update-child.pl b/members/update-child.pl index 42cfe27d80..765687f128 100755 --- a/members/update-child.pl +++ b/members/update-child.pl @@ -29,25 +29,21 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers output_and_exit_if_error output_and_exit ); use Koha::Patrons; use Koha::Patron::Categories; use Koha::Patrons; -# use Smart::Comments; - my $dbh = C4::Context->dbh; -my $input = new CGI; +my $input = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "members/update-child.tt", query => $input, type => "intranet", - authnotrequired => 0, flagsrequired => { borrowers => 'edit_borrowers' }, - debug => 1, } ); @@ -58,7 +54,7 @@ my $op = $input->param('op'); my $logged_in_user = Koha::Patrons->find( $loggedinuser ); -my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); +my $patron_categories = Koha::Patron::Categories->search_with_library_limits({ category_type => 'A' }, {order_by => ['categorycode']}); if ( $op eq 'multi' ) { # FIXME - what are the possible upgrade paths? C -> A , C -> S ... # currently just allowing C -> A @@ -84,7 +80,7 @@ elsif ( $op eq 'update' ) { # But we should not hit that with a normal use of the interface die "You are doing something wrong updating this child" unless $adult_category; - $_->delete() for $patron->guarantor_relationships(); + $_->delete() for $patron->guarantor_relationships->as_list; $patron->categorycode($adult_category->categorycode); $patron->store;